mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 06:58:56 +00:00
qtmux: add xmp support
Adds xmp metatags adding to qtmux. Fixes #609539
This commit is contained in:
parent
c5034a716d
commit
5e88363430
5 changed files with 36 additions and 3 deletions
|
@ -14,8 +14,8 @@ libgstqtmux_la_SOURCES = gstqtmux.c \
|
||||||
|
|
||||||
# flags used to compile this plugin
|
# flags used to compile this plugin
|
||||||
# add other _CFLAGS and _LIBS as needed
|
# add other _CFLAGS and _LIBS as needed
|
||||||
libgstqtmux_la_CFLAGS = $(GST_CFLAGS) $(GST_BASE_CFLAGS)
|
libgstqtmux_la_CFLAGS = $(GST_CFLAGS) $(GST_BASE_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS)
|
||||||
libgstqtmux_la_LIBADD = $(GST_LIBS) $(GST_BASE_LIBS)
|
libgstqtmux_la_LIBADD = $(GST_LIBS) $(GST_BASE_LIBS) $(GST_PLUGINS_BASE_LIBS) -lgsttag-$(GST_MAJORMINOR)
|
||||||
libgstqtmux_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
|
libgstqtmux_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
|
||||||
libgstqtmux_la_LIBTOOLFLAGS = --tag=disable-static
|
libgstqtmux_la_LIBTOOLFLAGS = --tag=disable-static
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
|
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
#include <gst/base/gstbytewriter.h>
|
#include <gst/base/gstbytewriter.h>
|
||||||
|
#include <gst/tag/tag.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new AtomsContext for the given flavor.
|
* 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);
|
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
|
* Functions for specifying media types
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -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,
|
void atom_moov_add_3gp_tag (AtomMOOV * moov, guint32 fourcc, guint8 * data,
|
||||||
guint size);
|
guint size);
|
||||||
|
|
||||||
|
void atom_moov_add_xmp_tags (AtomMOOV * moov, const GstTagList * tags);
|
||||||
|
|
||||||
#define GST_QT_MUX_DEFAULT_TAG_LANGUAGE "eng"
|
#define GST_QT_MUX_DEFAULT_TAG_LANGUAGE "eng"
|
||||||
guint16 language_code (const char * lang);
|
guint16 language_code (const char * lang);
|
||||||
|
|
||||||
|
|
|
@ -185,6 +185,7 @@ G_BEGIN_DECLS
|
||||||
#define FOURCC_soaa GST_MAKE_FOURCC('s','o','a','a')
|
#define FOURCC_soaa GST_MAKE_FOURCC('s','o','a','a')
|
||||||
#define FOURCC_soco GST_MAKE_FOURCC('s','o','c','o')
|
#define FOURCC_soco GST_MAKE_FOURCC('s','o','c','o')
|
||||||
#define FOURCC_sosn GST_MAKE_FOURCC('s','o','s','n')
|
#define FOURCC_sosn GST_MAKE_FOURCC('s','o','s','n')
|
||||||
|
#define FOURCC_XMP_ GST_MAKE_FOURCC('X','M','P','_')
|
||||||
|
|
||||||
|
|
||||||
/* SVQ3 fourcc */
|
/* SVQ3 fourcc */
|
||||||
|
|
|
@ -877,6 +877,19 @@ static const GstTagToFourcc tag_matches_3gp[] = {
|
||||||
/* qtdemux produces these for atoms it cannot parse */
|
/* qtdemux produces these for atoms it cannot parse */
|
||||||
#define GST_QT_DEMUX_PRIVATE_TAG "private-qt-tag"
|
#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
|
static void
|
||||||
gst_qt_mux_add_metadata_tags (GstQTMux * qtmux, const GstTagList * list)
|
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)) {
|
if (tags && !gst_tag_list_is_empty (tags)) {
|
||||||
GST_DEBUG_OBJECT (qtmux, "Formatting tags");
|
GST_DEBUG_OBJECT (qtmux, "Formatting tags");
|
||||||
gst_qt_mux_add_metadata_tags (qtmux, tags);
|
gst_qt_mux_add_metadata_tags (qtmux, tags);
|
||||||
|
gst_qt_mux_add_xmp_tags (qtmux, tags);
|
||||||
} else {
|
} else {
|
||||||
GST_DEBUG_OBJECT (qtmux, "No tags received");
|
GST_DEBUG_OBJECT (qtmux, "No tags received");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue