Hello everybody,
<div><br></div><div>I am trying to write a music manager using GTK+ and GStreamer. I would like to be able to extract some certain tags and apply it to the GtkTreeView in my software. However, I am not sure how to extract only a certain amount of tags from a stream. I know that I need to use gst_tag_list_foreach() to specify the GstForEachFunction for each tag, but I just need to display to the users some tags, like title, artist, name, not all the tags that are available. Here is part of my GstForEachFunction:</div>
<div><br></div><div><div>void insert_tag_on_tree(const GstTagList *list, const gchar *tag, gpointer user_data) {</div><div> gchar *str = NULL;</div><div> GtkTreeView *tree_view = NULL;</div><div> GtkListStore *list_store = NULL;</div>
<div> </div><div> if (gst_tag_get_type(tag) == G_TYPE_STRING) {</div><div> if (tag == (gchar*) "artist") {</div><div> gst_tag_list_get_string_index(list, tag, 0, &str);</div><div> g_print("%s : %20s\n", tag, str);</div>
<div> }</div><div> }</div><div>}</div></div><div><br></div><div>So in this GstForEachFunc I compare the tag's name to "artist" and if its name is "artist", I will print it out. However, I could not get this function to work. Any idea on how to extract only a certain amount of tags from a stream?</div>
<div><br></div><div>Thank you for reading my message! I hope you guys have a good weekend!</div><div><br></div><div><br></div><div>Best regards,</div><div><br></div><div>Phong Cao</div>