After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 104345 - vorbis metadata needs converting to gst format
vorbis metadata needs converting to gst format
Status: RESOLVED DUPLICATE of bug 110544
Product: GStreamer
Classification: Platform
Component: gst-plugins
git master
Other Linux
: Normal normal
: 0.4.0
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 112569 (view as bug list)
Depends on:
Blocks: 104836
 
 
Reported: 2003-01-24 18:38 UTC by Jorn Baayen
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: 2.0



Description Jorn Baayen 2003-01-24 18:38:50 UTC
Just filing a bug for the fact that there's no metadata implementented yet
for the flac element.
Comment 1 Ronald Bultje 2003-05-08 12:31:37 UTC
*** Bug 112569 has been marked as a duplicate of this bug. ***
Comment 2 Ronald Bultje 2003-05-08 12:33:06 UTC
Hm, seems like there's a lot of interest for FLAC...

http://flac.sourceforge.net/format.html

"VORBIS_COMMENT: This block is for storing a list of human-readable
name/value pairs. Values are encoded using UTF-8. It is an
implementation of the Vorbis comment specification. This is the only
officially supported tagging mechanism in FLAC. There may be only one
VORBIS_COMMENT block in a stream."

According to Ross (rburton), FLAC__file_encoder_set_metadata() is the
way to go here.
Comment 3 Ronald Bultje 2003-05-08 13:50:00 UTC
So, according to the docs, it'd look like:

static void
set_metadata (FLAC__StreamEncoder *encoder,
              GstCaps             *caps)
{
  FLAC__StreamMetadata *meta = g_malloc(sizeof(FLAC__StreamMetadata));
  const gchar **meta_types = { "TITLE", "VERSION", "ALBUM", "TRACKNUMBER",
                               "ARTIST", "PERFORMER", "COPYRIGHT",
"LICENSE",
                               "ORGANISATION", "DESCRIPTION", "GENRE",
"DATE",
                               "LOCATION", "CONTACT", "ISRC", NULL };

  meta->type = FLAC__METADATA_TYPE_VORBIS_COMMENT;
  meta->data.vorbis_comment.vendor_string.length =
strlen(FLAC__VENDOR_STRING);
  meta->data.vorbis_comment.vendor_string.entry = FLAC__VENDOR_STRING;
  meta->data.num_comments = 0;
  meta->data.comments =
g_malloc(sizeof(FLAC__StreamMetadata_VorbisComment_Entry) * 15); /* max */

  /* num_comments */
  for ( ; *meta_types != NULL; meta_types++) {
    if (gst_caps_has_property(caps, *meta_types)) {
      gchar *entry;
      gst_caps_get_string(caps, *meta_types, &entry);
      meta->data.comments[meta->data.num_comments].length =
strlen(entry) + strlen(*meta_types) + 1;
      meta->data.comments[meta.data.num_comments].entry =
g_strdup_printf("%s=%s", *meta_types, entry);

      meta->data.num_comments++;
    }
  }

  FLAC__file_encoder_set_metadata(encoder, &meta, 1);
}

After initting the encoder, we should free the struct somewhere.
Besides, it's untested. However, it's a start. :).
Comment 4 Ronald Bultje 2003-05-09 10:23:20 UTC
From what I understand, flacdec would have to use
FLAC__stream_decoder_set_metadata_callback() to get a metadata
callback when the file in question contains metadata.

The callback would then have to check whether the metadata block is a
VorbisComment metadata block and - if yes - read the metadata and
signal that it has metadata using the proper GStreamer callbacks
(g_object_notify(object, "metadata") or so)... The way in which we
interpret is is the same as above.
Comment 5 Ronald Bultje 2003-05-09 11:41:58 UTC
apoc just notified me that he added this last week, so I shouldn't
have written all that... Current stuff remaining is that we use the
vorbis comment tags (in caps, see above) for metadata, and we should
translate that to gstreamer tags (lowercase).
Comment 6 Ronald Bultje 2003-06-30 22:11:04 UTC
Hm, we have multiple bugs describing the same issue...

*** This bug has been marked as a duplicate of 110544 ***