glbufferpool: Fix offset for odd height
authorNicolas Dufresne <nicolas.dufresne@collabora.co.uk>
Sun, 1 Mar 2015 14:43:32 +0000 (09:43 -0500)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 9 Dec 2017 19:31:56 +0000 (19:31 +0000)
We also need to recalculate the offset, since otherwise the frame
mapping will be forward two lines in the U and V planes (I420) due
to gst_video_info_align() round up the Y plane to a even number of
lines.

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

gst-libs/gst/gl/gstglbufferpool.c

index 6cb2957..6dd496c 100644 (file)
@@ -172,9 +172,10 @@ gst_gl_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config)
     glpool->upload = gst_gl_upload_meta_new (glpool->context);
   }
 
-  /* Recalulate the size as we don't add padding between planes. */
+  /* Recalulate the size and offset as we don't add padding between planes. */
   priv->info.size = 0;
   for (p = 0; p < GST_VIDEO_INFO_N_PLANES (&priv->info); p++) {
+    priv->info.offset[p] = priv->info.size;
     priv->info.size +=
         gst_gl_get_plane_data_size (&priv->info, &priv->valign, p);
   }