Mesa (main): gallium/vl: respect the video codecs configure in meson

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 28 23:04:35 UTC 2022


Module: Mesa
Branch: main
Commit: 7ab05e3c3fe34ea7f8d7345b9229c163e42c3600
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7ab05e3c3fe34ea7f8d7345b9229c163e42c3600

Author: Dave Airlie <airlied at redhat.com>
Date:   Wed Mar 23 13:12:38 2022 +1000

gallium/vl: respect the video codecs configure in meson

Acked-by: Christian König <christian.koenig at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15258>

---

 src/gallium/auxiliary/vl/vl_codec.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/src/gallium/auxiliary/vl/vl_codec.c b/src/gallium/auxiliary/vl/vl_codec.c
index fc2d41b43ee..812222260a1 100644
--- a/src/gallium/auxiliary/vl/vl_codec.c
+++ b/src/gallium/auxiliary/vl/vl_codec.c
@@ -32,5 +32,25 @@ bool vl_codec_supported(struct pipe_screen *screen,
                         enum pipe_video_profile profile,
                         bool encode)
 {
+   if (profile == PIPE_VIDEO_PROFILE_VC1_SIMPLE ||
+       profile == PIPE_VIDEO_PROFILE_VC1_MAIN ||
+       profile == PIPE_VIDEO_PROFILE_VC1_ADVANCED) {
+      return VIDEO_CODEC_VC1DEC ? true : false;
+   }
+   if (profile >= PIPE_VIDEO_PROFILE_MPEG4_AVC_BASELINE &&
+       profile <= PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH444) {
+      if (encode)
+         return VIDEO_CODEC_H264ENC ? true : false;
+      else
+         return VIDEO_CODEC_H264DEC ? true : false;
+   }
+   if (profile >= PIPE_VIDEO_PROFILE_HEVC_MAIN &&
+       profile <= PIPE_VIDEO_PROFILE_HEVC_MAIN_444) {
+      if (encode)
+         return VIDEO_CODEC_H265ENC ? true : false;
+      else
+         return VIDEO_CODEC_H265DEC ? true : false;
+   }
+
    return screen->get_video_param(screen, profile, encode ? PIPE_VIDEO_ENTRYPOINT_ENCODE : PIPE_VIDEO_ENTRYPOINT_BITSTREAM, PIPE_VIDEO_CAP_SUPPORTED);
 }



More information about the mesa-commit mailing list