From: Julien Isorce Date: Mon, 19 May 2008 18:45:46 +0000 (+0000) Subject: [070/906] implement and fix onClose: when a user click on the cross of an internal... X-Git-Tag: 1.19.3~511^2~1989^2~2189 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7ce0cbad40f8cc216f5930a147a20a64857e6aac;p=platform%2Fupstream%2Fgstreamer.git [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 --- diff --git a/gst-libs/gst/gl/gstgldisplay.c b/gst-libs/gst/gl/gstgldisplay.c index 1f2604c..c92e200 100644 --- a/gst-libs/gst/gl/gstgldisplay.c +++ b/gst-libs/gst/gl/gstgldisplay.c @@ -25,16 +25,6 @@ #include "gstgldisplay.h" #include - -//------------------------------------------------------------------------------------------- -//--------------------------- 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); } diff --git a/gst-libs/gst/gl/gstgldisplay.h b/gst-libs/gst/gl/gstgldisplay.h index 9130d30..f45d4dc 100644 --- a/gst-libs/gst/gl/gstgldisplay.h +++ b/gst-libs/gst/gl/gstgldisplay.h @@ -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