From 53eab996809e826bc914e4c34c78fe74d86f8dc4 Mon Sep 17 00:00:00 2001 From: Jacopo Mondi Date: Sun, 27 Oct 2019 02:01:08 +0100 Subject: android: Replace ThreadRPC with blocking method call MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use the newly introduced InvocationTypeBlocking message type to replace the blocking message delivery implemented with the ThreadRPC class in the Android camera HAL. Signed-off-by: Jacopo Mondi Reviewed-by: Laurent Pinchart Reviewed-by: Niklas Söderlund --- src/android/camera_proxy.cpp | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) (limited to 'src/android/camera_proxy.cpp') diff --git a/src/android/camera_proxy.cpp b/src/android/camera_proxy.cpp index 43e1e1c3..3964b566 100644 --- a/src/android/camera_proxy.cpp +++ b/src/android/camera_proxy.cpp @@ -16,7 +16,6 @@ #include "utils.h" #include "camera_device.h" -#include "thread_rpc.h" using namespace libcamera; @@ -148,10 +147,8 @@ int CameraProxy::open(const hw_module_t *hardwareModule) void CameraProxy::close() { - ThreadRpc rpcRequest; - rpcRequest.tag = ThreadRpc::Close; - - threadRpcCall(rpcRequest); + cameraDevice_->invokeMethod(&CameraDevice::close, + ConnectionTypeBlocking); } void CameraProxy::initialize(const camera3_callback_ops_t *callbacks) @@ -176,18 +173,8 @@ int CameraProxy::configureStreams(camera3_stream_configuration_t *stream_list) int CameraProxy::processCaptureRequest(camera3_capture_request_t *request) { - ThreadRpc rpcRequest; - rpcRequest.tag = ThreadRpc::ProcessCaptureRequest; - rpcRequest.request = request; - - threadRpcCall(rpcRequest); + cameraDevice_->invokeMethod(&CameraDevice::processCaptureRequest, + ConnectionTypeBlocking, request); return 0; } - -void CameraProxy::threadRpcCall(ThreadRpc &rpcRequest) -{ - cameraDevice_->invokeMethod(&CameraDevice::call, ConnectionTypeQueued, - &rpcRequest); - rpcRequest.waitDelivery(); -} -- cgit v1.2.1