From patchwork Thu Sep 23 06:28:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xiang, Haihao" X-Patchwork-Id: 30473 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:6506:0:0:0:0:0 with SMTP id z6csp159093iob; Wed, 22 Sep 2021 23:30:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwiYZZtte1Z1ab04F0L9AwH8i8qq2GdLfGC2tij21yiujFY2W9l6YyS5yUNqOFinb/89d7K X-Received: by 2002:a17:906:f74f:: with SMTP id jp15mr3288363ejb.423.1632378619893; Wed, 22 Sep 2021 23:30:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632378619; cv=none; d=google.com; s=arc-20160816; b=hview9bxe3SkUBGK71Ay5CqKvwZ6yBn9TFJWV6dqmFvyKgzggGooKEGq96dAqEs7Sn QfYIP3g6AMJzB3IJ0yYkkaDEzInhyJQqRk0cLvpgqJuFJWlQ95XZvirnNgq+MF3IeJuJ h6BHaj8PY3aJxICjCu0XL5zBBwpV2VNnquWfvsrgwlaBJax/U7GjXVTCImpiZaceQ/W7 2OKzgGAolgmCRZUEfrOO+Y2fRO1EuSe7XX/yH8VzkA+WOtVFnvJXTM3hujz2DSwiPwvJ RsxiOGhORvs0r5t8pkq001PikhE/L3j8AJ2yXa7wBJXLyrLQmgsfvbUQ8u1X3CTRmU4B BUZw== 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=2/ICTFbQ2+afnuS3qbNjmlqpMjn5ulFgvKt79i+QAAs=; b=C99TVjF3MLIP3/t96wJqDha8RwcNYi8Sq7fnMDAKBBGw38depNZYfcgVDG6oiXXNzu BL6BZ4URRJy/BSUgPSsCtXqpMjHdqErlgMPTZJqv7rLuKftdfsF8UdUcximzYxyGni/v 3zEOe63xTwZZzc4b3PnWMGpwQrl3CUTOP+mpIUTLDHfrNgmts7WputRQ5nmjtNSV3BhY q2NFYefak/OsZxO3cQJzjj4mZZeUYJA/fUNhFzOdiqK++JB58BT1AEdW7Y1PHBoOJ8oS bzxLrJwjgxAH+CzLffoee4HtqMEpp3VcVuqshvoo8w8uvTdnyX9rsn7tjmsS6q7s+YLK H82g== 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 q15si5114440edc.297.2021.09.22.23.30.19; Wed, 22 Sep 2021 23:30:19 -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 2EAE168AC25; Thu, 23 Sep 2021 09:28:53 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6768268AAD5 for ; Thu, 23 Sep 2021 09:28:48 +0300 (EEST) X-IronPort-AV: E=McAfee;i="6200,9189,10115"; a="203930155" X-IronPort-AV: E=Sophos;i="5.85,316,1624345200"; d="scan'208";a="203930155" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Sep 2021 23:28:38 -0700 X-IronPort-AV: E=Sophos;i="5.85,316,1624345200"; d="scan'208";a="550689773" 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; 22 Sep 2021 23:28:37 -0700 From: Haihao Xiang To: ffmpeg-devel@ffmpeg.org Date: Thu, 23 Sep 2021 14:28:18 +0800 Message-Id: <20210923062818.18892-11-haihao.xiang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210923062818.18892-1-haihao.xiang@intel.com> References: <20210923062818.18892-1-haihao.xiang@intel.com> Subject: [FFmpeg-devel] [PATCH v4 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: 4gqR0tRmDUjH 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 9655a5823e..e9d2564819 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 @@ -6428,22 +6430,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