I am trying to get V4L2 user-ptr buffers to work with CMEM for video capture followed by H.264 encode.
I need to do ioctl(fd, VIDIOC_QBUF, &buf) where
buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
buf.memory = V4L2_MEMORY_USERPTR;
buf.m.userptr = buffers[i].start;
buf.length = buffers[i].length;
When I allocate the buffers using malloc() or memalign() the ioctl() call succeeds, but I can't pass those buffers to the DSP because they aren't contiguous. So I want to use CMEM so my buffers are contiguous. However, if I use Memory_contigAlloc() or CMEM_alloc(), to obtain the buffers so that they are in the CMEM space, then the ioctl() call returns an error and errno is set to EFAULT. (The V4L2 documentation doesn't give this as an expected error from the VIDIOC_QBUF ioctl() call.)
I have checked to make sure that the buffer created by the CMEM routines is valid--I can write to all of it from the allocating code. I just don't know why that buffer will cause an error, but the malloc one won't.
Any ideas?
I am using
- Rev.G OMAP3520 EVM
- PSP 02.01.03.11 (includes V4L2 driver)
- DVSDK 3.00.02.44 (in general, but a few components are newer)
- linuxutils 2.25.01.06 (CMEM)
- codec engine 2.24.01