From patchwork Fri Dec 29 07:06:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhong Li X-Patchwork-Id: 7009 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.79.195 with SMTP id r64csp10169270jad; Thu, 28 Dec 2017 23:07:48 -0800 (PST) X-Google-Smtp-Source: ACJfBotZDL3HKEvFKauwN/GVMI6MZZFlGyJmEvn353OpxBpvfa8UWPoojFvk6u8nClkJRKeMZQ19 X-Received: by 10.223.176.69 with SMTP id g5mr24021125wra.80.1514531268608; Thu, 28 Dec 2017 23:07:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514531268; cv=none; d=google.com; s=arc-20160816; b=gTHVetarMYWqpX/cSz8QjatqtMPbtotBVnJc/ZBtTIoH6MYT6j0toaN8fF1guUj6cg nHDgsXlAn2xJAmJML+WLNq1ppuW16vSYfiPCEQBlY7kwoT2663yqgwcyOoeDX6lUd402 JM8Hkkvy9AdkL2pK3+XsRYMak0CcZzlK1NmwC9LtstePDV1lPlt/wFgMaEAyNZ2zsraE MS70rq/jq0Jdba5MXreXi4C4wzbEsXDx+KBTEpkVeCuBWGcf300i6zvdcNnEN9xOrPq1 JiTZbaNuSBPrt4mT9JphOGk1smAjZOdyKj//Y54+ajajXoTYoYVrFYVA7maVd/ifif1q KtaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:delivered-to :arc-authentication-results; bh=C/HsxTT+0ryekMAHGutJSKblEZqBNiAwCVco5ej44HE=; b=wHS0v1NgYuOFIuSIuw8MnsdplcfDOmOsGv+9bT9yYy+JmsbaPYbW/dNVmZv47gjrd9 caUOMy51breLUc3oTP1nIQWD7jziV9X+rKe3/SW9yuVhjVcEbx8y7TAAFKv4/1biIFjI l6OFzJt44Eq86J1hqUt7S4ozV4q37sXTWiMAwnIvKBxhkK4XKEUM3IT0or6oCWbx/nOe EnuCsDE1lNU1/FIpKWI26D4pQltIcnAkioVyRZaXPslJN7lsj5l89Xy7z1wqCWgPdinQ WCNaX3u/2RA2xZalJRv8eFB048T63ZcoGvb0aXPnR7Flp3vLQ+mOGLKY2cq/1eKbxyuV b3iQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id m19si15939370wma.113.2017.12.28.23.07.48; Thu, 28 Dec 2017 23:07:48 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0BD99689A14; Fri, 29 Dec 2017 09:07:33 +0200 (EET) 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 9C84E688252 for ; Fri, 29 Dec 2017 09:07:26 +0200 (EET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Dec 2017 23:07:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,474,1508828400"; d="scan'208";a="190601992" Received: from unknown (HELO localhost.localdomain.sh.intel.com) ([10.239.13.18]) by fmsmga005.fm.intel.com with ESMTP; 28 Dec 2017 23:07:38 -0800 From: Zhong Li To: ffmpeg-devel@ffmpeg.org Date: Fri, 29 Dec 2017 15:06:09 +0800 Message-Id: <1514531169-20636-1-git-send-email-zhong.li@intel.com> X-Mailer: git-send-email 1.8.3.1 Subject: [FFmpeg-devel] [PATCH] lavc/qsvdec: hw device should be set 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: Zhong Li MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Add the flag "AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX" to indicate AVCodecContext.hw_device_ctx should be set before calling avcodec_open2() for qsv decoding. It is consistent with examples/qsvdec.c. It also can make function "hw_device_match_by_codec()" can find qsv device successfully. Signed-off-by: Zhong Li --- libavcodec/qsvdec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c index 55fe59b..ff1dcf1 100644 --- a/libavcodec/qsvdec.c +++ b/libavcodec/qsvdec.c @@ -45,7 +45,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, },