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/>

_______________________________________________
live-devel mailing list
live-devel@lists.live555.com
http://lists.live555.com/mailman/listinfo/live-devel

Reply via email to