GstPadTemplate is now created with a floating ref and
gst_element_class_add_pad_template() takes ownership of this floating ref.
+ GstPadTemplate instances are considered immutable and must not be
+ changed.
+
* GstMiniObject
A miniobject is now a simple refcounted structure holding the information
common to buffers, events, messages, queries and caps.
* from their base class but elements can add pad templates in class_init
* instead of base_init.
*/
- /* FIXME: Do we consider GstPadTemplates as immutable? If so we can
- * simply ref them instead of copying.
- */
padtemplates = g_list_copy (element_class->padtemplates);
for (node = padtemplates; node != NULL; node = node->next) {
GstPadTemplate *tmpl = (GstPadTemplate *) node->data;
- node->data = gst_pad_template_new (tmpl->name_template,
- tmpl->direction, tmpl->presence, gst_caps_copy (tmpl->caps));
+ gst_object_ref (tmpl);
}
element_class->padtemplates = padtemplates;