glupload: adjust memory offset calculation for dmabuf buffers
authorGeorge Kiagiadakis <george.kiagiadakis@collabora.com>
Mon, 13 Mar 2017 13:48:33 +0000 (15:48 +0200)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 9 Dec 2017 19:32:27 +0000 (19:32 +0000)
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

gst-libs/gst/gl/gstglupload.c

index 9890acd..f19cd6f 100644 (file)
@@ -652,7 +652,8 @@ _dma_buf_upload_accept (gpointer impl, GstBuffer * buffer, GstCaps * in_caps,
     /* otherwise create one and cache it */
     dmabuf->eglimage[i] =
         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])
       return FALSE;