Commit a5b0ad88 authored by Tim-Philipp Müller's avatar Tim-Philipp Müller

ext/taglib/gstid3v2mux.cc: Add support for writing images (APIC frames) into...

ext/taglib/gstid3v2mux.cc: Add support for writing images (APIC frames) into ID3v2 tags (picture type always set to '...

Original commit message from CVS:
* ext/taglib/gstid3v2mux.cc:
Add support for writing images (APIC frames) into ID3v2
tags (picture type always set to 'other' for now though).
parent d0ba8b0f
2006-05-15 Tim-Philipp Müller <tim at centricular dot net>
* ext/taglib/gstid3v2mux.cc:
Add support for writing images (APIC frames) into ID3v2
tags (picture type always set to 'other' for now though).
2006-05-14 Michael Smith <msmith@fluendo.com>
* gst/wavparse/gstwavparse.c:
......
common @ 3062df90
Subproject commit e41606ab2c6a31be473de511b5fd776bd2593b56
Subproject commit 3062df90281144cbdb55bd58ee9f0714ab346c23
......@@ -59,6 +59,7 @@
#include <textidentificationframe.h>
#include <uniquefileidentifierframe.h>
#include <attachedpictureframe.h>
#include <id3v2tag.h>
#include <gst/tag/tag.h>
......@@ -316,6 +317,49 @@ add_one_tag (const GstTagList * list, const gchar * tag, gpointer user_data)
id3v2tag->addFrame (frame);
g_free (id_str);
}
} else if (strcmp (tag, GST_TAG_IMAGE) == 0) {
const GValue *val;
GstBuffer *image;
GST_LOG ("image tag");
val = gst_tag_list_get_value_index (list, tag, 0);
image = (GstBuffer *) gst_value_get_mini_object (val);
if (GST_IS_BUFFER (image) && GST_BUFFER_SIZE (image) > 0 &&
GST_BUFFER_CAPS (image) != NULL &&
!gst_caps_is_empty (GST_BUFFER_CAPS (image))) {
const gchar *mime_type;
GstStructure *s;
s = gst_caps_get_structure (GST_BUFFER_CAPS (image), 0);
mime_type = gst_structure_get_name (s);
if (mime_type != NULL) {
ID3v2::AttachedPictureFrame * frame;
const gchar *desc;
if (strcmp (mime_type, "text/uri-list") == 0)
mime_type = "-->";
frame = new ID3v2::AttachedPictureFrame ();
GST_DEBUG ("Attaching picture of %u bytes and mime type %s",
GST_BUFFER_SIZE (image), mime_type);
id3v2tag->addFrame (frame);
frame->setPicture (ByteVector ((const char *) GST_BUFFER_DATA (image),
GST_BUFFER_SIZE (image)));
frame->setTextEncoding (String::UTF8);
frame->setMimeType (mime_type);
desc = gst_structure_get_string (s, "image-description");
frame->setDescription ((desc) ? desc : "");
/* FIXME */
frame->setType (ID3v2::AttachedPictureFrame::Other);
}
} else {
GST_WARNING ("NULL image or no caps on image buffer (%p, caps=%"
GST_PTR_FORMAT ")", image, (image) ? GST_BUFFER_CAPS (image) : NULL);
}
} else {
GST_WARNING ("Unsupported tag: %s", tag);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment