Expand description
Receiver media policy: decides which audio and which video encoding each receiver gets within its bandwidth and when to decide again.
Director reads committed room facts, worker observations (active speakers, receiver bandwidth and source bitrate) and the time. It decides audio admission, the encoding each video route forwards, route pauses, receiver BWE targets, the roomβs featured user and the next decision deadline. It never changes membership or publications, never creates or removes routes and never handles packets.
Director owns the values it decides into. Room records embed them and hand
&mut to Director, which alone changes their fields:
RouteAllocation per consumer, ReceiverAllocation per receiver and
PendingUpgrade per committed consumer.
A SourcePolicyTurn runs in workflow order:
capture room facts and observations, under the read guard
planner pure: facts and time in, allocations and wakeups out
turn transport controls, after the guard is released
commit accepted allocations, under the write lockTurns serialize with publication activity so their transport effects cannot overtake each other. Gate and activity controls must be accepted before the matching allocation commits. Each turn replaces or cancels its earliest receiver-pressure or exact-target upgrade deadline.
ModulesΒ§
- action π
- Records turn execution derives from a plan. Each carries the room identity that its commit checks again after the transport await.
- allocation π
- Values Director decides into. Room records embed them and hand
&mutto Director, so their fields change only here. - capture π
- Planner facts a policy turn captures under the room read guard.
- commit π
- Commits a policy turn under the room write lock after its transport controls settled.
- layout π
- Layout roles Director gives Room between policy turns.
- planner π
- Pure receiver policy: facts and time in, allocations and wakeups out.
- turn π
- Policy turn execution: capture facts under the read guard, plan, apply transport controls without the lock and commit what transport accepted.