diff options
author | Jacopo Mondi <jacopo@jmondi.org> | 2019-02-19 12:12:27 +0100 |
---|---|---|
committer | Jacopo Mondi <jacopo@jmondi.org> | 2019-03-01 12:31:45 +0100 |
commit | c6daee909c562ed104aff690f6a8b7a2e6ae090b (patch) | |
tree | 6039781989a6320205dfd3fed1778da16b3d38a0 /src/libcamera/include/v4l2_subdevice.h | |
parent | 77100a7578d8a0ccc56e6ab11a8dbe3c74665c4d (diff) |
libcamera: v4l2_subdevice: Store media entity
Store the media entity backing the V4L2Subdevice and add a deviceName()
method to retrieve the human readable name of the subdevice, which is
created using the name of the associated media entity.
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src/libcamera/include/v4l2_subdevice.h')
-rw-r--r-- | src/libcamera/include/v4l2_subdevice.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/libcamera/include/v4l2_subdevice.h b/src/libcamera/include/v4l2_subdevice.h index 82fa6685..eac699a0 100644 --- a/src/libcamera/include/v4l2_subdevice.h +++ b/src/libcamera/include/v4l2_subdevice.h @@ -9,9 +9,10 @@ #include <string> +#include "media_object.h" + namespace libcamera { -class MediaEntity; struct Rectangle; struct V4L2SubdeviceFormat { @@ -31,7 +32,8 @@ public: bool isOpen() const; void close(); - std::string deviceNode() const { return deviceNode_; } + std::string deviceNode() const { return entity_->deviceNode(); } + std::string deviceName() const { return entity_->name(); } int setCrop(unsigned int pad, Rectangle *rect); int setCompose(unsigned int pad, Rectangle *rect); @@ -43,7 +45,7 @@ private: int setSelection(unsigned int pad, unsigned int target, Rectangle *rect); - std::string deviceNode_; + const MediaEntity *entity_; int fd_; }; |