Commit 53705c77 authored by Philipp Zabel's avatar Philipp Zabel Committed by Nicolas Dufresne

v4l2allocator: only update non-dmabuf sizes during qbuf

Imported dmabufs already updated bytesperused during dmabuf_import.
parent 39d32b23
......@@ -1210,13 +1210,15 @@ gst_v4l2_allocator_qbuf (GstV4l2Allocator * allocator,
g_return_val_if_fail (g_atomic_int_get (&allocator->active), FALSE);
/* update sizes */
if (V4L2_TYPE_IS_MULTIPLANAR (obj->type)) {
for (i = 0; i < group->n_mem; i++)
group->planes[i].bytesused =
gst_memory_get_sizes (group->mem[i], NULL, NULL);
} else {
group->buffer.bytesused = gst_memory_get_sizes (group->mem[0], NULL, NULL);
/* update sizes, for DMABUF imports this already happened during import */
if (allocator->memory != V4L2_MEMORY_DMABUF) {
if (V4L2_TYPE_IS_MULTIPLANAR (obj->type)) {
for (i = 0; i < group->n_mem; i++)
group->planes[i].bytesused =
gst_memory_get_sizes (group->mem[i], NULL, NULL);
} else {
group->buffer.bytesused = gst_memory_get_sizes (group->mem[0], NULL, NULL);
}
}
/* Ensure the memory will stay around and is RO */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment