Gecko:RTSPProtocol

From MozillaWiki
Revision as of 08:30, 28 January 2013 by Thinker (talk | contribs)
Jump to navigation Jump to search

Support RTSPProtocol in B2G and other platforms(?) WEB content can use rtsp://... URL at the src attribute of MediaElement to play a RTSP stream. For browser, user type a RTSP URL to launch a simple player to play the stream.

Design

Current design of seek of the MediaResource supports only seeking by byte offsets, but for RTSP or other streaming services we need to support seeking by time offset. We should add a new function MediaResource::SeekTime() for seeking by time offset instead of Seek().

RTSP is a special protocol running with multiple network sessions, one for RTSP, and two for RTP protocol, for audio track and video track respectively. RTSPController is responsible for handling these sessions, it is initialized with an nsIChannel object for RTSP session, then communicate with the RTSP server given by the nsIChannel object. RTSPController provides basic funtions of RTSP protocol, seek, play, pause, stop, and others. These functions are common among streaming services, so MediaStreamController is defined for generalizing.

MediaResourceRTSP is a subclass of MediaResource, and collaborate with RTSPController. It implements the new added function SeekTime(). The MediaElement passes an nsIChannel instance to MediaResourceRTSP, then it create an RTSPController initialized with the nsIChannel object. The MediaResourceRTSP leverages RTSPController to handle RTSP protocol.

RtspDesignArchitecture.png