android: framebuffer: Add HALFrameBuffer and replace FrameBuffer
HALFrameBuffer is derived from FrameBuffer with access to buffer_handle_t, which is needed for JEA usage. Signed-off-by: Harvey Yang <chenghaoyang@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Han-Lin Chen <hanlinchen@chromium.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
4843bfa66d
commit
b64fa1363c
9 changed files with 72 additions and 15 deletions
|
@ -20,6 +20,7 @@
|
|||
|
||||
#include "../camera_device.h"
|
||||
#include "../frame_buffer_allocator.h"
|
||||
#include "../hal_framebuffer.h"
|
||||
|
||||
using namespace libcamera;
|
||||
|
||||
|
@ -79,7 +80,7 @@ public:
|
|||
|
||||
~Private() override;
|
||||
|
||||
std::unique_ptr<libcamera::FrameBuffer>
|
||||
std::unique_ptr<HALFrameBuffer>
|
||||
allocate(int halPixelFormat, const libcamera::Size &size, uint32_t usage);
|
||||
|
||||
private:
|
||||
|
@ -94,7 +95,7 @@ PlatformFrameBufferAllocator::Private::~Private()
|
|||
gralloc_close(allocDevice_);
|
||||
}
|
||||
|
||||
std::unique_ptr<libcamera::FrameBuffer>
|
||||
std::unique_ptr<HALFrameBuffer>
|
||||
PlatformFrameBufferAllocator::Private::allocate(int halPixelFormat,
|
||||
const libcamera::Size &size,
|
||||
uint32_t usage)
|
||||
|
@ -137,8 +138,10 @@ PlatformFrameBufferAllocator::Private::allocate(int halPixelFormat,
|
|||
offset += planeSize;
|
||||
}
|
||||
|
||||
return std::make_unique<FrameBuffer>(
|
||||
std::make_unique<GenericFrameBufferData>(allocDevice_, handle, planes));
|
||||
return std::make_unique<HALFrameBuffer>(
|
||||
std::make_unique<GenericFrameBufferData>(
|
||||
allocDevice_, handle, planes),
|
||||
handle);
|
||||
}
|
||||
|
||||
PUBLIC_FRAME_BUFFER_ALLOCATOR_IMPLEMENTATION
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue