From 117588b371ad8d1fbe6f8089c1017338d9d991e7 Mon Sep 17 00:00:00 2001 From: Jacopo Mondi Date: Sat, 23 May 2020 18:53:54 +0200 Subject: 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 Signed-off-by: Jacopo Mondi --- src/android/camera_device.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/android/camera_device.h') 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 #include +#include #include #include #include +#include #include #include @@ -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 getResultMetadata(int frame_number, @@ -75,6 +84,9 @@ private: std::map requestTemplates_; const camera3_callback_ops_t *callbacks_; + std::vector streamConfigurations_; + std::map formatsMap_; + int facing_; int orientation_; }; -- cgit v1.2.1