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>
This commit is contained in:
parent
ea3fa2680c
commit
1b80471805
2 changed files with 2 additions and 2 deletions
|
@ -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_;
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue