[Live-devel] OnDemandServerMediaSubsession with reusing issues

Igor Bukanov igor at mir2.org
Wed Mar 21 08:26:32 PDT 2007


Hi,

To stream on demand to multiple clients a live source I use a subclass
of OnDemandServerMediaSubsession with reuseFirstSource set to true.

Initially I thought that in a such case
OnDemandServerMediaSubsession::createNewStreamSource will be called
only once so I can perform on-demand initialization there. But it
turned out that it is called twice with the first time just to get sdp
lines. Moreover, this first call will then close the source. Since for
the source I use isMPEG4VideoStreamDiscreteFramer, that would close
the original source as well. And that is expensive to construct.

I worked around that by overriding sdpLines in the subclass of
OnDemandServerMediaSubsession but that forced to dupliacte all live555
code that automatically constructs the sdp lines based on the source
parameters. Ideally it would be nice if OnDemandServerMediaSubsession
calls createNewStreamSource only once, but a patch that I tried to
create became rather messy due to the need to store estBitrate results
of the first call to  createNewStreamSource.

That gives a suggestion: maybe it is better to remove estBitrate from
createNewStreamSource replacing it by a method in FramedSource ?

Regards, Igor


More information about the live-devel mailing list