Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to programatically determine if a gstreamer Element is a Bin?

Tags:

c

gstreamer

I can see that methods exist for iterating over the GstElement's within a bin... but for any given GstElement is there are way to programatically determine if it is in fact a bin?

like image 422
dicroce Avatar asked Dec 05 '25 16:12

dicroce


1 Answers

All GstElements are derived from the GLib GObject type, so the GLib G_OBJECT_TYPE() macro can be used to check the type:

if (G_OBJECT_TYPE(element) == GST_TYPE_BIN) ...

Even simpler is to use the convenience macros that are declared in gstbin.h:

if (GST_IS_BIN(element)) ...
like image 59
jpa Avatar answered Dec 08 '25 09:12

jpa



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!