summaryrefslogtreecommitdiff
path: root/src/android/camera_proxy.cpp
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-08-18 01:45:01 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-08-19 19:07:33 +0300
commit0ed40d2cd4342465cce916c3b6388d1849aef610 (patch)
treea99a31111f9e52e764612ebc7a5021d8f983adf9 /src/android/camera_proxy.cpp
parent5ce4bb62e77e85a681d6742f25e5173963b55415 (diff)
android: Pass Camera shared pointer to CameraProxy by const reference
The CameraProxy is constructed with a Camera instance passed through a shared pointer. It forwards it to the CameraDevice constructor, which takes a reference used for the sole purpose of making an internal copy of the shared pointer. Both constructors can thus take a const reference instead of a value or a mutable reference. This optimises the constructors slightly. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src/android/camera_proxy.cpp')
-rw-r--r--src/android/camera_proxy.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/android/camera_proxy.cpp b/src/android/camera_proxy.cpp
index 3eb2f9fb..4f5c0a02 100644
--- a/src/android/camera_proxy.cpp
+++ b/src/android/camera_proxy.cpp
@@ -113,7 +113,7 @@ static camera3_device_ops hal_dev_ops = {
.reserved = { nullptr },
};
-CameraProxy::CameraProxy(unsigned int id, std::shared_ptr<Camera> camera)
+CameraProxy::CameraProxy(unsigned int id, const std::shared_ptr<Camera> &camera)
: id_(id)
{
cameraDevice_ = new CameraDevice(id, camera);