summaryrefslogtreecommitdiff
path: root/src/android/camera_device.h
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2020-05-23 18:53:54 +0200
committerJacopo Mondi <jacopo@jmondi.org>2020-06-08 23:01:54 +0200
commit117588b371ad8d1fbe6f8089c1017338d9d991e7 (patch)
treeae0a3ffa6cc62578574fffd5c5d5be8ae1e5f5e2 /src/android/camera_device.h
parentcd1f258af90a58be5cc96c45113e78bb1da235ee (diff)
android: camera_device: Initialize stream configuration
Initialize the stream configuration map by applying the Android Camera3 requested resolutions and formats to the libcamera Camera device. For each required format test a list of required and optional resolutions, construct a map to translate from Android format to the libcamera formats and store the available stream configuration to be provided to the Android framework through static metadata. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src/android/camera_device.h')
-rw-r--r--src/android/camera_device.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/android/camera_device.h b/src/android/camera_device.h
index a87f7623..4e8911da 100644
--- a/src/android/camera_device.h
+++ b/src/android/camera_device.h
@@ -7,12 +7,15 @@
#ifndef __ANDROID_CAMERA_DEVICE_H__
#define __ANDROID_CAMERA_DEVICE_H__
+#include <map>
#include <memory>
+#include <vector>
#include <hardware/camera3.h>
#include <libcamera/buffer.h>
#include <libcamera/camera.h>
+#include <libcamera/geometry.h>
#include <libcamera/request.h>
#include <libcamera/stream.h>
@@ -59,6 +62,12 @@ private:
camera3_stream_buffer_t *buffers;
};
+ struct Camera3StreamConfiguration {
+ libcamera::Size resolution;
+ int androidScalerCode;
+ };
+
+ int initializeStreamConfigurations();
void notifyShutter(uint32_t frameNumber, uint64_t timestamp);
void notifyError(uint32_t frameNumber, camera3_stream_t *stream);
std::unique_ptr<CameraMetadata> getResultMetadata(int frame_number,
@@ -75,6 +84,9 @@ private:
std::map<unsigned int, CameraMetadata *> requestTemplates_;
const camera3_callback_ops_t *callbacks_;
+ std::vector<Camera3StreamConfiguration> streamConfigurations_;
+ std::map<int, libcamera::PixelFormat> formatsMap_;
+
int facing_;
int orientation_;
};