Commit 7b3ca538 authored by Matthieu Bouron's avatar Matthieu Bouron Committed by Tim-Philipp Müller
Browse files

tag: id3: encapsulate ID3V2 blob frames in GstSample

id3mux and id3v2mux expect GST_TAG_ID3V2_FRAME type to be stored in a
GstSample and not a buffer, which is also needed because we can't
attach extradata/caps to buffers any more. These are private tags
no one should be poking at, and also the extra info is missing.
parent 6d7ab5a8
......@@ -393,6 +393,7 @@ static void
id3v2_add_id3v2_frame_blob_to_taglist (ID3TagsWorking * work, guint size)
GstBuffer *blob;
GstSample *sample;
guint8 *frame_data;
#if 0
GstCaps *caps;
......@@ -420,6 +421,9 @@ id3v2_add_id3v2_frame_blob_to_taglist (ID3TagsWorking * work, guint size)
blob = gst_buffer_new_and_alloc (frame_size);
gst_buffer_fill (blob, 0, frame_data, frame_size);
sample = gst_sample_new (blob, NULL, NULL, NULL);
gst_buffer_unref (blob);
/* Sanitize frame id */
for (i = 0; i < 4; i++) {
if (!g_ascii_isalnum (frame_data[i]))
......@@ -440,8 +444,8 @@ id3v2_add_id3v2_frame_blob_to_taglist (ID3TagsWorking * work, guint size)
/* gst_util_dump_mem (GST_BUFFER_DATA (blob), GST_BUFFER_SIZE (blob)); */
gst_tag_list_add (work->tags, GST_TAG_MERGE_APPEND,
gst_buffer_unref (blob);
gst_sample_unref (sample);
static gboolean
......@@ -191,7 +191,7 @@ gst_tag_register_tags_internal (gpointer unused)
_("Media (image/video) intended vertical pixel density in ppi"), NULL);
gst_tag_register_static (GST_TAG_ID3V2_FRAME, GST_TAG_FLAG_META,
GST_TYPE_BUFFER, _("ID3v2 frame"), _("unparsed id3v2 tag frame"),
GST_TYPE_SAMPLE, _("ID3v2 frame"), _("unparsed id3v2 tag frame"),
gst_tag_register_static (GST_TAG_MUSICAL_KEY, GST_TAG_FLAG_META,
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