[libcamera-devel] [IPU3-IPA PATCH] libcamera-helpers: mapped_framebuffer: Update to new FD API

Umang Jain umang.jain at ideasonboard.com
Mon Dec 6 06:51:42 CET 2021


Hi Kieran,

On 12/3/21 11:18 PM, 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: Umang Jain <umang.jain 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,


More information about the libcamera-devel mailing list