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 590199 - Add Bin::add_ghost_pad(name, element, element_pad_name) method?
Add Bin::add_ghost_pad(name, element, element_pad_name) method?
Status: RESOLVED FIXED
Product: gstreamermm
Classification: Bindings
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on: 590288
Blocks:
 
 
Reported: 2009-07-29 23:16 UTC by Murray Cumming
Modified: 2011-01-16 23:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to add Gst::Bin::add_ghost_pad() (3.15 KB, patch)
2009-07-30 18:35 UTC, José Alburquerque
committed Details | Review

Description Murray Cumming 2009-07-29 23:16:22 UTC
In vidrot, we have code such as this:

Glib::RefPtr<Gst::Pad> bin_audio_sink =
  m_element_audconvert->get_static_pad("sink");
m_bin_audio->add_pad(Gst::GhostPad::create("audsink", bin_audio_sink));


That bin_audio_sink variable is just tempory, so I guess that this API would be simpler:
  m_bin_audio->add_ghost_pad(name, element, element_pad_name)?

We could make the name optional at the end, allowing:
  ghost_pad = m_bin_audio->add_ghost_pad(element, element_pad_name)?


Thoughts?
Comment 1 José Alburquerque 2009-07-30 01:09:21 UTC
That's fine with me if it helps development.
Comment 2 José Alburquerque 2009-07-30 15:33:02 UTC
I can also provide a patch for this.
Comment 3 José Alburquerque 2009-07-30 16:18:35 UTC
Let's delay the patch for a while.  I was just thinking that the Gst::GhostPad constructors all require a name for the ghost pad.  Maybe they should also be changed so that the name is optional and at the end also.  I could include a change to the constructors in this patch (or it could be fixed in git) if you like.
Comment 4 José Alburquerque 2009-07-30 16:57:55 UTC
I filed a new bug about the ghost pad constructors[1] (so the decision can be made publically) and made this one depend on that one because they're sort of related. :-)

[1] http://bugzilla.gnome.org/show_bug.cgi?id=590288
Comment 5 José Alburquerque 2009-07-30 18:35:50 UTC
Created attachment 139582 [details] [review]
Patch to add Gst::Bin::add_ghost_pad()

Would this patch be okay or should the method use lower level C API to accomplish the adding of a ghost pad from an element's static pad?
Comment 6 José Alburquerque 2009-07-30 18:51:05 UTC
If you have better implementation, feel free to use anything useful in the patch.
Comment 7 Murray Cumming 2009-07-30 19:12:58 UTC
Looks good to me. Thanks.

I don't see a need to add this to the C API. C APIs are generally more long-winded, partly because they don't have method overloads and optional parameters.
Comment 8 José Alburquerque 2009-07-30 19:17:28 UTC
Okay.  Pushed to master.