pbutils: Fix vp9 mime mapping when caps when no chroma-site.

It's possible to have 4:2:0 chroma format without chroma-site in caps, but it
isn't validated by the current code. This patch fixes it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3405>
This commit is contained in:
Víctor Manuel Jáquez Leal 2022-11-14 12:44:05 +01:00 committed by GStreamer Marge Bot
parent 202dc49f8b
commit f74fb5142d

View file

@ -2520,7 +2520,10 @@ vp9_caps_get_mime_codec (GstCaps * caps)
GstVideoChromaSite chroma_site; GstVideoChromaSite chroma_site;
chroma_site_str = gst_structure_get_string (caps_st, "chroma-site"); chroma_site_str = gst_structure_get_string (caps_st, "chroma-site");
chroma_site = gst_video_chroma_site_from_string (chroma_site_str); if (chroma_site_str)
chroma_site = gst_video_chroma_site_from_string (chroma_site_str);
else
chroma_site = GST_VIDEO_CHROMA_SITE_UNKNOWN;
if (chroma_site == GST_VIDEO_CHROMA_SITE_V_COSITED) { if (chroma_site == GST_VIDEO_CHROMA_SITE_V_COSITED) {
chroma_format = 0; chroma_format = 0;
} else if (chroma_site == GST_VIDEO_CHROMA_SITE_COSITED) { } else if (chroma_site == GST_VIDEO_CHROMA_SITE_COSITED) {