//! Capture dispatcher. Picks the per-display-server source backend and returns //! the shared [`pipeline::CaptureHandle`]. The handle itself, its teardown, and //! the whole encode/serve tail are display-agnostic and live in //! [`super::pipeline`]; the backends differ only in how they obtain a video //! source element. use anyhow::Result; use crate::cli::HostOpts; use crate::common::display::DisplayServer; use crate::host::pipeline::CaptureHandle; use crate::host::quality::EffectiveQuality; use crate::host::{wayland, x11}; pub async fn spawn( display: DisplayServer, opts: &HostOpts, quality: &EffectiveQuality, ) -> Result { match display { DisplayServer::Wayland => wayland::start(opts, quality).await, DisplayServer::X11 => x11::start(opts, quality).await, DisplayServer::Unknown => unreachable!("caller guarantees display != Unknown"), } }