libcamera: media_object: Add a const version of dev()

Add a const version of the MediaObject::dev() method to be able to
retrieve a pointer to a const MediaDevice from a constant instance of
a MediaObject sub-class.

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
Jacopo Mondi
2021-01-05 13:11:16 +01:00
parent 89b495c054
commit a1a20998ac
2 changed files with 6 additions and 0 deletions

View File

@@ -22,6 +22,7 @@ class MediaObject
{
public:
MediaDevice *device() { return dev_; }
const MediaDevice *device() const { return dev_; }
unsigned int id() const { return id_; }
protected: