From patchwork Thu Jun 2 03:41:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xiang, Haihao" X-Patchwork-Id: 36053 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:6914:b0:82:6b11:2509 with SMTP id q20csp3803551pzj; Wed, 1 Jun 2022 20:43:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJysyWDO4u5pb+ZEt7z1hrROVt8lg/w9Kwtf7OOdv5RhI7UfMuM1iAmhW5eKvasqVTImI2uk X-Received: by 2002:a17:907:6ea6:b0:6ff:7867:82b1 with SMTP id sh38-20020a1709076ea600b006ff786782b1mr2431870ejc.232.1654141408044; Wed, 01 Jun 2022 20:43:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654141408; cv=none; d=google.com; s=arc-20160816; b=Qg1yrOONEY5Kdp261Yw5g9yZgU6dz2Bk9l1lwY7nM5AuFM5LsLCOdljuZqN7ANrocl /9L6xKR7JFic40o3xut2zUkL8qi9ewDNs5bhBcAb5Cu8F1YRec/5V5Ye5DuELE8D26YW Z90817IZS95GqXZ/7CkOlJNQkCITG/KXvQlJ9cOiIiHbqIdLoUJGDHswErgByf5tzAV0 mfM831B5ky/6SBkQZ88gmRJ3P2DvtrNir8iwqQjXIm2sR6dVxDHfwExslNOub5T3oc+t /yWFbNQmXJS52LMBvBEGiByk8jwbo2Cib9jZ1/bxGCCfqN9WCogvkDJ47eYDqkOxZoqn GBWw== 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=k3QjkNYSoA579GOsE3ZXhQOyFl0IOLcuG1REGjywKvg=; b=gbr3SEfecfXPYlOtkvgW62J6hVbe2t0xX88M82Q1a+AggF49BMFP7r+06FUt2igTI/ CIO7hBoK+C1QxMijXp5jXxlMAp3PTyuC4MIwuDt68QzgTYS0oe8fEZec9A/W3VPM7Im2 fwwndM7DzY1ReFcDDw9vt1DpAJbI9PGwktW3IQJkpd0pEEcd2ux5yGO4WeHzNikUiZSC 6+PW6IFTShC1hFcF3LLHPa3Kbo+AuPKcBp+mBm1J6Yv75W9zSJKK0VY4om+Ny+MuABdB 0/Gpj1cl2Vviez18VC2JAdJYcVQjPLw3ah0q4hfo0NQQsZikQ8s9oR0pciqmTga/QQ+b xoTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel.com header.s=Intel header.b=mp0I+iJh; 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 gs40-20020a1709072d2800b006fea0e9ba89si2852614ejc.743.2022.06.01.20.43.27; Wed, 01 Jun 2022 20:43:28 -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=mp0I+iJh; 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 3C8B968B832; Thu, 2 Jun 2022 06:42:12 +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 7502668B812 for ; Thu, 2 Jun 2022 06:42:08 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654141328; x=1685677328; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=p1eN957LA2W2qbWRUMPRTATLyBOvQwnwiIsSbQC8KFM=; b=mp0I+iJh4Ai0XTeO05xlWu8m1WQgHJhjBTubnff9Xlj6lDO4DwuCUwLM QXbo2sl3LmiFu0dPDbFnTi+vVHfZDcKy+SA8MlG4f0i5OzCisFhTTI8w6 0NlPKt/3urcY43H0FNJyhVuQUWuD7Xivvwr3RLQoIN85JhmhyaMQNA1lK ZfsFByq/iEoj0M9Nyt/ZFoDL6WCAip5TzmdC2lEpyE2wOa2KghIuqBRzY J5XhfQBdnk4k/4OEhsY3inqysHDP9+1e4Hfi99wEdBC8p8Xf1PMIOjf4R PJAqNQ57Y7YhLXgVFP+yrX8kPTZva/F8tx96yeG1lK4mojKTk5tXmzEFr A==; X-IronPort-AV: E=McAfee;i="6400,9594,10365"; a="362181658" X-IronPort-AV: E=Sophos;i="5.91,270,1647327600"; d="scan'208";a="362181658" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jun 2022 20:42:00 -0700 X-IronPort-AV: E=Sophos;i="5.91,270,1647327600"; d="scan'208";a="552629629" Received: from xhh-dg164.sh.intel.com ([10.239.159.54]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jun 2022 20:41:59 -0700 From: "Xiang, Haihao" To: ffmpeg-devel@ffmpeg.org Date: Thu, 2 Jun 2022 11:41:18 +0800 Message-Id: <20220602034118.22447-11-haihao.xiang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220602034118.22447-1-haihao.xiang@intel.com> References: <20220602034118.22447-1-haihao.xiang@intel.com> Subject: [FFmpeg-devel] [PATCH v9 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: XGn8WGPDFXPc From: Haihao Xiang 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 | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/configure b/configure index 4ca22272e3..3a5b69c274 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,23 +6561,36 @@ 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 >= 1.28 libmfx < 2.0" "mfxvideo.h" MFXInit || +elif enabled libmfx; then + { check_pkg_config libmfx "libmfx >= 1.28 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 >= 1.28 libmfx < 2.0" "mfx/mfxvideo.h" MFXInit && add_cflags -I${libmfx_incdir}/mfx; } || - { require libmfx "mfxvideo.h mfxdefs.h" MFXInit "-llibmfx $advapi32_extralibs" && - { test_cpp_condition mfxdefs.h "MFX_VERSION >= 1028 && MFX_VERSION < 2000" || die "ERROR: libmfx version must be >= 1.28 and < 2.0"; } && - 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 >= 1.28 libmfx < 2.0" "mfx/mfxvideo.h" MFXInit && add_cflags -I${libmfx_incdir}/mfx; } || + { require libmfx "mfxvideo.h mfxdefs.h" MFXInit "-llibmfx $advapi32_extralibs" && + { test_cpp_condition mfxdefs.h "MFX_VERSION >= 1028 && MFX_VERSION < 2000" || die "ERROR: libmfx version must be >= 1.28 and < 2.0"; } && + 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"