o_sfu_core/engine/room/source_policy/mod.rs
1//! Per-room audio admission and receiver-video allocation.
2//!
3//! [`SourcePolicyTurn`] serializes policy refreshes with publication activity so
4//! their transport effects cannot overtake each other. Each turn combines
5//! committed routes, active-speaker observations, receiver bandwidth and source
6//! bitrate in a [`SourcePolicySnapshot`](input::SourcePolicySnapshot). Planning
7//! holds a room-state read guard. Planned transport controls run only after that
8//! guard is released.
9//!
10//! Audio policy admits observed speakers up to the room limit and blocks audio
11//! for deaf receivers. Video policy maps receiver layout roles, source caps and
12//! bandwidth estimates to encoding selectors, route activity and BWE targets.
13//!
14//! Gate and activity controls must be accepted before the matching
15//! [`ConsumerPacketSelectionUpdate`] commits to room state. Committed hysteresis
16//! observations schedule a delayed follow-up turn until the decision settles.
17
18mod action;
19mod audio;
20mod input;
21mod turn;
22mod video;
23
24pub(in crate::engine::room) use self::action::ConsumerPacketSelectionUpdate;
25#[cfg(test)]
26pub(super) use self::turn::SourcePolicyTransaction;
27pub(super) use self::turn::SourcePolicyTurn;
28#[cfg(feature = "internal-benchmarks")]
29pub use self::turn::run_source_policy_turn_for_benchmark;
30pub use self::video::VideoAdmissionRank;