Skip to content

Instantly share code, notes, and snippets.

@josebraga
Last active January 20, 2022 10:01
Show Gist options
  • Save josebraga/6a72e85236d56d4af40dcf5671f90ae9 to your computer and use it in GitHub Desktop.
Save josebraga/6a72e85236d56d4af40dcf5671f90ae9 to your computer and use it in GitHub Desktop.
gstreamer: print name of all pipeline elements
g_print("\nPrint all elements of the pipeline\n");
GValue item = G_VALUE_INIT;
GstIterator *iter = gst_bin_iterate_elements(GST_BIN(data.pipeline));
GstIteratorResult res = gst_iterator_next (iter, &item);
while (res == GST_ITERATOR_OK) {
GstElement* element = GST_ELEMENT_CAST (g_value_get_object (&item));
gchar *name = gst_object_get_name(GST_OBJECT (element));
g_print("\t- %s \n", name);
res = gst_iterator_next (iter, &item);
}
g_value_unset (&item);
gst_iterator_free (iter);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment