[libcamera-devel] [PATCH v2 0/9] Add support for blocking method invocation

Laurent Pinchart laurent.pinchart at ideasonboard.com
Mon Oct 28 11:49:04 CET 2019


Hello,

This patch series is a second version of Jacopo's initial work posted
under the same name.

The goal is to generalize the blocking method invocation code from the
Android camera HAL implementation (in the ThreadRPC class) to make it
available to libcamera. This will be used by the V4L2 adaptation layer,
among other components.

The first two patches add a Semaphore class that generalizes the
ObjectConditionVariable from v1, and add a concept of ConnectionType.
Patch 3/9 and 4/9 then adds support for the ConnectionType in the
BoundMethod classes. Patch 5/9 and 6/9 to 7/9 extend the
Signal::connect() and Object::invokeMethod() with connection type. Patch
8/9 adds testing of Object::invokeMethod(), and patch 9/9 finally
replaces the ThreadRPC class.

Jacopo Mondi (4):
  libcamera: bound_method: Define connection type for method invocation
  libcamera: object: Add connection type parameter to invokeMethod()
  test: object-invoke: Invoke method in blocking mode
  android: Replace ThreadRPC with blocking method call

Laurent Pinchart (5):
  libcamera: Add Semaphore class
  libcamera: bound_method: Store connection type in BoundMethodBase
  libcamera: bound_method: Support connection types
  libcamera: signal: Specify connection type for signals
  libcamera: object: Use bound method activePack() for invokeMethod()

 Documentation/Doxyfile.in         |   4 +-
 include/libcamera/bound_method.h  |  35 +++++++---
 include/libcamera/object.h        |   9 ++-
 include/libcamera/signal.h        |   5 +-
 src/android/camera_device.cpp     |  34 ++--------
 src/android/camera_device.h       |   5 +-
 src/android/camera_proxy.cpp      |  20 ++----
 src/android/camera_proxy.h        |   3 -
 src/android/meson.build           |   1 -
 src/android/thread_rpc.cpp        |  26 --------
 src/android/thread_rpc.h          |  39 -----------
 src/libcamera/bound_method.cpp    |  68 ++++++++++++++++++--
 src/libcamera/event_notifier.cpp  |   3 +-
 src/libcamera/include/meson.build |   1 +
 src/libcamera/include/message.h   |   5 ++
 src/libcamera/include/semaphore.h |  34 ++++++++++
 src/libcamera/meson.build         |   1 +
 src/libcamera/message.cpp         |  11 +++-
 src/libcamera/object.cpp          |  22 +++----
 src/libcamera/semaphore.cpp       | 103 ++++++++++++++++++++++++++++++
 src/libcamera/timer.cpp           |   3 +-
 test/object-invoke.cpp            |  16 ++---
 22 files changed, 285 insertions(+), 163 deletions(-)
 delete mode 100644 src/android/thread_rpc.cpp
 delete mode 100644 src/android/thread_rpc.h
 create mode 100644 src/libcamera/include/semaphore.h
 create mode 100644 src/libcamera/semaphore.cpp

-- 
Regards,

Laurent Pinchart



More information about the libcamera-devel mailing list