[Live-devel] LiveMedia in a Directshow Filter

Ross Finlayson finlayson at live555.com
Tue Nov 30 20:18:02 PST 2010


>  >while(true)
>  >{
>  >       fWatchVariable = 0;
>  >       dummyTask(NULL); // 100ms
>  >       env->taskScheduler().doEventLoop(&fWatchVariable);
>  >       if (fWatchVariable = 1)
>  >       {
>  >             printf("\nIn While fWatchVariable=%d,",fWatchVariable);
>  >             if (!mP4LiveSms->mpeg4LiveSource != NULL)
>  >                               mP4LiveSms->mpeg4LiveSource->deliverFrame();
>  >       }
>  >}

[...]

>  1)  How should I call deliverFrame() from the Main thread(DS Graph 
>in a Filter) in order to signal my FramedSource that a new frame is 
>arrived.

You don't!  "deliverFrame()" - being a LIVE555 library operation - 
should be called only from the LIVE555 event loop thread - not from 
some other thread.

However, what you *can* do in the non-LIVE555 thread (i.e., your 
'DirectShow' thread) is set "fWatchVariable" to 1.  If you do this, 
then the LIVE555 event loop (your code above) will notice this, and 
do the right thing, calling "deliverFrame()".


>3) Question about the parameters : fPresentationTime, 
>fDurationInMicroseconds what exactly they mean.
>   fPresentationTime Is the different between sample(frame) start and 
>Stop - in my received filter -> pSample->GetTime(&tStart, &tStop);?

In most situations, you can just set "fPresentationTime" by calling 
"gettimeofday()".  You should do this inside your "deliverFrame()" 
function (which is called from the LIVE555 event loop thread, of 
course).


>   fDurationInMicroseconds - How do I set this parameter?

In principle, it should be set to the duration between successive 
frames (that you deliver using "deliverFrame()").

However, because you are streaming from a live source, rather than 
from a file, it's probably OK to leave this variable unset (in which 
case, it'll get a default value of 0).
-- 

Ross Finlayson
Live Networks, Inc.
http://www.live555.com/


More information about the live-devel mailing list