[084/906] add a glfilterapp which holds the client draw and reshape callbacks (some...
authorJulien Isorce <julien.isorce@gmail.com>
Sun, 8 Jun 2008 02:19:43 +0000 (02:19 +0000)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 9 Dec 2017 19:31:16 +0000 (19:31 +0000)
git-svn-id: svn://svn.wobow.com/GStreamer_playground/gst-plugins-gl@496 93df14bb-0f41-7a43-8087-d3e2a2f0e464

gst-libs/gst/gl/gstgldisplay.c
gst-libs/gst/gl/gstgldisplay.h

index a67bc21..9c3adc5 100644 (file)
@@ -1332,7 +1332,38 @@ gst_gl_display_set_windowId (GstGLDisplay* display, gulong winId)
         display->textureFBOWidth, display->textureFBOHeight,
         winId,
         TRUE);
+}
+
+
+/* Called by gst_gl elements */
+void 
+gst_gl_display_resetGLcontext (GstGLDisplay* display, 
+                               gint glcontext_width, gint glcontext_height)
+{
+    static gint glheight = 0;
 
+    gst_gl_display_lock (display);
+    gst_gl_display_postMessage (GST_GL_DISPLAY_ACTION_DESTROY, display);
+    g_cond_wait (display->cond_destroy, display->mutex);
+    gst_gl_display_unlock (display);
+
+    if (g_hash_table_size (gst_gl_display_map) == 0)
+    {
+        g_thread_join (gst_gl_display_glutThread);
+        g_print ("Glut thread joined when setting winId\n");
+        gst_gl_display_glutThread = NULL;
+        g_async_queue_unref (gst_gl_display_messageQueue);
+        g_hash_table_unref  (gst_gl_display_map);
+        gst_gl_display_map = NULL;
+    }
+
+    //init opengl context
+    gst_gl_display_initGLContext (display, 
+        50, glheight++ * (glcontext_height+50) + 50, 
+        glcontext_width, glcontext_height,
+        display->textureFBOWidth, display->textureFBOHeight,
+        display->winId,
+        FALSE);
 }
 
 
index edcfca8..8bd0572 100644 (file)
@@ -252,5 +252,7 @@ void gst_gl_display_useFBO (GstGLDisplay* display, gint textureFBOWidth, gint te
 void gst_gl_display_rejectFBO (GstGLDisplay* display, guint fbo, 
                                guint depthbuffer, guint texture);
 void gst_gl_display_set_windowId (GstGLDisplay* display, gulong winId);
+void gst_gl_display_resetGLcontext (GstGLDisplay* display, 
+                                    gint glcontext_width, gint glcontext_height);
 
 #endif