[libcamera-devel] [IPU3-IPA PATCH] libcamera-helpers: mapped_framebuffer: Update to new FD API
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Fri Dec 3 19:56:15 CET 2021
Hi Kieran,
Thank you for the patch.
On Fri, Dec 03, 2021 at 05:48:53PM +0000, Kieran Bingham wrote:
> The plane file descriptors API has been updated in the libcamera
> base library.
>
> Update our mapped_framebuffer class accordingly.
>
> Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> ---
> src/libcamera-helpers/mapped_framebuffer.cpp | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/libcamera-helpers/mapped_framebuffer.cpp b/src/libcamera-helpers/mapped_framebuffer.cpp
> index a65740831331..3d231147ed91 100644
> --- a/src/libcamera-helpers/mapped_framebuffer.cpp
> +++ b/src/libcamera-helpers/mapped_framebuffer.cpp
> @@ -198,7 +198,7 @@ MappedFrameBuffer::MappedFrameBuffer(const FrameBuffer *buffer, MapFlags flags)
> std::map<int, MappedBufferInfo> mappedBuffers;
>
> for (const FrameBuffer::Plane &plane : buffer->planes()) {
> - const int fd = plane.fd.fd();
> + const int fd = plane.fd.get();
> if (mappedBuffers.find(fd) == mappedBuffers.end()) {
> const size_t length = lseek(fd, 0, SEEK_END);
> mappedBuffers[fd] = MappedBufferInfo{ nullptr, 0, length };
> @@ -220,7 +220,7 @@ MappedFrameBuffer::MappedFrameBuffer(const FrameBuffer *buffer, MapFlags flags)
> }
>
> for (const FrameBuffer::Plane &plane : buffer->planes()) {
> - const int fd = plane.fd.fd();
> + const int fd = plane.fd.get();
> auto &info = mappedBuffers[fd];
> if (!info.address) {
> void *address = mmap(nullptr, info.mapLength, mmapFlags,
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list