From patchwork Tue Jul 12 06:27:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xiang, Haihao" X-Patchwork-Id: 36751 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:6da0:b0:8b:e47:9dbf with SMTP id wl32csp1812210pzb; Mon, 11 Jul 2022 23:30:34 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vaB0uTc3oJdREuBQe7cyoQxWMRMXJKIuvGoEy65XdQQ8D+zbAQho3/MzgBYCrdP77j2kv/ X-Received: by 2002:a05:6402:11c7:b0:43a:c61c:21cd with SMTP id j7-20020a05640211c700b0043ac61c21cdmr18340502edw.108.1657607434695; Mon, 11 Jul 2022 23:30:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657607434; cv=none; d=google.com; s=arc-20160816; b=XMGjNRuahxgu3JIHTBYvGY631WyOxsTUj/+E+psHON12r/p9GjG1cDljCDcNG9+uPp m2kkPb+4unZwoWiQ05oymVcMdu1RoSD+zXFOORE9uaJjxqt0nPk3uci/ZWsU9Em+jk7k jK3BOSE6W1ane8+gxP5Ck5ZOm5dviz+xVxy7YIEJFwCpxln/yo0JKrneeqe9veHNpbN/ ZxBWQZyZFyxNiuP6fzh7Xgo+Ko7g6DPA88RdpBrOXdUg5/sYNaMnALZwfQV9D+6NHkXQ MspTIr9JK2AaiCK8JebZ5eVlt7OjlHUlSYqK0FWsoCsbJrJ2bRwU3nwNq3G4QxPnIDpm ofYg== 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=4I21T23yTlkmwlBNKCF1gqnjGvGP8CFB6FONfHi+NUM=; b=H4fd6+srr4kVq/jEqAPajzXh56xdrfQFaDd/hQ7ui8TRu8UkVyfi1j5v8qZdI1Lyyz cV8/Vyde4O66+9uIFsDxsc97/ioQVQNukdnhrwP/wLKa5qJgyKkhPlesy/VaJ4DEllCM CSJ4X8QATwoHrrLV64rqSjYn+Gf/W0el2ZfIxJ9V6o9b9caBelXJ4GeD+W659/Fvo65V w357Cnzxf6fctIG/okadjGeEBTZWef83QIc625uPqNQvM6VuhtEiOn6NRGqAldVfLNgL 0aVWaSs7+hr9D636Spe2opQnsgYqxgiSSA/697VIDqe2sqlE2oIFIUAH15phbo7h2Kiz Mh7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel.com header.s=Intel header.b=EljS0MRH; 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 gf5-20020a170906e20500b0072697437875si11260872ejb.704.2022.07.11.23.30.34; Mon, 11 Jul 2022 23:30:34 -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=EljS0MRH; 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 8F5CC68B920; Tue, 12 Jul 2022 09:28:52 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BE9E268B8AD for ; Tue, 12 Jul 2022 09:28:41 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657607322; x=1689143322; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=1aSJGqhAYf7jPY10BHHOGX+6njnD2mHTVBD2Mmq30BI=; b=EljS0MRHq1ug9sLMyqoGsMeU129GP/6KlEqcI07+RsP0FK/OcMk5LO9R xJtg8EdUSZ9nxveExDi1qIIvqPdhUc0LC7/PTsh6DjzTVvxXKZbUdFSUZ 1SsNcONn9zrPYZM+crYYtVYuxcTJ0ZV+Hn4dmWmnbWKa670Sz+kwGbZzY 1JGhgum+9GQk4pLKk9R6BkN0gHKgfPReZFn69JMwaBUV8eibiXR+YWGPt fNUOimdRAUcjP96GF5PtY+A9WHXViMq5iNBOBdptYB0dXcrn/4/laZqeG 1wdbEvBUJA04y8ddfklj35ml8qjrbXdu4DURv1pKV1WZdSVzn5Hrv7TVO g==; X-IronPort-AV: E=McAfee;i="6400,9594,10405"; a="346534461" X-IronPort-AV: E=Sophos;i="5.92,265,1650956400"; d="scan'208";a="346534461" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jul 2022 23:28:23 -0700 X-IronPort-AV: E=Sophos;i="5.92,265,1650956400"; d="scan'208";a="622382068" Received: from xhh-dg164.sh.intel.com ([10.239.159.146]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jul 2022 23:28:21 -0700 From: "Xiang, Haihao" To: ffmpeg-devel@ffmpeg.org Date: Tue, 12 Jul 2022 14:27:35 +0800 Message-Id: <20220712062735.20339-14-haihao.xiang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220712062735.20339-1-haihao.xiang@intel.com> References: <20220712062735.20339-1-haihao.xiang@intel.com> Subject: [FFmpeg-devel] [PATCH v10 13/13] 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: GX0WCZNpBEZu 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 7bf652a874..c37ef962a1 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 @@ -6567,23 +6569,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"