[Live-devel] Streaming Live H264
Ross Finlayson
finlayson at live555.com
Thu Oct 2 05:59:45 PDT 2008
>What should happened at the ImxDeviceSource::doGetNextFrame()?
>
>1.Does the function should return only when a frame is valid (and
>return the poiter and size)
No. Your "doGetNextFrame()" should *not* block. It should return
immediately, even if no frame is currently available for delivery.
>2.Does deliverFame() is called by the chain (doGetNextFrame() ) or
>by the encoder when a frame is valid?
You must (somehow) arrange for "deliverFrame()" to be called, by the
event loop, when your encoder has made a new frame available. I.e.,
the arrival of a new frame, from the encoder, has to be recognized as
an 'event' within the event loop.
As I explain in the comments in "DeviceSource.cpp", if your encoder
is a readable socket (open file), then this is easy to do, using
"turnOnBackgroundReadHandling()".
If, however, your encoder is not a readable socket, then you need to
do something else (specific to your particular system!) to arrange
for "deliverFrame()" to get called from within the event loop. (One
solution, used by many people, is to use the 'watchVariable'
parameter to "doEventLoop()", and to have a separate thread that sets
this 'watchVariable' (and does nothing else with the LIVE555
library!) when a new frame arrives.)
Ross Finlayson
Live Networks, Inc. (LIVE555.COM)
<http://www.live555.com/>
More information about the live-devel
mailing list