diff options
author | Edgard Lima <edgard.lima@indt.org.br> | 2007-11-30 18:30:12 +0000 |
---|---|---|
committer | Edgard Lima <edgard.lima@indt.org.br> | 2007-11-30 18:30:12 +0000 |
commit | d5ad427c732f6f398cfc9c1d9d4b1fe4298b543a (patch) | |
tree | 50015ea2d650557ef931bfc8c5ce2c1640a6ab26 /ext/metadata/metadataxmp.c | |
parent | ddd4af604a9cb37ba81d4ddf9b82625aa5817de0 (diff) | |
download | gst-plugins-bad-d5ad427c732f6f398cfc9c1d9d4b1fe4298b543a.tar.gz gst-plugins-bad-d5ad427c732f6f398cfc9c1d9d4b1fe4298b543a.tar.bz2 gst-plugins-bad-d5ad427c732f6f398cfc9c1d9d4b1fe4298b543a.zip |
Muxer writes (in jpeg only) whole EXIF and XMP chunks sent as tags.
Original commit message from CVS:
Muxer writes (in jpeg only) whole EXIF and XMP chunks sent as tags.
Diffstat (limited to 'ext/metadata/metadataxmp.c')
-rw-r--r-- | ext/metadata/metadataxmp.c | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/ext/metadata/metadataxmp.c b/ext/metadata/metadataxmp.c index b417a935..f153ed25 100644 --- a/ext/metadata/metadataxmp.c +++ b/ext/metadata/metadataxmp.c @@ -75,7 +75,7 @@ metadataparse_xmp_dispose (void) } void -metadatamux_xmp_create_chunk_from_tag_list (GstAdapter ** adapter, +metadatamux_xmp_create_chunk_from_tag_list (guint8 ** buf, guint32 * size, GstTagList * taglist) { /* do nothing */ @@ -247,16 +247,29 @@ metadataparse_xmp_iter (XmpPtr xmp, XmpIteratorPtr iter) } void -metadatamux_xmp_create_chunk_from_tag_list (GstAdapter ** adapter, +metadatamux_xmp_create_chunk_from_tag_list (guint8 ** buf, guint32 * size, GstTagList * taglist) { - if (adapter == NULL) - goto done; - - if (*adapter) - g_object_unref (*adapter); + GstBuffer *xmp_chunk = NULL; + const GValue *val = NULL; - *adapter = gst_adapter_new (); + if (!(buf && size)) + goto done; + if (*buf) { + g_free (*buf); + *buf = NULL; + } + *size = 0; + + val = gst_tag_list_get_value_index (taglist, GST_TAG_XMP, 0); + if (val) { + xmp_chunk = gst_value_get_buffer (val); + if (xmp_chunk) { + *size = GST_BUFFER_SIZE (xmp_chunk); + *buf = g_new (guint8, *size); + memcpy (*buf, GST_BUFFER_DATA (xmp_chunk), *size); + } + } done: |