summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReynaldo H. Verdejo Pinochet <reynaldo@collabora.com>2012-09-06 21:34:43 -0300
committerReynaldo H. Verdejo Pinochet <reynaldo@collabora.com>2012-09-06 21:34:43 -0300
commit44b722fed257f0ee9be7195e04565dc3d1cb2b72 (patch)
tree510d71ec23e883e9bf91188e9167d95eddaae09e
parent116990318f4e3cbf7c8d72602951368850f4677c (diff)
Add check for suported EGL version
-rw-r--r--sys/android/gstvidroidsink.c16
-rw-r--r--sys/android/gstvidroidsink.h3
2 files changed, 14 insertions, 5 deletions
diff --git a/sys/android/gstvidroidsink.c b/sys/android/gstvidroidsink.c
index e8247a122..57346d6c2 100644
--- a/sys/android/gstvidroidsink.c
+++ b/sys/android/gstvidroidsink.c
@@ -956,16 +956,22 @@ gst_vidroidsink_init_egl_display (GstViDroidSink * vidroidsink)
goto HANDLE_EGL_ERROR;
}
- GST_DEBUG_OBJECT (vidroidsink, "EGL version %d.%d", egl_major, egl_minor);
+ /* Check against required EGL version */
+ if (egl_major < GST_VIDROIDSINK_EGL_MIN_VERSION) {
+ GST_ERROR_OBJECT (vidroidsink, "EGL v%d\n needed, but you only have v%d.%d",
+ GST_VIDROIDSINK_EGL_MIN_VERSION, egl_major, egl_minor);
+ goto HANDLE_ERROR;
+ }
+
+ GST_INFO_OBJECT (vidroidsink, "System reports EGL version v%d.%d",
+ egl_major, egl_minor);
GST_DEBUG_OBJECT (vidroidsink, "Available EGL extensions: %s",
eglQueryString (vidroidsink->display, EGL_EXTENSIONS));
- /* XXX: Check for vidroidsink's EGL needed versions */
-
if (!eglChooseConfig (vidroidsink->display, vidroidsink_RGB16_config,
&vidroidsink->config, 1, &egl_configs)) {
- GST_ERROR_OBJECT (vidroidsink, "eglChooseConfig failed\n");
- goto HANDLE_ERROR;
+ GST_ERROR_OBJECT (vidroidsink, "eglChooseConfig failed");
+ goto HANDLE_EGL_ERROR;
}
eglBindAPI (EGL_OPENGL_ES_API);
diff --git a/sys/android/gstvidroidsink.h b/sys/android/gstvidroidsink.h
index 250f0a192..e33398356 100644
--- a/sys/android/gstvidroidsink.h
+++ b/sys/android/gstvidroidsink.h
@@ -66,6 +66,9 @@ G_BEGIN_DECLS
/* XXX: Harcoded format. Should be runtime built latter on. */
#define GST_VIDROIDSINK_IMAGE_RGB565 1
#define GST_VIDROIDSINK_IMAGE_NOFMT -1
+
+#define GST_VIDROIDSINK_EGL_MIN_VERSION 1
+
typedef struct _GstViDroidBuffer GstViDroidBuffer;
typedef struct _GstViDroidBufferClass GstViDroidBufferClass;