Skip to content

Instantly share code, notes, and snippets.

@TRPB
Created Mar 23, 2017
Embed
What would you like to do?
gst-streams
const GstStructure *structure = (GstStructure*)gst_message_get_structure(br->msg);
if(GST_MESSAGE_TYPE(br->msg) == GST_MESSAGE_STREAM_COLLECTION) {
GstStreamCollection *collection = NULL;
gst_message_parse_stream_collection (br->msg, &collection);
guint size = gst_stream_collection_get_size (collection);
for (guint i = 0; i < size; i++) {
g_print("Stream: %i\n",i);
GstStream *stream = gst_stream_collection_get_stream (collection, i);
GstTagList *taglist = gst_stream_get_tags(stream);
guint tagCount = gst_tag_list_n_tags(taglist);
for (guint j = 0; j < tagCount; j++) {
const gchar *name = gst_tag_list_nth_tag_name (taglist, j);
g_print("%s\n", name);
const GValue *value = gst_tag_list_get_value_index(taglist, name, j);
if (G_VALUE_TYPE(value) == G_TYPE_STRING) {
//It segfaults here for some values
const char *val = g_value_get_string(value);
}
}
gst_tag_list_unref(taglist);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment