qtdemux: Add parsing/dumping of nmhd / metx boxes

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2453>
This commit is contained in:
Sebastian Dröge 2022-05-19 11:30:20 +03:00 committed by GStreamer Marge Bot
parent 04f6258863
commit 365a9af9c5
3 changed files with 34 additions and 0 deletions

View file

@ -418,6 +418,8 @@ G_BEGIN_DECLS
#define FOURCC_aavd GST_MAKE_FOURCC('a','a','v','d') #define FOURCC_aavd GST_MAKE_FOURCC('a','a','v','d')
#define FOURCC_adrm GST_MAKE_FOURCC('a','d','r','m') #define FOURCC_adrm GST_MAKE_FOURCC('a','d','r','m')
#define FOURCC_metx GST_MAKE_FOURCC('m','e','t','x')
G_END_DECLS G_END_DECLS
#endif /* __FOURCC_H__ */ #endif /* __FOURCC_H__ */

View file

@ -348,6 +348,32 @@ qtdemux_dump_stsd_av01 (GstQTDemux * qtdemux, GstByteReader * data, guint size,
return TRUE; return TRUE;
} }
static gboolean
qtdemux_dump_stsd_metx (GstQTDemux * qtdemux, GstByteReader * data, int depth)
{
const gchar *content_encoding;
const gchar *namespaces;
const gchar *schema_locations;
if (gst_byte_reader_get_remaining (data) < 6 + 2)
return FALSE;
gst_byte_reader_skip_unchecked (data, 6);
GST_LOG_OBJECT (qtdemux, "%*s data reference:%d", depth, "",
GET_UINT16 (data));
if (!gst_byte_reader_get_string (data, &content_encoding) ||
!gst_byte_reader_get_string (data, &namespaces) ||
!gst_byte_reader_get_string (data, &schema_locations))
return FALSE;
GST_LOG ("%*s content_encoding: %s", depth, "", content_encoding);
GST_LOG ("%*s namespaces: %s", depth, "", namespaces);
GST_LOG ("%*s schema_locations: %s", depth, "", schema_locations);
return TRUE;
}
gboolean gboolean
qtdemux_dump_stsd (GstQTDemux * qtdemux, GstByteReader * data, int depth) qtdemux_dump_stsd (GstQTDemux * qtdemux, GstByteReader * data, int depth)
{ {
@ -402,6 +428,10 @@ qtdemux_dump_stsd (GstQTDemux * qtdemux, GstByteReader * data, int depth)
if (!qtdemux_dump_stsd_av01 (qtdemux, &sub, size, depth + 1)) if (!qtdemux_dump_stsd_av01 (qtdemux, &sub, size, depth + 1))
return FALSE; return FALSE;
break; break;
case FOURCC_metx:
if (!qtdemux_dump_stsd_metx (qtdemux, &sub, depth + 1))
return FALSE;
break;
default: default:
/* Unknown stsd data, dump the bytes */ /* Unknown stsd data, dump the bytes */
if (!qtdemux_dump_unknown (qtdemux, &sub, depth + 1)) if (!qtdemux_dump_unknown (qtdemux, &sub, depth + 1))

View file

@ -54,6 +54,7 @@ static const QtNodeType qt_node_types[] = {
{FOURCC_vmhd, "video media information", 0, {FOURCC_vmhd, "video media information", 0,
qtdemux_dump_vmhd}, qtdemux_dump_vmhd},
{FOURCC_smhd, "sound media information", 0}, {FOURCC_smhd, "sound media information", 0},
{FOURCC_nmhd, "null media information", 0},
{FOURCC_gmhd, "base media information header", QT_FLAG_CONTAINER}, {FOURCC_gmhd, "base media information header", QT_FLAG_CONTAINER},
{FOURCC_gmin, "base media info", 0, qtdemux_dump_gmin}, {FOURCC_gmin, "base media info", 0, qtdemux_dump_gmin},
{FOURCC_dinf, "data information", QT_FLAG_CONTAINER}, {FOURCC_dinf, "data information", QT_FLAG_CONTAINER},
@ -230,6 +231,7 @@ static const QtNodeType qt_node_types[] = {
{FOURCC_aavd, "AAX encrypted audio", 0}, {FOURCC_aavd, "AAX encrypted audio", 0},
{FOURCC_adrm, "AAX DRM key data", 0}, {FOURCC_adrm, "AAX DRM key data", 0},
{FOURCC_vttc, "VTTCueBox 14496-30", QT_FLAG_CONTAINER}, {FOURCC_vttc, "VTTCueBox 14496-30", QT_FLAG_CONTAINER},
{FOURCC_metx, "XML MetaData Sample Entry", 0},
{0, "unknown", 0,}, {0, "unknown", 0,},
}; };