summaryrefslogtreecommitdiff
path: root/src/android/mm/cros_camera_buffer.cpp
diff options
context:
space:
mode:
authorHirokazu Honda <hiroh@chromium.org>2021-08-26 17:00:21 +0900
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-08-27 00:52:32 +0300
commit6453e75c7ab28622d948745a768f3cc0ad2a2882 (patch)
treeed9df8718183e9b263719a443be5de35fd58a4f8 /src/android/mm/cros_camera_buffer.cpp
parentc5e2ed7806be482e682b7466beeff83130297a3f (diff)
android: camera_buffer: Add stride/offset/size function
This adds getter functions of stride, offset and size to CameraBuffer interface. Signed-off-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/android/mm/cros_camera_buffer.cpp')
-rw-r--r--src/android/mm/cros_camera_buffer.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/android/mm/cros_camera_buffer.cpp b/src/android/mm/cros_camera_buffer.cpp
index ba6650cf..44993379 100644
--- a/src/android/mm/cros_camera_buffer.cpp
+++ b/src/android/mm/cros_camera_buffer.cpp
@@ -31,6 +31,10 @@ public:
Span<uint8_t> plane(unsigned int plane);
+ unsigned int stride(unsigned int plane) const;
+ unsigned int offset(unsigned int plane) const;
+ unsigned int size(unsigned int plane) const;
+
size_t jpegBufferSize(size_t maxJpegBufferSize) const;
private:
@@ -111,6 +115,21 @@ Span<uint8_t> CameraBuffer::Private::plane(unsigned int plane)
bufferManager_->GetPlaneSize(handle_, plane) };
}
+unsigned int CameraBuffer::Private::stride(unsigned int plane) const
+{
+ return cros::CameraBufferManager::GetPlaneStride(handle_, plane);
+}
+
+unsigned int CameraBuffer::Private::offset(unsigned int plane) const
+{
+ return cros::CameraBufferManager::GetPlaneOffset(handle_, plane);
+}
+
+unsigned int CameraBuffer::Private::size(unsigned int plane) const
+{
+ return cros::CameraBufferManager::GetPlaneSize(handle_, plane);
+}
+
size_t CameraBuffer::Private::jpegBufferSize([[maybe_unused]] size_t maxJpegBufferSize) const
{
return bufferManager_->GetPlaneSize(handle_, 0);