qtmux: add xmp support

Adds xmp metatags adding to qtmux.

Fixes #609539
This commit is contained in:
Thiago Santos 2010-02-22 16:45:34 -03:00 committed by Tim-Philipp Müller
parent f9bba010fa
commit a740adc137
4 changed files with 34 additions and 1 deletions

View file

@ -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
*/

View file

@ -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);

View file

@ -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 */

View file

@ -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");
}