[Live-devel] Multiple clients on a single FramedSource substream
Ross Finlayson
finlayson at live555.com
Sat Jan 28 20:34:54 PST 2012
> >In your "OnDemandServerMediaSubsession" subclass constructor, are you setting the "reuseFirstSource" parameter (in the parent class constructor) to True? This is important if - as in your case - you're streaming from a live input source. It prevents a new input source object from being created each time a new client connects.
>
> Yes, I believe I am setting this flag to true, so I can’t understand why I’m getting more source objects (and an increasing reference count).
OK. However, it turns out that your "createNewStreamSource()" function gets called twice (but no more), even if you've set the "reuseFirstParameter" to True. The first call is used to create 'dummy' source objects that might (depending upon the codec) be needed in order to determine the stream's SDP description (which the server will return in the response to the RTSP "DESCRIBE" command). Then this dummy source object gets closed. And then afterwards, when the first client does a RTSP "PLAY", "createNewStreamSource()" will get called again. (But because you've set "reuseFirstSource" to True, it won't get called again, even if more clients connect.)
So, your code needs to be prepared for the following, in order:
1/ Your "createNewStreamSource()" gets called.
2/ The destructor of your source object (the one that was returned by the first call to "createNewStreamSource()") gets called.
3/ Your "createNewStreamSource()" gets called again.
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/20120128/99f12890/attachment-0001.html>
More information about the live-devel
mailing list