libcamera: media_object: Add functions to entities

Media entities convey information about their main function in the
'function' field of 'struct media_v2_entity'.

Store the main function in the MediaEntity function_ class member and provide
a getter function for that.

While at there update comments, keep the MediaPad description in sync
with the MediaEntity one and remove a stale TODO entry.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
Jacopo Mondi
2019-01-14 15:19:19 +01:00
parent 21ff749a79
commit ec53057f0a
2 changed files with 17 additions and 7 deletions
+2
View File
@@ -84,6 +84,7 @@ class MediaEntity : public MediaObject
{
public:
const std::string &name() const { return name_; }
unsigned int function() const { return function_; }
unsigned int deviceMajor() const { return major_; }
unsigned int deviceMinor() const { return minor_; }
@@ -103,6 +104,7 @@ private:
~MediaEntity();
std::string name_;
unsigned int function_;
std::string devnode_;
unsigned int major_;
unsigned int minor_;