[Live-devel] Live555MediaServer

Ross Finlayson finlayson at live555.com
Fri Nov 5 04:18:07 PDT 2010


>i use vlc to play sample.mp3 from Live555MediaServer.
>and i found that vlc buffer twice when i click play button.

I'm not sure what this means, but it is completely irrelevant to the 
rest of your question.  (Whatever the VLC client does, it requests 
the stream (using the RTSP protocol) only once.  You could also have 
used the "openRTSP" client to play the stream.)


>and i debug the code found that,the FrameSource object will be created twice.
>and the first time is to get sdp information.

That is correct.  The first time a particular file is requested, the 
"live555MediaServer" creates a new "ServerMediaSubsession" object for 
it.  As part of getting the stream's SDP description, the server then 
calls "OnDemandServerMediaSubsession::sdpLines()", which in turn 
creates - and then deletes - 'dummy' source and sink objects. 
(However, for MP3 files, these 'dummy' objects do not actually get 
used.)

Note again that this happens only when a particular file is being 
requested *for the first time*.


>and the second time is to play stream.

Yes.  When actually playing the stream (i.e., handling the RTSP 
"PLAY" command), 'real' source and sink (i.e., RTPSink) objects are 
created and used.


>but it called doGetNextFrame automately in the first time when 
>FrameSource was created.
>ofcourse it was sent immediately.
>
>is there a reason you called doGetNextFrame when get sdp?

We don't.  When streaming a MP3 file, "FramedSource::getNextFrame()" 
(and therefore the "doGetNextFrame()" virtual function) gets called 
only when the file is actually being streamed (i.e., in response to 
the RTSP "PLAY" command).

When streaming certain other kinds of media file - in particular, 
MPEG-4 Elementary Stream Video (.m4e) files - the server may need to 
start reading the file to get all the information that it needs to 
create the SDP description.  That is not true for MP3 files, however.

In any case, you should not need to concern yourself with any of this.
-- 

Ross Finlayson
Live Networks, Inc.
http://www.live555.com/


More information about the live-devel mailing list