diff options
author | Edgard Lima <edgard.lima@indt.org.br> | 2007-12-03 16:14:01 +0000 |
---|---|---|
committer | Edgard Lima <edgard.lima@indt.org.br> | 2007-12-03 16:14:01 +0000 |
commit | e415aeeb4f0e0bf7a622328ee9a2b36804c50d29 (patch) | |
tree | ba99c1acb3c9a743c407eee7fce8a7855a703cb4 /ext/metadata/metadataiptc.c | |
parent | 79b7ae29aa2bdc345496c975b56203fab7af5a00 (diff) | |
download | gst-plugins-bad-e415aeeb4f0e0bf7a622328ee9a2b36804c50d29.tar.gz gst-plugins-bad-e415aeeb4f0e0bf7a622328ee9a2b36804c50d29.tar.bz2 gst-plugins-bad-e415aeeb4f0e0bf7a622328ee9a2b36804c50d29.zip |
Muxer writes (in jpeg only) whole IPTC chunk sent as tag. Muxer implemets GstTagSetter interface.
Original commit message from CVS:
Muxer writes (in jpeg only) whole IPTC chunk sent as tag. Muxer implemets GstTagSetter interface.
Diffstat (limited to 'ext/metadata/metadataiptc.c')
-rw-r--r-- | ext/metadata/metadataiptc.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/ext/metadata/metadataiptc.c b/ext/metadata/metadataiptc.c index 7af879ef..7009cc04 100644 --- a/ext/metadata/metadataiptc.c +++ b/ext/metadata/metadataiptc.c @@ -66,7 +66,7 @@ metadataparse_iptc_tag_list_add (GstTagList * taglist, GstTagMergeMode mode, void metadatamux_iptc_create_chunk_from_tag_list (guint8 ** buf, guint32 * size, - GstTagList * taglist) + const GstTagList * taglist) { /* do nothing */ } @@ -133,8 +133,11 @@ iptc_data_foreach_dataset_func (IptcDataSet * dataset, void *user_data) void metadatamux_iptc_create_chunk_from_tag_list (guint8 ** buf, guint32 * size, - GstTagList * taglist) + const GstTagList * taglist) { + GstBuffer *iptc_chunk = NULL; + const GValue *val = NULL; + if (!(buf && size)) goto done; if (*buf) { @@ -143,6 +146,16 @@ metadatamux_iptc_create_chunk_from_tag_list (guint8 ** buf, guint32 * size, } *size = 0; + val = gst_tag_list_get_value_index (taglist, GST_TAG_IPTC, 0); + if (val) { + iptc_chunk = gst_value_get_buffer (val); + if (iptc_chunk) { + *size = GST_BUFFER_SIZE (iptc_chunk); + *buf = g_new (guint8, *size); + memcpy (*buf, GST_BUFFER_DATA (iptc_chunk), *size); + } + } + done: return; |