summaryrefslogtreecommitdiff
path: root/src/android/camera_hal_manager.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_hal_manager.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_hal_manager.h')
-rw-r--r--src/android/camera_hal_manager.h17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/android/camera_hal_manager.h b/src/android/camera_hal_manager.h
index c23abd1c..94d8f005 100644
--- a/src/android/camera_hal_manager.h
+++ b/src/android/camera_hal_manager.h
@@ -7,8 +7,7 @@
#ifndef __ANDROID_CAMERA_MANAGER_H__
#define __ANDROID_CAMERA_MANAGER_H__
-#include <condition_variable>
-#include <mutex>
+#include <stddef.h>
#include <vector>
#include <hardware/hardware.h>
@@ -16,33 +15,27 @@
#include <libcamera/camera_manager.h>
-#include "thread.h"
-
class CameraDevice;
-class CameraProxy;
-class CameraHalManager : public libcamera::Thread
+class CameraHalManager
{
public:
+ CameraHalManager();
~CameraHalManager();
int init();
- CameraProxy *open(unsigned int id, const hw_module_t *module);
+ CameraDevice *open(unsigned int id, const hw_module_t *module);
unsigned int numCameras() const;
int getCameraInfo(unsigned int id, struct camera_info *info);
private:
- void run() override;
camera_metadata_t *getStaticMetadata(unsigned int id);
libcamera::CameraManager *cameraManager_;
- std::mutex mutex_;
- std::condition_variable cv_;
-
- std::vector<std::unique_ptr<CameraProxy>> proxies_;
+ std::vector<std::unique_ptr<CameraDevice>> cameras_;
};
#endif /* __ANDROID_CAMERA_MANAGER_H__ */