Revert "[880/906] glimagesink: remove unused stored_buffer field"
authorMatthew Waters <ystreet00@gmail.com>
Fri, 30 May 2014 01:35:04 +0000 (11:35 +1000)
committerMatthew Waters <ystreet00@gmail.com>
Fri, 30 May 2014 01:35:04 +0000 (11:35 +1000)
This reverts commit af3a68db7dc473fb6903c18966b39e4c3f1464d7.

Conflicts:
ext/gl/gstglimagesink.c

https://bugzilla.gnome.org/show_bug.cgi?id=723529

ext/gl/gstglimagesink.c
ext/gl/gstglimagesink.h

index 3e8b996..2f40fe1 100644 (file)
@@ -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 */
index 2f02836..0d9c44e 100644 (file)
@@ -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