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: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2199>
This commit is contained in:
Nicolas Dufresne 2021-05-07 16:30:49 -04:00
parent e08c0803e1
commit b884bcb93e

View file

@ -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))) {