[Live-devel] Can someone please explain the control flow?

Danny Halamish dny at vicon.co.il
Sun Mar 1 23:59:20 PST 2009


02/03/2009 07:47:19, Ross Finlayson <finlayson at live555.com> wrote:

>>Can someone please explain the control flow from a source to a sink...
>
>You can use one of the existing demo applications (in the 'testProgs" 
>directory) as a model.  If you want to stream using multicast, use 
>one of the "test*Streamer" applications as a model.  If you want to 
>stream unicast on-demand, use "testOnDemandRTSPServer" as a model.


I have looked at these for some time, and I must admit - like I said - that it simply eludes me. Every 
function I look at seems to defer to another function, etc.

>To understand how an application that uses this library works, you 
>need to understand event-driven programming, and, in particular, the 
>concept of an event loop.  'Control flow' is not really the right way 
>to think about such applications.


I understand these concepts, and have written such programs before. Like I said, the part I'm struggling 
with is the inter-relation between the different classes, etc.

>>What functions do I need to add to the h264 stub?
>
>Search for "H.264" in the FAQ.


I have, and I understand the principle, but I do not seem to be able to translate it into code. It's not that I 
don't undestand what the code needs to do, I just don't quite see where each part should go.

>>  Do I need to create a
>>new source to enclose my codec (DeviceSource)?
>
>Yes.  You can use the "DeviceSource.cpp" code as a model.


I undestand, but don't quiter understand what need to go into the "doGetNextFrame" function - will it 
defer to another class? Will it defer some action to another class? which part? I want to use background 
processing, of course, and my device does not use a file handle. I guess I will need to use 
"scheduleDelayedTask" to poll for data if it is not available; but what will the deferred function do? 

Again, I understand the principle of it, and I have written such code before; but the interrelations 
between the classes, and the control flow, elude me. I understand that the code is event driven, and I 
am not looking for the "main loop"; but event driven systems have a control flow as well, for each event 
- and this is the thing which eludes me.

Help would be appreciated,

   Danny





More information about the live-devel mailing list