<HTML dir=ltr><HEAD>
<META content="text/html; charset=unicode" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18928"></HEAD>
<BODY>
<DIV dir=ltr id=idOWAReplyText10779>
<DIV dir=ltr> </DIV></DIV>
<DIV>
<DIV dir=ltr>
<DIV class=gmail_quote>
<DIV dir=ltr>Hi,
<DIV><BR></DIV>
<DIV> I almost started to give up with live555, then I decided to go over to F&Q, and start from streaming Mpeg1-2 instead of MPeg4 and ondemand, Following testMPEG1or2VideoStreamer and the advice of encapsulating my DS source with FramedSource then I see some gray static picture on my VLCplayer from. Didn't gave up continue trying to make it works. I think my main problem is synchronizing both threads. Actually with DirectShow filter is more then one, Anyway I took the tread that receives the MediaSample (i.e frame) type of CRTSPInputPin. Subclass it from FramedSource, then I realize the when I'm creating it I need to pass the BasicUsageEnvironment as a parameter so the usage environment have to be global for use of both threads. then only after I'm creating my CRTSPInputPin type of FramedSource in my filter creation I'm assigning the pointer to a global CRTSPInputPin type of FramedSource. That used in the Live555 thread at the point of creating the framer MPEG1or2VideoStreamFramer later used by videoSink->startPlaying as the video source. </DIV>
<DIV>The flow: On the CRTSPInputPin when a new MediaSample(Frame) is received I'm running the live555 thread only for the first time . . That create the server,socket,port etc -> startPlaying at the end doEventLoopwith the fWatchVariable - Live555 is running. Continue in DS thread getting the buffer and length of the frame from the MediaSample call to doGetNextFrame() to process that frame.</DIV>
<DIV>From that point both threads asynchronously running, And I need to sync them somehow. Sometimes I'm receiving frames from my source before Live555 get to the point of startplaying, Sometimes Live555 process the same frame on a loop, (The gray VLC effect). Most of the time I'm getting "ignoring non video sequence header" between one receive to another.</DIV>
<DIV>Questions:</DIV>
<DIV>1) How do I sync the LiveMedia Sequence, It's running on 1 thread moving the nextFrame from source to sink on endless loop.</DIV>
<DIV> It seams that while breaking that loop I have to dill with the consciences , My source is FramedSource and I'm calling doGetNextFrame in order to set fTo, fFrameSize from a global buffer, do I need the fWatchVariable? Do I need to used the DeliverFrame method and do the frame set over there?</DIV>
<DIV>2) Should I add another task to the scheduler or subclass it and used it from the DS thread in order to sync to Live555 flow.</DIV>
<DIV><BR></DIV>
<DIV>Source Code attached,</DIV>
<DIV>I'm more then accepting to see it works.</DIV>
<DIV>Thanks a lot </DIV>
<DIV> Eyal</DIV>
<DIV>
<DIV class=gmail_quote>
<BLOCKQUOTE style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0.8ex; PADDING-LEFT: 1ex; PADDING-RIGHT: 1ex; BORDER-RIGHT: #ccc 1px solid" class=gmail_quote>
<DIV>
<DIV>
<P><FONT size=2>> >while(true)<BR>> >{<BR>> > fWatchVariable = 0;<BR>> > dummyTask(NULL); // 100ms<BR>> > env->taskScheduler().doEventLoop(&fWatchVariable);<BR>> > if (fWatchVariable = 1)<BR>> > {<BR>> > printf("\nIn While fWatchVariable=%d,",fWatchVariable);<BR>> > if (!mP4LiveSms->mpeg4LiveSource != NULL)<BR>> > mP4LiveSms->mpeg4LiveSource->deliverFrame();<BR>> > }<BR>> >}<BR><BR>[...]<BR><BR>> 1) How should I call deliverFrame() from the Main thread(DS Graph<BR>>in a Filter) in order to signal my FramedSource that a new frame is<BR>>arrived.<BR><BR>You don't! "deliverFrame()" - being a LIVE555 library operation -<BR>should be called only from the LIVE555 event loop thread - not from<BR>some other thread.<BR><BR>However, what you *can* do in the non-LIVE555 thread (i.e., your<BR>'DirectShow' thread) is set "fWatchVariable" to 1. If you do this,<BR>then the LIVE555 event loop (your code above) will notice this, and<BR>do the right thing, calling "deliverFrame()".<BR><BR><BR>>3) Question about the parameters : fPresentationTime,<BR>>fDurationInMicroseconds what exactly they mean.<BR>> fPresentationTime Is the different between sample(frame) start and<BR>>Stop - in my received filter -> pSample->GetTime(&tStart, &tStop);?<BR><BR>In most situations, you can just set "fPresentationTime" by calling<BR>"gettimeofday()". You should do this inside your "deliverFrame()"<BR>function (which is called from the LIVE555 event loop thread, of<BR>course).<BR><BR><BR>> fDurationInMicroseconds - How do I set this parameter?<BR><BR>In principle, it should be set to the duration between successive<BR>frames (that you deliver using "deliverFrame()").<BR><BR>However, because you are streaming from a live source, rather than<BR>from a file, it's probably OK to leave this variable unset (in which<BR>case, it'll get a default value of 0).<BR>--<BR><BR>Ross Finlayson<BR>Live Networks, Inc.<BR><A href="http://www.live555.com/" target=_blank>http://www.live555.com/</A><BR><BR><BR></FONT></P></DIV></DIV></BLOCKQUOTE></DIV></DIV></DIV></DIV><BR></DIV></DIV>
<HR><Font face=arial size=2 color=black><I>
LEGAL NOTICE - Unless expressly stated otherwise, this message, its annexes, attachments, appendixes,
<BR>any subsequent correspondence, and any document, data, sketches, plans and/or other material
that<BR> is hereby attached, are proprietary confidential and may be legally privileged.<BR>
Nothing in this e-mail is intended to conclude a contract on behalf of Aeronautics or
<BR>make it subject to any other legally binding commitments, unless the e-mail <BR>
contains an express statement to the contrary or incorporates a formal Purchase Order.<BR>
This transmission is intended for the named addressee only. Unless you are the named addressee (or
<BR>authorised to receive it for the addressee) you may not copy or use it, or disclose it to anyone else, any
<BR>disclosure or copying of the contents of this e-mail or any action taken (or not taken) in reliance on it is
<BR>unauthorised and may be unlawful. If you are not an addressee, please inform the sender
immediately.<BR>
</BODY></HTML>