Created
March 23, 2017 20:06
-
-
Save TRPB/06a96c00656daa3c7a976127289de633 to your computer and use it in GitHub Desktop.
gst-streams
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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