[libcamera-devel,v2,0/4] android: Camera hotplug support
mbox series

Message ID 20200810120406.52654-1-email@uajain.com
Headers show
Series
  • android: Camera hotplug support
Related show

Message

Umang Jain Aug. 10, 2020, 12:04 p.m. UTC
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.

Tested:
- Camera hotplug and unplug by running cros_camera_service, their
  assigned IDs. Unfortunately I only have UVC cameras(#2) so the IDs
  always started with 1000 and so on.
- Hotplug/Hot-unplug entry updated on chrome::media-internals in real
  time.

Untested:
- Hot-unplug of an currently open/streaming camera. The patch 4/4 deals
  with this is only a compile-test-only patch, not tested end-of-end.
  I am now looking into how to make libcamera streaming work with an
  UVC camera so that I can test this use case too with the internal
  CrOS camera application.
  

Umang Jain (4):
  libcamera: pipeline: uvcvideo: Treat all UVC cameras as external
  android: camera_hal_manager: Set camera module callbacks
  android: camera_hal_manager: Support camera hotplug
  android: camera_hal_manager: Handle hot-unplug of currently open
    camera

 src/android/camera3_hal.cpp                  |   2 +
 src/android/camera_device.cpp                |  15 ++
 src/android/camera_device.h                  |   9 +-
 src/android/camera_hal_manager.cpp           | 174 ++++++++++++++++---
 src/android/camera_hal_manager.h             |  20 ++-
 src/libcamera/pipeline/uvcvideo/uvcvideo.cpp |   4 +
 6 files changed, 197 insertions(+), 27 deletions(-)