diff options
author | Barnabás Pőcze <barnabas.pocze@ideasonboard.com> | 2025-03-31 16:22:47 +0200 |
---|---|---|
committer | Barnabás Pőcze <barnabas.pocze@ideasonboard.com> | 2025-04-01 12:08:24 +0200 |
commit | 37283b68eacbcb0a234c1bd21eedaa22323240b8 (patch) | |
tree | 2a6d2f829533377bdb7c2a7c3a14d1ee0b380bd2 /src | |
parent | 056ebf0b6e511958087470812b1f629fcc44dd70 (diff) |
libcamera: camera_manager: Take camera id in `std::string_view`
Do not force the caller to have an `std::string` object as a
simple string view is sufficient to do the lookup.
Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/libcamera/camera_manager.cpp | 2 | ||||
-rw-r--r-- | src/py/libcamera/py_camera_manager.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/libcamera/camera_manager.cpp b/src/libcamera/camera_manager.cpp index b28bd0bd..e62e7193 100644 --- a/src/libcamera/camera_manager.cpp +++ b/src/libcamera/camera_manager.cpp @@ -381,7 +381,7 @@ std::vector<std::shared_ptr<Camera>> CameraManager::cameras() const * * \return Shared pointer to Camera object or nullptr if camera not found */ -std::shared_ptr<Camera> CameraManager::get(const std::string &id) +std::shared_ptr<Camera> CameraManager::get(std::string_view id) { Private *const d = _d(); diff --git a/src/py/libcamera/py_camera_manager.h b/src/py/libcamera/py_camera_manager.h index 3574db23..af69b915 100644 --- a/src/py/libcamera/py_camera_manager.h +++ b/src/py/libcamera/py_camera_manager.h @@ -20,7 +20,7 @@ public: ~PyCameraManager(); pybind11::list cameras(); - std::shared_ptr<Camera> get(const std::string &name) { return cameraManager_->get(name); } + std::shared_ptr<Camera> get(std::string_view name) { return cameraManager_->get(name); } static const std::string &version() { return CameraManager::version(); } |