}
void
-atom_moov_add_xmp_tags (AtomMOOV * moov, const GstTagList * tags)
+atom_moov_add_xmp_tags (AtomMOOV * moov, GstBuffer * xmpbuffer)
{
- GstBuffer *xmpbuffer;
AtomData *data_atom = NULL;
if (moov->context.flavor == ATOMS_TREE_FLAVOR_MOV) {
- xmpbuffer = gst_tag_list_to_xmp_buffer (tags, TRUE);
if (xmpbuffer) {
data_atom = atom_data_new_from_gst_buffer (FOURCC_XMP_, xmpbuffer);
atom_moov_init_metatags (moov, &moov->context);
moov->udta->entries = g_list_append (moov->udta->entries,
build_atom_info_wrapper ((Atom *) data_atom, atom_data_copy_data,
atom_data_free));
- gst_buffer_unref (xmpbuffer);
}
} else {
GST_DEBUG ("Not adding xmp to moov atom, it is only used in 'mov' format");
}
AtomInfo *
-build_uuid_xmp_atom (const GstTagList * taglist)
+build_uuid_xmp_atom (GstBuffer * xmp_data)
{
- GstBuffer *xmp_data;
AtomUUID *uuid;
static guint8 xmp_uuid[] = { 0xBE, 0x7A, 0xCF, 0xCB,
0x97, 0xA9, 0x42, 0xE8,
0x91, 0xE3, 0xAF, 0xAC
};
- xmp_data = gst_tag_list_to_xmp_buffer (taglist, TRUE);
if (xmp_data == NULL)
return NULL;
uuid->datalen = GST_BUFFER_SIZE (xmp_data);
memcpy (uuid->data, GST_BUFFER_DATA (xmp_data), GST_BUFFER_SIZE (xmp_data));
- gst_buffer_unref (xmp_data);
return build_atom_info_wrapper ((Atom *) uuid, atom_uuid_copy_data,
atom_uuid_free);
}
AtomInfo * build_SMI_atom (const GstBuffer *seqh);
AtomInfo * build_ima_adpcm_extension (gint channels, gint rate,
gint blocksize);
-AtomInfo * build_uuid_xmp_atom (const GstTagList * taglist);
+AtomInfo * build_uuid_xmp_atom (GstBuffer * xmp);
/*
void atom_moov_add_3gp_tag (AtomMOOV * moov, guint32 fourcc, guint8 * data,
guint size);
-void atom_moov_add_xmp_tags (AtomMOOV * moov, const GstTagList * tags);
+void atom_moov_add_xmp_tags (AtomMOOV * moov, GstBuffer * xmp);
#define GST_QT_MUX_DEFAULT_TAG_LANGUAGE "eng"
guint16 language_code (const char * lang);
#include <gst/gst.h>
#include <gst/base/gstcollectpads.h>
+#include <gst/tag/xmpwriter.h>
#include <sys/types.h>
#ifdef G_OS_WIN32
gst_qt_mux_add_xmp_tags (GstQTMux * qtmux, const GstTagList * list)
{
GstQTMuxClass *qtmux_klass = (GstQTMuxClass *) (G_OBJECT_GET_CLASS (qtmux));
+ GstBuffer *xmp = NULL;
/* adobe specs only have 'quicktime' and 'mp4',
* but I guess we can extrapolate to gpp.
GST_DEBUG_OBJECT (qtmux, "Adding xmp tags");
if (qtmux_klass->format == GST_QT_MUX_FORMAT_QT) {
- atom_moov_add_xmp_tags (qtmux->moov, list);
+ xmp = gst_tag_xmp_writer_tag_list_to_xmp_buffer (GST_TAG_XMP_WRITER (qtmux),
+ list, TRUE);
+ if (xmp)
+ atom_moov_add_xmp_tags (qtmux->moov, xmp);
} else {
+ AtomInfo *ainfo;
/* for isom/mp4, it is a top level uuid atom */
- AtomInfo *ainfo = build_uuid_xmp_atom (list);
- if (ainfo) {
- qtmux->extra_atoms = g_slist_prepend (qtmux->extra_atoms, ainfo);
+ xmp = gst_tag_xmp_writer_tag_list_to_xmp_buffer (GST_TAG_XMP_WRITER (qtmux),
+ list, TRUE);
+ if (xmp) {
+ ainfo = build_uuid_xmp_atom (xmp);
+ if (ainfo) {
+ qtmux->extra_atoms = g_slist_prepend (qtmux->extra_atoms, ainfo);
+ }
}
}
+ if (xmp)
+ gst_buffer_unref (xmp);
}
static void
static const GInterfaceInfo tag_setter_info = {
NULL, NULL, NULL
};
+ static const GInterfaceInfo tag_xmp_writer_info = {
+ NULL, NULL, NULL
+ };
GType type;
GstQTMuxFormat format;
GstQTMuxClassParams *params;
0);
g_type_set_qdata (type, GST_QT_MUX_PARAMS_QDATA, (gpointer) params);
g_type_add_interface_static (type, GST_TYPE_TAG_SETTER, &tag_setter_info);
+ g_type_add_interface_static (type, GST_TYPE_TAG_XMP_WRITER,
+ &tag_xmp_writer_info);
if (!gst_element_register (plugin, prop->name, GST_RANK_PRIMARY, type))
return FALSE;