diff options
author | Thiago Santos <thiago.sousa.santos@collabora.co.uk> | 2010-02-22 16:45:34 -0300 |
---|---|---|
committer | Thiago Santos <thiago.sousa.santos@collabora.co.uk> | 2010-03-11 16:42:31 -0300 |
commit | 5e883634308171dabb7722cc632df79b8c5901c5 (patch) | |
tree | bb643a09955d69833e819d37c46a53e32d74847a | |
parent | c5034a716dc10e9d631d2b447faad2089a432284 (diff) |
qtmux: add xmp support
Adds xmp metatags adding to qtmux.
Fixes #609539
-rw-r--r-- | gst/qtmux/Makefile.am | 4 | ||||
-rw-r--r-- | gst/qtmux/atoms.c | 18 | ||||
-rw-r--r-- | gst/qtmux/atoms.h | 2 | ||||
-rw-r--r-- | gst/qtmux/fourcc.h | 1 | ||||
-rw-r--r-- | gst/qtmux/gstqtmux.c | 14 |
5 files changed, 36 insertions, 3 deletions
diff --git a/gst/qtmux/Makefile.am b/gst/qtmux/Makefile.am index 308136af4..7fbbcc01e 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 d62077e10..99b02eff6 100644 --- a/gst/qtmux/atoms.c +++ b/gst/qtmux/atoms.c @@ -47,7 +47,7 @@ #include <gst/gst.h> #include <gst/base/gstbytewriter.h> - +#include <gst/tag/tag.h> /** * 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 9fc803006..ae167ba10 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 f859e0ccb..559f45f4f 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 085ae926a..96f97abf4 100644 --- a/gst/qtmux/gstqtmux.c +++ b/gst/qtmux/gstqtmux.c @@ -878,6 +878,19 @@ static const GstTagToFourcc tag_matches_3gp[] = { #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) { GstQTMuxClass *qtmux_klass = (GstQTMuxClass *) (G_OBJECT_GET_CLASS (qtmux)); @@ -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"); } |