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.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/android/camera_hal_manager.cpp b/src/android/camera_hal_manager.cpp
index b364f62a..5f7bfe26 100644
--- a/src/android/camera_hal_manager.cpp
+++ b/src/android/camera_hal_manager.cpp
@@ -145,6 +145,23 @@ void CameraHalManager::cameraAdded(std::shared_ptr<Camera> cam)
}
const CameraConfigData *cameraConfigData = halConfig_.cameraConfigData(cam->id());
+
+ /*
+ * Some cameras whose location is reported by libcamera as external may
+ * actually be internal to the device. This is common with UVC cameras
+ * that are integrated in a laptop. In that case the real location
+ * should be specified in the configuration file.
+ *
+ * If the camera location is external and a configuration entry exists
+ * for it, override its location.
+ */
+ if (isCameraNew && isCameraExternal) {
+ if (cameraConfigData && cameraConfigData->facing != -1) {
+ isCameraExternal = false;
+ id = numInternalCameras_;
+ }
+ }
+
if (!isCameraExternal && !cameraConfigData) {
LOG(HAL, Error)
<< "HAL configuration entry for internal camera "