msdk: add mfx in include path
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Tue, 8 Jan 2019 12:36:09 +0000 (13:36 +0100)
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Tue, 8 Jan 2019 12:59:45 +0000 (12:59 +0000)
Thus removing the preprocessor's directives to included if found.

configure.ac
sys/msdk/gstmsdkh265dec.c
sys/msdk/gstmsdkh265enc.c
sys/msdk/gstmsdkmjpegdec.c
sys/msdk/gstmsdkvp8dec.c
sys/msdk/gstmsdkvp8enc.c
sys/msdk/gstmsdkvp9dec.c
sys/msdk/meson.build
sys/msdk/msdk.h
sys/msdk/msdk_libva.h

index 3497d67..0fc7154 100644 (file)
@@ -1058,7 +1058,9 @@ AG_GST_CHECK_FEATURE(MSDK, [Intel MediaSDK], msdk, [
     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])
+      MFX_INCDIR="`$PKG_CONFIG --variable=includedir libmfx`"
+      MSDK_CFLAGS="-I$MFX_INCDIR/mfx"
+      AC_SUBST(MSDK_CFLAGS)
     fi
     CPPFLAGS="$save_CPPFLAGS"
   ], [
@@ -1070,7 +1072,7 @@ AG_GST_CHECK_FEATURE(MSDK, [Intel MediaSDK], msdk, [
             [AS_IF([test "x$MFX_HOME" != "x"],
                    [MSDK_PREFIX="$MFX_HOME"],
                    [MSDK_PREFIX="/opt/intel/media"])])
-    MSDK_CFLAGS="-I$MSDK_PREFIX/include"
+    MSDK_CFLAGS="-I$MSDK_PREFIX/include -I$MSDK_PREFIX/include/mfx"
     MSDK_LIBS="-L$MSDK_PREFIX/lib/lin_x64 -L$MSDK_PREFIX/lib/x64 -L$MSDK_PREFIX/lib64 -L$MSDK_PREFIX/lib -lmfx -ldl"
     AC_SUBST(MSDK_CFLAGS)
     AC_SUBST(MSDK_LIBS)
@@ -1113,21 +1115,12 @@ AG_GST_CHECK_FEATURE(MSDK, [Intel MediaSDK], msdk, [
   [
     #include <mfxplugin.h>
   ])
-  dnl check the availability of vp9 apis in PREFIX/include/mfx
-  AC_CHECK_HEADER(mfx/mfxvp9.h, [HAVE_MFX_MFXVP9_H=1], [HAVE_MFX_MFXVP9_H=0],
-  [
-    #include <mfx/mfxplugin.h>
-  ])
-  if test $HAVE_MFX_MFXVP9_H -eq 1; then
-    AC_DEFINE(HAVE_MFX_MFXVP9_H, 1, [Define if mfx/mfxdefs.h available])
-  fi
 
-  if test $HAVE_MFXVP9_H -eq 1 \
-    -o $HAVE_MFX_MFXVP9_H -eq 1; then
+  if test $HAVE_MFXVP9_H -eq 1; then
       USE_MSDK_VP9_DEC=1
       AC_DEFINE(USE_MSDK_VP9_DEC, 1, [Define if MediaSDK VP9 decoder api is available])
   fi
-  ], [USE_MSDK_VP9_DEC=0])
+], [USE_MSDK_VP9_DEC=0])
 AM_CONDITIONAL(USE_MSDK_LIBVA,
     test "x$HAVE_MSDK" = "xyes" -a "x$HAVE_LIBVA_DRM" = "xyes")
 AM_CONDITIONAL([USE_MSDK_VP9_DEC],
index d370948..fd7e27f 100644 (file)
 #  include <config.h>
 #endif
 
-#ifdef HAVE_MFX_MFXDEFS_H
-#  include <mfx/mfxplugin.h>
-#else
-#  include "mfxplugin.h"
-#endif
+#include <mfxplugin.h>
 
 #include "gstmsdkh265dec.h"
 #include "gstmsdkvideomemory.h"
index c45bd65..842fe6d 100644 (file)
 #  include <config.h>
 #endif
 
-#ifdef HAVE_MFX_MFXDEFS_H
-#  include <mfx/mfxplugin.h>
-#else
-#  include "mfxplugin.h"
-#endif
+#include <mfxplugin.h>
 
 #include <gst/allocators/gstdmabuf.h>
 
index 84e00ef..b8f5d90 100644 (file)
 #  include <config.h>
 #endif
 
-#ifdef HAVE_MFX_MFXDEFS_H
-#  include <mfx/mfxstructures.h>
-#  include <mfx/mfxjpeg.h>
-#else
-#  include "mfxstructures.h"
-#  include "mfxjpeg.h"
-#endif
+#include <mfxstructures.h>
+#include <mfxjpeg.h>
 
 #include "gstmsdkmjpegdec.h"
 
index 893ba62..92f05af 100644 (file)
 #  include <config.h>
 #endif
 
-#ifdef HAVE_MFX_MFXDEFS_H
-#  include <mfx/mfxplugin.h>
-#  include <mfx/mfxvp8.h>
-#else
-#  include "mfxplugin.h"
-#  include "mfxvp8.h"
-#endif
+#include <mfxplugin.h>
+#include <mfxvp8.h>
 
 #include "gstmsdkvp8dec.h"
 
index bc51ab5..6e6551a 100644 (file)
 #  include <config.h>
 #endif
 
-#ifdef HAVE_MFX_MFXDEFS_H
-#  include <mfx/mfxplugin.h>
-#  include <mfx/mfxvp8.h>
-#else
-#  include "mfxplugin.h"
-#  include "mfxvp8.h"
-#endif
+#include <mfxplugin.h>
+#include <mfxvp8.h>
 
 #include "gstmsdkvp8enc.h"
 
index 07df893..61a6a05 100644 (file)
 #  include <config.h>
 #endif
 
-#ifdef HAVE_MFX_MFXVP9_H
-#  include <mfx/mfxplugin.h>
-#  include <mfx/mfxvp9.h>
-#else
-#  include "mfxplugin.h"
-#  include "mfxvp9.h"
-#endif
+#include <mfxplugin.h>
+#include <mfxvp9.h>
 
 #include "gstmsdkvp9dec.h"
 
index b9f9425..363c155 100644 (file)
@@ -61,7 +61,7 @@ endif
 
 # Old versions of MediaSDK don't have the 'mfx' directory prefix
 if cxx.has_header('mfx/mfxdefs.h', args: '-I' + mfx_incdir)
-  cdata.set('HAVE_MFX_MFXDEFS_H', 1)
+  mfx_incdir = join_paths([mfx_incdir, 'mfx'])
 endif
 
 if host_machine.system() == 'windows'
index a2775a6..12b5d5a 100644 (file)
 #include <gst/gst.h>
 #include <gst/video/video.h>
 
-#ifdef HAVE_MFX_MFXDEFS_H
-#  include <mfx/mfxvideo.h>
-#else
-#  include "mfxvideo.h"
-#endif
+#include <mfxvideo.h>
 
 G_BEGIN_DECLS
 
index 691ea25..4155ebb 100644 (file)
 #include <gst/gst.h>
 #include <va/va.h>
 
-#ifdef HAVE_MFX_MFXDEFS_H
-#  include <mfx/mfxvideo.h>
-#else
-#  include "mfxvideo.h"
-#endif
+#include <mfxvideo.h>
 
 G_BEGIN_DECLS