Description
This issue documents the progress of video API changes, pursuing the work on the video API past the Video 4 Zephyr added to Zephyr in #17194.
The main source of inspiration for the video APIs is currently the Linux Kernel v4l2/media subsystem and driver APIs.
Changelog
remote-endpoint
is not used by Zephyr drivers. RTIO can be leveraged to replace the many FIFOs that are typically defined in each driver 1, 2, 3 and provide a way to directly connect drivers while also allowing the application to be interleaved in the pipeline. This would act as a splice(2) for Zephyr video drivers, triggered by the devicetree `remote-endpoint
[UPDATE: it might be possible to use RTIO on top of the current API instead of replacing it]
video_endpoint_id
has unclear semantics in some cases (doc fix only) and can be adjusted to allow positive numbers refer an individual endpoint number or address
[UPDATE: a documentation fix, mostly]
Following this, devicetree macros can be introduced to provide ways to refer a particular endpoint without manually coding the endpoint number from the application.
video_get_caps()
fills a struct with all the video caps filled at once. This works well, but makes it more difficult than using an enumerator-style API such as what #72254 proposes which allows drivers to be a bit more generic: a device doing software video processing can filter the format capabilities of its sources this way.
video_enqueue()
: "an addition to the video API to enable streaming partial frames within one video buffer" is missing. A new API is introduced as part of Arducam Mega sensor support.
- drivers: video: video_mcux_smartdma: add SMARTDMA video driver #72827
- drivers: video: Add support for arducam mega #66994 (comment)
Introduce a directory for the video drivers, as image sensors, MIPI/DMA controllers [...] are being mixed in one same driver API. A sensor directory was the chosen way and will be merged once the ongoing PR are completed.
Add a drivers/video_*_skeleton.c
in the same style as drivers/usb/udc/udc_skeleton.c
that can speed-up development and help with understanding the semantics.
[UPDATE: proposed as an emulated/fake driver instead]
The devicetree can be flattened to enable more uniform processing, such as DT macros used to reduce boilerplate code and homogenize drivers
- dts: flatten video's device tree endpoints definition #72950 (this turns out to not require any change: just conventions)
[UPDATE: no API change needed]
VIDEO_BUF_FRAG
: Add fragmentation support to allow partial/fragmented frames being returned from video devices.
- drivers: video: Add support for arducam mega #66994 (comment)
- drivers: video: video_mcux_smartdma: add SMARTDMA video driver #72827 (comment)
- usb: device_next: new USB Video Class (UVC) implementation #76798 (comment) > fe3d207
video-interfaces.yaml
: Introduce common devicetree bindings for all video devices:
<zephyr/drivers/video-controls.h>
: Add a flag to the video CIDs that specify variants of current controls to query the kind of result to get: current value (default) or minimum/maximum/default value.
<zephyr/drivers/video.h>
: Introduce types for controls, and add move repeated code from the drivers to a new video framework.
<zephyr/drivers/video.h>
: Merge video_stream_start()
and video_stream_stop()
together to reduce code size in the drivers.
<zephyr/drivers/video.h>
: Add a video_get_stats()
API to collect image statistics from drivers.
<zephyr/drivers/video.h>
: Remove the video endpoint parameter and instead use a flag to decide between input and output. Multi-endpoint devices can expose multiple struct device *
<zephyr/drivers/video.h>
: Switch from ad-hoc queueing mechanism and buffer handling to the RTIO implementation:
<zephyr/drivers/video.h>
: Introduce video_set_selection()
mirroring the Linux Kernel behavior to crop and scale and pad an image source depending on what the hardware supports. The same API is used by both the sensor and video processing hardware.
<zephyr/drivers/video.h>
: Rework the buffering, ongoing discussion about the model to use.
m2m
First memory-to-memory device introduced. No API change required however this is the first time a video device has both input and output from RAM:
Metadata
Metadata
Assignees
Type
Projects
Status