[Live-devel] mkv streaming in loop
Ross Finlayson
finlayson at live555.com
Mon Dec 23 09:59:27 PST 2013
> I need to stream a mkv in a loop, i know that I need to write my own ByteStreamFileSource subclass
No, I don't recommend doing things this way.
Rather than defining a new class that would sit 'below' MatroskaFile (because, as you discovered, this would require a lot of code duplication), I recommend that you instead define a new class (a subclass of "FramedFilter", perhaps) that would sit *above* "MatroskaFile".
In particular, your new class would - when needed - create a new "MatroskaFile" object (to start reading from the underlying file all over again, and create demuxed track(s)). When calling "getNextFrame()" on the demuxed track(s), it would set an appropriate 'onCloseFunc' that would be called when the end of the underlying file is reached. At that point, you would just close the existing "MatroskaFile", and create a new one.
You should be able to do this without modifying (or duplicating) any of the "Matroska*" code.
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/20131224/ebe53f8c/attachment.html>
More information about the live-devel
mailing list