[Live-devel] Implementing FramedSource
Ken Seo
ken.seo at gmail.com
Tue Apr 8 16:28:26 PDT 2008
Hi, Ross,
Thank you for your reply,
if "doGetNextFrame()" returns immediately, I'm not quite sure how it
would work, the following is my understanding of RTP cycle,
RTSPServer
- upon start playing - calls GetNextFrame() -> calls doGetNextFrame()
-> calls afterGetting() -> sends packets all that -> calls
GetNextFrame()
So, in the cycle above, once doGetNextFrame() returns without
scheduling afterGetting(), then the cycle stops there. Also,
doGetNextFrame() should be called only by "GetNextFrame()" which takes
many parameters and has some initialization steps.
So, from your explanation "Later, when a frame becomes available, this
will be triggered as an event that can get handled within the event
loop.", once I have a sample, how should I *handle* that in the event
loop?, I can create a callback function or a watch variable to get
notified, but, I'm not exactly sure what to do with it, should I
manually call "doGetNextFrame()"?
Here is what I tried, my doGetNextFrame() is empty.
void QueueSource::doGetNextFrame()
{
}
And I have a function that gets invoked when a sample arrives,
HRESULT ReceivedSample(IMediaSample *pSample)
{
On Fri, Apr 4, 2008 at 5:17 PM, Ross Finlayson <finlayson at live555.com> wrote:
> >I'm trying to implement a FramedSource which will get next frames from
> >a Queue. From my digging so far, "doGetNextFrame()" should be blocking
> >until the next frame is available
>
> No, it should *not* be blocking until the next frame is available,
> because if you block, you'll be starving out any other events that
> need to be handled. Instead, if no frame is immediately available,
> "doGetNextFrame()" should return. Later, when a frame becomes
> available, this will be triggered as an event that can get handled
> within the event loop.
>
> You can use the "watchVariable" parameter to "doEventLoop()" for this
> purpose (e.g., have your separate queue-filling thread set the
> 'watchVariable' when a new frame becomes available. (See the FAQ for
> more information.)
> --
>
> 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