[Live-devel] LiveMedia in a Directshow Filter
Yuri Timenkov
yuri.timenkov at itv.ru
Wed Dec 1 22:03:01 PST 2010
BTW,
On 01.12.2010 7:18, Ross Finlayson wrote:
>> >while(true)
>> >{
>> > fWatchVariable = 0;
>> > dummyTask(NULL); // 100ms
>> > env->taskScheduler().doEventLoop(&fWatchVariable);
>> > if (fWatchVariable = 1)
This statement looks very strange: is it still assignment instead of
comparison in your code? What is it supposed to be?
>> > {
>> > 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).
More information about the live-devel
mailing list