diff options
author | Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> | 2024-04-24 17:39:09 +0200 |
---|---|---|
committer | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2024-06-04 08:31:24 +0200 |
commit | 5f3ce14fae742d1d23061c3122d93edb879ebf53 (patch) | |
tree | 198d88b90e9b6e7ccbf5b6131133894232ab4923 /include/media | |
parent | media: subdev: Improve v4l2_subdev_enable/disable_streams_fallback (diff) | |
download | linux-5f3ce14fae742d1d23061c3122d93edb879ebf53.tar.xz linux-5f3ce14fae742d1d23061c3122d93edb879ebf53.zip |
media: subdev: Add v4l2_subdev_is_streaming()
Add a helper function which returns whether the subdevice is streaming,
i.e. if .s_stream or .enable_streams has been called successfully.
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Umang Jain <umang.jain@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'include/media')
-rw-r--r-- | include/media/v4l2-subdev.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index f191cf00c840..23c970d09870 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h @@ -1956,4 +1956,17 @@ extern const struct v4l2_subdev_ops v4l2_subdev_call_wrappers; void v4l2_subdev_notify_event(struct v4l2_subdev *sd, const struct v4l2_event *ev); +/** + * v4l2_subdev_is_streaming() - Returns if the subdevice is streaming + * @sd: The subdevice + * + * v4l2_subdev_is_streaming() tells if the subdevice is currently streaming. + * "Streaming" here means whether .s_stream() or .enable_streams() has been + * successfully called, and the streaming has not yet been disabled. + * + * If the subdevice implements .enable_streams() this function must be called + * while holding the active state lock. + */ +bool v4l2_subdev_is_streaming(struct v4l2_subdev *sd); + #endif /* _V4L2_SUBDEV_H */ |