mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-03 21:12:26 +00:00
element: Consider GstPadTemplate as immutable
Don't copy the templates when creating subclasses but only increase their refcount.
This commit is contained in:
parent
be00534878
commit
5f406248eb
2 changed files with 4 additions and 5 deletions
|
@ -101,6 +101,9 @@ The 0.11 porting guide
|
||||||
GstPadTemplate is now created with a floating ref and
|
GstPadTemplate is now created with a floating ref and
|
||||||
gst_element_class_add_pad_template() takes ownership of this floating ref.
|
gst_element_class_add_pad_template() takes ownership of this floating ref.
|
||||||
|
|
||||||
|
GstPadTemplate instances are considered immutable and must not be
|
||||||
|
changed.
|
||||||
|
|
||||||
* GstMiniObject
|
* GstMiniObject
|
||||||
A miniobject is now a simple refcounted structure holding the information
|
A miniobject is now a simple refcounted structure holding the information
|
||||||
common to buffers, events, messages, queries and caps.
|
common to buffers, events, messages, queries and caps.
|
||||||
|
|
|
@ -251,14 +251,10 @@ gst_element_base_class_init (gpointer g_class)
|
||||||
* from their base class but elements can add pad templates in class_init
|
* from their base class but elements can add pad templates in class_init
|
||||||
* instead of base_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);
|
padtemplates = g_list_copy (element_class->padtemplates);
|
||||||
for (node = padtemplates; node != NULL; node = node->next) {
|
for (node = padtemplates; node != NULL; node = node->next) {
|
||||||
GstPadTemplate *tmpl = (GstPadTemplate *) node->data;
|
GstPadTemplate *tmpl = (GstPadTemplate *) node->data;
|
||||||
node->data = gst_pad_template_new (tmpl->name_template,
|
gst_object_ref (tmpl);
|
||||||
tmpl->direction, tmpl->presence, gst_caps_copy (tmpl->caps));
|
|
||||||
}
|
}
|
||||||
element_class->padtemplates = padtemplates;
|
element_class->padtemplates = padtemplates;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue