From patchwork Sat Sep 18 02:30:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xiang, Haihao" X-Patchwork-Id: 30331 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2a4a:0:0:0:0 with SMTP id k10csp2752908iov; Fri, 17 Sep 2021 19:32:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIA2ZjQeBiIZIsPQnY7CLyB0m95AL9dHQhLsEFi1dZn/9SMBvGUBL3o/r+B70JJITLEL3z X-Received: by 2002:a17:906:9395:: with SMTP id l21mr15716918ejx.308.1631932320788; Fri, 17 Sep 2021 19:32:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631932320; cv=none; d=google.com; s=arc-20160816; b=d5OYqPraHGvJa15b+mULzqDuwixMOrUpRiCe37/URrpPH5SnHpVN6uZ8tW68+8RKTR /MK1yUFJKNjVZwiEPM/LLzD0NrpvSw4pFuN50+ZOCdgftE3Z4tsYklrrZ+tT2ONiWtkb tqIHhtGnFdT/Ok8kG18QUTsFQItNOXKDn1A6jL1Rr/R4srjVgZ4kd/92f13BX8Vkp5Kw Bqro2fJYtWuhXacRw3JNkkYI9BtbANDNK0OJ+dovDUBn+R+S6DWx6K/v9Tk138iqTFbT vuQxzWStmd1RuabQlcErNtar7z6TQDDnxKQCmDC0f8H5Ze7iYTzd5ISbyxDVQfI4RNFY Ye9w== 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=EbiegVKP6dz0gPPN/RtKB8ys72PWMMXn9JZVTgeTJsA=; b=HuVC/7axvXS5XTMoPkGJ4sJb8Z6b7aQOCvFw+OyAcnffIn+ZkD8ZUmfjFutxs8wwFt h7UvXCUvd7sb2Q68wnoTx6CJPwTLCanR11EuU0NojMmdj5mAC5RGgOA7Q2Aiav8k1nhK QtViIYMd0xnlNpFtz+cqSoW/qa0No5JQJQ+JzssDEAt+16SG9AqkNL8PLbsC2Q1bhyF8 rseJ9ydHumLFbGG0xt8bFqjEr9lirmkos/CgoEjY4bZzDZvc86UyyPyKL9Ev4QtQfYTu lw5gsuuzkNKVKQjVBWpEEdLnxblFXl9Y9CExw97KjzSy9sQqOKirps3wP3TVVYPXoO09 6Nyg== 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 k5si8312928edv.339.2021.09.17.19.32.00; Fri, 17 Sep 2021 19:32:00 -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 4545968B1A6; Sat, 18 Sep 2021 05:30:49 +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 DEF2568B18F for ; Sat, 18 Sep 2021 05:30:44 +0300 (EEST) X-IronPort-AV: E=McAfee;i="6200,9189,10110"; a="222563156" X-IronPort-AV: E=Sophos;i="5.85,303,1624345200"; d="scan'208";a="222563156" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Sep 2021 19:30:36 -0700 X-IronPort-AV: E=Sophos;i="5.85,303,1624345200"; d="scan'208";a="473303730" 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; 17 Sep 2021 19:30:34 -0700 From: Haihao Xiang To: ffmpeg-devel@ffmpeg.org Date: Sat, 18 Sep 2021 10:30:05 +0800 Message-Id: <20210918023005.30128-11-haihao.xiang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210918023005.30128-1-haihao.xiang@intel.com> References: <20210918023005.30128-1-haihao.xiang@intel.com> Subject: [FFmpeg-devel] [PATCH v3 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: +wSLEb6q6tdR 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. --- configure | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/configure b/configure index 34fe342c3b..0d9cb67490 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 @@ -6426,22 +6428,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