<!doctype html public "-//W3C//DTD W3 HTML//EN">
<html><head><style type="text/css"><!--
blockquote, dl, ul, ol, li { padding-top: 0 ; padding-bottom: 0 }
 --></style><title>Re: [Live-devel] FW: LiveMedia in a Directshow
Filter</title></head><body>
<div>I discovered (and, I hope, fixed) a bug in our mailing list
software that was apparently causing the list's digesting and
archiving mechanism to choke on some Unicode characters that were in
Eyal's message (and quoted in my response).</div>
<div><br></div>
<div>Therefore, I'm sending my response again, in the hope that it
will get through to everyone this time.  (This may be the third
time that some of you have seen this message; if so, my
apologies.)</div>
<div><br></div>
<div>------------------</div>
<blockquote type="cite" cite>Question #1:  How should
 <u><b>Notify</b></u> MPEG4LiveSource::doGetNextFrame
?</blockquote>
<blockquote type="cite" cite>while(true)</blockquote>
<blockquote type="cite" cite>{</blockquote>
<blockquote type="cite" cite>fWatchVariable = 0;</blockquote>
<blockquote type="cite" cite>dummyTask(NULL);  // 100 ms to awake
a sleeping server.</blockquote>
<blockquote type="cite"
cite>env->taskScheduler().doEventLoop(&fWatchVariable);</blockquote
>
<blockquote type="cite" cite>if (fWatchVariable =1)</blockquote>
<blockquote type="cite" cite>{</blockquote>
<blockquote type="cite"
cite
>           <span
></span>     // How to Invoke
MPEG4LiveSource::doGetNextFrame?</blockquote>
<blockquote type="cite"
cite>printf("\nEventThrown=%d,",fWatchVariable);</blockquote
>
<blockquote type="cite" cite>}</blockquote>
<blockquote type="cite" cite>}</blockquote>
<div><br></div>
<div>Assuming that "fWatchVariable" gets set when new data
arrives for your "MPEG4LiveSource" object, then you would
handle this event by calling whatever function - in your
"MPEG4LIVESource" class - you have defined to handle the
arrival of new data.</div>
<div><br></div>
<div>(E.g, if you were to use our "DeviceSource" code as a
model ("liveMedia/DeviceSource.cpp"), this would be the
"deliverFrame()" member function.)</div>
<div><br></div>
<div><br></div>
<blockquote type="cite" cite>Question #2: Is It ok to use
MPEG4VideoStreamFramer or should I use MPEG4VideoStreamDiscreteFramer
in order to parse test.m4e file.?</blockquote>
<div><br></div>
<div>".m4e" files should always be streamed using the
"MPEG4VideoStreamFramer" class (because files deliver a byte
stream - not a stream of discrete frames).</div>
<div><br></div>
<div><br></div>
<blockquote type="cite" cite>void MPEG4LiveSource::doGetNextFrame()
{</blockquote>
<blockquote type="cite"
cite>           
</blockquote>
<blockquote type="cite"
cite
>           <span
></span>     if
(!isCurrentlyAwaitingData())</blockquote>
<blockquote type="cite"
cite
>           <span
></span
>           <span
></span>         
  return; // we're not ready for the data yet</blockquote>
<blockquote type="cite"
cite>           
</blockquote>
<blockquote type="cite"
cite
>           <span
></span>     // WaitForSingleObject( hEvent,
INFINITE ); // Question #3:  Try to sync both thread Ignoring <a
href=
"http://www.live555.com/liveMedia/doxygen/html/classTaskScheduler.html"
>TaskScheduler::doEventLoop()</a> , is that
recommendable?</blockquote>
<div><br></div>
<div>No!  Your "doGetNextFrame()" function should never
block.  If no data is immediately available for delivery, then
"doGetNextFrame()" should just return.  (Again, see the
"DeviceSource" code for an illustration.)</div>
<div><br></div>
<div><br></div>
<blockquote type="cite" cite>nextTask() =
envir().taskScheduler().scheduleDelayedTask(0,(TaskFunc*)FramedSource<span
></span>::afterGetting, this);     // Question #4:
 Is that good to call suitable here?</blockquote>
<div><br></div>
<div>Yes.  This tells the downstream object that data has been
delivered to it.</div>
<div><br></div>
<div><br></div>
<blockquote type="cite" cite>Question #5:  Run over the Mailing
list I could not found any example of streaming from DirectShopw
filter, Is there a problem with that approach?</blockquote>
<div><br></div>
<div>No.  Several other people have done this.  (However, I
personally do not use 'DirectShow'.)</div>
<x-sigsep><pre>-- 
</pre></x-sigsep>
<div><br>
Ross Finlayson<br>
Live Networks, Inc.<br>
http://www.live555.com/</div>
</body>
</html>