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 622504 - [GstPad] Provide more fine-grained linking methods
[GstPad] Provide more fine-grained linking methods
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal enhancement
: 0.10.30
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-06-23 15:36 UTC by Edward Hervey
Modified: 2010-06-23 16:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GstPad: Add new pad linking method with configurable checks. (7.45 KB, patch)
2010-06-23 15:37 UTC, Edward Hervey
reviewed Details | Review
gstutils: New gst_element_link_pads_full method (6.51 KB, patch)
2010-06-23 15:37 UTC, Edward Hervey
none Details | Review
gstghostpad: We don't need any checks when linking target pad (1.16 KB, patch)
2010-06-23 15:37 UTC, Edward Hervey
none Details | Review
GstPad: Add new pad linking method with configurable checks. (9.18 KB, patch)
2010-06-23 16:35 UTC, Edward Hervey
committed Details | Review
gstutils: New gst_element_link_pads_full method (7.03 KB, patch)
2010-06-23 16:35 UTC, Edward Hervey
committed Details | Review
gstghostpad: We don't need any checks when linking target pad (1.19 KB, patch)
2010-06-23 16:35 UTC, Edward Hervey
committed Details | Review

Description Edward Hervey 2010-06-23 15:36:49 UTC
Currently gst_pad_link unconditionally does a series of checks that could be avoided when the caller knows they will never fail.

The following patches:
* add a new method for pad linking which allows to chose which checks could be done at link time
* add a new utility method for link element pads which allows to chose which checks should be done at link time
* does a check-less link when gstghostpad links its internal pad to the target.
Comment 1 Edward Hervey 2010-06-23 15:37:14 UTC
Created attachment 164408 [details] [review]
GstPad: Add new pad linking method with configurable checks.

To be used for cases where we don't need all checks to be validated.

API: gst_pad_link_full
API: GstPadLinkCheck
Comment 2 Edward Hervey 2010-06-23 15:37:20 UTC
Created attachment 164409 [details] [review]
gstutils: New gst_element_link_pads_full method

Links the elements with the specified pad linking checks.
Comment 3 Edward Hervey 2010-06-23 15:37:28 UTC
Created attachment 164410 [details] [review]
gstghostpad: We don't need any checks when linking target pad
Comment 4 Wim Taymans 2010-06-23 15:46:43 UTC
looks simple and effective, no objections from me for pushing it.
Comment 5 Tim-Philipp Müller 2010-06-23 16:02:32 UTC
Comment on attachment 164408 [details] [review]
GstPad: Add new pad linking method with configurable checks.

>+typedef enum {
>+  GST_PADLINK_CHECK_NOTHING       = 1 << 0,
>+  GST_PADLINK_CHECK_HIERARCHY     = 1 << 1,
>+  GST_PADLINK_CHECK_TEMPLATE_CAPS = 1 << 2,
>+  GST_PADLINK_CHECK_CAPS          = 1 << 3,
>+} GstPadLinkCheck;
>+...
>+ * GST_PADLINK_CHECK_DEFAULT:
>+ ...
>+#define GST_PADLINK_CHECK_DEFAULT (GST_PADLINK_CHECK_HIERARCHY | GST_PADLINK_CHECK_CAPS)

Minor nitpick: I think that should be GST_PAD_LINK_CHECK_* everywhere here.
Comment 6 Tim-Philipp Müller 2010-06-23 16:04:19 UTC
And please add Since: 0.10.30 markers to the gtk-doc chunks for the new functions/enums/defines
Comment 7 Edward Hervey 2010-06-23 16:35:15 UTC
Created attachment 164412 [details] [review]
GstPad: Add new pad linking method with configurable checks.

To be used for cases where we don't need all checks to be validated.

API: gst_pad_link_full
API: GstPadLinkCheck
Comment 8 Edward Hervey 2010-06-23 16:35:21 UTC
Created attachment 164413 [details] [review]
gstutils: New gst_element_link_pads_full method

Links the elements with the specified pad linking checks.

API:gst_element_link_pads_full
Comment 9 Edward Hervey 2010-06-23 16:35:25 UTC
Created attachment 164414 [details] [review]
gstghostpad: We don't need any checks when linking target pad
Comment 10 Edward Hervey 2010-06-23 16:44:08 UTC
commit 4a999b5e43b5cd9f6bc9b2d0615d8491cee23ec0
Author: Edward Hervey <bilboed@bilboed.com>
Date:   Wed Jun 23 17:24:07 2010 +0200

    gstghostpad: We don't need any checks when linking target pad
    
    https://bugzilla.gnome.org/show_bug.cgi?id=622504

commit 5faf5620f3756e16130d9a6dcde77070c02b8f38
Author: Edward Hervey <bilboed@bilboed.com>
Date:   Wed Jun 23 17:00:17 2010 +0200

    gstutils: New gst_element_link_pads_full method
    
    Links the elements with the specified pad linking checks.
    
    API:gst_element_link_pads_full
    
    https://bugzilla.gnome.org/show_bug.cgi?id=622504

commit 625c4e2d80f02ed54eb8bfd2ff3cde41da06f9da
Author: Edward Hervey <bilboed@bilboed.com>
Date:   Wed Jun 23 16:45:19 2010 +0200

    GstPad: Add new pad linking method with configurable checks.
    
    To be used for cases where we don't need all checks to be validated.
    
    API: gst_pad_link_full
    API: GstPadLinkCheck
    
    https://bugzilla.gnome.org/show_bug.cgi?id=622504