summaryrefslogtreecommitdiff
path: root/src/android/camera_hal_manager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/android/camera_hal_manager.cpp')
-rw-r--r--src/android/camera_hal_manager.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/android/camera_hal_manager.cpp b/src/android/camera_hal_manager.cpp
index b02d8d1a..02b6418f 100644
--- a/src/android/camera_hal_manager.cpp
+++ b/src/android/camera_hal_manager.cpp
@@ -65,8 +65,11 @@ int CameraHalManager::init()
unsigned int index = 0;
for (auto &cam : cameraManager_->cameras()) {
CameraDevice *camera = new CameraDevice(index, cam);
- cameras_.emplace_back(camera);
+ ret = camera->initialize();
+ if (ret)
+ continue;
+ cameras_.emplace_back(camera);
++index;
}
@@ -107,9 +110,8 @@ int CameraHalManager::getCameraInfo(unsigned int id, struct camera_info *info)
CameraDevice *camera = cameras_[id].get();
- /* \todo Get these info dynamically inspecting the camera module. */
- info->facing = id ? CAMERA_FACING_FRONT : CAMERA_FACING_BACK;
- info->orientation = 0;
+ info->facing = camera->facing();
+ info->orientation = camera->orientation();
info->device_version = CAMERA_DEVICE_API_VERSION_3_3;
info->resource_cost = 0;
info->static_camera_characteristics = camera->getStaticMetadata();