[Live-devel] OnDemandServerMediaSubsession with reusing issues

Igor Bukanov igor at mir2.org
Fri Mar 23 03:33:28 PDT 2007


I have found a simple way to solve my problems. It is enough just to
extend OnDemandServerMediaSubsession with a new virtual function:

virtual void closeStreamSource(FramedSource *inputSource) {
    Medium::close(inputSource);
}

and call this function in OnDemandServerMediaSubsession.cpp whenever
the current code calls Medium::close on the result of
createNewStreamSource.

The attached patch does just that.

In this way I can override createNewStreamSource in a subclass of
OnDemandServerMediaSubsession to return a lazily initialized source
stored in a field of the subclass and then override closeStreamSource
to do nothing delegating the closing of the source to the destructor
of my subclass.

Regards, Igor


On 21/03/07, Igor Bukanov <igor at mir2.org> wrote:
> On 21/03/07, Ross Finlayson <finlayson at live555.com> wrote:
> > >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.
> >
> > This is unfortunate, but unavoidable.  The SDP data has to be
> > returned (in the RTSP "DESCRIBE" response) before streaming can
> > begin, and unfortunately (for MPEG-4 video only) the SDP data
> > includes configuration data that can only be obtained (in general) by
> > reading part of the stream
>
> I have no problems with that, for me the issue is the fact that
> OnDemandServerMediaSubsession::sdpLines closes the stream instead of
> keeping it opened to feed to clients later. As I wrote, I worked
> around it, but that is not elegant and kind of defeats the purpose of
> reuse flag.
>
> Regards, Igor
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: close_control.patch
Type: application/octet-stream
Size: 6923 bytes
Desc: not available
Url : http://lists.live555.com/pipermail/live-devel/attachments/20070323/49a93ace/attachment.obj 


More information about the live-devel mailing list