diff options
author | Paul Elder <paul.elder@ideasonboard.com> | 2021-03-19 18:56:39 +0900 |
---|---|---|
committer | Paul Elder <paul.elder@ideasonboard.com> | 2021-03-23 19:23:21 +0900 |
commit | 500c9a1f980d376d15829a2f1a24812ed74a7470 (patch) | |
tree | 11a2ee30e883643dbfc0a2f1f54aec8fc2b7da9b /src/android/camera_hal_manager.h | |
parent | 67e791373de781a68889c8b56c7e18f3f27bd52e (diff) |
android: Return -EUSERS when failed to open a Camera that's in use
The correct return value for the HAL for hal_dev_open() when trying to
open a camera that's already opened is EUSERS. Make hal_dev_open()
return -EUSERS, and plumb the logic for this through
CameraHalManager::open().
This allows the following CTS tests to pass:
- android.hardware.camera2.cts.CameraManagerTest#testCameraManagerOpenAllCameras
- android.hardware.camera2.cts.MultiViewTest#testDualCameraPreview
Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src/android/camera_hal_manager.h')
-rw-r--r-- | src/android/camera_hal_manager.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/android/camera_hal_manager.h b/src/android/camera_hal_manager.h index a91decc7..24bf716c 100644 --- a/src/android/camera_hal_manager.h +++ b/src/android/camera_hal_manager.h @@ -10,6 +10,7 @@ #include <map> #include <mutex> #include <stddef.h> +#include <tuple> #include <vector> #include <hardware/camera_common.h> @@ -28,7 +29,8 @@ public: int init(); - CameraDevice *open(unsigned int id, const hw_module_t *module); + std::tuple<CameraDevice *, int> + open(unsigned int id, const hw_module_t *module); unsigned int numCameras() const; int getCameraInfo(unsigned int id, struct camera_info *info); |