Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mmap in mplane mode used correctly in Camea.cpp? #9

Open
jacobschloss opened this issue Mar 31, 2022 · 0 comments
Open

mmap in mplane mode used correctly in Camea.cpp? #9

jacobschloss opened this issue Mar 31, 2022 · 0 comments

Comments

@jacobschloss
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant