Skip to content

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

Description

@jacobschloss

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions