From: Sebastian Dröge Date: Mon, 12 Jun 2017 19:29:01 +0000 (+0300) Subject: glupload: Fix DirectVIV uploader for formats with a single plane X-Git-Tag: 1.16.2~955^2~79 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=59db0ee4e1699b316ecf31befa8d930f3278d45d;p=platform%2Fupstream%2Fgst-plugins-base.git glupload: Fix DirectVIV uploader for formats with a single plane We have to pass the "height" as height = vmeta->offset[1] / width to the API, which of course does not work well for formats with only a single plane. Use the whole memory size instead of the offset in that case. --- diff --git a/gst-libs/gst/gl/gstglupload.c b/gst-libs/gst/gl/gstglupload.c index 810f4fa..7bc1b6d 100644 --- a/gst-libs/gst/gl/gstglupload.c +++ b/gst-libs/gst/gl/gstglupload.c @@ -1446,10 +1446,16 @@ _directviv_upload_perform_gl_thread (GstGLContext * context, vmeta = gst_buffer_get_video_meta (directviv->inbuf); if (vmeta) { width = vmeta->stride[0]; - height = vmeta->offset[1] / width; + if (GST_VIDEO_INFO_N_PLANES (in_info) == 1) + height = gst_memory_get_sizes (in_mem, NULL, NULL) / width; + else + height = vmeta->offset[1] / width; } else { width = GST_VIDEO_INFO_PLANE_STRIDE (in_info, 0); - height = GST_VIDEO_INFO_PLANE_OFFSET (in_info, 1) / width; + if (GST_VIDEO_INFO_N_PLANES (in_info) == 1) + height = gst_memory_get_sizes (in_mem, NULL, NULL) / width; + else + height = GST_VIDEO_INFO_PLANE_OFFSET (in_info, 1) / width; } width /= GST_VIDEO_INFO_COMP_PSTRIDE (in_info, 0);