From 6b6a8a46b5fe240fe4cd066dbcba4e2620f55695 Mon Sep 17 00:00:00 2001 From: George Kiagiadakis Date: Mon, 13 Mar 2017 15:48:33 +0200 Subject: [PATCH] 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 --- gst-libs/gst/gl/gstglupload.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/gl/gstglupload.c b/gst-libs/gst/gl/gstglupload.c index 9890acd795..f19cd6ff5e 100644 --- a/gst-libs/gst/gl/gstglupload.c +++ b/gst-libs/gst/gl/gstglupload.c @@ -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;