kmssink: adjust memory offset calculation for dmabuf buffers

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

https://bugzilla.gnome.org/show_bug.cgi?id=779790
This commit is contained in:
George Kiagiadakis 2017-03-13 16:06:53 +02:00
parent 20d4aca0d4
commit 4757ec8860

View file

@ -1090,6 +1090,10 @@ gst_kms_sink_import_dmabuf (GstKMSSink * self, GstBuffer * inbuf,
mems[i] = gst_buffer_peek_memory (inbuf, mems_idx[i]);
/* adjust for memory offset, in case data does not
* start from byte 0 in the dmabuf fd */
mems_skip[i] += mems[i]->offset;
/* And all memory found must be dmabuf */
if (!gst_is_dmabuf_memory (mems[i]))
return FALSE;