From patchwork Tue Jul 12 06:27:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xiang, Haihao" X-Patchwork-Id: 36741 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:6da0:b0:8b:e47:9dbf with SMTP id wl32csp1811563pzb; Mon, 11 Jul 2022 23:28:49 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sBQ51J7WGIsR1uF4/c5vB2xsOU+n7Ot8RAm1NJMTVqP2T5c7lM4w7b4S56LQstfRBJCw5d X-Received: by 2002:a17:906:1ca:b0:715:73f3:b50f with SMTP id 10-20020a17090601ca00b0071573f3b50fmr21936654ejj.374.1657607329370; Mon, 11 Jul 2022 23:28:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657607329; cv=none; d=google.com; s=arc-20160816; b=JBLUC4yVJN6pPVVO7sJtfC1Ev6qfvUptf4fIKDzxOX6zf5ZAZUx53gijsJtEQm+TbY iRzDAaL1juhuy08mesjTnaj+/UP+fF1OHjS+s6FqtJaC66vun9Sb8f9ecO6tTEjy3On4 IP7bvSbvR0GKSrPKv/nqzcV3RIw/mPdsuxAq9XV8YMvfB9MaLAAjtM7LC2D8j37vy618 jcaCXgy4NxC4f46DqEe+Xc5jBSLlPWVEzJVbQ2UAw+uLPqA9x2iunVS2W/uoPzbhljn5 IPHUUAnLSxvZf+mjv53p+nlIkJ7nQhd/GuVomUwWBksulCKPdBsxcoMDHTCpva5xN8GT r0mQ== 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=P9z5uyW7wWmtGbwf5oBp1EnngXbWwaVgUwBJ3X2/DxI=; b=jYcWMAwgFjQ44eUj1yAZT+hIHc6uoiVq+MBAb6FyH7QvnOY2vErLw6lpIqBQhq6M2W /OuVuyzrMLjyJqxLPb/7m12JpEAhzwaO/t9J1L4ZPV/N6lMt0JJhjkalAPZ9yKBaJR0+ HSmsKcxc+IldMDQOx4/5KRhaVrlgcXx+6Qb74e+jCKGE6UrBzbSP1TJBYukAL3dMTbmA ULEZG8KDsspDjFNmaiNNJLzISRsJ2zjRc8N25OiA0g7Sv0PgZXJcAHE5T2KjZn+9XYnE uu5vd/e24LaFQ/pOa2oc4stKjYcc/M4nc5HthVgNmytyTpslETQgWSFIOpoh3EQn/6LF XOlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel.com header.s=Intel header.b="LGZOKr/q"; 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 y10-20020a056402270a00b0043acae1274esi10993480edd.229.2022.07.11.23.28.49; Mon, 11 Jul 2022 23:28:49 -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="LGZOKr/q"; 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 675EE68B83A; Tue, 12 Jul 2022 09:28:40 +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 5112568B76A for ; Tue, 12 Jul 2022 09:28:33 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657607318; x=1689143318; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=SogPziYcKIhCundixfa32avvx2YoM2KgWHLrqrPMtcg=; b=LGZOKr/qQkTnGVpmD0x9rKNwwNq9zr6tb2aCD+PqIAxJCvV+cjf64aZr jOGngUk4ASCpAuHH+qOACyTiCX6jRXT6FPNKiohJb6xMe7v2L6Iez1NyX B9hi4dHsPZk8dGn20/asRwbeaWfeIMuL24KTFwZlfh1N8Dy/w5PZrD/n8 cQjVMIM8g8P1bzBhHl3KrsQw7hTk46L0UnKydT6CVi2bmfuIEfTbkYWT2 SS6MWPT2lfvNfk69+5PCrxg/ZmvaC3W3VR9U1FR1wHgrcFf4ivUrswoTY QqHVG9d7ObYuPyLgmcvhLgyhh/Y/ChIZ3/nOGSjD9Yzff1dG8SDKEx+4F A==; X-IronPort-AV: E=McAfee;i="6400,9594,10405"; a="346534432" X-IronPort-AV: E=Sophos;i="5.92,265,1650956400"; d="scan'208";a="346534432" 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:11 -0700 X-IronPort-AV: E=Sophos;i="5.92,265,1650956400"; d="scan'208";a="622381985" 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:10 -0700 From: "Xiang, Haihao" To: ffmpeg-devel@ffmpeg.org Date: Tue, 12 Jul 2022 14:27:25 +0800 Message-Id: <20220712062735.20339-4-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 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: rqwYOlF5wzkX 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 959526ec8f..7bf652a874 100755 --- a/configure +++ b/configure @@ -6573,15 +6573,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 5fc5bed4c8..b75559f083 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 2382c2f5f7..0c699d3b04 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 b754ac4b56..ad6ac70f72 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 87b09360cb..bc28589d10 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 f6027f600b..6df4a1a136 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 825eb8dc06..030b358d75 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 5cb12a2582..c68bf64231 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 4b2a6ce77f..9e96751828 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