From 0c32433d8c742d2a52d44264c64faec2c7ac28f2 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Mon, 12 Aug 2019 05:30:06 +0300 Subject: android: Simplify thread RPC with Object::invokeMethod() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the manual implementation of asynchronous method invocation through a custom message with Object::invokeMethod(). This simplifies the thread RPC implementation. Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund Reviewed-by: Jacopo Mondi --- src/android/camera_proxy.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/android/camera_proxy.cpp') diff --git a/src/android/camera_proxy.cpp b/src/android/camera_proxy.cpp index f0cacac8..3eb2f9fb 100644 --- a/src/android/camera_proxy.cpp +++ b/src/android/camera_proxy.cpp @@ -9,6 +9,8 @@ #include +#include + #include "log.h" #include "message.h" #include "utils.h" @@ -185,10 +187,6 @@ int CameraProxy::processCaptureRequest(camera3_capture_request_t *request) void CameraProxy::threadRpcCall(ThreadRpc &rpcRequest) { - std::unique_ptr message = - utils::make_unique(); - message->rpc = &rpcRequest; - - cameraDevice_->postMessage(std::move(message)); + cameraDevice_->invokeMethod(&CameraDevice::call, &rpcRequest); rpcRequest.waitDelivery(); } -- cgit v1.2.1