diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2017-06-12 22:29:01 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2017-06-12 22:30:21 +0300 |
commit | 428f2fad4b18ee7f09d8f4c57a7309b4e3b11bc8 (patch) | |
tree | 9decf82ad80a31bbfdcc0e9b9bf5f3089bf3a2ae /gst-libs | |
parent | 14f8808bf2d8b8e7fd2988a9622a6ce059a89b1c (diff) | |
download | gstreamer-plugins-bad-428f2fad4b18ee7f09d8f4c57a7309b4e3b11bc8.tar.gz |
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.
Diffstat (limited to 'gst-libs')
-rw-r--r-- | gst-libs/gst/gl/gstglupload.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gst-libs/gst/gl/gstglupload.c b/gst-libs/gst/gl/gstglupload.c index 2b51bfad8..496ca86bc 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); |