gallium/vl: Check for VP9 and AV1 meson option support flags

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26223>
This commit is contained in:
Sil Vilerino 2023-10-28 11:19:10 -04:00 committed by Marge Bot
parent 7b22dd8bfd
commit 527def0171

View file

@ -32,6 +32,20 @@ bool vl_codec_supported(struct pipe_screen *screen,
enum pipe_video_profile profile,
bool encode)
{
static_assert(PIPE_VIDEO_PROFILE_MAX == 26, "Update table below when adding new video profiles");
if (profile == PIPE_VIDEO_PROFILE_AV1_MAIN) {
if (encode) {
if (!VIDEO_CODEC_AV1ENC)
return false;
} else if (!VIDEO_CODEC_AV1DEC) {
return false;
}
}
if (profile == PIPE_VIDEO_PROFILE_VP9_PROFILE0 ||
profile == PIPE_VIDEO_PROFILE_VP9_PROFILE2) {
if (!VIDEO_CODEC_VP9DEC)
return false;
}
if (profile == PIPE_VIDEO_PROFILE_VC1_SIMPLE ||
profile == PIPE_VIDEO_PROFILE_VC1_MAIN ||
profile == PIPE_VIDEO_PROFILE_VC1_ADVANCED) {