summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Santos <thiago.sousa.santos@collabora.com>2013-03-19 15:55:40 -0300
committerThiago Santos <thiago.sousa.santos@collabora.com>2013-04-16 16:08:50 -0300
commitd808ced75aec6d6e3e4eb9edbd285283354899a0 (patch)
treecffff987a73425832c25a83b5fb23e27cbbf410a
parent85bf8aa92037164c2c32f65e824e7264a8138e11 (diff)
downloadgstreamer-plugins-bad-d808ced75aec6d6e3e4eb9edbd285283354899a0.tar.gz
egladaptation: removing egl specific error handling
Move egl specific error handling to egl code
-rw-r--r--ext/eglgles/gstegladaptation.c16
-rw-r--r--ext/eglgles/gstegladaptation.h1
-rw-r--r--ext/eglgles/gstegladaptation_eagl.m4
-rw-r--r--ext/eglgles/gstegladaptation_egl.c18
4 files changed, 20 insertions, 19 deletions
diff --git a/ext/eglgles/gstegladaptation.c b/ext/eglgles/gstegladaptation.c
index 17bf929c9..db06816a5 100644
--- a/ext/eglgles/gstegladaptation.c
+++ b/ext/eglgles/gstegladaptation.c
@@ -315,27 +315,11 @@ gst_egl_adaptation_context_free (GstEglAdaptationContext * ctx)
}
gboolean
-got_egl_error (const char *wtf)
-{
- EGLint error;
-
- if ((error = eglGetError ()) != EGL_SUCCESS) {
- GST_CAT_DEBUG (GST_CAT_DEFAULT, "EGL ERROR: %s returned 0x%04x", wtf,
- error);
- return TRUE;
- }
-
- return FALSE;
-}
-
-gboolean
gst_egl_adaptation_choose_config (GstEglAdaptationContext * ctx)
{
gint egl_configs;
if (!_gst_egl_choose_config (ctx, FALSE, &egl_configs)) {
- got_egl_error ("eglChooseConfig");
- GST_ERROR_OBJECT (ctx->element, "eglChooseConfig failed");
goto HANDLE_EGL_ERROR;
}
diff --git a/ext/eglgles/gstegladaptation.h b/ext/eglgles/gstegladaptation.h
index 95661f583..f648e29d1 100644
--- a/ext/eglgles/gstegladaptation.h
+++ b/ext/eglgles/gstegladaptation.h
@@ -172,7 +172,6 @@ gint gst_egl_adaptation_context_get_surface_width (GstEglAdaptationContext * ctx
gint gst_egl_adaptation_context_get_surface_height (GstEglAdaptationContext * ctx);
/* error handling */
-gboolean got_egl_error (const char *wtf);
gboolean got_gl_error (const char *wtf);
/* platform specific helpers */
diff --git a/ext/eglgles/gstegladaptation_eagl.m b/ext/eglgles/gstegladaptation_eagl.m
index 144a14102..d5e8b9c5e 100644
--- a/ext/eglgles/gstegladaptation_eagl.m
+++ b/ext/eglgles/gstegladaptation_eagl.m
@@ -119,7 +119,7 @@ gst_egl_adaptation_context_make_current (GstEglAdaptationContext * ctx,
GST_DEBUG_OBJECT (ctx->element, "Attaching context to thread %p",
g_thread_self ());
if ([EAGLContext setCurrentContext: ctx->eagl_context] == NO) {
- got_egl_error ("eglMakeCurrent");
+ got_gl_error ("setCurrentContext");
GST_ERROR_OBJECT (ctx->element, "Couldn't bind context");
return FALSE;
}
@@ -127,7 +127,7 @@ gst_egl_adaptation_context_make_current (GstEglAdaptationContext * ctx,
GST_DEBUG_OBJECT (ctx->element, "Detaching context from thread %p",
g_thread_self ());
if ([EAGLContext setCurrentContext: nil] == NO) {
- got_egl_error ("eglMakeCurrent");
+ got_gl_error ("setCurrentContext");
GST_ERROR_OBJECT (ctx->element, "Couldn't unbind context");
return FALSE;
}
diff --git a/ext/eglgles/gstegladaptation_egl.c b/ext/eglgles/gstegladaptation_egl.c
index b1367c423..2cc028600 100644
--- a/ext/eglgles/gstegladaptation_egl.c
+++ b/ext/eglgles/gstegladaptation_egl.c
@@ -108,6 +108,20 @@ struct _GstEglGlesRenderContext
#define EGL_SANE_DAR_MIN ((EGL_DISPLAY_SCALING)/10)
#define EGL_SANE_DAR_MAX ((EGL_DISPLAY_SCALING)*10)
+static gboolean
+got_egl_error (const char *wtf)
+{
+ EGLint error;
+
+ if ((error = eglGetError ()) != EGL_SUCCESS) {
+ GST_CAT_DEBUG (GST_CAT_DEFAULT, "EGL ERROR: %s returned 0x%04x", wtf,
+ error);
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
gboolean
gst_egl_adaptation_init_display (GstEglAdaptationContext * ctx)
{
@@ -190,6 +204,10 @@ _gst_egl_choose_config (GstEglAdaptationContext * ctx, gboolean try_only,
ret = eglChooseConfig (ctx->eglglesctx->display,
eglglessink_RGBA8888_attribs, config, 1, &cfg_number) != EGL_FALSE;
+ if (!ret) {
+ got_egl_error ("eglChooseConfig");
+ GST_ERROR_OBJECT (ctx->element, "eglChooseConfig failed");
+ }
if (num_configs)
*num_configs = cfg_number;