summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-07-03 21:37:44 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-08-31 22:44:10 +0300
commita376aa331ae9308f55baa9bb50680c35dc032058 (patch)
treedd3d6badc55a1932af86ed54c01b8e879ab971b1 /include
parent2e4fc65f77309fd99225ab0b40c123f92eba13a8 (diff)
libcamera: media_object: Expose entity type
Add a new field to the MediaEntity class to identify the type of interface it exposes to userspace. The MediaEntity constructor is changed to take a media_v2_interface pointer instead of just the device node major and minor to have access to the interface type. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Tested-by: Martin Kepplinger <martin.kepplinger@puri.sm>
Diffstat (limited to 'include')
-rw-r--r--include/libcamera/internal/media_object.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/libcamera/internal/media_object.h b/include/libcamera/internal/media_object.h
index 2f5d33e1..6ae22c67 100644
--- a/include/libcamera/internal/media_object.h
+++ b/include/libcamera/internal/media_object.h
@@ -88,9 +88,17 @@ private:
class MediaEntity : public MediaObject
{
public:
+ enum class Type {
+ Invalid,
+ MediaEntity,
+ V4L2Subdevice,
+ V4L2VideoDevice,
+ };
+
const std::string &name() const { return name_; }
unsigned int function() const { return function_; }
unsigned int flags() const { return flags_; }
+ Type type() const { return type_; }
const std::string &deviceNode() const { return deviceNode_; }
unsigned int deviceMajor() const { return major_; }
unsigned int deviceMinor() const { return minor_; }
@@ -108,13 +116,14 @@ private:
friend class MediaDevice;
MediaEntity(MediaDevice *dev, const struct media_v2_entity *entity,
- unsigned int major = 0, unsigned int minor = 0);
+ const struct media_v2_interface *iface);
void addPad(MediaPad *pad);
std::string name_;
unsigned int function_;
unsigned int flags_;
+ Type type_;
std::string deviceNode_;
unsigned int major_;
unsigned int minor_;