[libcamera-devel] [PATCH v4 0/5] android: Camera hotplug support

Umang Jain email at uajain.com
Fri Aug 21 16:46:06 CEST 2020


Changes from v3:
- No major functional changes as such. Only comestic and refactoring
  ones pointed out in the review.

Changes from v2:
- Separate CameraDevice as shared pointer and a getter func
  as two new commits from "camera_hal_manager: Support camera hotplug"
- Rename few variables and refactor to have more code-sharing.
- Drop "camera_hal_manager: Handle hot-unplug of currently open camera"
  - Still finding out a nice way to deal with this. Current stock
    implementation on CrOS is to ::exit(1) cros_camera_service 
    if an open camera is unplugged. AOSP doesn't seem to handle
    this use case, maybe because it doesn't have notion of 
    hot-[un]pluggable cameras? Add a \todo on unplug handler path.
 
Changes from v1:
- Treat all UVC cameras as external - based off Laurent's suggestion.
   -It's difficult to know whether a UVC camera is external or internal.
    Hence, treat all UVC camereas as external by setting their
    CameraLocation property as CameraLocationExternal.
- Use different IDs for internal and external cameras.
   -Internal camera IDs are meant to be started with 0 and
    external/removable ones from 1000. Also, support  that
    if the camera has been seen in the past, reuse it's ID.
- Few changes dealing with race conditions, locking and graceful
  handling of currently streaming camera.

Umang Jain (5):
  libcamera: pipeline: uvcvideo: Treat all UVC cameras as external
  android: camera_hal_manager: Set camera module callbacks
  android: camera_device: Make CameraDevice a shared object
  android: camera_device: Add a getter to get libcamera::Camera pointer
  android: camera_hal_manager: Support camera hotplug

 src/android/camera3_hal.cpp                  |   2 +
 src/android/camera_device.cpp                |   7 +
 src/android/camera_device.h                  |   6 +-
 src/android/camera_hal_manager.cpp           | 176 ++++++++++++++++---
 src/android/camera_hal_manager.h             |  25 ++-
 src/libcamera/pipeline/uvcvideo/uvcvideo.cpp |   7 +
 6 files changed, 198 insertions(+), 25 deletions(-)

-- 
2.26.2



More information about the libcamera-devel mailing list