Commit 428f2fad authored by Sebastian Dröge's avatar Sebastian Dröge 🍵
Browse files

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.
parent 14f8808b
...@@ -1446,9 +1446,15 @@ _directviv_upload_perform_gl_thread (GstGLContext * context, ...@@ -1446,9 +1446,15 @@ _directviv_upload_perform_gl_thread (GstGLContext * context,
vmeta = gst_buffer_get_video_meta (directviv->inbuf); vmeta = gst_buffer_get_video_meta (directviv->inbuf);
if (vmeta) { if (vmeta) {
width = vmeta->stride[0]; width = vmeta->stride[0];
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; height = vmeta->offset[1] / width;
} else { } else {
width = GST_VIDEO_INFO_PLANE_STRIDE (in_info, 0); width = GST_VIDEO_INFO_PLANE_STRIDE (in_info, 0);
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; height = GST_VIDEO_INFO_PLANE_OFFSET (in_info, 1) / width;
} }
width /= GST_VIDEO_INFO_COMP_PSTRIDE (in_info, 0); width /= GST_VIDEO_INFO_COMP_PSTRIDE (in_info, 0);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment