diff options
author | Jacopo Mondi <jacopo@jmondi.org> | 2019-01-02 11:55:43 +0100 |
---|---|---|
committer | Jacopo Mondi <jacopo@jmondi.org> | 2019-01-02 12:21:45 +0100 |
commit | 1b80471805b98e3a7cefaa8a89611881391b63c7 (patch) | |
tree | 861f9ff77829b963064f0d75f2d318e7546ada57 | |
parent | ea3fa2680c56a798f752e197eff57f3148fcdf40 (diff) |
libcamera: media_device: Make getEntityByName() const
The function does not modify the instance state. Mark it as const.
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
-rw-r--r-- | src/libcamera/include/media_device.h | 2 | ||||
-rw-r--r-- | src/libcamera/media_device.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/libcamera/include/media_device.h b/src/libcamera/include/media_device.h index 8d491a87..9f45fc7a 100644 --- a/src/libcamera/include/media_device.h +++ b/src/libcamera/include/media_device.h @@ -38,7 +38,7 @@ public: const std::string devnode() const { return devnode_; } const std::vector<MediaEntity *> &entities() const { return entities_; } - MediaEntity *getEntityByName(const std::string &name); + MediaEntity *getEntityByName(const std::string &name) const; private: std::string driver_; diff --git a/src/libcamera/media_device.cpp b/src/libcamera/media_device.cpp index 18956519..4ff9ffe1 100644 --- a/src/libcamera/media_device.cpp +++ b/src/libcamera/media_device.cpp @@ -297,7 +297,7 @@ int MediaDevice::populate() * \return The entity with \a name * \return nullptr if no entity with \a name is found */ -MediaEntity *MediaDevice::getEntityByName(const std::string &name) +MediaEntity *MediaDevice::getEntityByName(const std::string &name) const { for (MediaEntity *e : entities_) if (e->name() == name) |