libcamera: device_enumerator: Don't mark the search() function as const
While the DeviceEnumerator::search() function doesn't modify the instance directly, it returns a non-const pointer to a MediaEntity that is owned by the DeviceEnumerator instance. This breaks the const semantics. Don't mark the function as const. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
This commit is contained in:
parent
3e6090a17a
commit
f388aa7041
2 changed files with 2 additions and 2 deletions
|
@ -245,7 +245,7 @@ int DeviceEnumerator::addDevice(const std::string &devnode)
|
||||||
*
|
*
|
||||||
* \return pointer to the matching MediaDevice, or nullptr if no match is found
|
* \return pointer to the matching MediaDevice, or nullptr if no match is found
|
||||||
*/
|
*/
|
||||||
MediaDevice *DeviceEnumerator::search(const DeviceMatch &dm) const
|
MediaDevice *DeviceEnumerator::search(const DeviceMatch &dm)
|
||||||
{
|
{
|
||||||
for (MediaDevice *dev : devices_) {
|
for (MediaDevice *dev : devices_) {
|
||||||
if (dev->busy())
|
if (dev->busy())
|
||||||
|
|
|
@ -41,7 +41,7 @@ public:
|
||||||
virtual int init() = 0;
|
virtual int init() = 0;
|
||||||
virtual int enumerate() = 0;
|
virtual int enumerate() = 0;
|
||||||
|
|
||||||
MediaDevice *search(const DeviceMatch &dm) const;
|
MediaDevice *search(const DeviceMatch &dm);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int addDevice(const std::string &devnode);
|
int addDevice(const std::string &devnode);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue