diff options
author | Jacopo Mondi <jacopo@jmondi.org> | 2019-05-10 17:40:02 +0200 |
---|---|---|
committer | Jacopo Mondi <jacopo@jmondi.org> | 2019-08-12 11:55:46 +0200 |
commit | 667d8ea8fd4bda35e8888792d2b6c055fdb4be18 (patch) | |
tree | 786462c9f8dfce3d3d05d69dc8befcd67e94db07 /src/android/camera_proxy.h | |
parent | 6bed34da161bb8c4e86821116dcff2205e29c58a (diff) |
android: hal: Add Camera3 HAL
Add libcamera Android Camera HALv3 implementation.
The initial camera HAL implementation supports the LIMITED hardware
level and uses statically defined metadata and camera characteristics.
Add a build option named 'android' and adjust the build system to
selectively compile the Android camera HAL and link it against the
required Android libraries.
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src/android/camera_proxy.h')
-rw-r--r-- | src/android/camera_proxy.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/android/camera_proxy.h b/src/android/camera_proxy.h new file mode 100644 index 00000000..da63bfa7 --- /dev/null +++ b/src/android/camera_proxy.h @@ -0,0 +1,45 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2019, Google Inc. + * + * camera_proxy.h - Proxy to camera devices + */ +#ifndef __ANDROID_CAMERA_PROXY_H__ +#define __ANDROID_CAMERA_PROXY_H__ + +#include <memory> + +#include <hardware/camera3.h> + +#include <libcamera/camera.h> + +class CameraDevice; +class ThreadRpc; + +class CameraProxy +{ +public: + CameraProxy(unsigned int id, std::shared_ptr<libcamera::Camera> camera); + ~CameraProxy(); + + int open(const hw_module_t *hardwareModule); + void close(); + + void initialize(const camera3_callback_ops_t *callbacks); + const camera_metadata_t *getStaticMetadata(); + const camera_metadata_t *constructDefaultRequestSettings(int type); + int configureStreams(camera3_stream_configuration_t *stream_list); + int processCaptureRequest(camera3_capture_request_t *request); + + unsigned int id() const { return id_; } + camera3_device_t *camera3Device() { return &camera3Device_; } + +private: + void threadRpcCall(ThreadRpc &rpcRequest); + + unsigned int id_; + CameraDevice *cameraDevice_; + camera3_device_t camera3Device_; +}; + +#endif /* __ANDROID_CAMERA_PROXY_H__ */ |