GNOME Bugzilla – Bug 762778
API: add gst_element_class_add_static_pad_template()
Last modified: 2016-02-28 13:31:03 UTC
In bug #662664 it was decided to only add this to 0.10 and not to the future 1.x branch, because it was not needed in 1.x to fix the memory leak observed there. However, I'm proposing to add this again now, simply because the current API is unnecessarily confusing for newbies and unnecessarily convoluted (why bother with GstStaticPadTemplate structs? if so, why not just pass it directly to the klass but have this additional step to convert it to an object, which is then taken ownership of, it's just weird really).
Created attachment 322538 [details] [review] element: add gst_element_class_add_static_pad_template() Pretty much every single element does gst_element_class_add_pad_template (element_class, gst_static_pad_template_get (&some_templ)); which is both confusing and unnecessary. We might just as well add a function to do that in one step.
Created attachment 322539 [details] [review] elements: use new gst_element_class_add_static_pad_template()
(In reply to Tim-Philipp Müller from comment #0) > why bother with GstStaticPadTemplate structs? if so, why not just pass it > directly to the klass but have this additional step I would vote to get rid of GstStaticPadTemplate for 2.0, there's not much point in it... like GstElementDetails in 0.10. For now, I like the new API and was thinking of adding that too a few times. Go for it.
+1
commit cf0680017e44f62434ee57c670a66b7dfa0a7746 Author: Tim-Philipp Müller <tim@centricular.com> Date: Sat Feb 27 15:36:28 2016 +0000 elements: use new gst_element_class_add_static_pad_template() https://bugzilla.gnome.org/show_bug.cgi?id=762778 commit fa12d23a17dbd16d4df552da1ca016c53fa038fb Author: Tim-Philipp Müller <tim@centricular.com> Date: Sat Feb 27 15:28:49 2016 +0000 element: add gst_element_class_add_static_pad_template() Pretty much every single element does gst_element_class_add_pad_template (element_class, gst_static_pad_template_get (&some_templ)); which is both confusing and unnecessary. We might just as well add a function to do that in one step. https://bugzilla.gnome.org/show_bug.cgi?id=762778