[Live-devel] Question: some issues of PS streaming...

Ross Finlayson finlayson at live.com
Tue Feb 3 00:55:08 PST 2004


>During my implementation to make testOnDemandRTSPServer able to stream MPEG PS

FYI, as I noted in my last message, this is now supported in the latest 
source code release.

>  I tried to implement one video and one audio ServerMediaSubsession where 
> MPEG1o2Demux's newVideoStream/newAudioStream functions are used as input 
> for MPEG1o2VideoStreamFramer/MPEG1o2AudioStreamFramer.However, there are 
> some issues during my implementations:
>1. By refering to FileServerMediaSubsession, sdpLines() will call 
>createNewStreamSource(), and its returned FramedSource* is used as input 
>for createNewRTPSink().I found the FramedSource* is not actually used in 
>that function (maybe I am wrong :b).Is this just for checking the 
>existence of the file?

The "inputSource" parameter to "createNewRTPSink()" allows for the 
possibility that some of the parameters to the creation of the RTP sink 
object may depend on the characterisics of the input source 
object.  Usually, that is not the case, so the "inputSource" parameter is 
usually not used.

The one current exception is the "AMRAudioFileServerMediaSubsession" 
class.  For this class, the creation of the RTP sink object 
("AMRAudioRTPSink")  depends on (i) whether or not the input source is 
wideband AMR, and (ii) the number of audio channels in the input source.

>2. Given audio and video are indepentdent subsessions, their input sources 
>are both from MPEG1o2Demux. Whenever the user requests SETUP, one of two 
>subsessions has to open MPEG1o2Demux with a given ByteStreamFileSource. 
>The similar issue happens when the user requests TEARDOWN: one of two 
>subsessions has to close MPEG1o2Demux.Where is the best place to 
>open/close MPEG1or2Demux respectively? It seems an architecture issue.

Yes, this was tricky to get right.  The creation of new "MPEG1or2Demux"es 
on demand is handled by the new "MPEG1or2FileServerDemux" class.  The 
deletion of each "MPEG1or2Demux" is now done automatically, when the last 
component elementary stream gets deleted.  (This behavior is an optional 
flag to "MPEG1or2Demux::createNew()".  By default, the deletion of each 
"MPEG1or2Demux" needs to be done manually, as before.)

>3. In testMPEG1o2AudioVideoStreamer, there is one comment: start playing 
>video first, to ensure that any video sequence header at the start of the 
>file gets read.How to guarantee this mechanism for on-demand streaming?

This is done by adding the 'video' "ServerMediaSubsession" to the 
"ServerMediaSession" before adding the 'audio' 
"ServerMediaSubsession".  (See "testOnDemandRTSPServer.cpp" for an 
illustration of this.  This is a bit of a hack, but it seems to be the 
simplest way to guarantee the correct behavior here.


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



More information about the live-devel mailing list