mmap physically contiguous memory
If you cannot pass the result of Memory_alloc()
as first argument to your mmap()
(for example, if it also uses mmap() that would make it impossible to map to that memory again), you probably should use another streaming I/O method from the given example - IO_METHOD_USERPTR
variation. It uses the same ioctl
as IO_METHOD_MMAP to capture frames and should provide the similar efficiency.
You would need driver support from the camera driver. mmap
gets the physical pages it maps from whatever driver it's mapping - the camera in this case. You cannot tell mmap to use some pre-allocated pages, because the underlying driver would have to be told to use these pre-allocated pages.