From patchwork Sun Oct 27 20:33:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 2231 Return-Path: Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4715B6017A for ; Sun, 27 Oct 2019 21:31:48 +0100 (CET) X-Originating-IP: 93.2.121.143 Received: from uno.localdomain (143.121.2.93.rev.sfr.net [93.2.121.143]) (Authenticated sender: jacopo@jmondi.org) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id C3E62C0002; Sun, 27 Oct 2019 20:31:47 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Sun, 27 Oct 2019 21:33:29 +0100 Message-Id: <20191027203335.26888-1-jacopo@jmondi.org> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 0/6] 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: Sun, 27 Oct 2019 20:31:48 -0000 Hello, this small series generalise the blocking method invocation implemented in the Android Camera HAL to be a generic libcamera core concept. Patch 1/6 contains the definition of message invocation types, which I've been suggested to 'be insipired' from the QT defined ones. unfortunately I'm not sure how to handle 3 on 5 of them, so I made it clear in the documentation which shall be changed in the v2 of this series. 2/6 passes the newly defined message invocation type to the Object::invokeMethod() operation, 3/6 creates a synchronization class for Objects that wraps an std::conditional_variable and 4/6 uses them in the method invocation path of the Object and Message classes to block until a method has not been invoked on the receiver Object. Patch 5/6 makes the objec-invoke test use the newly introduced blocking method invocation mode, and patch 6/6 removes the ThreadRPC class from the Android camera HAL implementation. Thanks j Jacopo Mondi (6): libcamera: object: Define message invocation type libcamera: object: Invoke method with invokeType libcamera: object: Add ObjectConditionVariable class libcamera: Support blocking method invocation test: object-invoke: invoke method in blocking mode android: Replace ThreadRPC with blocking method call include/libcamera/object.h | 32 +++++++++-- 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/event_notifier.cpp | 3 +- src/libcamera/include/message.h | 5 ++ src/libcamera/message.cpp | 11 +++- src/libcamera/object.cpp | 92 ++++++++++++++++++++++++++++++-- src/libcamera/timer.cpp | 2 +- test/object-invoke.cpp | 6 +-- 14 files changed, 149 insertions(+), 130 deletions(-) delete mode 100644 src/android/thread_rpc.cpp delete mode 100644 src/android/thread_rpc.h --- 2.23.0