matroska-demux: Basic support for container-specific-track-id tag

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6041>
This commit is contained in:
Philippe Normand 2024-02-03 11:53:36 +00:00
parent 30bb88a91b
commit e9ecde83a7
2 changed files with 10 additions and 1 deletions

View file

@ -2,7 +2,7 @@ event stream-start: GstEventStreamStart, flags=(GstStreamFlags)GST_STREAM_FLAG_S
event caps: video/x-vp9, framerate=(fraction)0/1, height=(int)240, width=(int)426;
event segment: format=TIME, start=0:00:00.000000000, offset=0:00:00.000000000, stop=none, time=0:00:00.000000000, base=0:00:00.000000000, position=0:00:00.000000000, duration=0:02:15.469000000
event tag: GstTagList-global, taglist=(taglist)"taglist\,\ container-format\=\(string\)Matroska\;";
event tag: GstTagList-stream, taglist=(taglist)"taglist\,\ video-codec\=\(string\)\"On2\\\ VP9\"\;";
event tag: GstTagList-stream, taglist=(taglist)"taglist\,\ video-codec\=\(string\)\"On2\\\ VP9\"\,\ container-specific-track-id\=\(string\)1\;";
buffer: pts=0:00:00.000000000, flags=discont tag-memory
buffer: pts=0:00:00.033000000, flags=delta-unit tag-memory
buffer: pts=0:00:00.067000000, flags=delta-unit tag-memory

View file

@ -1596,6 +1596,15 @@ gst_matroska_demux_parse_stream (GstMatroskaDemux * demux, GstEbmlRead * ebml,
context->tags_changed = TRUE;
}
/* https://dev.w3.org/html5/html-sourcing-inband-tracks/#webm */
if (context->num) {
gchar *track_id_str = g_strdup_printf ("%" G_GUINT64_FORMAT, context->num);
gst_tag_list_add (context->tags, GST_TAG_MERGE_REPLACE,
GST_TAG_CONTAINER_SPECIFIC_TRACK_ID, track_id_str, NULL);
g_free (track_id_str);
context->tags_changed = TRUE;
}
if (caps == NULL) {
GST_WARNING_OBJECT (demux, "could not determine caps for stream with "
"codec_id='%s'", context->codec_id);