configure: check vaapi/DXVA availability. 95/27495/3
authorgunsoo83.kim <gunsoo83.kim@samsung.com>
Fri, 12 Sep 2014 08:06:22 +0000 (17:06 +0900)
committergunsoo83.kim <gunsoo83.kim@samsung.com>
Mon, 15 Sep 2014 06:54:37 +0000 (15:54 +0900)
- disable vaapi feature to verify

Change-Id: I82937441c7e989d5c526677cacdb02bde4f431a7
Signed-off-by: gunsoo83.kim <gunsoo83.kim@samsung.com>
configure
tizen/emulator_configure.sh
tizen/src/hw/pci/Makefile.objs
tizen/src/hw/pci/maru_brillcodec_device.c

index 8e06cf8986dd00cceef5ac7acfc70d3e37b9b82b..b4feed2ca8f4972d7ef87f606376fd5d8fdc9951 100755 (executable)
--- a/configure
+++ b/configure
@@ -325,6 +325,8 @@ maru="no"
 shm="no"
 libav="no"
 libpng="no"
+dxva2="no"
+vaapi="no"
 #
 glusterfs=""
 glusterfs_discard="no"
@@ -1105,6 +1107,10 @@ for opt do
   ;;
   --enable-libpng) libpng="yes"
   ;;
+  --enable-dxva2) dxva2="yes"
+  ;;
+  --enable-vaapi) vaapi="yes"
+  ;;
 #
   --disable-glusterfs) glusterfs="no"
   ;;
@@ -1421,6 +1427,8 @@ TIZEN-maru options:
   --enable-libav           enable libav library
   --disable-libav          disable libav library
   --enable-libpng          enable png library
+  --enable-dxva2           enable dxva2 support
+  --enable-vaapi           enable vaapi support
 
 NOTE: The object files are built at the place where configure is launched
 EOF
@@ -3976,6 +3984,53 @@ if compile_prog "" "" ; then
     getauxval=yes
 fi
 
+########################################
+# check if dxva2 is available.
+
+if test "$dxva2" = "yes" ; then
+    dxva2="no"
+if test "$mingw32" = "yes" ; then
+cat > $TMPC << EOF
+#include <d3d9.h>
+#include <dxva2api.h>
+int main(void) {
+#if !defined(IDirect3D9_CreateDevice) || \
+    !defined(IDirect3DDeviceManager9_ResetDevice)
+#error No DXVA2 support
+#endif
+    return 0;
+}
+EOF
+if compile_prog "" "" ; then
+    dxva2="yes"
+fi
+else
+    error_exit "DXVA2 is supported only on Windows"
+fi
+fi
+
+########################################
+# check if vaapi is available.
+
+if test "$vaapi" = "yes" ; then
+    vaapi="no"
+if test "$linux" = "yes" ; then
+    if $pkg_config libva --exists; then
+    if $pkg_config libva-x11 --exists; then
+        libva_cflags=`$pkg_config --cflags libva`
+        libva_libs=`$pkg_config --libs libva`
+        libva_x11_cflags=`$pkg_config --cflags libva-x11`
+        libva_x11_libs=`$pkg_config --libs libva-x11`
+
+        libs_softmmu="$libva_libs $libva_x11_libs $libs_softmmu"
+        vaapi="yes"
+    fi
+    fi
+else
+    error_exit "VAAPI is supported only on Linux"
+fi
+fi
+
 ##########################################
 # libav probe
 
@@ -4354,6 +4409,8 @@ echo "TIZEN-maru support $maru"
 echo "TIZEN-maru shared framebuffer support $shm"
 echo "TIZEN-maru libav support $libav"
 echo "TIZEN-maru libpng support $libpng"
+echo "TIZEN-maru DXVA2 support $dxva2"
+echo "TIZEN-maru vaapi support $vaapi"
 #
 
 if test "$sdl_too_old" = "yes"; then
@@ -4848,6 +4905,13 @@ if test "$libpng" = "yes" ; then
   echo "CONFIG_PNG=y" >> $config_host_mak
   echo "LIBPNG_CFLAGS=$libpng_cflags" >> $config_host_mak
 fi
+if test "$dxva2" = "yes" ; then
+  echo "CONFIG_DXVA2=y" >> $config_host_mak
+fi
+if test "$vaapi" = "yes" ; then
+  echo "CONFIG_VAAPI=y" >> $config_host_mak
+  echo "LIBVA_CFLAGS=$libva_cflags $libva_x11_cflags" >> $config_host_mak
+fi
 
 # TPM passthrough support?
 if test "$tpm" = "yes"; then
index e8730a3f7d206ea93ba9c8208e2d0bf0e7c36e05..b56cff0f78afa68d5c3bb2e53ebad110b30af2fc 100755 (executable)
@@ -222,6 +222,7 @@ exec ./configure \
  --audio-drv-list=winwave \
  --enable-hax \
  --disable-vnc \
+ --enable-dxva2 \
  $CONFIGURE_APPEND \
 ;;
 Darwin*)
index 0d2d6b3b769eb186be6ec24d1b98a1133b35d585..511f6ae6415356949a18edd89516f99a1dedb7eb 100644 (file)
@@ -3,6 +3,8 @@ ifdef CONFIG_LINUX
 LIBS += -ldl
 endif
 obj-y += maru_brillcodec.o
+obj-$(CONFIG_DXVA2) += maru_dxva2_plugin.o
+obj-$(CONFIG_VAAPI) += maru_brillcodec_vaapi.o
 
 obj-y += maru_brightness.o
 
@@ -12,7 +14,6 @@ obj-y += maru_camera_linux_pci.o
 LIBS += -lv4l2 -lv4lconvert
 endif
 ifdef CONFIG_WIN32
-obj-y += maru_dxva2_plugin.o
 obj-y += maru_camera_win32_pci.o
 LIBS += -lole32 -loleaut32 -luuid -lstrmiids
 endif
@@ -26,4 +27,9 @@ endif
 
 maru_brillcodec.o-cflags := $(LIBAV_CFLAGS)
 maru_brillcodec_device.o-cflags := $(LIBAV_CFLAGS)
+ifdef CONFIG_DXVA2
 maru_dxva2_plugin.o-cflags := $(LIBAV_CFLAGS)
+endif
+ifdef CONFIG_VAAPI
+maru_brillcodec_vaapi.o-cflags := $(LIBAV_CFLAGS) $(LIBVA_CFLAGS)
+endif
index 21ee8811c7ef4af27b3f928d6bd8b690b8b1be17..8e28171e196c4aa22b4aa0559ee9996484075521 100644 (file)
@@ -30,7 +30,6 @@
 
 //FIXME
 //#define CONFIG_VAAPI
-//#define CONFIG_DXVA2
 
 #ifdef CONFIG_VAAPI
 #include "dlfcn.h"