GNOME Bugzilla – Bug 590199
Add Bin::add_ghost_pad(name, element, element_pad_name) method?
Last modified: 2011-01-16 23:37:49 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?
That's fine with me if it helps development.
I can also provide a patch for this.
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.
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
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?
If you have better implementation, feel free to use anything useful in the patch.
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.
Okay. Pushed to master.