[Live-devel] Push (instead of Pull) to custom DeviceSource
Chad Ata
Chad_Ata at Brightcom.com
Thu Oct 11 18:23:00 PDT 2007
Aww.. i was hoping for a really easy way out =)
I was trying to avoid queuing incoming data.
Thanks for the suggestions. I'll probably go the watchVariable route..
-Chad
Ross Finlayson
<finlayson at live55
5.com> To
Sent by: LIVE555 Streaming Media -
live-devel-bounce development & use
s at ns.live555.com <live-devel at ns.live555.com>
cc
10/11/2007 17:59 Subject
Re: [Live-devel] Push (instead of
Pull) to custom DeviceSource
Please respond to
LIVE555 Streaming
Media -
development & use
<live-devel at ns.li
ve555.com>
>I'd like to just call doGetNextFrame() at my own pace when I have data
>ready for it.
No, "getNextFrame()" (and thus "doGetNextFrame()") must be called by
the downstream object, when it is willing to receive data - i.e., the
'pull' model.
What you can do, however, is arrange to call your "deliverFrame()"
function (*not* "doGetNextFrame()") when data becomes available. The
best way to do this is to have "the availability of new data" be an
'event', that gets handled within the event loop.
Is your input device an open file (this is often true if you're
running a Unix (including Linux) system)? If so, then you can do
this easily using "TaskScheduler::turnOnBackgroundReadHandling()".
If not, then you can use the "watchVariable" feature of
"doEventLoop()" to do this - along with a separate thread that
watches for the availability of new data, and sets the
"watchVariable" when this happens. (See the FAQ.) (Alternatively,
you could write your own "TaskScheduler" subclass in order to make
the availability of new data an 'event', but that is far more
complicated to do.)
--
Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
_______________________________________________
live-devel mailing list
live-devel at lists.live555.com
http://lists.live555.com/mailman/listinfo/live-devel
More information about the live-devel
mailing list