Re: How to get pipeline from gstreamer plugin written in python?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: How to get pipeline from gstreamer plugin written in python?

Josh Doe
On Wed, Jul 1, 2020 at 9:51 AM facepalm <[hidden email]> 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
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to get pipeline from gstreamer plugin written in python?

Michael Gruner
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 <[hidden email]> wrote:


On Wed, Jul 1, 2020 at 9:51 AM facepalm <[hidden email]> 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
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel