From patchwork Mon Aug 16 07:33:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xiang, Haihao" X-Patchwork-Id: 29549 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2a4a:0:0:0:0 with SMTP id k10csp1800402iov; Mon, 16 Aug 2021 00:35:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7Qt27UKJAa8BSdCKgX+YouhWeNb6UWtlPDTTA4zTU2gX/XFTSzdnhc80x7IZJJe7TCVqe X-Received: by 2002:aa7:cc0d:: with SMTP id q13mr9435371edt.109.1629099332860; Mon, 16 Aug 2021 00:35:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629099332; cv=none; d=google.com; s=arc-20160816; b=FsGxzweDexNpy+8MyjHO5N3r684iTWAbGlxqVQ4ix+EqOxKskawpP/KsPhlydzccS6 XYu82b7voyAOACWdV8cYsL3lJ+L5MSNaHHNqQUwJKPm5NZQtWs8PGU59o8uiDO1P7/sW bFUwft6Semh6UVm6r5T2q4x8/KDKEVW0AkFjKQFIougfSewjayOhXlx+Epmehi/RFxTe mdZqb8xrThxZfgdFKfoyu/yURFx2/lPpBYzSMMaiSV0kHcFOXOa0x7MMX7cl8luepI62 IbSPv3CzO7T5QCwL+0CAVH7uHSeDXsAJZwNJxvGa9vDm/qX8GMxgI7FE76reHVc3ewzw k01g== 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=jHOB1E2jk4el1ArMn8i2wSBLBPQVmVvCwEkVPp5b/FI=; b=QPIwF06qPZZDfibp+AB56rQbPqCVfEouLAdrXpLR60ZVzsq2jXUmOMFs4/4dwwKYTI Kd0oHcHrLmY67sszrs0z/cWD4zBJBxBhwRjw3YMkj5wvmnEryNAiAFrsiOtepAUn8wNU bZ+1oD8yDLFAJ4P5uAMyH4NZEFxwoeVLFPVny9BlZ89WmC5y0axc4aZANm1FAZF7eAr/ 8A3UJ6WHGbWTmjNoV8Gr/b5G3SQIdjjLtlPn1zHt4lU2WwRbhGkr2qlPJR9+/VTY4vMX t4AbPPJmrtitYy0rUgF1NlW2lgZVYdT8Xu9h+HWPMxjSp0j5/Yu04Aqr03kW06ZayoEp ZptQ== 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 ec28si10459048edb.404.2021.08.16.00.35.32; Mon, 16 Aug 2021 00:35:32 -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 4B24568A646; Mon, 16 Aug 2021 10:34: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 0347368A5F3 for ; Mon, 16 Aug 2021 10:33:52 +0300 (EEST) X-IronPort-AV: E=McAfee;i="6200,9189,10077"; a="301396339" X-IronPort-AV: E=Sophos;i="5.84,324,1620716400"; d="scan'208";a="301396339" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Aug 2021 00:33:51 -0700 X-IronPort-AV: E=Sophos;i="5.84,324,1620716400"; d="scan'208";a="519461897" Received: from xhh-dg164.sh.intel.com ([10.239.159.167]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Aug 2021 00:33:50 -0700 From: Haihao Xiang To: ffmpeg-devel@ffmpeg.org Date: Mon, 16 Aug 2021 15:33:25 +0800 Message-Id: <20210816073325.27020-11-haihao.xiang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210816073325.27020-1-haihao.xiang@intel.com> References: <20210816073325.27020-1-haihao.xiang@intel.com> Subject: [FFmpeg-devel] [PATCH v2 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: qNqUcD4PMOht This allows user to build FFmpeg against Intel's oneVPL SDK. oneVPL 2.2 is the required minimum version when building Intel oneVPL SDK code. It will fail to run configure script if both libmfx and libvpl are enabled. --- configure | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/configure b/configure index d3c0f63f85..b2e819a695 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 SDK 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] @@ -1895,6 +1896,7 @@ HWACCEL_LIBRARY_NONFREE_LIST=" HWACCEL_LIBRARY_LIST=" $HWACCEL_LIBRARY_NONFREE_LIST libmfx + libvpl mmal omx opencl @@ -6430,22 +6432,34 @@ 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$($pkg_config --variable=includedir libmfx)/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$($pkg_config --variable=includedir libmfx)/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 used in the following check for --enable-vpl option +# because QSV has dependency on libmfx, we can use the same dependency if using libmfx in this check. + 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