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 692508 - gst_element_get_compatible_pad_template: use gst_pad_get_pad_template
gst_element_get_compatible_pad_template: use gst_pad_get_pad_template
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other All
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 693715 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-01-25 09:55 UTC by Niv Sardi
Modified: 2018-11-03 12:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
0001-gst_element_get_compatible_pad_template-use-gst_pad_.patch (2.25 KB, patch)
2013-01-25 09:55 UTC, Niv Sardi
needs-work Details | Review

Description Niv Sardi 2013-01-25 09:55:31 UTC
Created attachment 234371 [details] [review]
0001-gst_element_get_compatible_pad_template-use-gst_pad_.patch

motivation comes from: /* FIXME: why not gst_pad_get_pad_template (pad); */
    this code path is quite nicer, we now only revert to creating the template
    if gst_pad_get_pad_template fails.
    
    with this fork, we gain a non-allocation of GstCaps *templcaps
    
    Signed-off-by: Niv Sardi <xaiki@evilgiggle.com>
Comment 1 Niv Sardi 2013-01-25 09:58:47 UTC
this used to be unsuable:
gst_pad_get_pad_template ()

Returns : the GstPadTemplate from which this pad was instantiated, or NULL if this pad has no template. FIXME: currently returns an unrefcounted padtemplate. [transfer none]

but has been fixed by:
commit b5bc5b459ad888766b8f9c81b48f830018294e5e
Author: Sebastian Dröge <sebastian.droege@collabora.co.uk>
Date:   Tue May 17 11:59:00 2011 +0200

    pad: Let template related functions return new references
    
    gst_pad_template_get_caps(), gst_pad_get_pad_template_caps()
    and gst_pad_get_pad_template() return a new reference of the
    caps or template now and the return value needs to be
    unreffed after usage.
Comment 2 Niv Sardi 2013-01-25 10:00:29 UTC
NOTE: we still do correctly unref the template.
we could be sainter than the saints and try to check if it was actually allocated (can gst_pad_template_new really fail ?!) but I don't think it's mandatory.
Comment 3 Tim-Philipp Müller 2013-02-13 15:18:43 UTC
*** Bug 693715 has been marked as a duplicate of this bug. ***
Comment 4 Niv Sardi 2013-02-13 15:21:26 UTC
sorry 'bout the dup, I couldn't find this bug in my mail.
Comment 5 Sebastian Dröge (slomo) 2013-02-14 09:27:56 UTC
commit 1a1a9e143fb0e155d7627aa8e489cd5d04bc093c
Author: Niv Sardi <xaiki@evilgiggle.com>
Date:   Fri Jan 25 06:50:27 2013 -0300

    utils: Use gst_pad_get_pad_template() in gst_element_get_compatible_pad_template()
    
    motivation comes from: /* FIXME: why not gst_pad_get_pad_template (pad); */
    this code path is quite nicer, we now only revert to creating the template
    if gst_pad_get_pad_template fails.
    
    with this fork, we gain a non-allocation of GstCaps *templcaps
    
    https://bugzilla.gnome.org/show_bug.cgi?id=692508
Comment 6 Tim-Philipp Müller 2013-02-14 14:11:45 UTC
This appears to break the pipelines/tagschecking unit test in -good for some reason.
Comment 7 Tim-Philipp Müller 2013-02-15 12:42:08 UTC
commit 6c7573226e307a87ec06fb43ce157a2ad767073c
Author: Tim-Philipp Müller <tim.muller@collabora.co.uk>
Date:   Thu Feb 14 14:09:13 2013 +0000

    Revert "utils: Use gst_pad_get_pad_template() in gst_element_get_compatible_pad_template()"
    
    This reverts commit 1a1a9e143fb0e155d7627aa8e489cd5d04bc093c.
    
    This breaks the pipelines/tagschecking unit test for some reason
    (fakesrc ! capsfilter ! qtmux linking fails now). It might be
    a bug in the unit test of course, but someone will need to
    investigate this. Reverting for now.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=692508
Comment 8 GStreamer system administrator 2018-11-03 12:16:50 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/33.