Draft: RFC: Autoprobing data sources (frameservers)
This is a proposal in form of pseudocode to allow drivers to have autoprobers that autoprobe not only xrt_devices
but also data sources. In the current state, a data source is equivalent to a xrt_fs
.
Reasons
There are drivers that:
- expose (or could expose) data sources but no
xrt_device
at all (vf
,v4l2
) - expose both data sources and devices that might be dependant on those data sources (
realsense
,euroc
).
The idea of this proposal is to allow drivers to expose to the prober xrt_source_info
s as they already expose xrt_device
s. A xrt_source_info
has the necessary information to create and start a data source (a xrt_fs
) at a later time through what was before called p_open_video_device
(now called p_open_source
).
This proposal comes after stumbling multiple times with how it is necessary to hardcode functionality into p_list_video_devices
to allow "video devices" (data sources) to be created and start. This change should make it easier for drivers to tell Monado they have sources of data to expose, and even to let other parts of the runtime consume those sources (even other drivers).
What's in the MR
The changes in this MR are mostly in pseudocode form and they should how all of this would work. vf
, v4l2
and realsense
drivers were adapted to show how drivers could expose their own sources for autoprobing.
In any case, this is just a proposal feel free to point out any deep flaws I might not have considered that would make this unfeasible.