From patchwork Fri Oct 15 13:39:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xiang, Haihao" X-Patchwork-Id: 31121 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2084:0:0:0:0 with SMTP id a4csp379611ioa; Fri, 15 Oct 2021 06:41:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxBWpWZ3jLq03Z1/SeoQCkbAW7TevvstiAi94LARpxwy0JfXlXyI6IuRThIS8Vol23YISBC X-Received: by 2002:a17:906:e104:: with SMTP id gj4mr6809700ejb.358.1634305265782; Fri, 15 Oct 2021 06:41:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634305265; cv=none; d=google.com; s=arc-20160816; b=ECdqpxylfggR//z24n6fS3lvEIW+mWesv91m31kI/VbQ70Sh5G0D3Fti/5Ekcg0ziF 9QVmPbk3nDGFDOvSwOkvww/9noXn/enMt2cirTfZSZsvuxPxW0lP8iZxsIEjmgQp23ai oBiCT4s8fvYgG3/FgUuIMe83h1f0+5cztlTOrb0H+GXlJaYuGIh55Y++UqPkIzUXpfUH 0dBF42EQdugv7W7FbCgCLUMAvsefa8VwzLZ4th2Et2A7YWALmlI/TV3xbQob7UVvXb7A aY/RAisCl6jZY84dWoOGWx2d8fTK52C8rmKJv9wmcN7EQg1XpHwBNRYJ880NOl/dgRZs MvQA== 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:references:in-reply-to:message-id:date :to:from:delivered-to; bh=mxLHdWVkOgm8luGfPr2PA5pzBTAHwLlQBLk8Lmpk5Jg=; b=CKYmOrpG4eh+DgAS+ouonPC+PuYHDLp0iKCgpUVNKpbB3rNUSjuN84RTBSvsx1nkgF rp4IYqgWKD2TeG7bAFQEtFHaKKm0awo+SnIFWHn8TRX700Wp5zIV+pezciZba9EHoydI hv3Ob16NiIPWcU2owJl+G1kzRJJrerRFD3JRVftmIHqE4ryVY32OiCiooV0E3nOLRLr3 8BE9YNbxHQfxtiNRhD2FqAXFGoo1qfQUKDlorFsT4Uc7ER4OnNSbeiAV8d/5MsFimPqA yXb3X5cG+PTZaqzYVH6hjyEq7QegDQilAoQvoi/X4CJQKM4P57sT/4GExa1Cb4tg0/Fe R1EA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 16si7172560ejf.233.2021.10.15.06.41.05; Fri, 15 Oct 2021 06:41:05 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 968C168AA84; Fri, 15 Oct 2021 16:39:50 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 562CF68A9F0 for ; Fri, 15 Oct 2021 16:39:47 +0300 (EEST) X-IronPort-AV: E=McAfee;i="6200,9189,10137"; a="226687001" X-IronPort-AV: E=Sophos;i="5.85,375,1624345200"; d="scan'208";a="226687001" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Oct 2021 06:39:40 -0700 X-IronPort-AV: E=Sophos;i="5.85,375,1624345200"; d="scan'208";a="442524837" Received: from xhh-dg164.sh.intel.com ([10.239.159.167]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Oct 2021 06:39:39 -0700 From: Haihao Xiang To: ffmpeg-devel@ffmpeg.org Date: Fri, 15 Oct 2021 21:39:15 +0800 Message-Id: <20211015133915.13624-11-haihao.xiang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211015133915.13624-1-haihao.xiang@intel.com> References: <20211015133915.13624-1-haihao.xiang@intel.com> Subject: [FFmpeg-devel] [PATCH v6 10/10] configure: add --enable-libvpl option X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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: Haihao Xiang MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: o+kJGcZXhT4V This allows user to build FFmpeg against Intel oneVPL. oneVPL 2.2 is the required minimum version when building Intel oneVPL code. It will fail to run configure script if both libmfx and libvpl are enabled. It is recommended to use oneVPL for new work, even for currently available hardwares [1] Note the preferred child device type is d3d11va for libvpl on Windows. The commands below will use d3d11va if d3d11va is available on Windows. $> ffmpeg -hwaccel qsv -c:v h264_qsv ... $> ffmpeg -qsv_device 0 -hwaccel qsv -c:v h264_qsv ... $> ffmpeg -init_hw_device qsv=qsv:hw_any -hwaccel qsv -c:v h264_qsv ... $> ffmpeg -init_hw_device qsv=qsv:hw_any,child_device=0 -hwaccel qsv -c:v h264_qsv ... User may use child_device_type option to specify child device type to dxva2 or derive a qsv device from a dxva2 device $> ffmpeg -init_hw_device qsv=qsv:hw_any,child_device=0,child_device_type=dxva2 -hwaccel qsv -c:v h264_qsv ... $> ffmpeg -init_hw_device dxva2=d3d9:0 -init_hw_device qsv=qsv@d3d9 -hwaccel qsv -c:v h264_qsv ... [1] https://software.intel.com/content/www/us/en/develop/articles/upgrading-from-msdk-to-onevpl.html --- configure | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/configure b/configure index cc5894dcac..88dc2bda91 100755 --- a/configure +++ b/configure @@ -337,6 +337,7 @@ External library support: --disable-ffnvcodec disable dynamically linked Nvidia code [autodetect] --enable-libdrm enable DRM code (Linux) [no] --enable-libmfx enable Intel MediaSDK (AKA Quick Sync Video) code via libmfx [no] + --enable-libvpl enable Intel oneVPL code via libvpl if libmfx is not used [no] --enable-libnpp enable Nvidia Performance Primitives-based code [no] --enable-mmal enable Broadcom Multi-Media Abstraction Layer (Raspberry Pi) via MMAL [no] --disable-nvdec disable Nvidia video decoding acceleration (via hwaccel) [autodetect] @@ -1898,6 +1899,7 @@ HWACCEL_LIBRARY_NONFREE_LIST=" HWACCEL_LIBRARY_LIST=" $HWACCEL_LIBRARY_NONFREE_LIST libmfx + libvpl mmal omx opencl @@ -6432,22 +6434,35 @@ enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -li enabled libklvanc && require libklvanc libklvanc/vanc.h klvanc_context_create -lklvanc enabled libkvazaar && require_pkg_config libkvazaar "kvazaar >= 0.8.1" kvazaar.h kvz_api_get enabled liblensfun && require_pkg_config liblensfun lensfun lensfun.h lf_db_new + +if enabled libmfx && enabled libvpl; then + die "ERROR: can not use libmfx and libvpl together" # While it may appear that require is being used as a pkg-config # fallback for libmfx, it is actually being used to detect a different # installation route altogether. If libmfx is installed via the Intel # Media SDK or Intel Media Server Studio, these don't come with # pkg-config support. Instead, users should make sure that the build # can find the libraries and headers through other means. - -enabled libmfx && { { check_pkg_config libmfx "libmfx < 2.0" "mfxvideo.h" MFXInit || +elif enabled libmfx; then + { check_pkg_config libmfx "libmfx < 2.0" "mfxvideo.h" MFXInit || \ # Some old versions of libmfx have the following settings in libmfx.pc: # includedir=/usr/include # Cflags: -I${includedir} # So add -I${includedir}/mfx to CFLAGS - { check_pkg_config libmfx "libmfx < 2.0" "mfx/mfxvideo.h" MFXInit && add_cflags -I${libmfx_incdir}/mfx; } || - { require "libmfx < 2.0" "mfxvideo.h" MFXInit "-llibmfx $advapi32_extralibs" && warn "using libmfx without pkg-config"; } } && - warn "build FFmpeg against libmfx 1.x, obsolete features of libmfx such as OPAQUE memory,\n"\ - "multi-frame encode, user plugins and LA_EXT rate control mode are enabled"; } + { check_pkg_config libmfx "libmfx < 2.0" "mfx/mfxvideo.h" MFXInit && add_cflags -I${libmfx_incdir}/mfx; } || + { require "libmfx < 2.0" "mfxvideo.h" MFXInit "-llibmfx $advapi32_extralibs" && warn "using libmfx without pkg-config"; } } && + warn "build FFmpeg against libmfx 1.x, obsolete features of libmfx such as OPAQUE memory,\n"\ + "multi-frame encode, user plugins and LA_EXT rate control mode are enabled" +elif enabled libvpl; then +# Consider pkg-config only. The name of libmfx is still passed to check_pkg_config function for --enable-libvpl option +# because QSV has dependency on libmfx, we can use the same dependency if using libmfx in this check. The package name +# is extracted from "vpl >= 2.2" + check_pkg_config libmfx "vpl >= 2.2" "mfxvideo.h mfxdispatcher.h" MFXLoad && \ + warn "build FFmpeg against oneVPL 2.2+, OPAQUE memory, multi-frame encode, user plugins\n"\ + "and LA_EXT rate control mode in FFmpeg QSV won't be supported." || + die "ERROR: libvpl >= 2.2 not found" +fi + if enabled libmfx; then check_cc MFX_CODEC_VP9 "mfxdefs.h mfxstructures.h" "MFX_CODEC_VP9" fi