From: "Xiang, Haihao" <haihao.xiang-at-intel.com@ffmpeg.org> To: ffmpeg-devel@ffmpeg.org Cc: Haihao Xiang <haihao.xiang@intel.com> Subject: [FFmpeg-devel] [PATCH v12 03/13] qsv: remove mfx/ prefix from mfx headers Date: Mon, 25 Jul 2022 12:11:41 +0800 Message-ID: <20220725041151.7710-4-haihao.xiang@intel.com> (raw) In-Reply-To: <20220725041151.7710-1-haihao.xiang@intel.com> From: Haihao Xiang <haihao.xiang@intel.com> 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 33ca654424..8a6702f2a8 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 <mfx/mfxvideo.h> -#include <mfx/mfxplugin.h> -#include <mfx/mfxjpeg.h> +#include <mfxvideo.h> +#include <mfxplugin.h> +#include <mfxjpeg.h> #include <stdio.h> #include <string.h> @@ -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 <mfx/mfxvideo.h> +#include <mfxvideo.h> #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 <mfx/mfxvideo.h> +#include <mfxvideo.h> #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 <string.h> #include <sys/types.h> -#include <mfx/mfxvideo.h> +#include <mfxvideo.h> #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 <string.h> #include <sys/types.h> -#include <mfx/mfxvideo.h> +#include <mfxvideo.h> #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 <stdint.h> #include <sys/types.h> -#include <mfx/mfxvideo.h> +#include <mfxvideo.h> #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 <stdint.h> #include <sys/types.h> -#include <mfx/mfxvideo.h> +#include <mfxvideo.h> #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 <stdint.h> #include <sys/types.h> -#include <mfx/mfxvideo.h> +#include <mfxvideo.h> #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 <stdint.h> #include <sys/types.h> -#include <mfx/mfxvideo.h> +#include <mfxvideo.h> #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 <stdint.h> #include <sys/types.h> -#include <mfx/mfxvideo.h> +#include <mfxvideo.h> #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 <stdint.h> #include <sys/types.h> -#include <mfx/mfxvideo.h> +#include <mfxvideo.h> #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 <mfx/mfxvideo.h> +#include <mfxvideo.h> #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 <mfx/mfxvideo.h> +#include <mfxvideo.h> #include <stdio.h> #include <string.h> 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 <mfx/mfxvideo.h> +#include <mfxvideo.h> #include <stdio.h> #include <string.h> 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 <mfx/mfxstructures.h> +#include <mfxstructures.h> #endif #include <va/va.h> #include <CL/cl_va_api_media_sharing_intel.h> 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 <stdint.h> #include <string.h> -#include <mfx/mfxvideo.h> +#include <mfxvideo.h> #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 <mfx/mfxvideo.h> +#include <mfxvideo.h> /** * @file -- 2.17.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next prev parent reply other threads:[~2022-07-25 4:12 UTC|newest] Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-07-25 4:11 [FFmpeg-devel] [PATCH v12 00/13] make QSV works with the Intel's oneVPL Xiang, Haihao 2022-07-25 4:11 ` [FFmpeg-devel] [PATCH v12 01/13] configure: ensure --enable-libmfx uses libmfx 1.x Xiang, Haihao 2022-07-25 4:11 ` [FFmpeg-devel] [PATCH v12 02/13] configure: fix the check for MFX_CODEC_VP9 Xiang, Haihao 2022-07-25 4:11 ` Xiang, Haihao [this message] 2022-07-25 4:11 ` [FFmpeg-devel] [PATCH v12 04/13] qsv: restrict user plugin to MFX_VERSION < 2.0 Xiang, Haihao 2022-07-25 4:11 ` [FFmpeg-devel] [PATCH v12 05/13] qsv: restrict audio related code " Xiang, Haihao 2022-07-25 4:11 ` [FFmpeg-devel] [PATCH v12 06/13] qsvenc: restrict multi-frame encode " Xiang, Haihao 2022-07-25 4:11 ` [FFmpeg-devel] [PATCH v12 07/13] qsvenc: restrict MFX_RATECONTROL_LA_EXT " Xiang, Haihao 2022-07-25 4:11 ` [FFmpeg-devel] [PATCH v12 08/13] qsv: restrict OPAQUE memory " Xiang, Haihao 2022-07-25 4:11 ` [FFmpeg-devel] [PATCH v12 09/13] lavu/hwcontext_qsv: add loader field to AVQSVDeviceContext Xiang, Haihao 2022-07-25 4:11 ` [FFmpeg-devel] [PATCH v12 10/13] lavu/hwcontext_qsv: make qsv hwdevice works with oneVPL Xiang, Haihao 2022-07-25 4:11 ` [FFmpeg-devel] [PATCH v12 11/13] lavc/qsv: create mfx session using oneVPL for decoding/encoding Xiang, Haihao 2022-08-01 13:33 ` Anton Khirnov 2022-08-02 8:20 ` Xiang, Haihao 2022-08-02 11:20 ` Anton Khirnov 2022-07-25 4:11 ` [FFmpeg-devel] [PATCH v12 12/13] lavfi/qsv: create mfx session using oneVPL for qsv filters Xiang, Haihao 2022-07-25 4:11 ` [FFmpeg-devel] [PATCH v12 13/13] configure: add --enable-libvpl option Xiang, Haihao 2022-08-01 13:27 ` Anton Khirnov 2022-08-11 3:10 ` Xiang, Haihao 2022-08-03 4:55 ` [FFmpeg-devel] [PATCH v12 00/13] make QSV works with the Intel's oneVPL Xiang, Haihao 2022-08-09 1:23 ` Xiang, Haihao 2022-08-12 3:02 ` Xiang, Haihao
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220725041151.7710-4-haihao.xiang@intel.com \ --to=haihao.xiang-at-intel.com@ffmpeg.org \ --cc=ffmpeg-devel@ffmpeg.org \ --cc=haihao.xiang@intel.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git