Adds xmp metatags adding to qtmux.
Fixes #609539
# flags used to compile this plugin
# add other _CFLAGS and _LIBS as needed
-libgstqtmux_la_CFLAGS = $(GST_CFLAGS) $(GST_BASE_CFLAGS)
-libgstqtmux_la_LIBADD = $(GST_LIBS) $(GST_BASE_LIBS)
+libgstqtmux_la_CFLAGS = $(GST_CFLAGS) $(GST_BASE_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS)
+libgstqtmux_la_LIBADD = $(GST_LIBS) $(GST_BASE_LIBS) $(GST_PLUGINS_BASE_LIBS) -lgsttag-$(GST_MAJORMINOR)
libgstqtmux_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstqtmux_la_LIBTOOLFLAGS = --tag=disable-static
#include <gst/gst.h>
#include <gst/base/gstbytewriter.h>
-
+#include <gst/tag/tag.h>
/**
* Creates a new AtomsContext for the given flavor.
atom_moov_add_3gp_str_int_tag (moov, fourcc, NULL, value);
}
+void
+atom_moov_add_xmp_tags (AtomMOOV * moov, const GstTagList * tags)
+{
+ GstBuffer *xmpbuffer = gst_tag_list_to_xmp_buffer (tags, TRUE);
+ AtomData *data_atom = NULL;
+
+ data_atom = atom_data_new_from_gst_buffer (FOURCC_XMP_, xmpbuffer);
+ gst_buffer_unref (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));
+}
+
/*
* Functions for specifying media types
*/
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);
+
#define GST_QT_MUX_DEFAULT_TAG_LANGUAGE "eng"
guint16 language_code (const char * lang);
#define FOURCC_soaa GST_MAKE_FOURCC('s','o','a','a')
#define FOURCC_soco GST_MAKE_FOURCC('s','o','c','o')
#define FOURCC_sosn GST_MAKE_FOURCC('s','o','s','n')
+#define FOURCC_XMP_ GST_MAKE_FOURCC('X','M','P','_')
/* SVQ3 fourcc */
/* qtdemux produces these for atoms it cannot parse */
#define GST_QT_DEMUX_PRIVATE_TAG "private-qt-tag"
+static void
+gst_qt_mux_add_xmp_tags (GstQTMux * qtmux, const GstTagList * list)
+{
+ GstQTMuxClass *qtmux_klass = (GstQTMuxClass *) (G_OBJECT_GET_CLASS (qtmux));
+
+ if (qtmux_klass->format != GST_QT_MUX_FORMAT_QT)
+ return; /* adobe spec only specs for qt */
+
+ GST_DEBUG_OBJECT (qtmux, "Adding xmp tags");
+
+ atom_moov_add_xmp_tags (qtmux->moov, list);
+}
+
static void
gst_qt_mux_add_metadata_tags (GstQTMux * qtmux, const GstTagList * list)
{
if (tags && !gst_tag_list_is_empty (tags)) {
GST_DEBUG_OBJECT (qtmux, "Formatting tags");
gst_qt_mux_add_metadata_tags (qtmux, tags);
+ gst_qt_mux_add_xmp_tags (qtmux, tags);
} else {
GST_DEBUG_OBJECT (qtmux, "No tags received");
}