How to get pipeline from gstreamer plugin written in python?

Michael Gruner michael.gruner at ridgerun.com
Thu Jul 2 17:26:31 UTC 2020


Ultimately, you need the pipeline (or a bin) to get the element by name. Elements live in bins, which are their parents. The only element that doesn’t have a parent is the top level pipeline. Something like this should work:

parent = your_element;

do {
  old_parent = parent;
  parent = gst_object_get_parent (parent);
} while (parent);

pipeline = old_parent;

other_element = gst_bin_get_by_name (pipeline, “name”);

Hope this helps,

Michael
www.ridgerun.com

> On Jul 2, 2020, at 11:12, Josh Doe <josh at joshdoe.com> wrote:
> 
> 
>> On Wed, Jul 1, 2020 at 9:51 AM facepalm <ejlungay at gmail.com> wrote:
> 
>> In my gst-python plugin I wanted to get the pipeline so that I can query all
>> plugins from the pipeline by name and update their properties.
> 
> Something like this:
> 
> self = playbin.get_by_name('mix')
> bin = self.get_parent()  # may need to recurse up if bins are nested
> for el in bin.iterate_elements():
>     print(el.get_name())
> 
>  
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20200702/0504d06d/attachment.htm>


More information about the gstreamer-devel mailing list