Search code examples
gstreamer

GStreamer: get child element from GstElement*


In my code, I currently have a pipeline description that is a string. I use gst_parse_launch(...) to utilize this pipeline and everything is working great.

However, now I am interested in setting some properties on one of the elements in the pipeline. Specifically the pipeline sink element (in my case autovideosink). I would like the set the property enable-last-sample but the autovideosink doesn't have that property. Thus my question is, how can I determine which video sink the autovideosink has resolved to so I can set this property?

My application is written in C++.


Solution

  • autovideosink implements the GstChildProxy interface:

    https://gstreamer.freedesktop.org/documentation/gstreamer/gstchildproxy.html?gi-language=c

    You should be able to set things directly via this interface, or hook into the callbacks directly when a new child is being added.