Home > Back-end >  How to programatically determine if a gstreamer Element is a Bin?
How to programatically determine if a gstreamer Element is a Bin?

Time:06-02

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?

CodePudding user response:

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)) ...
  • Related