glupload: adjust memory offset calculation for dmabuf buffers

The data in the dmabuf fd may not start from byte 0, therefore
we need to inform EGL about this additional offset.

https://bugzilla.gnome.org/show_bug.cgi?id=779790
This commit is contained in:
George Kiagiadakis 2017-03-13 15:48:33 +02:00 committed by Tim-Philipp Müller
parent 61ee2685c0
commit 6b6a8a46b5

View file

@ -652,7 +652,8 @@ _dma_buf_upload_accept (gpointer impl, GstBuffer * buffer, GstCaps * in_caps,
/* otherwise create one and cache it */ /* otherwise create one and cache it */
dmabuf->eglimage[i] = dmabuf->eglimage[i] =
gst_egl_image_from_dmabuf (dmabuf->upload->context, gst_egl_image_from_dmabuf (dmabuf->upload->context,
gst_dmabuf_memory_get_fd (mems[i]), in_info, i, mems_skip[i]); gst_dmabuf_memory_get_fd (mems[i]), in_info, i,
mems[i]->offset + mems_skip[i]);
if (!dmabuf->eglimage[i]) if (!dmabuf->eglimage[i])
return FALSE; return FALSE;