After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 762778 - API: add gst_element_class_add_static_pad_template()
API: add gst_element_class_add_static_pad_template()
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other All
: Normal enhancement
: 1.7.90
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-02-27 16:23 UTC by Tim-Philipp Müller
Modified: 2016-02-28 13:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
element: add gst_element_class_add_static_pad_template() (3.33 KB, patch)
2016-02-27 16:25 UTC, Tim-Philipp Müller
committed Details | Review
elements: use new gst_element_class_add_static_pad_template() (20.07 KB, patch)
2016-02-27 16:25 UTC, Tim-Philipp Müller
committed Details | Review

Description Tim-Philipp Müller 2016-02-27 16:23:05 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).
Comment 1 Tim-Philipp Müller 2016-02-27 16:25:01 UTC
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.
Comment 2 Tim-Philipp Müller 2016-02-27 16:25:25 UTC
Created attachment 322539 [details] [review]
elements: use new gst_element_class_add_static_pad_template()
Comment 3 Sebastian Dröge (slomo) 2016-02-27 16:33:14 UTC
(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.
Comment 4 Nicolas Dufresne (ndufresne) 2016-02-28 13:23:16 UTC
+1
Comment 5 Tim-Philipp Müller 2016-02-28 13:30:37 UTC
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