[gst-devel] get GstElement from param

Tim-Philipp Müller t.i.m at zen.co.uk
Tue Dec 21 00:04:46 CET 2010


On Mon, 2010-12-20 at 14:48 -0800, Wes Miller wrote:

> That is the code I was looking at.  Rather than knowing the type_name, I
> want the GstElement* so I can run it back through this same function to get
> information about THAT element.
> 
> Goal is to enumerate the properties of, say, playbin, and to find that
> property 'audio-sink" is a "reference" to an object of type GstElement then
> to get the audio-sink's GstElement pointer  and explore it's properties to
> find out that the, say, pulsesink has it's sync property set to false.
> 
> Alice is in wonderland, walking backwards speaking APL.

GstElement *element = NULL;

g_object_get (playbin, param->name, &element, NULL);
...
gst_object_unref (element);

(or go via the GValue using g_object_get_property() and then
g_value_get_object() as the gst-inspect code does)

-Tim
 





More information about the gstreamer-devel mailing list