From patchwork Wed Jul 20 08:39:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xiang, Haihao" X-Patchwork-Id: 36858 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:1649:b0:8b:613a:194d with SMTP id no9csp2255091pzb; Wed, 20 Jul 2022 01:41:05 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uMLbalrqGTU6/SR+ayjfRtDbnw+IBJfBPJZmWM49Y0QrwMx134K3YGN8y2ExTled102Jwj X-Received: by 2002:aa7:c599:0:b0:43b:b7c8:36ff with SMTP id g25-20020aa7c599000000b0043bb7c836ffmr3185383edq.110.1658306464967; Wed, 20 Jul 2022 01:41:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658306464; cv=none; d=google.com; s=arc-20160816; b=Dea1/M5yb+2+i0UsT4m5eeFTtcpOq9oyBBJkVM/6WvgUIkHCD5VD5HDWFQgOJpwvwB QPzVTg1+RoyYqO4FyCbsh+GR6M64G/v7Pc+g84YjeHryxbwjjSSjgkDIZI8F6DzRdJlB /xVl14/MyhGVsZWQKMwsv4jIxIP+k2eUn2Rg8P+UbTriys560mlETzczFBRUr1FeIh4T +4AYCMb7LCNWIWAg/EY0p2rVTsVm6mh6wUvQ3gqtUd25k02tJWzOK/eA39Vsonv1c/iW 15SP4WqIUxbz4bznTSiNAVFagBAQIiKf8Fyfy5p3ZlT9NTjgWjSHUOxOeN+ELm1/tRgH QlKA== 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=CAF0ZYNtVJelN8D85r9lHkwANOJqOp98JcxY1zsxGVA=; b=Z4CMzNztZj+VmkCY2+TZdjVeSpK1hNEelkOtbaOMYMwb8mNkhrV+omP/Qa6QQltzwO 4zEGEFfAKv66ZnsNy06+jg3QEp6WnZja7ym2LB3jLH2wpP7SPUddYEljgFLj56pmTSHH SJHUKnVQkHXNB9DjEouVq+aU0IS/L7l+qoeQo/6SN5hwRxve/gHTGaXXBdRyC1RHqjuP lnnzXw8UTPvVhtO9+5GW9C/rgQNpj7XJf3HBnCRE+y/bqT++icso6PdJbjytVbBgblyE L0nKjSu/xvpO7tsGkpZy8qVFVoI8K/UH6UKTjEWz9U8Ifw2UH2dxOOtVZpn4qzuWskqt FUnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel.com header.s=Intel header.b="lKFD/6D4"; 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 c24-20020a170906341800b0072b4cba9671si19349110ejb.186.2022.07.20.01.41.04; Wed, 20 Jul 2022 01:41:04 -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="lKFD/6D4"; 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 8684068B7CC; Wed, 20 Jul 2022 11:40:38 +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 90D0F68B64E for ; Wed, 20 Jul 2022 11:40:30 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1658306435; x=1689842435; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=QH9MomYHuFB7k4sNV48XSGNs/LkVsy9oTavRlwijUm0=; b=lKFD/6D4oP25ENAzklmzvR9Kn/PW8sduIa2qW62h7QBqs5Uu+vmKn1v5 gQXrgUD+eLmv5onHu0sAVHdxmtU+Xd0g+Hc+YXKkfUCibIMNpneyrvOwB oV6HgVzTLoF41184VV65ggrVieroWqwoQOXrpD3+T14E+a5jZEYbB7MkH 0u996Ndwl+gysYjS52lHk4Z2iC7wPPMq8ohx8aAOCYpl05vzYkGkfDu4a lgh3Jeipx82ZrRe1XN0qWq9qxlNnAAwnkUZDKcao1ugKYVzAx/UceO2QS 4MQqL4a4ier2u/pKXAaeO6Q+3FsJYdBcVerMq3x9PK519rLOvacfS5BJf w==; X-IronPort-AV: E=McAfee;i="6400,9594,10413"; a="348412491" X-IronPort-AV: E=Sophos;i="5.92,286,1650956400"; d="scan'208";a="348412491" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jul 2022 01:40:27 -0700 X-IronPort-AV: E=Sophos;i="5.92,286,1650956400"; d="scan'208";a="625574646" Received: from xhh-dg164.sh.intel.com ([10.238.5.169]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jul 2022 01:40:25 -0700 From: "Xiang, Haihao" To: ffmpeg-devel@ffmpeg.org Date: Wed, 20 Jul 2022 16:39:56 +0800 Message-Id: <20220720084006.5033-4-haihao.xiang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220720084006.5033-1-haihao.xiang@intel.com> References: <20220720084006.5033-1-haihao.xiang@intel.com> Subject: [FFmpeg-devel] [PATCH v11 03/13] qsv: remove mfx/ prefix from mfx headers 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: A7gMJi8T6gmH From: Haihao Xiang The following Cflags has been added to libmfx.pc, so mfx/ prefix is no longer needed when including mfx headers in FFmpeg. Cflags: -I${includedir} -I${includedir}/mfx Some old versions of libmfx have the following Cflags in libmfx.pc Cflags: -I${includedir} We may add -I${includedir}/mfx to CFLAGS when running 'configure --enable-libmfx' for old versions of libmfx, if so, mfx headers without mfx/ prefix can be included too. If libmfx comes without pkg-config support, we may do a small change to the settings of the environment(e.g. set -I/opt/intel/mediasdk/include/mfx instead of -I/opt/intel/mediasdk/include to CFLAGS), then the build can find the mfx headers without mfx/ prefix After applying this change, we won't need to change #include for mfx headers when mfx headers are installed under a new directory. This is in preparation for oneVPL support (mfx headers in oneVPL are installed under vpl directory) --- configure | 19 ++++++++++++------- libavcodec/qsv.c | 8 ++++---- libavcodec/qsv.h | 2 +- libavcodec/qsv_internal.h | 2 +- libavcodec/qsvdec.c | 2 +- libavcodec/qsvenc.c | 2 +- libavcodec/qsvenc.h | 2 +- libavcodec/qsvenc_h264.c | 2 +- libavcodec/qsvenc_hevc.c | 2 +- libavcodec/qsvenc_jpeg.c | 2 +- libavcodec/qsvenc_mpeg2.c | 2 +- libavcodec/qsvenc_vp9.c | 2 +- libavfilter/qsvvpp.h | 2 +- libavfilter/vf_deinterlace_qsv.c | 2 +- libavfilter/vf_scale_qsv.c | 2 +- libavutil/hwcontext_opencl.c | 2 +- libavutil/hwcontext_qsv.c | 2 +- libavutil/hwcontext_qsv.h | 2 +- 18 files changed, 32 insertions(+), 27 deletions(-) diff --git a/configure b/configure index 3b9aa44a95..23ae3eaf7e 100755 --- a/configure +++ b/configure @@ -6580,15 +6580,20 @@ enabled liblensfun && require_pkg_config liblensfun lensfun lensfun.h lf_ # 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" "mfx/mfxvideo.h" MFXInit || - { require libmfx "mfx/mfxvideo.h mfx/mfxdefs.h" MFXInit "-llibmfx $advapi32_extralibs" && - { test_cpp_condition mfx/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"; } +enabled libmfx && { { 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"; } if enabled libmfx; then - check_cc MFX_CODEC_VP9 "mfx/mfxdefs.h mfx/mfxstructures.h" "MFX_CODEC_VP9" + check_cc MFX_CODEC_VP9 "mfxdefs.h mfxstructures.h" "MFX_CODEC_VP9" fi enabled libmodplug && require_pkg_config libmodplug libmodplug libmodplug/modplug.h ModPlug_Load diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c index 385b43bb6c..25331ccce8 100644 --- a/libavcodec/qsv.c +++ b/libavcodec/qsv.c @@ -18,9 +18,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include -#include +#include +#include +#include #include #include @@ -38,7 +38,7 @@ #define MFX_IMPL_VIA_MASK(impl) (0x0f00 & (impl)) -#include "mfx/mfxvp8.h" +#include "mfxvp8.h" int ff_qsv_codec_id_to_mfx(enum AVCodecID codec_id) { diff --git a/libavcodec/qsv.h b/libavcodec/qsv.h index b77158ec26..04ae0d6f34 100644 --- a/libavcodec/qsv.h +++ b/libavcodec/qsv.h @@ -21,7 +21,7 @@ #ifndef AVCODEC_QSV_H #define AVCODEC_QSV_H -#include +#include #include "libavutil/buffer.h" diff --git a/libavcodec/qsv_internal.h b/libavcodec/qsv_internal.h index 8131acdae9..cb1e55ae30 100644 --- a/libavcodec/qsv_internal.h +++ b/libavcodec/qsv_internal.h @@ -39,7 +39,7 @@ #include "libavutil/hwcontext_vaapi.h" #endif -#include +#include #include "libavutil/frame.h" diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c index d8283b9207..edbe7bcdee 100644 --- a/libavcodec/qsvdec.c +++ b/libavcodec/qsvdec.c @@ -27,7 +27,7 @@ #include #include -#include +#include #include "libavutil/common.h" #include "libavutil/fifo.h" diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index 7594091a4b..e772bd99b5 100644 --- a/libavcodec/qsvenc.c +++ b/libavcodec/qsvenc.c @@ -25,7 +25,7 @@ #include #include -#include +#include #include "libavutil/common.h" #include "libavutil/hwcontext.h" diff --git a/libavcodec/qsvenc.h b/libavcodec/qsvenc.h index bffe957526..4cadc38a59 100644 --- a/libavcodec/qsvenc.h +++ b/libavcodec/qsvenc.h @@ -26,7 +26,7 @@ #include #include -#include +#include #include "libavutil/avutil.h" #include "libavutil/fifo.h" diff --git a/libavcodec/qsvenc_h264.c b/libavcodec/qsvenc_h264.c index 7756dc1789..64c22852d2 100644 --- a/libavcodec/qsvenc_h264.c +++ b/libavcodec/qsvenc_h264.c @@ -24,7 +24,7 @@ #include #include -#include +#include #include "libavutil/common.h" #include "libavutil/opt.h" diff --git a/libavcodec/qsvenc_hevc.c b/libavcodec/qsvenc_hevc.c index b09640365c..1d92b8ec13 100644 --- a/libavcodec/qsvenc_hevc.c +++ b/libavcodec/qsvenc_hevc.c @@ -22,7 +22,7 @@ #include #include -#include +#include #include "libavutil/common.h" #include "libavutil/opt.h" diff --git a/libavcodec/qsvenc_jpeg.c b/libavcodec/qsvenc_jpeg.c index c5b6a406a5..582886c7c0 100644 --- a/libavcodec/qsvenc_jpeg.c +++ b/libavcodec/qsvenc_jpeg.c @@ -22,7 +22,7 @@ #include #include -#include +#include #include "libavutil/common.h" #include "libavutil/opt.h" diff --git a/libavcodec/qsvenc_mpeg2.c b/libavcodec/qsvenc_mpeg2.c index 7340ece9a9..8ed578c396 100644 --- a/libavcodec/qsvenc_mpeg2.c +++ b/libavcodec/qsvenc_mpeg2.c @@ -22,7 +22,7 @@ #include #include -#include +#include #include "libavutil/common.h" #include "libavutil/opt.h" diff --git a/libavcodec/qsvenc_vp9.c b/libavcodec/qsvenc_vp9.c index 3662df1823..7ae392da75 100644 --- a/libavcodec/qsvenc_vp9.c +++ b/libavcodec/qsvenc_vp9.c @@ -22,7 +22,7 @@ #include #include -#include +#include #include "libavutil/common.h" #include "libavutil/opt.h" diff --git a/libavfilter/qsvvpp.h b/libavfilter/qsvvpp.h index 4fe07ab1f7..543c58a967 100644 --- a/libavfilter/qsvvpp.h +++ b/libavfilter/qsvvpp.h @@ -24,7 +24,7 @@ #ifndef AVFILTER_QSVVPP_H #define AVFILTER_QSVVPP_H -#include +#include #include "avfilter.h" #include "libavutil/fifo.h" diff --git a/libavfilter/vf_deinterlace_qsv.c b/libavfilter/vf_deinterlace_qsv.c index fb54d179ed..b8ff3e8339 100644 --- a/libavfilter/vf_deinterlace_qsv.c +++ b/libavfilter/vf_deinterlace_qsv.c @@ -21,7 +21,7 @@ * deinterlace video filter - QSV */ -#include +#include #include #include diff --git a/libavfilter/vf_scale_qsv.c b/libavfilter/vf_scale_qsv.c index da3c2eca86..af0e85bd03 100644 --- a/libavfilter/vf_scale_qsv.c +++ b/libavfilter/vf_scale_qsv.c @@ -21,7 +21,7 @@ * scale video filter - QSV */ -#include +#include #include #include diff --git a/libavutil/hwcontext_opencl.c b/libavutil/hwcontext_opencl.c index 32aec7d228..247834aaf6 100644 --- a/libavutil/hwcontext_opencl.c +++ b/libavutil/hwcontext_opencl.c @@ -47,7 +47,7 @@ #if HAVE_OPENCL_VAAPI_INTEL_MEDIA #if CONFIG_LIBMFX -#include +#include #endif #include #include diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c index 56dffa1f25..99735f5557 100644 --- a/libavutil/hwcontext_qsv.c +++ b/libavutil/hwcontext_qsv.c @@ -20,7 +20,7 @@ #include #include -#include +#include #include "config.h" diff --git a/libavutil/hwcontext_qsv.h b/libavutil/hwcontext_qsv.h index b98d611cfc..42e34d0dda 100644 --- a/libavutil/hwcontext_qsv.h +++ b/libavutil/hwcontext_qsv.h @@ -19,7 +19,7 @@ #ifndef AVUTIL_HWCONTEXT_QSV_H #define AVUTIL_HWCONTEXT_QSV_H -#include +#include /** * @file