From patchwork Fri Mar 11 08:16:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xiang, Haihao" X-Patchwork-Id: 34673 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6838:3486:0:0:0:0 with SMTP id ek6csp1484669nkb; Fri, 11 Mar 2022 00:17:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJy4nhleXPc+k3EPajk5cy3FN1SBrFVPSrQprXmS5w00D9nEQo6iL7jTSuuxbxQ3fb8d+Ucc X-Received: by 2002:a17:906:dc90:b0:6da:a5b1:7879 with SMTP id cs16-20020a170906dc9000b006daa5b17879mr7389911ejc.433.1646986651684; Fri, 11 Mar 2022 00:17:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646986651; cv=none; d=google.com; s=arc-20160816; b=zRorUj687LjflXpxsfWjhtM0Do26E63hQW+Bbb5HxQWazcH0pT9mQQO2GS8YLcMMfM mn3imk5YXFwY0B+tvhAFol3sZRSceT5+RVoi0AewHjqqrf4DiCQnMu3L/dB+pr7XsoID O8Qyj06KZYTkKsAATXKJmZPFzIGmEwzKkzIRvdw1TNNU3CTmLN0veV1J9XHbVFi8ztTe af0uplmU0WWWVl+JEzsnsvzYyrELb8dNCbVhRpcW1MVhGjRt97XlPj6AXw+JyUCOEZ4i 6lFSeFHihOcgbpk6O9LLk8TVAELVLgxeP6fmApL6/x4xbVbG6VQgXvw+Qd703TMv5RJP HRzA== 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=AKl4TlTjT8MK7VMAdB+/2qm4VPu2ZVMH9N8qn2qoLYo=; b=TjG8sfmKgta5jsmljeFYVB0f6w8Ub0xQaFsBT+cot+foQe+qeIdfXwiE9PzsNUSEHv xdhOOIMWLkiTAiINNBEdB149klu8IQfzJTe8+z/KfKVOZlbeoH9JhtE0271jXm/HNgc4 Rn/eelYJKvdROki8FDymr6gT5sZKMvlWFp5CO5WE8U4zzrHTCxJj+lnLr+JFuzse+OlW dsvREcJVFhAB4fq6Akg/Ec0eTmVkd3QYlZuIoPHag+mTFnT+bj1zN9jcFkjzHj6068Ki HW20XDrFdVGteYNKXuAMW7zRGhwCp8ajooXkQpc17db/UkK3sY8GGQNEsbNRGU/5YGA7 CDHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel.com header.s=Intel header.b=OWogujtD; 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 sc35-20020a1709078a2300b006d055cf07dfsi4615289ejc.574.2022.03.11.00.17.31; Fri, 11 Mar 2022 00:17:31 -0800 (PST) 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=OWogujtD; 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 E80B968B23A; Fri, 11 Mar 2022 10:17:03 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A343D68B1D9 for ; Fri, 11 Mar 2022 10:16:56 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646986621; x=1678522621; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=cu3k+0arQzELDYVEvu/gpPSlIugaJU7p2T+DbOvziEY=; b=OWogujtD7OkciBarDxoubCXK0/xzS7ugtx77SkNoTL7V+Jsd9VwcHBSH 6t6GOl0a1SU9l7R41O1Xdm1dw8/ddiuTCS/vWOzqXMZmSx9Iwo4dyWIR6 OdCCrniLtMN/8+fn8PYr9v/qNoHkLw736ogQmEDDbRORR36G3GF7rUAPz C4zjz5LXWlGBelFeBo1u3GOMQtGuGsT516YOuUHqUhceTaO3ULVladx4f 3IXpw5LFwNLMm7oRtcMucbcTRgoFTu/cV9qDQBtBJqAEudIQOuEWkyNx9 L4YMJrhAy3CM1s3MKKiVUefPSUaJdFakjOmxZfkNk9wDeLyLAzvCim/f1 g==; X-IronPort-AV: E=McAfee;i="6200,9189,10282"; a="237700126" X-IronPort-AV: E=Sophos;i="5.90,173,1643702400"; d="scan'208";a="237700126" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Mar 2022 00:16:52 -0800 X-IronPort-AV: E=Sophos;i="5.90,173,1643702400"; d="scan'208";a="688997025" Received: from xhh-dg164.sh.intel.com ([10.239.159.54]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Mar 2022 00:16:51 -0800 From: "Xiang, Haihao" To: ffmpeg-devel@ffmpeg.org Date: Fri, 11 Mar 2022 16:16:23 +0800 Message-Id: <20220311081630.21927-4-haihao.xiang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220311081630.21927-1-haihao.xiang@intel.com> References: <20220311081630.21927-1-haihao.xiang@intel.com> Subject: [FFmpeg-devel] [PATCH v7 03/10] 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: ykIhxGHT/QtR 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 | 13 +++++++++---- 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, 29 insertions(+), 24 deletions(-) diff --git a/configure b/configure index 31d4f4928b..eacdf03c18 100755 --- a/configure +++ b/configure @@ -6548,13 +6548,18 @@ 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 < 2.0" "mfx/mfxvideo.h" MFXInit || - { require "libmfx < 2.0" "mfx/mfxvideo.h" MFXInit "-llibmfx $advapi32_extralibs" && warn "using libmfx without pkg-config"; } } && + +enabled libmfx && { { 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${libmfx_incdir}/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"; } - 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 67d0e3934a..f749e77d3a 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 @@ -39,7 +39,7 @@ #define MFX_IMPL_VIA_MASK(impl) (0x0f00 & (impl)) #if QSV_VERSION_ATLEAST(1, 12) -#include "mfx/mfxvp8.h" +#include "mfxvp8.h" #endif 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 58186ea7ca..09fc76f6c4 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 6236391357..1a492da74b 100644 --- a/libavcodec/qsvdec.c +++ b/libavcodec/qsvdec.c @@ -25,7 +25,7 @@ #include #include -#include +#include #include "libavutil/common.h" #include "libavutil/fifo.h" diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index 9b71487666..0170ae14e4 100644 --- a/libavcodec/qsvenc.c +++ b/libavcodec/qsvenc.c @@ -23,7 +23,7 @@ #include #include -#include +#include #include "libavutil/common.h" #include "libavutil/hwcontext.h" diff --git a/libavcodec/qsvenc.h b/libavcodec/qsvenc.h index 2bda858427..559d7cbe3e 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 bec3633268..7c6f3a530c 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 ade546d4ca..e383caf238 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 dd082692be..ad8f09befe 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 525df99e50..610bbf79c1 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 1168ddda0e..5a0c04481d 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 371f629457..2ba7d086b7 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 4f4bd13405..55e4e566fa 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 95f8071abe..dbe7bafb8e 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