summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2022-03-30 11:08:43 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-08-03 17:42:59 +0300
commit39d491761956b9c0e8c01ba5fc0a27558b90016e (patch)
tree73ce0536328bc6764eea366a581a50eab1ac01b5 /include
parent8695e02916ab7687231cb6e1a7f489b874f8b269 (diff)
libcamera: v4l2_subdevice: Collect subdev capabilities
Collect subdev capabilities at open() time. Model the V4L2SubdevCapabilties as V4L2Capability from the video device class. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'include')
-rw-r--r--include/libcamera/internal/v4l2_subdevice.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/libcamera/internal/v4l2_subdevice.h b/include/libcamera/internal/v4l2_subdevice.h
index 2db392d5..a1d3144c 100644
--- a/include/libcamera/internal/v4l2_subdevice.h
+++ b/include/libcamera/internal/v4l2_subdevice.h
@@ -29,6 +29,17 @@ namespace libcamera {
class MediaDevice;
+struct V4L2SubdeviceCapability final : v4l2_subdev_capability {
+ bool isReadOnly() const
+ {
+ return capabilities & V4L2_SUBDEV_CAP_RO_SUBDEV;
+ }
+ bool hasStreams() const
+ {
+ return capabilities & V4L2_SUBDEV_CAP_MPLEXED;
+ }
+};
+
struct V4L2SubdeviceFormat {
uint32_t mbus_code;
Size size;
@@ -70,6 +81,7 @@ public:
Whence whence = ActiveFormat);
const std::string &model();
+ const V4L2SubdeviceCapability &caps() const { return caps_; }
static std::unique_ptr<V4L2Subdevice>
fromEntityName(const MediaDevice *media, const std::string &entity);
@@ -87,6 +99,7 @@ private:
const MediaEntity *entity_;
std::string model_;
+ struct V4L2SubdeviceCapability caps_;
};
} /* namespace libcamera */