[Live-devel] Changes to make it easier to subclass ServerMediaSession and set packet buffer size

Ross Finlayson finlayson at live555.com
Thu Feb 20 09:39:04 PST 2014


Michael,

To begin with, it's important to note that 'ONVIF' is an industry consortium (and one that Live Networks, Inc. does not belong to) - not a standards organization.  The relevant standards organization here (the one that we belong to, and whose specifications we try to adhere to) is the IETF.  For the most part, 'ONVIF standards' are really just IETF standards that they have referenced 'as is'; in this case, we will try to support them ourselves.  In some cases, however, 'ONVIF' may have made their own changes to SDP (or other IETF standards), without describing them in an IETF RFC or Internet-Draft; in that case, I feel no compulsion to support them in the "LIVE555 Streaming Media" software (and certainly not 'for free').

But having said that, let's look at each of the specific changes that you requested:


> 1. ServerMediaSession::generateSDPDescription() becomes a virtual method. Allows subclass to generate the SDP description in an independent manner e.g. database lookup.

The reason I can't do this is that the existing "generateSDPDescription()" code is important.  It explicitly generates 'session-level' SDP lines, followed by 'media-level' SDP lines for each "ServerMediaSubsession" - by calling "sdpLines()" (which, BTW, *is* a virtual function) on each subsession.  If I were to make it possible for subclasses to completely replace this code, then there's no guarantee that the resulting SDP would be (1) standards compliant, and (2) in a form that would allow a client to properly operate on the session/subsessions.

However, what I *might* do - sometime in the future - is provide a mechanism to allow developers to add their own 'session-level' attributes (i.e., beginning with "a=x-") to a SDP description.  Perhaps that would give you what you want here??


>  2. ServerMediaSession::duration() becomes a virtual method. Allows subclass to generate the duration in an independent manner e.g. database lookup.

Note that "ServerMedia*Sub*session::duration()" is already a virtual function, so your "ServerMediaSubsession" subclasses can redefine "duration()" to return whatever you want.  But the existing "ServerMediaSession::duration()" code is important (although admittedly a bit 'hacky'), and the code in several places makes assumptions about how "ServerMediaSession::duration()" works (basically, by returning the maximum of all the subsession "duration()"s, along with an indication of whether or not the subsession "duration()"s differ).  So it can't be changed arbitrarily.

Note that the child "ServerMediaSubsession"s are assumed to be 'concurrent' tracks within the parent "ServerMediaSession", so that the "duration()" of the parent is simply the maximum of the "duration()" of the children.  I hope you're not proposing that media-level SDP lines (i.e., generated from "ServerMediaSubsession"s) within a SDP description mean something different that this.  That's certainly not something that I could support, because that would be a non-standard interpretation of SDP (unless the SDP description also includes some IETF-defined 'grouping' mechanism that indicates otherwise).


>  3. Add a virtual method called ServerMediaSession::mediaSdpLines() and modify the implementation of ServerMediaSession::generateSDPDescription() to call mediaSdpLines() instead of calling subsession->sdpLines() directly.

This seems unnecessary, because "ServerMediaSubsession::sdpLines()" is already a virtual function.


> 4. Modify MatroskaFile::createSourceForStreaming() implementation to check for larger values of OutPacketBuffer::maxSize before setting 300000 value. Allows server instantiation to set a larger value without it being ignored. With a full field-of-view I'm seeing a few warning messages being emitted during replay and therefore a larger value than 300000 is recommended.

Yes, this is a good point.  What I'll do (in the next release of the software) is define a new function "OutPacketBuffer::increaseMaxSizeTo(unsigned)" that doesn't change "OutPacketBuffer::maxSize" if it's already less than the specified value - and then change "MatroskaFile::createSourceForStreaming()" to call this new function instead.


Needless to say, you are, of course, welcome to make whatever changes you want to your own copy of the code, provided that - in doing so - you comply with the LGPL; see http://www.live555.com/liveMedia/faq.html#copyright-and-license

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/20140221/04f8d3a8/attachment-0001.html>


More information about the live-devel mailing list