From 0f155808538ea5bab0bde2353b1dc0e3260039a9 Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Wed, 2 Mar 2022 16:31:24 -0500 Subject: [PATCH] matroska: Fix AV1 alignment to TU Matroska stores AV1 in temporal unit, so that all OBU sharing the same timestamp are put together. This was previously just assumed, which isn't safe now that we have more alignments. Part-of: --- subprojects/gst-plugins-good/gst/matroska/matroska-demux.c | 3 ++- subprojects/gst-plugins-good/gst/matroska/matroska-mux.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/subprojects/gst-plugins-good/gst/matroska/matroska-demux.c b/subprojects/gst-plugins-good/gst/matroska/matroska-demux.c index ef51dca298..64cc6be60b 100644 --- a/subprojects/gst-plugins-good/gst/matroska/matroska-demux.c +++ b/subprojects/gst-plugins-good/gst/matroska/matroska-demux.c @@ -6621,7 +6621,8 @@ gst_matroska_demux_video_caps (GstMatroskaTrackVideoContext * gst_caps_set_simple (caps, "codec-alpha", G_TYPE_BOOLEAN, TRUE, NULL); *codec_name = g_strdup_printf ("On2 VP9"); } else if (!strcmp (codec_id, GST_MATROSKA_CODEC_ID_VIDEO_AV1)) { - caps = gst_caps_new_empty_simple ("video/x-av1"); + caps = gst_caps_new_simple ("video/x-av1", + "alignment", G_TYPE_STRING, "tu", NULL); if (data) { GstBuffer *priv; diff --git a/subprojects/gst-plugins-good/gst/matroska/matroska-mux.c b/subprojects/gst-plugins-good/gst/matroska/matroska-mux.c index 189f4eea21..0147de216a 100644 --- a/subprojects/gst-plugins-good/gst/matroska/matroska-mux.c +++ b/subprojects/gst-plugins-good/gst/matroska/matroska-mux.c @@ -146,7 +146,7 @@ static GstStaticPadTemplate videosink_templ = "video/x-prores, " COMMON_VIDEO_CAPS "; " "video/x-wmv, " "wmvversion = (int) [ 1, 3 ], " COMMON_VIDEO_CAPS "; " - "video/x-av1, " COMMON_VIDEO_CAPS ";" + "video/x-av1, " "alignment = (string) \"tu\", " COMMON_VIDEO_CAPS ";" "video/x-ffv, ffversion = (int) 1, " COMMON_VIDEO_CAPS) );