[Live-devel] About data flow

Ross Finlayson finlayson at live.com
Mon Jun 13 11:31:57 PDT 2005


>I have one question about data flow from source -->
>Filter ----> Sink.
>
>When I run the testMPEG2TransportStreamer.exe
>application, I noticed that in FrameSource.cpp, the
>getNextFrame function call virtual function
>doGetNextFrame, the first time it calls the
>MPEG2TransportStreamerFramer::doGetNextFrame, in fact,
>this function just calls FrameSource::getNextFrame
>again, so getNextFrame function then calls
>doGetNextFrame again, however, the second time it
>calls ByteStreamFileSource::doGetNextFrame, this just
>exactly confirm the data flow as you say in the FAQ!
>However, I am a little confused about it. I can not
>understand how the second time the virtual function
>doGetNextFrame in FrameSource.cpp just call the
>ByteStreamFileSource::doGetNextFrame, not
>MPEG2TransportStreamerFramer::doGetNextFrame?(sure
>which will cause loop)?

Are you referring to the following code in "MPEG2TransportStreamer.cpp":
         void MPEG2TransportStreamFramer::doGetNextFrame() {
                 // Read directly from our input source into our client's 
buffer:
                 fFrameSize = 0;
                 fInputSource->getNextFrame(fTo, fMaxSize,
                                         afterGettingFrame, this,
                                         FramedSource::handleClosure, this);
         }
?

Note that this calls "getNextFrame()", but on a *different* object (the 
object that feeds into the "MPEG2TransportStreamFramer"), *not* on 
itself.  Therefore, in the "testMPEGTransportStreamer" application, the 
next "doGetNextFrame()" that will get called will be 
"ByteStreamFileSource::doGetNextFrame()", not 
"MPEG2TransportStreamFramer::doGetNextFrame()".


	Ross Finlayson
	LIVE.COM
	<http://www.live.com/>



More information about the live-devel mailing list