From b884bcb93e291ebb80451457a21ba764e9a45d0d Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Fri, 7 May 2021 16:30:49 -0400 Subject: [PATCH] vp9parse: Manually fixate codec-alpha field This is a newly introduced field, and we interpret it as false when missing in the caps. Otherwise, a simple capsfilter will just add the missing field and keep going, despite the upstream caps being a superset. Part-of: --- gst/videoparsers/gstvp9parse.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gst/videoparsers/gstvp9parse.c b/gst/videoparsers/gstvp9parse.c index 79ca9ffc58..d5e6f4a96c 100644 --- a/gst/videoparsers/gstvp9parse.c +++ b/gst/videoparsers/gstvp9parse.c @@ -482,6 +482,7 @@ gst_vp9_parse_update_src_caps (GstVp9Parse * self, GstCaps * caps) gchar *colorimetry = NULL; const gchar *chroma_format = NULL; const gchar *profile = NULL; + gboolean codec_alpha_allowed = FALSE; if (!self->update_caps) return; @@ -526,6 +527,10 @@ gst_vp9_parse_update_src_caps (GstVp9Parse * self, GstCaps * caps) gst_structure_get_fraction (s, "framerate", &fps_n, &fps_d); } + if (s && gst_structure_has_field (s, "codec-alpha")) { + gst_structure_get_boolean (s, "codec-alpha", &codec_alpha_allowed); + } + if (fps_n > 0 && fps_d > 0) { gst_caps_set_simple (final_caps, "framerate", GST_TYPE_FRACTION, fps_n, fps_d, NULL); @@ -633,6 +638,9 @@ gst_vp9_parse_update_src_caps (GstVp9Parse * self, GstCaps * caps) if (profile) gst_caps_set_simple (final_caps, "profile", G_TYPE_STRING, profile, NULL); + gst_caps_set_simple (final_caps, "codec-alpha", G_TYPE_BOOLEAN, + codec_alpha_allowed, NULL); + src_caps = gst_pad_get_current_caps (GST_BASE_PARSE_SRC_PAD (self)); if (!(src_caps && gst_caps_is_strictly_equal (src_caps, final_caps))) {