[Live-devel] RTSP blocked

Ross Finlayson finlayson at live.com
Fri Feb 11 10:49:01 PST 2005


>Usually the encoder calls the take frame and exit end the rtsp call the
>doGetNextFrame and if finds a new frame calls the deliverFrame. If no
>new frame is available he sets requiredframe to true and the next time
>the encoder calls the takeframe he can see the requiredframe flag set
>and directly calls deliverframe.

Remember, if your encoder is running as a separate thread, it *must not* 
call "deliverFrame()", because LIVE.COM code is supposed to be running in a 
single-threaded event loop.  (See 
<http://www.live.com/liveMedia/faq.html#threads>)

Instead, you should do what you were trying to do before:  If (in 
"doNextFrame()") no frame is immediately available, arrange to delay a 
short period of time (i.e., within the LIVE.COM event loop, by calling 
"scheduleDelayedTask()"), and then call "doGetNextFrame()" 
again.  (Hopefully, this should be an infrequent occurrence.)

>Another question: could be useful compute the attended
>fDurationInMicroseconds based on the recent history intead of using the
>formal fps?

No, "fDurationInMicroseconds" should be set based on the actual frame rate 
(as you are correctly doing now).  The 'sink' object ("MultiFramedRTPSink") 
will use this to correctly figure out when next to request a new frame from 
the source.


	Ross Finlayson
	LIVE.COM
	<http://www.live.com/>



More information about the live-devel mailing list