[gst-devel] Extensibility

Andy Wingo wingo at pobox.com
Thu Feb 5 05:22:50 CET 2004


Hey space travelers,

A bit of background: I use derived versions of GstPad and GstPadTemplate
in soundscrape. The extended classes store a default value for the pad
or template. Combined with buffers that only hold one float but are
meant to be valid for an entire buffer-frames period, this implements a
distinction between control-rate and audio-rate flow, an important
optimization in DSP.

This kind of extensibility is a strong point of GStreamer. It should be
supported, of course only where the impact on the core is low, and the
extending code doesn't hack around with private internals.

So, to my question. Why does gst_element_class_add_template explicitly
memcpy the template, instead of just reffing it? Of course doing that
prevents the function from working on subclasses of GstPadTemplate. For
now I'm going to hack around the situation, but as this is a recent
change (last two or three months), I wanted to hear why it was changed.

Cheers,
-- 
Andy Wingo <wingo at pobox.com>




More information about the gstreamer-devel mailing list