v4l2: camera: Handle memory mapping of buffers directly
In the upcoming FrameBuffer API the memory mapping of buffers will be left to the user of the FrameBuffer objects. Prepare the V4L2 compatibility layer to this upcoming change to ease conversion to the new API. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
@@ -121,12 +121,6 @@ int V4L2Camera::configure(StreamConfiguration *streamConfigOut,
|
||||
return 0;
|
||||
}
|
||||
|
||||
void *V4L2Camera::mmap(unsigned int index)
|
||||
{
|
||||
Stream *stream = *camera_->streams().begin();
|
||||
return stream->buffers()[index].planes()[0].mem();
|
||||
}
|
||||
|
||||
int V4L2Camera::allocBuffers(unsigned int count)
|
||||
{
|
||||
int ret = camera_->allocateBuffers();
|
||||
@@ -138,6 +132,12 @@ void V4L2Camera::freeBuffers()
|
||||
camera_->freeBuffers();
|
||||
}
|
||||
|
||||
FileDescriptor V4L2Camera::getBufferFd(unsigned int index)
|
||||
{
|
||||
Stream *stream = *camera_->streams().begin();
|
||||
return FileDescriptor(stream->buffers()[index].planes()[0].dmabuf());
|
||||
}
|
||||
|
||||
int V4L2Camera::streamOn()
|
||||
{
|
||||
if (isRunning_)
|
||||
|
||||
Reference in New Issue
Block a user