From 415caf4b87c53a0aa3990493a7c350dd0e9d7c87 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Olivier=20Cr=C3=AAte?= Date: Wed, 25 Jul 2018 16:39:18 -0400 Subject: [PATCH] matroskademux: Extract codec_data for AV1 According to https://github.com/Matroska-Org/matroska-specification/blob/av1-mappin/codec/av1.md --- gst/matroska/matroska-demux.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gst/matroska/matroska-demux.c b/gst/matroska/matroska-demux.c index 32d4598..e305e5c 100644 --- a/gst/matroska/matroska-demux.c +++ b/gst/matroska/matroska-demux.c @@ -5627,6 +5627,17 @@ gst_matroska_demux_video_caps (GstMatroskaTrackVideoContext * *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"); + if (data) { + GstBuffer *priv; + + priv = gst_buffer_new_wrapped (g_memdup (data, size), size); + gst_caps_set_simple (caps, "codec_data", GST_TYPE_BUFFER, priv, NULL); + gst_buffer_unref (priv); + } else { + GST_WARNING ("No codec data found, assuming output is byte-stream"); + gst_caps_set_simple (caps, "stream-format", G_TYPE_STRING, "byte-stream", + NULL); + } *codec_name = g_strdup_printf ("AOM AV1"); } else if (!strcmp (codec_id, GST_MATROSKA_CODEC_ID_VIDEO_PRORES)) { guint32 fourcc; -- 2.7.4