From 1cb7e22b98cfb0fd2b0777a08493a974c5202ed3 Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Fri, 30 May 2014 11:35:04 +1000 Subject: [PATCH] Revert "[880/906] glimagesink: remove unused stored_buffer field" This reverts commit af3a68db7dc473fb6903c18966b39e4c3f1464d7. Conflicts: ext/gl/gstglimagesink.c https://bugzilla.gnome.org/show_bug.cgi?id=723529 --- ext/gl/gstglimagesink.c | 10 ++++++++-- ext/gl/gstglimagesink.h | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ext/gl/gstglimagesink.c b/ext/gl/gstglimagesink.c index 3e8b996..2f40fe1 100644 --- a/ext/gl/gstglimagesink.c +++ b/ext/gl/gstglimagesink.c @@ -269,10 +269,11 @@ gst_glimage_sink_init (GstGLImageSink * glimage_sink) glimage_sink->clientReshapeCallback = NULL; glimage_sink->clientDrawCallback = NULL; glimage_sink->client_data = NULL; - glimage_sink->keep_aspect_ratio = TRUE; - glimage_sink->par_n = 1; + glimage_sink->keep_aspect_ratio = FALSE; + glimage_sink->par_n = 0; glimage_sink->par_d = 1; glimage_sink->pool = NULL; + glimage_sink->stored_buffer = NULL; glimage_sink->redisplay_texture = 0; g_mutex_init (&glimage_sink->drawing_lock); @@ -540,6 +541,10 @@ gst_glimage_sink_change_state (GstElement * element, GstStateChange transition) */ GST_GLIMAGE_SINK_LOCK (glimage_sink); glimage_sink->redisplay_texture = 0; + if (glimage_sink->stored_buffer) { + gst_buffer_unref (glimage_sink->stored_buffer); + glimage_sink->stored_buffer = NULL; + } GST_GLIMAGE_SINK_UNLOCK (glimage_sink); if (glimage_sink->upload) { @@ -768,6 +773,7 @@ gst_glimage_sink_show_frame (GstVideoSink * vsink, GstBuffer * buf) /* Avoid to release the texture while drawing */ GST_GLIMAGE_SINK_LOCK (glimage_sink); glimage_sink->redisplay_texture = glimage_sink->next_tex; + gst_buffer_replace (&glimage_sink->stored_buffer, buf); GST_GLIMAGE_SINK_UNLOCK (glimage_sink); /* Ask the underlying window to redraw its content */ diff --git a/ext/gl/gstglimagesink.h b/ext/gl/gstglimagesink.h index 2f02836..0d9c44e 100644 --- a/ext/gl/gstglimagesink.h +++ b/ext/gl/gstglimagesink.h @@ -79,6 +79,7 @@ struct _GstGLImageSink /* avoid replacing the stored_buffer while drawing */ GMutex drawing_lock; + GstBuffer *stored_buffer; GLuint redisplay_texture; #if GST_GL_HAVE_GLES2 -- 2.7.4