Skip to main content

vector_core/calls/
mod.rs

1//! Calls. The platform-free half (wire format, jitter buffer, rate control) is the
2//! `vector-calls` crate, re-exported here; with the `calls` feature, the session and
3//! its video track run here too, over whatever a client plugs into [`platform`](crate::calls::platform).
4
5pub use vector_calls::*;
6
7#[cfg(feature = "calls")]
8pub mod platform;
9#[cfg(feature = "calls")]
10pub mod session;
11#[cfg(feature = "calls")]
12pub mod settings;
13#[cfg(feature = "calls")]
14pub mod video;
15#[cfg(feature = "calls")]
16pub mod voice;
17
18/// The Main Menu's switches: remembered for every call, and applied to the one under way.
19#[cfg(feature = "calls")]
20pub async fn set_mic(s: settings::MicState) -> Result<(), String> {
21    settings::remember_mic(s);
22    if voice::snapshot().is_some() {
23        voice::set_deafened(s.deafened)?;
24        voice::set_muted(s.muted)?;
25    }
26    if session::snapshot().is_some() {
27        session::set_deafened(s.deafened).await?;
28        if !s.deafened {
29            session::set_muted(s.muted).await?;
30        }
31    }
32    Ok(())
33}