[FFmpeg-devel] [PATCH] lavc/qsvdec: fix the regression on linux for init_hw_device

Linjie Fu linjie.fu at intel.com
Tue Sep 3 09:51:06 EEST 2019


Fixed the regression mentioned in #7030 since commit:
b0cd14fb1dab4b044f7fe6b53ac635409849de77
which breaks the decode pipeline with " -init_hw_device qsv:hw"
on Linux.

hw_device_match_by_codec(ist->dec) can't get the valid dev for QSV
thus can't call ff_qsv_init_session_device.
(called ff_qsv_init_internal_session instead)

As a contrast, the previous version found the dev and called
ff_qsv_init_session_device successfully.

Application shall call SetHandle on Linux, however currently in
Linux pipeline ff_qsv_set_display_handle was removed in
ff_qsv_init_internal_session since commit:
1f26a231bb065276cd80ce02957c759f3197edfa
so the Handle was not set on ffmpeg level.

The regression could not be detected on windows is because of the
difference between windows and linux in MSDK:

"on the past we intentionally didn't implement initialization of
vaDisplay inside MSDK library on Linux."

Details in ticket #7030 and issue in MSDK:
https://github.com/Intel-Media-SDK/MediaSDK/issues/1611

Signed-off-by: Linjie Fu <linjie.fu at intel.com>
---
 libavcodec/qsvdec.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c
index eef4fe7..319b549 100644
--- a/libavcodec/qsvdec.c
+++ b/libavcodec/qsvdec.c
@@ -46,6 +46,7 @@ const AVCodecHWConfigInternal *ff_qsv_hw_configs[] = {
         .public = {
             .pix_fmt     = AV_PIX_FMT_QSV,
             .methods     = AV_CODEC_HW_CONFIG_METHOD_HW_FRAMES_CTX |
+                           AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX |
                            AV_CODEC_HW_CONFIG_METHOD_AD_HOC,
             .device_type = AV_HWDEVICE_TYPE_QSV,
         },
-- 
2.7.4



More information about the ffmpeg-devel mailing list