[Live-devel] Media subsession lifetime
Ross Finlayson
finlayson at live555.com
Sat May 26 03:15:01 PDT 2012
> could you please shed a little light on the following item:
>
> I'm using testOnDemandRTSPServer-based application to stream h264 stream. The strange thing that I don't wee when the subsession is destroyed when the client is disconnected.
A "ServerMediaSubsession" (note, not a "MediaSubsession"; that's something that's used only by clients) object represents a media 'track' (i.e., an audio, video, text substream within a possibly compound stream), *regardless* of which clients, if any, are currently receiving it. Therefore, it does not get deleted when a client disconnects. Instead, it stays in existence, in case other, new clients also want to receive it later.
Note that "ServerMediaSubsession" objects are contained within "ServerMediaSession" objects. A "ServerMediaSession" object represents a complete media stream (consisting of one or more "ServerMediaSubsession"s (i.e., 'tracks')).
Each "ServerMediaSubsession" object is automatically reclaimed when its parent "ServerMediaSession" object is reclaimed. "ServerMediaSession" (and thus also "ServerMediaSubsession") objects are automatically reclaimed when the "RTSPServer" object is closed. However, you can also, if you wish, remove a "ServerMediaSession" object (and thus also its "ServerMediaSubsession"s) from the server yourself, using the "RTSPServer::removeServerMediaSession()" function. This is rarely needed, but you would do this, for example, if you decide that you don't want any more clients to be able access this particular stream (but want the server to stay running, to continue to serve other streams).
To summarize: You usually don't need to worry about reclaiming "ServerMediaSession" or "ServerMediaSubsession" objects. They will get reclaimed automatically after you call "Medium::close()" on the "RTSPServer" object.
Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20120526/d7f6c877/attachment.html>
More information about the live-devel
mailing list