diff --git a/gst/qtmux/Makefile.am b/gst/qtmux/Makefile.am index 308136af46..7fbbcc01e9 100644 --- a/gst/qtmux/Makefile.am +++ b/gst/qtmux/Makefile.am @@ -14,8 +14,8 @@ libgstqtmux_la_SOURCES = gstqtmux.c \ # 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 diff --git a/gst/qtmux/atoms.c b/gst/qtmux/atoms.c index d62077e100..99b02eff62 100644 --- a/gst/qtmux/atoms.c +++ b/gst/qtmux/atoms.c @@ -47,7 +47,7 @@ #include #include - +#include /** * Creates a new AtomsContext for the given flavor. @@ -2772,6 +2772,22 @@ atom_moov_add_3gp_uint_tag (AtomMOOV * moov, guint32 fourcc, guint16 value) 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 */ diff --git a/gst/qtmux/atoms.h b/gst/qtmux/atoms.h index 9fc8030065..ae167ba105 100644 --- a/gst/qtmux/atoms.h +++ b/gst/qtmux/atoms.h @@ -756,6 +756,8 @@ void atom_moov_add_3gp_str_int_tag (AtomMOOV * moov, guint32 fourcc, const gch 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); diff --git a/gst/qtmux/fourcc.h b/gst/qtmux/fourcc.h index f859e0ccb7..559f45f4f3 100644 --- a/gst/qtmux/fourcc.h +++ b/gst/qtmux/fourcc.h @@ -185,6 +185,7 @@ G_BEGIN_DECLS #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 */ diff --git a/gst/qtmux/gstqtmux.c b/gst/qtmux/gstqtmux.c index 085ae926a2..96f97abf4c 100644 --- a/gst/qtmux/gstqtmux.c +++ b/gst/qtmux/gstqtmux.c @@ -877,6 +877,19 @@ static const GstTagToFourcc tag_matches_3gp[] = { /* 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) { @@ -969,6 +982,7 @@ gst_qt_mux_setup_metadata (GstQTMux * qtmux) 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"); }