[libcamera-devel] [PATCH v4 0/4] android: Handle internal UVC cameras

Umang Jain umang.jain at ideasonboard.com
Tue Aug 3 16:02:33 CEST 2021


libcamera-core all UVC cameras as 'external' (which makes sense
as there is not much information to accurately determine location).
However, in the HAL layer, we can probably determine accurately
by looking at HAL config file camera entries.

This series addresses the handling of such cameras, where the libcamera
reports properties::CameraLocationExternal, but we know one of the UVC
is internal/integrated to the system. It should be treated as internal.
Also, as a point raised while reviews, we should disallow
'location: external' in HAL config file.

Testing:
With nautilus, it has one UVC and one IPU3 cameras. With these patches
applied, both these cameras have id as '0' & '1' (i.e. internal).

With camera service still running, I hotplugged a external UVC camera,
and it got the camera numerical id as '1000'.

Changes in v4:
- Commit message typos
- Drop the camera id_ < 1000 check in 3/4. It's not required because if a
  cameraConfigData is valid and has front/back valid location, it implicitly
  means that camera is internal.

Changes in v3:
- Introduce a new patch 2/4 to disallow 'external' location in HAL
  config
- In 3/4, Reflect and adapt `if` checks accordingly in context of 2/4.
  (No tags have been collected intentionally due to change in `if`
  conditional checks)
- Few minor clarifications in comments.

Change in v2:
- Introduce a re-factor patch 1/3
- Change comments in 2/3

Umang Jain (4):
  android: Instantiate CameraDevice after checking HAL config validity
  android: Disallow external location in HAL config
  android: Override camera as "Internal" provided found in HAL config
  android: nautilus: Add camera HAL configuration

 src/android/camera_device.cpp             | 13 ++++++++++++-
 src/android/camera_hal_config.cpp         |  2 --
 src/android/camera_hal_manager.cpp        | 23 ++++++++++++++++++++---
 src/android/data/nautilus/camera_hal.yaml |  8 ++++++++
 4 files changed, 40 insertions(+), 6 deletions(-)
 create mode 100644 src/android/data/nautilus/camera_hal.yaml

-- 
2.31.1



More information about the libcamera-devel mailing list