diff options
author | Niklas Söderlund <niklas.soderlund@ragnatech.se> | 2020-01-09 15:20:44 +0100 |
---|---|---|
committer | Niklas Söderlund <niklas.soderlund@ragnatech.se> | 2020-01-12 16:10:37 +0100 |
commit | 3c4b87244352552cce8d7a9c7b97ff85b39b3d58 (patch) | |
tree | e59a72b49992ac75b612e60bff14986c588c4d9a /src/v4l2/v4l2_camera.cpp | |
parent | 35ac23dca19ea31f17a526679a697e3e327e6af1 (diff) |
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>
Diffstat (limited to 'src/v4l2/v4l2_camera.cpp')
-rw-r--r-- | src/v4l2/v4l2_camera.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/v4l2/v4l2_camera.cpp b/src/v4l2/v4l2_camera.cpp index 2a507b9b..07f05a31 100644 --- a/src/v4l2/v4l2_camera.cpp +++ b/src/v4l2/v4l2_camera.cpp @@ -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_) |