eglglessink: Add proper check for X11
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Wed, 26 Dec 2012 09:20:21 +0000 (10:20 +0100)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Wed, 26 Dec 2012 09:21:34 +0000 (10:21 +0100)
configure.ac
ext/eglgles/video_platform_wrapper.c

index a3acfa1..461f8f1 100644 (file)
@@ -237,7 +237,7 @@ PKG_CHECK_MODULES(GMODULE_EXPORT, gmodule-export-2.0, HAVE_GMODULE_EXPORT=yes, H
 dnl Needed by plugins that use g_module_*() API
 PKG_CHECK_MODULES(GMODULE_NO_EXPORT, gmodule-no-export-2.0)
 
-dnl x11 is optional for librfb
+dnl x11 is optional for librfb and eglglessink
 HAVE_X11=NO
 PKG_CHECK_MODULES(X11, x11, HAVE_X11=yes, HAVE_X11=no)
 AC_SUBST(X11_LIBS)
index f7139a3..8fab9d6 100644 (file)
@@ -55,7 +55,7 @@
 #include <gst/gst.h>
 #include "video_platform_wrapper.h"
 
-#ifndef __BIONIC__
+#ifdef HAVE_X11
 #include <X11/Xlib.h>
 #endif
 
@@ -67,12 +67,12 @@ gboolean
 platform_wrapper_init (void)
 {
   GST_DEBUG_CATEGORY_INIT (eglgles_platform_wrapper,
-      "EglGles Platform Wrapper", 0,
+      "eglglessink-platform", 0,
       "Platform dependent native-window utility routines for EglGles");
   return TRUE;
 }
 
-#ifndef __BIONIC__
+#ifdef HAVE_X11
 EGLNativeWindowType
 platform_create_native_window (gint width, gint height)
 {
@@ -83,7 +83,7 @@ platform_create_native_window (gint width, gint height)
 
   d = XOpenDisplay (NULL);
   if (d == NULL) {
-    GST_CAT_ERROR (GST_CAT_DEFAULT, "Can't open X11 display");
+    GST_ERROR ("Can't open X11 display");
     return (EGLNativeWindowType) 0;
   }
 
@@ -104,30 +104,14 @@ platform_destroy_native_window (EGLNativeDisplayType display,
   XDestroyWindow (display, window);
   return TRUE;
 }
+#endif
 
-/* XXX: Missing implementation */
-EGLint *
-platform_crate_native_image_buffer (EGLNativeWindowType win, EGLConfig config,
-    EGLNativeDisplayType display, const EGLint * egl_attribs)
-{
-  return NULL;
-}
-
-#else
-/* Android does not support the creation of an egl window surface
- * from native code. Hence, we just return NULL here for the time
- * being. Function is left for reference as implementing it should
- * help us suport other EGL platforms.
- */
+#if !defined(HAVE_X11)
+/* Dummy functions for creating a native Window */
 EGLNativeWindowType
 platform_create_native_window (gint width, gint height)
 {
-  /* XXX: There was one example on AOSP that was using something
-   * along the lines of window = android_createDisplaySurface();
-   * but wasn't working properly.
-   */
-
-  GST_CAT_ERROR (GST_CAT_DEFAULT, "Android: Can't create native window");
+  GST_ERROR ("Can't create native window");
   return (EGLNativeWindowType) 0;
 }
 
@@ -135,7 +119,7 @@ gboolean
 platform_destroy_native_window (EGLNativeDisplayType display,
     EGLNativeWindowType window)
 {
-  GST_CAT_ERROR (GST_CAT_DEFAULT, "Android: Can't destroy native window");
+  GST_ERROR ("Can't destroy native window");
   return TRUE;
 }