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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user