meson: add mpeg12dec as a video-codec

Add mpeg12dec as a selectable video-codec and add a corresponding check
to vl_codec_supported.

Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: David Rosca <david.rosca@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39354>
This commit is contained in:
Thong Thai 2026-01-16 14:24:58 +00:00 committed by Marge Bot
parent f9c1ba8c17
commit f4959c16c8
3 changed files with 7 additions and 2 deletions

View file

@ -413,7 +413,7 @@ endif
_codecs = get_option('video-codecs')
patent_codecs = ['vc1dec', 'h264dec', 'h264enc', 'h265dec', 'h265enc']
free_codecs = ['av1dec', 'av1enc', 'vp9dec', 'jpegdec']
free_codecs = ['av1dec', 'av1enc', 'vp9dec', 'mpeg12dec', 'jpegdec']
all_codecs = patent_codecs + free_codecs
if _codecs.contains('all')

View file

@ -720,7 +720,7 @@ option(
value : ['all_free'],
choices: [
'all', 'all_free', 'vc1dec', 'h264dec', 'h264enc', 'h265dec', 'h265enc',
'av1dec', 'av1enc', 'vp9dec', 'jpegdec'
'av1dec', 'av1enc', 'vp9dec', 'mpeg12dec', 'jpegdec'
],
description : 'List of codecs to build support for. ' +
'Distros might want to consult their legal department before ' +

View file

@ -57,6 +57,11 @@ bool vl_codec_supported(struct pipe_screen *screen,
if (!VIDEO_CODEC_VC1DEC)
return false;
}
if (profile >= PIPE_VIDEO_PROFILE_MPEG1 &&
profile <= PIPE_VIDEO_PROFILE_MPEG2_SIMPLE) {
if (!VIDEO_CODEC_MPEG12DEC)
return false;
}
if (profile >= PIPE_VIDEO_PROFILE_MPEG4_AVC_BASELINE &&
profile <= PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH444) {
if (encode) {