[gst-devel] Muxing subtitles to matroska [Was: Re: dvdsrc status update, sundry questions]

Mark Nauwelaerts manauw at skynet.be
Wed Dec 13 23:47:36 CET 2006


Michal Benes wrote:
> Mark Nauwelaerts píše v St 13. 12. 2006 v 00:03 +0100:
>> Wim Taymans wrote:
>>> On Fri, 2006-12-08 at 17:42 -0700, Jason Gerard DeRose wrote:
<snip>
>> Could it be helpful / somehow possible to (re-)use the techniques given above in
>> a sort of upgraded collectpads that could then also be of use to muxers that
>> might be interested/capable in muxing subtitles, e.g. a matroskamux ?
> 
> Hi Mark,
> 
> 	I have a simple hack that does this. However it is a hack, therefore I
> never tried to commit it upstream. The technique is according to
> docs/design/part-sparsestreams.txt
> 
> 	Since collectpads is not yet handling update NEWSEGMENTS properly, I
> handle them in matroskamux. I catch the update NEWSEGMENT events at
> sinks and transform them to empty buffers (which I call "filler
> buffers"). Collectpads class is happy with these buffers and calls
> gst_matroska_mux_collected method (in which I discard filler buffers
> again)
> 
> This is the relevant part of gst_matroska_mux_handle_sink_event
> 
<snip code>
> 
> 	Unfortunately, I am not able to post the complete patch, because it is
> mixed with my other hack and it would be complicated to separate these
> two.

That's indeed a handy way to keep collectpads happy and going (assuming that
upstream elements follow design and produce sufficient subtitles and/or
NEWSEGMENT events of course).  Collectpads seems to invite some hacking, since
it already took me some doing/hacking to get hands on (tag) events of a
collectpads-controlled pad, e.g. in matroskamux (and duplicate this likewise in
avimux), which is a hack needed in the first place to get a NEWSEGMENT.

Ah, well, if some hacks are repeated enough times around collectpads, it may
become a trick, then a technique, and eventually in code that can then make in
upstream and be re-used (not duplicated) in other elements as well ;-)

Admittedly, it may not be so easy to adjust collectpads.  It seems there can be
no generic way in which it can handle NEWSEGMENT "right", since that can very
well be different depending on the element (e.g. adder versus typical muxer).
A (good?) start might be if it provided an "official" way for an element to have
a peek at events and act (properly) accordingly, would already reduce the "hack"
degree of the solution above.  Perhaps (just wild thought) [also] allow
specifying that it should not wait around for a buffer to arrive on some set of
pads (like subtitles).  Maybe some variation of the technique above (for the
subtitle mixer), though that is pretty much an enhanced specialized combination
of collectpads and a particular _collected function ?

Well, just hoping that these hacks around collectpads can shed their "hacking"
existence some day, and that the functionality they provide can make it cleanly
into upstream, as much re-usable as possible ... :-)

Regards,
Mark.




More information about the gstreamer-devel mailing list