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 764176 - expose pad_link_maybe_ghosting
expose pad_link_maybe_ghosting
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal enhancement
: 1.9.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-03-25 01:47 UTC by Matthew Waters (ystreet00)
Modified: 2016-04-06 13:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
utils: expose pad_link_maybe_ghosting() (3.09 KB, patch)
2016-03-25 01:49 UTC, Matthew Waters (ystreet00)
none Details | Review
utils: expose pad_link_maybe_ghosting() (3.81 KB, patch)
2016-03-31 11:16 UTC, Matthew Waters (ystreet00)
committed Details | Review
utils: check the correct element state when ghosting (1.57 KB, patch)
2016-04-04 10:34 UTC, Matthew Waters (ystreet00)
committed Details | Review

Description Matthew Waters (ystreet00) 2016-03-25 01:47:52 UTC
gst_element_link_pads(full) only works with pad names which doesn't really work if you have actual pads you're attempting to link together across bin boundaries.
Comment 1 Matthew Waters (ystreet00) 2016-03-25 01:49:03 UTC
Created attachment 324734 [details] [review]
utils: expose pad_link_maybe_ghosting()
Comment 2 Sebastian Dröge (slomo) 2016-03-25 08:42:21 UTC
Review of attachment 324734 [details] [review]:

::: gst/gstutils.c
@@ +1520,3 @@
 
+gboolean
+gst_pad_link_maybe_ghosting_full (GstPad * src, GstPad * sink,

This needs docs and a Since marker :) Also should probably mention under which situations it can actually work
Comment 3 Matthew Waters (ystreet00) 2016-03-31 11:16:56 UTC
Created attachment 325075 [details] [review]
utils: expose pad_link_maybe_ghosting()

Now with docs!
Comment 4 Matthew Waters (ystreet00) 2016-04-04 10:34:58 UTC
Created attachment 325318 [details] [review]
utils: check the correct element state when ghosting
Comment 5 Sebastian Dröge (slomo) 2016-04-05 11:10:48 UTC
Comment on attachment 325318 [details] [review]
utils: check the correct element state when ghosting

Bonus points for a unit test :)
Comment 6 Matthew Waters (ystreet00) 2016-04-06 13:33:38 UTC
commit e8c8c27ae81519af7942d34ed65a390baf27328e
Author: Matthew Waters <matthew@centricular.com>
Date:   Mon Apr 4 10:28:18 2016 +0000

    utils: check the correct element's state on ghosting pads
    
    Checking the current element's state when we're adding pads to
    the parent element is checking the wrong thing.
    
    Silences a 'attempting to add an inactive pad to a running element'
    warning when adding a ghost pad to a running parent bin of the parent
    bin of the element.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=764176

commit f87630663856e15ef6d6e93b40a1f01f56aaa718
Author: Matthew Waters <matthew@centricular.com>
Date:   Fri Mar 25 01:28:18 2016 +0000

    utils: expose pad_link_maybe_ghosting
    
    This is a useful function to automatically add ghost pads when linking
    two elements across bin boundaries without know their exact parentage.
    
    e.g. when using gst_parse_bin_from_description (with or without it ghosting pads),
    one can simply retreive the src/sink pads from the bin to link to another pad.
    
    Similar functionality is provided by gst_element_link_pads{_full}() however only
    by pad name rather than by actual pads.
    
    API: gst_pad_link_maybe_ghosting_full
    
    https://bugzilla.gnome.org/show_bug.cgi?id=764176
Comment 7 Matthew Waters (ystreet00) 2016-04-06 13:34:27 UTC
Comment on attachment 325318 [details] [review]
utils: check the correct element state when ghosting

Committed with a unit test.