How to extract only a certain tag from the stream?

Phong Cao phngcv at
Sat Jun 11 15:12:12 PDT 2011

Hello everybody,

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:

void insert_tag_on_tree(const GstTagList *list, const gchar *tag, gpointer
user_data) {
  gchar *str = NULL;
  GtkTreeView *tree_view = NULL;
  GtkListStore *list_store = NULL;

  if (gst_tag_get_type(tag) == G_TYPE_STRING) {
    if (tag == (gchar*) "artist") {
      gst_tag_list_get_string_index(list, tag, 0, &str);
      g_print("%s : %20s\n", tag, str);

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?

Thank you for reading my message! I hope you guys have a good weekend!

Best regards,

Phong Cao
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the gstreamer-devel mailing list