[FFmpeg-devel] [PATCH] lavc/qsvdec: allow qsv decoders to use initialized device

Dmitry Rogozhkin dmitry.v.rogozhkin at intel.com
Wed Sep 2 05:44:20 EEST 2020


qsv decoders did not allow to use devices explicitly initialized on
the command line and actually were using default device. This starts
to cause confusion with intel discrete GPUs since in this case decoder
might run on default integrated GPU device (/dev/dri/renderD128) and
encoder on the device specified on the command line (/dev/dri/renderD129).

Example:
ffmpeg -init_hw_device vaapi=va:/dev/dri/renderD129 -init_hw_device qsv=hw at va \
  -c:v h264_qsv -i input.h264 -c:v hevc_qsv -y output.h264

Signed-off-by: Dmitry Rogozhkin <dmitry.v.rogozhkin at intel.com>
---
 libavcodec/qsvdec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c
index fc25dc7..f2fac17 100644
--- a/libavcodec/qsvdec.c
+++ b/libavcodec/qsvdec.c
@@ -47,7 +47,8 @@ const AVCodecHWConfigInternal *ff_qsv_hw_configs[] = {
     &(const AVCodecHWConfigInternal) {
         .public = {
             .pix_fmt     = AV_PIX_FMT_QSV,
-            .methods     = AV_CODEC_HW_CONFIG_METHOD_HW_FRAMES_CTX |
+            .methods     = AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX |
+                           AV_CODEC_HW_CONFIG_METHOD_HW_FRAMES_CTX |
                            AV_CODEC_HW_CONFIG_METHOD_AD_HOC,
             .device_type = AV_HWDEVICE_TYPE_QSV,
         },
-- 
1.8.3.1



More information about the ffmpeg-devel mailing list