From ab7e974dabb04b8836b4a2a6fdbe7de0144faac4 Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Mon, 1 Feb 2010 17:16:16 +0200 Subject: [PATCH] jpegparse: extract comment and post as metadata --- gst/jpegformat/gstjpegparse.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/gst/jpegformat/gstjpegparse.c b/gst/jpegformat/gstjpegparse.c index 2c9894fef0..252d695122 100644 --- a/gst/jpegformat/gstjpegparse.c +++ b/gst/jpegformat/gstjpegparse.c @@ -510,10 +510,26 @@ gst_jpeg_parse_read_header (GstJpegParse * parse, GstBuffer * buffer) goto error; break; + case COM:{ /* read comment and post as tag */ + GstTagList *tags; + const guint8 *comment; + + if (!gst_byte_reader_get_uint16_be (&reader, &size)) + goto error; + if (!gst_byte_reader_get_data (&reader, size - 2, &comment)) + goto error; + + tags = gst_tag_list_new (); + gst_tag_list_add (tags, GST_TAG_MERGE_REPLACE, + GST_TAG_COMMENT, comment, NULL); + gst_element_found_tags_for_pad (GST_ELEMENT_CAST (parse), + parse->priv->srcpad, tags); + break; + } + case APP0: case APP1: case APP15: - case COM: case DHT: case DQT: /* Ignore these codes */