[libcamera-devel] [PATCH 00/14] object: Propagate return value of invoked method

Laurent Pinchart laurent.pinchart at ideasonboard.com
Sat Jan 4 06:09:33 CET 2020


Hello,

This patch series implements support for propagating the return value of
invoked method all the way to the caller of Object::invokeMethod(). The
change is motivated by the recently merged V4L2 compatibility layer that
works around this missing feature using function arguments to pass a
pointer to the return value.

The individual patches should be pretty self-explicit. It's worth noting
that patch 03/14 fixes a memory leak that I noticed while developing
this. Patch 14/14 shows how the new feature simplifies the V4L2
compatibility layer.

Laurent Pinchart (14):
  test: object-invoke: Test direct invocation
  libcamera: object: Use activate() in invokeMethod()
  libcamera: bound_method: Fix memory leak with direct connections
  libcamera: bound_method: Mark overriden methods with override
  libcamera: bound_method: Drop unused BoundMethodBase::connectionType()
  libcamera: bound_method: Move sequence and generator to
    BoundMethodBase
  libcamera: bound_method: Store method arguments in a class
  libcamera: bound_method: Support bindings to non-void methods
  libcamera: bound_method: Manage BoundMethodPack through
    std::shared_ptr
  libcamera: bound_method: Propagate method return value
  libcamera: bound_method: Rename Bound*Method to BoundMethod*
  test: object-invoke: Test invoking a non-void method
  test: signal: Test connecting to non-void slots
  libcamera: v4l2: Use Object::invokeMethod() return value

 Documentation/Doxyfile.in        |   8 +-
 include/libcamera/bound_method.h | 178 ++++++++++++++++++++++++-------
 include/libcamera/object.h       |  13 +--
 include/libcamera/signal.h       |  39 +++----
 src/libcamera/bound_method.cpp   |  28 ++++-
 src/libcamera/include/message.h  |   5 +-
 src/libcamera/message.cpp        |   5 +-
 src/libcamera/object.cpp         |   6 +-
 src/libcamera/signal.cpp         |   8 +-
 src/v4l2/v4l2_camera.cpp         | 109 +++++++++----------
 src/v4l2/v4l2_camera.h           |  18 ++--
 src/v4l2/v4l2_camera_proxy.cpp   |  51 +++++----
 test/object-invoke.cpp           |  35 ++++++
 test/signal.cpp                  |  17 +++
 14 files changed, 344 insertions(+), 176 deletions(-)

-- 
Regards,

Laurent Pinchart



More information about the libcamera-devel mailing list