mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-24 17:15:07 +03:00
android: CameraDevice: Return const shared_ptr& by camera()
CameraDevice::camera() originally returns shared_ptr. It is mandatory to make a copy by calling camera() in this way. There is no need of copying if a caller needs the reference of the camera like const shared_ptr<Camera> &cam = camera(). That is, it is a caller that copying is required. This changes the return type of camera() to const shared_ptr&, so that we are able to reduce one redundant copy in the above case. Signed-off-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
9538ce4cc6
commit
14b262dacf
1 changed files with 1 additions and 1 deletions
|
@ -43,7 +43,7 @@ public:
|
|||
|
||||
unsigned int id() const { return id_; }
|
||||
camera3_device_t *camera3Device() { return &camera3Device_; }
|
||||
std::shared_ptr<libcamera::Camera> camera() const { return camera_; }
|
||||
const std::shared_ptr<libcamera::Camera> &camera() const { return camera_; }
|
||||
libcamera::CameraConfiguration *cameraConfiguration() const
|
||||
{
|
||||
return config_.get();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue