From patchwork Mon Oct 28 10:49:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 2273 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9B0016017E for ; Mon, 28 Oct 2019 11:49:25 +0100 (CET) Received: from pendragon.ideasonboard.com (unknown [91.217.168.176]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 50333325 for ; Mon, 28 Oct 2019 11:49:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1572259765; bh=Rc1nbcR8gAvgKHTF+PP+aoJfe18jOtHEZYJKJ3oLWdo=; h=From:To:Subject:Date:From; b=IRKoZi2Lb1EVtHY/MZ9wwX1Rl+TObqktTZdV5k8vfasNu/TrfFP7YzA+hJVZ+Us/4 IhPifEO8Iz6l7VVFJgTjslEoDJc8rhrdoxKqfp5td9kj8pIurpXAFtS4lXJmwQWchq Xnhj/JkAl+vTxoNHtuSfuLlGEuPX1cUgW0uTxe4o= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Mon, 28 Oct 2019 12:49:04 +0200 Message-Id: <20191028104913.14985-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 0/9] Add support for blocking method invocation X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Oct 2019 10:49:25 -0000 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