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/metadataexif.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/metadataexif.c')
-rw-r--r-- | ext/metadata/metadataexif.c | 39 |
1 files changed, 33 insertions, 6 deletions
diff --git a/ext/metadata/metadataexif.c b/ext/metadata/metadataexif.c index 583be86f..135bedd2 100644 --- a/ext/metadata/metadataexif.c +++ b/ext/metadata/metadataexif.c @@ -64,7 +64,7 @@ metadataparse_exif_tag_list_add (GstTagList * taglist, GstTagMergeMode mode, } void -metadatamux_exif_create_chunk_from_tag_list (GstAdapter ** adapter, +metadatamux_exif_create_chunk_from_tag_list (guint8 ** buf, guint32 * size, GstTagList * taglist) { /* do nothing */ @@ -202,19 +202,46 @@ exif_content_foreach_entry_func (ExifEntry * entry, void *user_data) */ void -metadatamux_exif_create_chunk_from_tag_list (GstAdapter ** adapter, +metadatamux_exif_create_chunk_from_tag_list (guint8 ** buf, guint32 * size, GstTagList * taglist) { - if (adapter == NULL) + ExifData *ed = NULL; + GstBuffer *exif_chunk = NULL; + const GValue *val = NULL; + + if (!(buf && size)) goto done; + if (*buf) { + g_free (*buf); + *buf = NULL; + } + *size = 0; + + val = gst_tag_list_get_value_index (taglist, GST_TAG_EXIF, 0); + if (val) { + exif_chunk = gst_value_get_buffer (val); + if (exif_chunk) { + ed = exif_data_new_from_data (GST_BUFFER_DATA (exif_chunk), + GST_BUFFER_SIZE (exif_chunk)); + } + } - if (*adapter) - g_object_unref (*adapter); + if (!ed) { + ed = exif_data_new (); + exif_data_set_data_type (ed, EXIF_DATA_TYPE_COMPRESSED); + exif_data_fix (ed); + } + + /* FIXME: consider individual tags */ + + exif_data_save_data (ed, buf, size); - *adapter = gst_adapter_new (); done: + if (ed) + exif_data_unref (ed); + return; } |