[Live-devel] Proper use of StreamReplicator

Jan Ekholm jan.ekholm at d-pointer.com
Sat Oct 18 02:12:40 PDT 2014


On 18 okt 2014, at 01:09, Ross Finlayson <finlayson at live555.com> wrote:

>> In fact, you *might* try having your “ReplicaJPEGVideoSource” class inherit from both “JPEGVideoSource” and “FramedFilter”, but I’m not sure whether or not that will work.  (I’m wary of multiple inheritance in C++, and haven’t used it at all in any of the LIVE555 code so far.))
> 
> FYI, I looked into this, and unfortunately that hack (having your “ReplicaJPEGVideoSource” class inherit from both “JPEGVideoSource” and “FramedFilter”) won’t work, because of the ‘Diamond Problem’.  Because both “JPEGVideoSource” and “FramedFilter” inherit (non-virtually) from “FramedSource”, you can’t multiply-inherit from “JPEGVideoSource” and “FramedFilter”, otherwise you’d end up with two copies of “FramedSource”, which would probably be bad.
> 
> So, unfortunately you’re going to have to duplicate some of the existing functionality of “FramedFilter” in your new “ReplicaJPEGVideoSource” class.

I tend to avoid multiple inheritance too, unless one class is a totally abstract interface base class. I ran into the same
issue with replicating H264 too, as the StreamReplica does not fulfill isH264VideoStreamFramer(). I'll take a shot at
making a proxy class for at least H264 and perhaps JPEG too. I have not found a working way to actually get the JPEG 
video replayed from disk, so I may end up having to discard to idea of saving JPEG video to disk for later streaming.

Yes, I know JPEG video is far from ideal, but in this case it's a question of a demo that would prerecord some minutes
of live camera footage and then replay said material over and over again. H264 tends to drop frames and have glitches
even when run over localhost while JPEG video looks best.

-- 
Jan Ekholm
jan.ekholm at d-pointer.com






More information about the live-devel mailing list