eglglessink: Add proper check for X11

This commit is contained in:
Sebastian Dröge 2012-12-26 10:20:21 +01:00
parent 8a63face0e
commit 7efa7b9698
2 changed files with 10 additions and 26 deletions

View 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 dnl Needed by plugins that use g_module_*() API
PKG_CHECK_MODULES(GMODULE_NO_EXPORT, gmodule-no-export-2.0) 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 HAVE_X11=NO
PKG_CHECK_MODULES(X11, x11, HAVE_X11=yes, HAVE_X11=no) PKG_CHECK_MODULES(X11, x11, HAVE_X11=yes, HAVE_X11=no)
AC_SUBST(X11_LIBS) AC_SUBST(X11_LIBS)

View file

@ -55,7 +55,7 @@
#include <gst/gst.h> #include <gst/gst.h>
#include "video_platform_wrapper.h" #include "video_platform_wrapper.h"
#ifndef __BIONIC__ #ifdef HAVE_X11
#include <X11/Xlib.h> #include <X11/Xlib.h>
#endif #endif
@ -67,12 +67,12 @@ gboolean
platform_wrapper_init (void) platform_wrapper_init (void)
{ {
GST_DEBUG_CATEGORY_INIT (eglgles_platform_wrapper, GST_DEBUG_CATEGORY_INIT (eglgles_platform_wrapper,
"EglGles Platform Wrapper", 0, "eglglessink-platform", 0,
"Platform dependent native-window utility routines for EglGles"); "Platform dependent native-window utility routines for EglGles");
return TRUE; return TRUE;
} }
#ifndef __BIONIC__ #ifdef HAVE_X11
EGLNativeWindowType EGLNativeWindowType
platform_create_native_window (gint width, gint height) platform_create_native_window (gint width, gint height)
{ {
@ -83,7 +83,7 @@ platform_create_native_window (gint width, gint height)
d = XOpenDisplay (NULL); d = XOpenDisplay (NULL);
if (d == 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; return (EGLNativeWindowType) 0;
} }
@ -104,30 +104,14 @@ platform_destroy_native_window (EGLNativeDisplayType display,
XDestroyWindow (display, window); XDestroyWindow (display, window);
return TRUE; return TRUE;
} }
#endif
/* XXX: Missing implementation */ #if !defined(HAVE_X11)
EGLint * /* Dummy functions for creating a native Window */
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.
*/
EGLNativeWindowType EGLNativeWindowType
platform_create_native_window (gint width, gint height) platform_create_native_window (gint width, gint height)
{ {
/* XXX: There was one example on AOSP that was using something GST_ERROR ("Can't create native window");
* along the lines of window = android_createDisplaySurface();
* but wasn't working properly.
*/
GST_CAT_ERROR (GST_CAT_DEFAULT, "Android: Can't create native window");
return (EGLNativeWindowType) 0; return (EGLNativeWindowType) 0;
} }
@ -135,7 +119,7 @@ gboolean
platform_destroy_native_window (EGLNativeDisplayType display, platform_destroy_native_window (EGLNativeDisplayType display,
EGLNativeWindowType window) EGLNativeWindowType window)
{ {
GST_CAT_ERROR (GST_CAT_DEFAULT, "Android: Can't destroy native window"); GST_ERROR ("Can't destroy native window");
return TRUE; return TRUE;
} }