summaryrefslogtreecommitdiff
path: root/src/libcamera/include/v4l2_device.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcamera/include/v4l2_device.h')
-rw-r--r--src/libcamera/include/v4l2_device.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/libcamera/include/v4l2_device.h b/src/libcamera/include/v4l2_device.h
index b92e1f1c..cb3601ca 100644
--- a/src/libcamera/include/v4l2_device.h
+++ b/src/libcamera/include/v4l2_device.h
@@ -26,10 +26,16 @@ struct V4L2Capability final : v4l2_capability {
{
return reinterpret_cast<const char *>(v4l2_capability::bus_info);
}
+ unsigned int device_caps() const
+ {
+ return capabilities & V4L2_CAP_DEVICE_CAPS
+ ? v4l2_capability::device_caps
+ : v4l2_capability::capabilities;
+ }
- bool isCapture() const { return capabilities & V4L2_CAP_VIDEO_CAPTURE; }
- bool isOutput() const { return capabilities & V4L2_CAP_VIDEO_OUTPUT; }
- bool hasStreaming() const { return capabilities & V4L2_CAP_STREAMING; }
+ bool isCapture() const { return device_caps() & V4L2_CAP_VIDEO_CAPTURE; }
+ bool isOutput() const { return device_caps() & V4L2_CAP_VIDEO_OUTPUT; }
+ bool hasStreaming() const { return device_caps() & V4L2_CAP_STREAMING; }
};
class MediaEntity;