summaryrefslogtreecommitdiff
path: root/src/android/camera_device.h
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-01-20 01:09:34 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-02-13 13:23:23 +0200
commitda3f50ee9cdb6896b365357b0d35577344f72ba4 (patch)
tree4e3b31244adeb18f0458992153ab77ce47dd1c93 /src/android/camera_device.h
parent8a8502ec0ea5e64a0c44eb18aac0ecd4b6771e6b (diff)
android: Remove internal thread
Now that libcamera creates threads internally and doesn't rely on an application-provided event loop, remove the thread from the Android Camera HAL layer. The CameraProxy class becomes meaningless, remove it and communicate directly from the CameraHalManager to the CameraDevice. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src/android/camera_device.h')
-rw-r--r--src/android/camera_device.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/android/camera_device.h b/src/android/camera_device.h
index caa617dc..55eac317 100644
--- a/src/android/camera_device.h
+++ b/src/android/camera_device.h
@@ -13,7 +13,6 @@
#include <libcamera/buffer.h>
#include <libcamera/camera.h>
-#include <libcamera/object.h>
#include <libcamera/request.h>
#include <libcamera/stream.h>
@@ -21,19 +20,23 @@
class CameraMetadata;
-class CameraDevice : public libcamera::Object
+class CameraDevice
{
public:
CameraDevice(unsigned int id, const std::shared_ptr<libcamera::Camera> &camera);
~CameraDevice();
- int open();
+ int open(const hw_module_t *hardwareModule);
void close();
+
+ unsigned int id() const { return id_; }
+ camera3_device_t *camera3Device() { return &camera3Device_; }
+
void setCallbacks(const camera3_callback_ops_t *callbacks);
- camera_metadata_t *getStaticMetadata();
+ const camera_metadata_t *getStaticMetadata();
const camera_metadata_t *constructDefaultRequestSettings(int type);
int configureStreams(camera3_stream_configuration_t *stream_list);
- void processCaptureRequest(camera3_capture_request_t *request);
+ int processCaptureRequest(camera3_capture_request_t *request);
void requestComplete(libcamera::Request *request);
private:
@@ -52,6 +55,9 @@ private:
std::unique_ptr<CameraMetadata> getResultMetadata(int frame_number,
int64_t timestamp);
+ unsigned int id_;
+ camera3_device_t camera3Device_;
+
bool running_;
std::shared_ptr<libcamera::Camera> camera_;
std::unique_ptr<libcamera::CameraConfiguration> config_;