From dec095351770d88beda49e78091baa75e012759c Mon Sep 17 00:00:00 2001 From: Sreerenj Balachandran Date: Tue, 15 May 2018 16:31:02 -0800 Subject: [PATCH] msdk: allow building against open sourced msdk Building against mfx_dispatcher is used to search for headers in PREFIX/include/mfx/ only (commit: 62f04e801bd7e247102ac67df889bee33ab74ff7), but it is just PREFIX/include with open source msdk version. https://bugzilla.gnome.org/show_bug.cgi?id=796118 --- configure.ac | 8 ++++++++ sys/msdk/gstmsdkh265dec.c | 2 +- sys/msdk/gstmsdkh265enc.c | 2 +- sys/msdk/gstmsdkmjpegdec.c | 2 +- sys/msdk/gstmsdkmjpegenc.c | 2 +- sys/msdk/gstmsdkvp8dec.c | 2 +- sys/msdk/gstmsdkvp8enc.c | 2 +- sys/msdk/msdk.h | 2 +- sys/msdk/msdk_libva.h | 2 +- 9 files changed, 16 insertions(+), 8 deletions(-) diff --git a/configure.ac b/configure.ac index 1d386f96fe..a1c7df5d7f 100644 --- a/configure.ac +++ b/configure.ac @@ -1088,6 +1088,14 @@ AG_GST_CHECK_FEATURE(MSDK, [Intel MediaSDK], msdk, [ [ AC_DEFINE(HAVE_LIBMFX, 1, [Define if mfx_dispatcher is available]) HAVE_MSDK="yes" + dnl external msdk dispatchers sometimes install headers into prefix/mfx/ + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$LIBMFX_CFLAGS $save_CPPFLAGS" + AC_CHECK_HEADER(mfx/mfxdefs.h, [HAVE_MFX_MFXDEFS_H=1], [HAVE_MFX_MFXDEFS_H=0]) + if test $HAVE_MFX_MFXDEFS_H -eq 1; then + AC_DEFINE(HAVE_MFX_MFXDEFS_H, 1, [Define if mfx/mfxdefs.h available]) + fi + CPPFLAGS="$save_CPPFLAGS" ], [ AC_ARG_WITH([msdk-prefix], AS_HELP_STRING([--with-msdk-prefix], diff --git a/sys/msdk/gstmsdkh265dec.c b/sys/msdk/gstmsdkh265dec.c index f89cf0acc6..66c9e138c6 100644 --- a/sys/msdk/gstmsdkh265dec.c +++ b/sys/msdk/gstmsdkh265dec.c @@ -33,7 +33,7 @@ # include #endif -#ifdef HAVE_LIBMFX +#ifdef HAVE_MFX_MFXDEFS_H # include #else # include "mfxplugin.h" diff --git a/sys/msdk/gstmsdkh265enc.c b/sys/msdk/gstmsdkh265enc.c index 7cd39061d6..3ae9bbd257 100644 --- a/sys/msdk/gstmsdkh265enc.c +++ b/sys/msdk/gstmsdkh265enc.c @@ -33,7 +33,7 @@ # include #endif -#ifdef HAVE_LIBMFX +#ifdef HAVE_MFX_MFXDEFS_H # include #else # include "mfxplugin.h" diff --git a/sys/msdk/gstmsdkmjpegdec.c b/sys/msdk/gstmsdkmjpegdec.c index ef377751e4..84e00ef3b9 100644 --- a/sys/msdk/gstmsdkmjpegdec.c +++ b/sys/msdk/gstmsdkmjpegdec.c @@ -33,7 +33,7 @@ # include #endif -#ifdef HAVE_LIBMFX +#ifdef HAVE_MFX_MFXDEFS_H # include # include #else diff --git a/sys/msdk/gstmsdkmjpegenc.c b/sys/msdk/gstmsdkmjpegenc.c index 00230f8bf5..aed53d2cf4 100644 --- a/sys/msdk/gstmsdkmjpegenc.c +++ b/sys/msdk/gstmsdkmjpegenc.c @@ -33,7 +33,7 @@ # include #endif -#ifdef HAVE_LIBMFX +#ifdef HAVE_MFX_MFXDEFS_H # include # include #else diff --git a/sys/msdk/gstmsdkvp8dec.c b/sys/msdk/gstmsdkvp8dec.c index 1b5a1f07de..abe7402329 100644 --- a/sys/msdk/gstmsdkvp8dec.c +++ b/sys/msdk/gstmsdkvp8dec.c @@ -34,7 +34,7 @@ # include #endif -#ifdef HAVE_LIBMFX +#ifdef HAVE_MFX_MFXDEFS_H # include # include #else diff --git a/sys/msdk/gstmsdkvp8enc.c b/sys/msdk/gstmsdkvp8enc.c index 4c161564fc..bc51ab59e9 100644 --- a/sys/msdk/gstmsdkvp8enc.c +++ b/sys/msdk/gstmsdkvp8enc.c @@ -33,7 +33,7 @@ # include #endif -#ifdef HAVE_LIBMFX +#ifdef HAVE_MFX_MFXDEFS_H # include # include #else diff --git a/sys/msdk/msdk.h b/sys/msdk/msdk.h index d1c874cbaf..d56bb3a814 100644 --- a/sys/msdk/msdk.h +++ b/sys/msdk/msdk.h @@ -41,7 +41,7 @@ #include #include -#ifdef HAVE_LIBMFX +#ifdef HAVE_MFX_MFXDEFS_H # include #else # include "mfxvideo.h" diff --git a/sys/msdk/msdk_libva.h b/sys/msdk/msdk_libva.h index 9f0187076b..691ea25a00 100644 --- a/sys/msdk/msdk_libva.h +++ b/sys/msdk/msdk_libva.h @@ -40,7 +40,7 @@ #include #include -#ifdef HAVE_LIBMFX +#ifdef HAVE_MFX_MFXDEFS_H # include #else # include "mfxvideo.h"