summaryrefslogtreecommitdiff
path: root/src/android/camera_hal_manager.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/android/camera_hal_manager.h')
-rw-r--r--src/android/camera_hal_manager.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/android/camera_hal_manager.h b/src/android/camera_hal_manager.h
index 3e34d63f..a91decc7 100644
--- a/src/android/camera_hal_manager.h
+++ b/src/android/camera_hal_manager.h
@@ -7,6 +7,8 @@
#ifndef __ANDROID_CAMERA_MANAGER_H__
#define __ANDROID_CAMERA_MANAGER_H__
+#include <map>
+#include <mutex>
#include <stddef.h>
#include <vector>
@@ -33,10 +35,27 @@ public:
void setCallbacks(const camera_module_callbacks_t *callbacks);
private:
+ using Mutex = std::mutex;
+ using MutexLocker = std::unique_lock<std::mutex>;
+
+ static constexpr unsigned int firstExternalCameraId_ = 1000;
+
+ static int32_t cameraLocation(const libcamera::Camera *cam);
+
+ void cameraAdded(std::shared_ptr<libcamera::Camera> cam);
+ void cameraRemoved(std::shared_ptr<libcamera::Camera> cam);
+
+ CameraDevice *cameraDeviceFromHalId(unsigned int id);
+
libcamera::CameraManager *cameraManager_;
const camera_module_callbacks_t *callbacks_;
std::vector<std::shared_ptr<CameraDevice>> cameras_;
+ std::map<std::string, unsigned int> cameraIdsMap_;
+ Mutex mutex_;
+
+ unsigned int numInternalCameras_;
+ unsigned int nextExternalCameraId_;
};
#endif /* __ANDROID_CAMERA_MANAGER_H__ */