https://www.kernel.org/doc/html/v4.9/media/uapi/v4l/mmap.html#mmap says:
When using the multi-planar API, every plane of every buffer has to be mapped separately, so the number of calls to mmap() should be equal to number of buffers times number of planes in each buffer.
But the code when in mp mode only maps a single plane per buffer without checking v4l2_buffer::length
|
void *pData = mmap(NULL, m_bMplaneApi ? pBuffer->m.planes[0].length : pBuffer->length, PROT_READ | PROT_WRITE, MAP_SHARED, nFileDescriptor, m_bMplaneApi ? pBuffer->m.planes[0].m.mem_offset : pBuffer->m.offset); |
Should this code be mapping as many planes as v4l2_buffer::length indicates?
https://www.kernel.org/doc/html/v4.9/media/uapi/v4l/mmap.html#mmap says:
But the code when in mp mode only maps a single plane per buffer without checking v4l2_buffer::length
examples/BasicV4L2/Source/Camera.cpp
Line 123 in fd8b9cf
Should this code be mapping as many planes as v4l2_buffer::length indicates?