源:http://www.live555.com/liveMedia/faq.html#trick-mode
When talking about "trick mode support", it's important to distinguish between RTSP client support, and RTSP server support.
Our RTSP client implementation fully supports 'trick play' operations. Note the "start", "end" and "scale" parameters to "RTSPClient::sendPlayCommand()". (Note also that our "openRTSP" demo RTSP client application has command-line options that can be used to demonstrate client 'trick play' operations.)
Our RTSP server implementation also supports 'trick play' operations, but note that parts of this are (necessarily) media type specific. I.e., there has to be some new code added for each different type of media file that we wish to stream. This functionality has already been provided for some types of media file.
To add 'trick play' support for a media type (that does not already support it), changes need to be made to the corresponding subclass of "ServerMediaSubsession":
- To add support for seeking within a stream, you will need to implement the following virtual functions:
-
virtual float duration() const;
Returns the file's duration, in seconds -
virtual void seekStreamSource(FramedSource* inputSource, float seekNPT);
(Attempts to) seek within the input source.
-
- To add support for 'fast forward' and/or 'reverse play', you will also need to implement the following virtual functions:
-
virtual void testScaleFactor(float& scale);
Inspects the input value of "scale", and, if necessary, changes it to a nearby value that we support. (E.g., if the input value of "scale" is 3.3, you might change it to 3 (an integer).) If there's no 'nearby' value that you support, just set "scale" to 1 (the default value). -
virtual void setStreamSourceScale(FramedSource* inputSource, float scale);
Actually sets the scale factor for a specific input source. (The value of "scale" will previously have been passed in and out of "testScaleFactor()", so we know that it is a value that we support.)
-