From patchwork Fri Oct 8 07:50:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xiang, Haihao" X-Patchwork-Id: 30984 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2084:0:0:0:0 with SMTP id a4csp610361ioa; Fri, 8 Oct 2021 00:53:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyeIfkxv3KzlOUG5gB0GRLCxJL3+DXaxEs4VQ7/c6KTu79aVbn0PMAWenqCmPJoWVJ6uaKu X-Received: by 2002:a50:be81:: with SMTP id b1mr13063787edk.59.1633679585569; Fri, 08 Oct 2021 00:53:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633679585; cv=none; d=google.com; s=arc-20160816; b=eRGkU1pxdzdaASAHzINdm2STzXiStNDonPCYkibwjLLfDaJ1lnrg3R9rzE9q2IES+O DBj2Aun6ZaH++F0vj6YC/xWnnD9sKoGpiwsO2xlOrJ62RdhYJ+AQQvZqergPLNyvvQ60 ajLpUYgOM8Mnp6Tk3r35Mk/b+c6Qp0UKlOHT9HbKddZGliJVzS6jYFclKnOFmoQ9Xx7X pOp164PebcKVaEvTMQ79G6R/yi4dHMmZr4Z7ERFdbUVnxPZ+TDO6AwDe+ORdD1g7AlVr 3RxlyQkNSgHWqV+2vO9Sp+YyjENaa3RX7qZwGsqm2iPPTQgMF1iWJ6/ltkq0nfVEmQXX YBMA== 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=LPM4KoNhfMUQY1lmyj4mJHUGC0WD5mJs3aJILQ3Ad3s=; b=VodPBbn82IYp+LNjUy8xXpgTApwg7qsxL5zsRC/4y8nkZRzfsMzWLe37NKCtJeia9I pLY/O7cra4mVPSJV6AYDo/M4vhP77jKntndL+d86ci2oyViH6OlxXXQ1okfXkRbRn8IU lIajlvHXQudNSO6iuXaETaf7V9F9W4de+WX2954i33atMlKQL6FSZ4W7SNUWUTCzIsEP 0PabaQZx45fis+YLNNJ2sn4mTvi70ViBcGLbhs3JJJghamyH54O96tswCr44lpfOlqJq MAT8GNWCrGoM9Ta/rAPb4h02zuW9KL3pM7GwmZWxUPhLSKWddX4wRLqWE2k9VtgPQY5D +F3w== 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 kz10si2582019ejc.582.2021.10.08.00.53.05; Fri, 08 Oct 2021 00:53: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 4198E68A799; Fri, 8 Oct 2021 10:51:29 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9D39968A711 for ; Fri, 8 Oct 2021 10:51:23 +0300 (EEST) X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="226409202" X-IronPort-AV: E=Sophos;i="5.85,357,1624345200"; d="scan'208";a="226409202" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Oct 2021 00:51:18 -0700 X-IronPort-AV: E=Sophos;i="5.85,357,1624345200"; d="scan'208";a="478885099" Received: from xhh-dg164.sh.intel.com ([10.239.159.167]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Oct 2021 00:51:17 -0700 From: Haihao Xiang To: ffmpeg-devel@ffmpeg.org Date: Fri, 8 Oct 2021 15:50:56 +0800 Message-Id: <20211008075056.27151-11-haihao.xiang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211008075056.27151-1-haihao.xiang@intel.com> References: <20211008075056.27151-1-haihao.xiang@intel.com> Subject: [FFmpeg-devel] [PATCH v5 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: mEtbK+Ky7vNK 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] [1] https://software.intel.com/content/www/us/en/develop/articles/upgrading-from-msdk-to-onevpl.html --- configure | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/configure b/configure index b7691d3218..5ccb2592a6 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] @@ -1895,6 +1896,7 @@ HWACCEL_LIBRARY_NONFREE_LIST=" HWACCEL_LIBRARY_LIST=" $HWACCEL_LIBRARY_NONFREE_LIST libmfx + libvpl mmal omx opencl @@ -6429,22 +6431,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-libvpl 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