v4l2: Add mmap fallback when USERPTR is not supported

When we don't support EXPBUF according to the probe, the host will
allocate memory for us. We will then try to use USERPTR to import the
memory into v4l2.

If this is not supported, try to fall back to MMAP support, mmap the
buffers and memcpy the MMAP buffer to the host allocated buffers.
This commit is contained in:
Wim Taymans 2024-11-07 15:46:28 +01:00
parent 7a0aea835a
commit b409f5f5d1
2 changed files with 44 additions and 7 deletions

View file

@ -58,6 +58,7 @@ struct buffer {
struct spa_meta_videotransform *vt;
struct v4l2_buffer v4l2_buffer;
void *ptr;
void *mmap_ptr;
};
#define MAX_CONTROLS 64