[Live-devel] Re: [vlc-devel] RTSP trickplay support

Dermot McGahon dermot at dspsrv.com
Tue Dec 21 14:34:25 PST 2004


On Tue, 21 Dec 2004 04:54:25 -0800, Ross Finlayson <finlayson at live.com>  
wrote:

> You would need to send us an example of SDP descriptions for:
> 1/ Kasenna MPEG-2 TS/UDP streams, and

This is generated at the bottom of RTSPClient::describeURL(). I'm just
not familiar enough with SDP to suggest what we might add here.

BitBand isn't a priority and could be left for another time.


> But in any case, I don't really understand what value inserting a  
> "MPEG2TransportStreamFramer" object gives to VLC.  The only thing this  
> object does is use the PCR values in the stream to estimate the duration  
> of each incoming chunk of Transport Stream data.  This duration is  
> passed (as the "duration" parameter) to "StreamRead()" (in  
> "livedotcom.cpp").  But this parameter is not used anywhere in  
> "StreamRead()"!
>
> So, once again, what value does the "MPEG2TransportStreamFramer" object  
> give you??

in StreamRead(), p_sys->i_running_duration is updated with duration.  
Without
the framer this is always zero. With the framer this increments correctly.

I'm working on a trickplay patch that uses the Scale: parameter. Within vlc
this is implemented as i_rate. I also use this code at the beginning of
StreamRead:

     if (p_sys->i_rate == INPUT_RATE_MAX)
     {
        p_sys->i_running_duration += duration * 12;
     }
     else if (p_sys->i_rate == INPUT_RATE_MIN)
     {
        p_sys->i_running_duration -= duration * 12;
     }
     else
     {
        p_sys->i_running_duration += duration;
     }


With this value saved, resume from PAUSE becomes possible, i.e:

                 if( ( b_bool && !p_sys->rtsp->pauseMediaSubsession( *sub )  
) ||
                     ( !b_bool && !p_sys->rtsp->playMediaSubsession( *sub,
                       p_sys->i_running_duration / 1000000 ) ) )


Same for trickplay. The server is something of an automaton, it needs to  
be told
 from where to begin streaming faster or slower:

                 if ( !p_sys->rtsp->playMediaSubsession( *sub,  
(float)p_sys->i_running_duration / 1000000,
                                                         p_sys->i_length /  
1000000, 12, 0 ) ) // Scale: 12.0 header in PLA


I was wrong about seeking. Seeking can be implemented independently of  
this.

To sum up, the running_duration needs to be kept track of for:

(1) Resume from PAUSE, i.e PLAY with Range: npt=xxx-yyy
(2) PLAY with Scale: headers and Range: npt=xxx-yyy

Basically, anytime you are sending a PLAY to the server and you would like  
to
start streaming at a point other than the beginning of the file.



Dermot.
--


More information about the live-devel mailing list