summaryrefslogtreecommitdiff
path: root/src/android/camera_proxy.cpp
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-08-12 05:30:06 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-08-19 18:07:28 +0300
commit0c32433d8c742d2a52d44264c64faec2c7ac28f2 (patch)
tree2d38c176392f38b9e31f7d48a5ad1be26f628a79 /src/android/camera_proxy.cpp
parent778f6b1d7070ddc5b920764d5233e318b15ccf12 (diff)
android: Simplify thread RPC with Object::invokeMethod()
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 <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src/android/camera_proxy.cpp')
-rw-r--r--src/android/camera_proxy.cpp8
1 files changed, 3 insertions, 5 deletions
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 <system/camera_metadata.h>
+#include <libcamera/object.h>
+
#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<ThreadRpcMessage> message =
- utils::make_unique<ThreadRpcMessage>();
- message->rpc = &rpcRequest;
-
- cameraDevice_->postMessage(std::move(message));
+ cameraDevice_->invokeMethod(&CameraDevice::call, &rpcRequest);
rpcRequest.waitDelivery();
}