[070/906] implement and fix onClose: when a user click on the cross of an internal window (there is not this issue when using the gstxoverlay interface)

git-svn-id: svn://svn.wobow.com/GStreamer_playground/gst-plugins-gl@436 93df14bb-0f41-7a43-8087-d3e2a2f0e464
This commit is contained in:
Julien Isorce 2008-05-19 18:45:46 +00:00 committed by Tim-Philipp Müller
parent ee488f6e6f
commit 7ce0cbad40
2 changed files with 14 additions and 13 deletions

View file

@ -25,16 +25,6 @@
#include "gstgldisplay.h"
#include <gst/gst.h>
//-------------------------------------------------------------------------------------------
//--------------------------- TODO ----------------------------------------------------------
// - send EOS when the user click on the window cross
//-------------------------------------------------------------------------------------------
//------------------------------------------------------------
//-------------------- Private d<>clarations ------------------
//------------------------------------------------------------
static void gst_gl_display_finalize (GObject * object);
static gpointer gst_gl_display_glutThreadFunc (GstGLDisplay* display);
static void gst_gl_display_glutCreateWindow (GstGLDisplay* display);
@ -159,6 +149,7 @@ gst_gl_display_init (GstGLDisplay *display, GstGLDisplayClass *klass)
display->glcontext_width = 0;
display->glcontext_height = 0;
display->visible = FALSE;
display->isAlive = TRUE;
display->clientReshapeCallback = NULL;
display->clientDrawCallback = NULL;
display->title = g_string_new ("OpenGL renderer ");
@ -1042,12 +1033,18 @@ gst_gl_display_videoChanged (GstGLDisplay* display, GstVideoFormat video_format,
/* Called by gst_gl elements */
void
gboolean
gst_gl_display_postRedisplay (GstGLDisplay* display)
{
gboolean isAlive = TRUE;
gst_gl_display_lock (display);
isAlive = display->isAlive;
gst_gl_display_postMessage (GST_GL_DISPLAY_ACTION_REDISPLAY, display);
gst_gl_display_unlock (display);
return isAlive;
}
@ -1207,7 +1204,10 @@ void gst_gl_display_onClose (void)
if (display == NULL) return;
g_print ("on close\n");
//gst_event_new_eos();
gst_gl_display_lock (display);
display->isAlive = FALSE;
gst_gl_display_unlock (display);
}

View file

@ -97,6 +97,7 @@ struct _GstGLDisplay {
gint glcontext_width;
gint glcontext_height;
gboolean visible;
gboolean isAlive;
//intput frame buffer object (video -> GL)
GLuint fbo;
@ -209,7 +210,7 @@ void gst_gl_display_clearTexture (GstGLDisplay* display, guint texture,
void gst_gl_display_videoChanged (GstGLDisplay* display, GstVideoFormat video_format,
gpointer data);
void gst_gl_display_postRedisplay (GstGLDisplay* display);
gboolean gst_gl_display_postRedisplay (GstGLDisplay* display);
void gst_gl_display_set_windowId (GstGLDisplay* display, gulong winId);
#endif