[libcamera-devel] [PATCH] libcamera: Give MappedFrameBuffer its own implementation

Kieran Bingham kieran.bingham at ideasonboard.com
Fri Aug 6 12:56:40 CEST 2021


Hi Laurent,

On 06/08/2021 11:37, Laurent Pinchart wrote:
<snip>

>>> +++ b/include/libcamera/internal/mapped_framebuffer.h
>>> @@ -0,0 +1,52 @@
>>> +/* SPDX-License-Identifier: LGPL-2.1-or-later */
>>> +/*
>>> + * Copyright (C) 2021, Google Inc.
>>> + *
>>> + * mapped_framebuffer.h - Frame buffer memory mapping support
>>> + */
>>> +#ifndef __LIBCAMERA_INTERNAL_MAPPED_FRAMEBUFFER_H__
>>> +#define __LIBCAMERA_INTERNAL_MAPPED_FRAMEBUFFER_H__
>>> +
>>> +#include <sys/mman.h>
> 
> This isn't needed anymore, but you need stdint.h instead.

Users of MappedFrameBuffer need to specify the mapping flags.

We can abstract that with your new Flags class now if you prefer ?


<snip>


>>> diff --git a/include/libcamera/internal/meson.build b/include/libcamera/internal/meson.build
>>> index dac1a2d36fa8..665fd6de4ed3 100644
>>> --- a/include/libcamera/internal/meson.build
>>> +++ b/include/libcamera/internal/meson.build
>>> @@ -28,6 +28,7 @@ libcamera_internal_headers = files([
>>>      'ipa_module.h',
>>>      'ipa_proxy.h',
>>>      'ipc_unixsocket.h',
>>> +    'mapped_framebuffer.h',
>>>      'media_device.h',
>>>      'media_object.h',
>>>      'pipeline_handler.h',
>>> diff --git a/src/android/camera_buffer.h b/src/android/camera_buffer.h
>>> index 21373fa25bf8..e67cfa2b363e 100644
>>> --- a/src/android/camera_buffer.h
>>> +++ b/src/android/camera_buffer.h
>>> @@ -7,6 +7,8 @@
>>>  #ifndef __ANDROID_CAMERA_BUFFER_H__
>>>  #define __ANDROID_CAMERA_BUFFER_H__
>>>
>>> +#include <sys/mman.h>
>>> +

That's also why it is added here ...


>>>  #include <hardware/camera3.h>
>>>
>>>  #include <libcamera/base/class.h>

<snip>


More information about the libcamera-devel mailing list