From 537d1996e91b035b1f6783db84c0fa15cd674afa Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Tue, 24 May 2016 23:38:22 +1000 Subject: [PATCH] gldisplay: add some debugging about retrieving GL contexts --- gst-libs/gst/gl/gstgldisplay.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/gl/gstgldisplay.c b/gst-libs/gst/gl/gstgldisplay.c index 8f57e70fd8..ee8febc4b9 100644 --- a/gst-libs/gst/gl/gstgldisplay.c +++ b/gst-libs/gst/gl/gstgldisplay.c @@ -437,8 +437,11 @@ _get_gl_context_for_thread_unlocked (GstGLDisplay * display, GThread * thread) continue; } - if (thread == NULL) + if (thread == NULL) { + GST_DEBUG_OBJECT (display, "Returning GL context %" GST_PTR_FORMAT " for " + "NULL thread", context); return context; + } context_thread = gst_gl_context_get_thread (context); if (thread != context_thread) { @@ -451,9 +454,13 @@ _get_gl_context_for_thread_unlocked (GstGLDisplay * display, GThread * thread) if (context_thread) g_thread_unref (context_thread); + + GST_DEBUG_OBJECT (display, "Returning GL context %" GST_PTR_FORMAT " for " + "thread %p", context, thread); return context; } + GST_DEBUG_OBJECT (display, "No GL context for thread %p", thread); return NULL; } @@ -549,11 +556,16 @@ gst_gl_display_add_context (GstGLDisplay * display, GstGLContext * context) /* adding the same context is a no-op */ if (context == collision) { + GST_LOG_OBJECT (display, "Attempting to add the same GL context %" + GST_PTR_FORMAT ". Ignoring", context); + collision = NULL; ret = TRUE; goto out; } if (_check_collision (context, collision)) { + GST_DEBUG_OBJECT (display, "Collision detected adding GL context " + "%" GST_PTR_FORMAT, context); ret = FALSE; goto out; } @@ -562,6 +574,7 @@ gst_gl_display_add_context (GstGLDisplay * display, GstGLContext * context) ref = g_new0 (GWeakRef, 1); g_weak_ref_init (ref, context); + GST_DEBUG_OBJECT (display, "Adding GL context %" GST_PTR_FORMAT, context); display->priv->contexts = g_list_prepend (display->priv->contexts, ref); out: