From patchwork Thu Apr 28 09:23:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xiang, Haihao" X-Patchwork-Id: 35464 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b9e:b0:7d:cfb5:dc7c with SMTP id b30csp3473797pzh; Thu, 28 Apr 2022 02:28:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJysWwt6lRbFITpCH9PcxVq7aAgnxHrjXd2cOgW8PfO/z01Avxbuyz+8NEMqqm6Fw+QHrAa9 X-Received: by 2002:a05:6402:5108:b0:426:312d:54c3 with SMTP id m8-20020a056402510800b00426312d54c3mr22986edd.333.1651138104916; Thu, 28 Apr 2022 02:28:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651138104; cv=none; d=google.com; s=arc-20160816; b=WDI3Udkn1mrRVy4mYTIsaW8N19bh6tmtHagMGuGAI6qJQpNINKenkcOLg98EPGTtxR Pt+Kx0CeGH4rfR2bbYxYY25zgj3iv4Man2MqNeD/GRYda/rR/rRtqC5zLc/cE76nTYw+ nGLPhXWyMQ7aCWGzWJ9+fGT278gNs62/wce2horEBpg6LJyPdc+Qpw3V34IfxnIpONFY khzbdo6nPnV6mIwGezm5K57T6og6rmuQ0ivMrnP0R8jqaKvSHUO1sjCwp08QWEHJRiSA nlSN7Hed0XyyOaskzGTfw5671twEURz1wP18c9C8mNuAhFLD2906zODF593UxbrYdSM1 KFaw== 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:dkim-signature:delivered-to; bh=g6kntY9A38Y98rKPQtUacfpJlO3JB7oMLCerlxCogyI=; b=Y4WbaoYblfwM07JyRjqoi0f8WLiSX4Zq3cvVZ/BVGaBSWFlXmIqeexAsmrfedG2UJj VA6aamddTvq7pxOsS/FT/Qqh13efBhKIUNsyvVJhNlL9blHI4R/iiPWALKMOtDbW4CD8 6p5jitnd67MpEBPhUyLrpNzuaJlEFkphPoGzXSIBTLWUXeMrd6Y3s34dKp0UgZ82Tm3N rwv1AUW33u4tmCqlUYwZRmaAck0CjF3s7Evn+flHBqOCVOq4gxqCwcfyk9t5o3jewyPt l0IAWm6uYnx7QT/pDdb/yeJ2TRloO8Dw6DASP8xbKRRSJVUESnU1dmGELFfs56cw5ld9 rVmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel.com header.s=Intel header.b=nC4Nhq70; 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 y17-20020a170906471100b006f3976ed175si3326440ejq.938.2022.04.28.02.28.24; Thu, 28 Apr 2022 02:28:24 -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; dkim=neutral (body hash did not verify) header.i=@intel.com header.s=Intel header.b=nC4Nhq70; 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 4313E68B3BB; Thu, 28 Apr 2022 12:26:56 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D4E0D68B3D8 for ; Thu, 28 Apr 2022 12:26:53 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651138014; x=1682674014; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=XomqIPwee4FjbwdPZda+MUqi2SIk6+psUTJkJ2zwJ9A=; b=nC4Nhq703nN4ZedUCl+h7fLPB9l/YQ2aVf1tOXx9jzrxCH5eehCtDe80 RRJ1nyo2saFTxP0E1J6k/1vFXKotBU+IhTmfHamiO9MOiMGUq4uh5e2hC 2dGfhHzK5v1g5qpKtd6aEuUHg1Zs+i+Us5cd9KmIbVOgsfGHdEHejEa// Vw695htC2UlP76hO6P3+sU52zfA88d1RMAdSrMBdDaDlJZAj9x8+Nq3aL 4XrJrXKSDw433P2jBKLjcWKOoXYWquFz4HY3jWK64tgTPUaCzogPy85bX 0uOSNzTF4hVGsXRGWxWlMxUxEhudpMu7AkW8Jo1dIHteS94+hDiPKkD3G g==; X-IronPort-AV: E=McAfee;i="6400,9594,10330"; a="266381490" X-IronPort-AV: E=Sophos;i="5.90,295,1643702400"; d="scan'208";a="266381490" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2022 02:26:53 -0700 X-IronPort-AV: E=Sophos;i="5.90,295,1643702400"; d="scan'208";a="581176124" Received: from zhao12-mobl.ccr.corp.intel.com (HELO hxiang-desk.ccr.corp.intel.com) ([10.254.214.89]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2022 02:26:51 -0700 From: Haihao Xiang To: ffmpeg-devel@ffmpeg.org Date: Thu, 28 Apr 2022 17:23:27 +0800 Message-Id: <20220428092327.16558-11-haihao.xiang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220428092327.16558-1-haihao.xiang@intel.com> References: <20220428092327.16558-1-haihao.xiang@intel.com> Subject: [FFmpeg-devel] [PATCH v08 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: xlYHG6h5zKPY This allows user to build FFmpeg against Intel oneVPL. oneVPL 2.6 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://www.intel.com/content/www/us/en/develop/documentation/upgrading-from-msdk-to-onevpl/top.html --- configure | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/configure b/configure index e163c743e1..cea185fc9b 100755 --- a/configure +++ b/configure @@ -341,6 +341,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] @@ -1921,6 +1922,7 @@ HWACCEL_LIBRARY_NONFREE_LIST=" HWACCEL_LIBRARY_LIST=" $HWACCEL_LIBRARY_NONFREE_LIST libmfx + libvpl mmal omx opencl @@ -6559,22 +6561,35 @@ enabled libjxl && require_pkg_config libjxl "libjxl >= 0.7.0" jxl/dec 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.6" + check_pkg_config libmfx "vpl >= 2.6" "mfxvideo.h mfxdispatcher.h" MFXLoad && \ + warn "build FFmpeg against oneVPL 2.6+, 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.6 not found" +fi + if enabled libmfx; then check_cc MFX_CODEC_VP9 "mfxdefs.h mfxstructures.h" "MFX_CODEC_VP9" fi