msdk: allow building against open sourced msdk
authorSreerenj Balachandran <sreerenj.balachandran@intel.com>
Wed, 16 May 2018 00:31:02 +0000 (16:31 -0800)
committerSreerenj Balachandran <sreerenj.balachandran@intel.com>
Wed, 16 May 2018 00:31:02 +0000 (16:31 -0800)
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
sys/msdk/gstmsdkh265dec.c
sys/msdk/gstmsdkh265enc.c
sys/msdk/gstmsdkmjpegdec.c
sys/msdk/gstmsdkmjpegenc.c
sys/msdk/gstmsdkvp8dec.c
sys/msdk/gstmsdkvp8enc.c
sys/msdk/msdk.h
sys/msdk/msdk_libva.h

index 1d386f9..a1c7df5 100644 (file)
@@ -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],
index f89cf0a..66c9e13 100644 (file)
@@ -33,7 +33,7 @@
 #  include <config.h>
 #endif
 
-#ifdef HAVE_LIBMFX
+#ifdef HAVE_MFX_MFXDEFS_H
 #  include <mfx/mfxplugin.h>
 #else
 #  include "mfxplugin.h"
index 7cd3906..3ae9bbd 100644 (file)
@@ -33,7 +33,7 @@
 #  include <config.h>
 #endif
 
-#ifdef HAVE_LIBMFX
+#ifdef HAVE_MFX_MFXDEFS_H
 #  include <mfx/mfxplugin.h>
 #else
 #  include "mfxplugin.h"
index ef37775..84e00ef 100644 (file)
@@ -33,7 +33,7 @@
 #  include <config.h>
 #endif
 
-#ifdef HAVE_LIBMFX
+#ifdef HAVE_MFX_MFXDEFS_H
 #  include <mfx/mfxstructures.h>
 #  include <mfx/mfxjpeg.h>
 #else
index 00230f8..aed53d2 100644 (file)
@@ -33,7 +33,7 @@
 #  include <config.h>
 #endif
 
-#ifdef HAVE_LIBMFX
+#ifdef HAVE_MFX_MFXDEFS_H
 #  include <mfx/mfxstructures.h>
 #  include <mfx/mfxjpeg.h>
 #else
index 1b5a1f0..abe7402 100644 (file)
@@ -34,7 +34,7 @@
 #  include <config.h>
 #endif
 
-#ifdef HAVE_LIBMFX
+#ifdef HAVE_MFX_MFXDEFS_H
 #  include <mfx/mfxplugin.h>
 #  include <mfx/mfxvp8.h>
 #else
index 4c16156..bc51ab5 100644 (file)
@@ -33,7 +33,7 @@
 #  include <config.h>
 #endif
 
-#ifdef HAVE_LIBMFX
+#ifdef HAVE_MFX_MFXDEFS_H
 #  include <mfx/mfxplugin.h>
 #  include <mfx/mfxvp8.h>
 #else
index d1c874c..d56bb3a 100644 (file)
@@ -41,7 +41,7 @@
 #include <gst/gst.h>
 #include <gst/video/video.h>
 
-#ifdef HAVE_LIBMFX
+#ifdef HAVE_MFX_MFXDEFS_H
 #  include <mfx/mfxvideo.h>
 #else
 #  include "mfxvideo.h"
index 9f01870..691ea25 100644 (file)
@@ -40,7 +40,7 @@
 #include <gst/gst.h>
 #include <va/va.h>
 
-#ifdef HAVE_LIBMFX
+#ifdef HAVE_MFX_MFXDEFS_H
 #  include <mfx/mfxvideo.h>
 #else
 #  include "mfxvideo.h"