pub struct Engine { /* private fields */ }Implementations§
Source§impl Engine
impl Engine
pub fn new(cfg: EngineConfig) -> (Engine, Receiver<Event>)
pub fn channels(&self) -> &[ChannelSpec]
pub fn channel_by_name(&self, name: &str) -> Option<&ChannelSpec>
pub fn counters(&self) -> &Counters
pub fn profile(&self) -> &'static Profile
Sourcepub fn ceiling_kbps(&self, channel: u8) -> u32
pub fn ceiling_kbps(&self, channel: u8) -> u32
The bitrate ceiling in force for a video channel: the profile’s,
lowered to the publisher’s declared maximum (ChannelSpec::max_bitrate_kbps).
Sourcepub fn publisher_config(&self, channel: u8, reason: &str) -> Value
pub fn publisher_config(&self, channel: u8, reason: &str) -> Value
The video-config a publisher should receive for channel under the
current profile, with the bitrate clamped to the channel’s ceiling.
pub fn now_us(&self) -> u64
pub fn session_count(&self) -> usize
pub fn signal_session_ids(&self) -> Vec<String>
Sourcepub fn expect_pilot(&self, signal_id: &str, role: Role)
pub fn expect_pilot(&self, signal_id: &str, role: Role)
The cloud told us a pilot is coming (pilot-connecting). Remembered
for 30 s so its hello can be matched to a role.
Sourcepub fn revoke(&self, signal_id: &str, reason: &str)
pub fn revoke(&self, signal_id: &str, reason: &str)
The cloud revoked a session (pilot left / abort / revoke).
Sourcepub fn set_profile(&self, profile: &'static Profile, reason: &str)
pub fn set_profile(&self, profile: &'static Profile, reason: &str)
Change the QoS ceiling live (also reachable by pilots via set-qos).
Sourcepub fn push_video(&self, channel: u8, frame: VideoFrame)
pub fn push_video(&self, channel: u8, frame: VideoFrame)
Offer a new frame. In-order bounded queue (see FrameQueue): a keyframe
flushes deltas that lead nowhere (keyframe_flushes_queue); an
overflowing delta is dropped together with every delta after it until
the next keyframe, and a recovery request is raised so that keyframe
arrives in ~1 RTT.
Sourcepub fn push_video_layer(&self, channel: u8, layer: u8, frame: VideoFrame)
pub fn push_video_layer(&self, channel: u8, layer: u8, frame: VideoFrame)
As push_video, for a channel that publishes several simulcast layers
(ADR 0008). Frames of every declared layer are offered; the engine
relays one and drops the rest, so the alternative is always encoded and
one keyframe away. A channel that declared no ladder ignores layer.
Sourcepub fn push_message(&self, channel: u8, payload: &[u8])
pub fn push_message(&self, channel: u8, payload: &[u8])
Send one sensor message to every session.
Sourcepub async fn accept_loop(self, endpoint: Arc<Endpoint>)
pub async fn accept_loop(self, endpoint: Arc<Endpoint>)
Accept sessions from the endpoint forever.