From patchwork Tue Sep 3 06:51:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Fu, Linjie" X-Patchwork-Id: 14881 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id D4EFD449636 for ; Tue, 3 Sep 2019 09:53:04 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B17C8687F88; Tue, 3 Sep 2019 09:53:04 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1F035687F88 for ; Tue, 3 Sep 2019 09:52:56 +0300 (EEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Sep 2019 23:52:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,462,1559545200"; d="scan'208";a="194252158" Received: from icl-dev.sh.intel.com ([10.239.158.73]) by orsmga002.jf.intel.com with ESMTP; 02 Sep 2019 23:52:53 -0700 From: Linjie Fu To: ffmpeg-devel@ffmpeg.org Date: Tue, 3 Sep 2019 14:51:06 +0800 Message-Id: <1567493466-21852-1-git-send-email-linjie.fu@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [FFmpeg-devel] [PATCH] lavc/qsvdec: fix the regression on linux for init_hw_device X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Linjie Fu MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" 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 --- 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, },