mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-10 01:15:39 +00:00
qtdemux: parse embedded ID32 tags
This commit is contained in:
parent
e2179cbb74
commit
d959bb6041
2 changed files with 51 additions and 1 deletions
|
@ -8361,6 +8361,42 @@ unknown_tag:
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
qtdemux_tag_add_id32 (GstQTDemux * demux, const char *tag,
|
||||
const char *tag_bis, GNode * node)
|
||||
{
|
||||
guint8 *data;
|
||||
GstBuffer *buf;
|
||||
guint len;
|
||||
GstTagList *taglist = NULL;
|
||||
|
||||
GST_LOG_OBJECT (demux, "parsing ID32");
|
||||
|
||||
data = node->data;
|
||||
len = GST_READ_UINT32_BE (data);
|
||||
|
||||
/* need at least full box and language tag */
|
||||
if (len < 12 + 2)
|
||||
return;
|
||||
|
||||
buf = gst_buffer_new ();
|
||||
GST_BUFFER_DATA (buf) = data + 14;
|
||||
GST_BUFFER_SIZE (buf) = len - 14;
|
||||
|
||||
taglist = gst_tag_list_from_id3v2_tag (buf);
|
||||
if (taglist) {
|
||||
GST_LOG_OBJECT (demux, "parsing ok");
|
||||
gst_tag_list_insert (demux->tag_list, taglist, GST_TAG_MERGE_KEEP);
|
||||
} else {
|
||||
GST_LOG_OBJECT (demux, "parsing failed");
|
||||
}
|
||||
|
||||
if (taglist)
|
||||
gst_tag_list_free (taglist);
|
||||
|
||||
gst_buffer_unref (buf);
|
||||
}
|
||||
|
||||
typedef void (*GstQTDemuxAddTagFunc) (GstQTDemux * demux,
|
||||
const char *tag, const char *tag_bis, GNode * node);
|
||||
|
||||
|
@ -8430,7 +8466,9 @@ static const struct
|
|||
* http://atomicparsley.sourceforge.net/mpeg-4files.html and
|
||||
* bug #614471
|
||||
*/
|
||||
FOURCC_____, "", NULL, qtdemux_tag_add_revdns}
|
||||
FOURCC_____, "", NULL, qtdemux_tag_add_revdns}, {
|
||||
/* see http://www.mp4ra.org/specs.html for ID32 in meta box */
|
||||
FOURCC_ID32, "", NULL, qtdemux_tag_add_id32}
|
||||
};
|
||||
|
||||
static void
|
||||
|
@ -8846,6 +8884,15 @@ qtdemux_parse_tree (GstQTDemux * qtdemux)
|
|||
GST_LOG_OBJECT (qtdemux, "No udta node found.");
|
||||
}
|
||||
|
||||
/* maybe also some tags in meta box */
|
||||
udta = qtdemux_tree_get_child_by_type (qtdemux->moov_node, FOURCC_meta);
|
||||
if (udta) {
|
||||
GST_DEBUG_OBJECT (qtdemux, "Parsing meta box for tags.");
|
||||
qtdemux_parse_udta (qtdemux, udta);
|
||||
} else {
|
||||
GST_LOG_OBJECT (qtdemux, "No meta node found.");
|
||||
}
|
||||
|
||||
qtdemux->tag_list = qtdemux_add_container_format (qtdemux, qtdemux->tag_list);
|
||||
|
||||
return TRUE;
|
||||
|
|
|
@ -189,6 +189,9 @@ G_BEGIN_DECLS
|
|||
#define FOURCC_albm GST_MAKE_FOURCC('a','l','b','m')
|
||||
#define FOURCC_yrrc GST_MAKE_FOURCC('y','r','r','c')
|
||||
|
||||
/* misc tag stuff */
|
||||
#define FOURCC_ID32 GST_MAKE_FOURCC('I', 'D','3','2')
|
||||
|
||||
/* ISO Motion JPEG 2000 fourcc */
|
||||
#define FOURCC_mjp2 GST_MAKE_FOURCC('m','j','p','2')
|
||||
#define FOURCC_jp2h GST_MAKE_FOURCC('j','p','2','h')
|
||||
|
|
Loading…
Reference in a new issue