pub struct PayloadRouteManager { /* private fields */ }Expand description
Fanout manager for one or more OpenIPC/WFB payload routes.
The manager owns one PayloadPipeline per (channel_id, key_slot) and
lets multiple route IDs share that runtime. This is useful for outputs like
video display plus RTP forwarding, or video plus telemetry.
Implementations§
Source§impl PayloadRouteManager
impl PayloadRouteManager
Sourcepub fn new(frame_layout: FrameLayout) -> Self
pub fn new(frame_layout: FrameLayout) -> Self
Create an empty route manager for frames with the given layout.
Sourcepub const fn frame_layout(&self) -> FrameLayout
pub const fn frame_layout(&self) -> FrameLayout
Return the frame layout used for all registered routes.
Sourcepub fn runtime_count(&self) -> usize
pub fn runtime_count(&self) -> usize
Return the number of distinct WFB runtimes.
Sourcepub fn add_plain_route(
&mut self,
route_id: PayloadRouteId,
channel_id: ChannelId,
key_slot: u64,
fec_k: usize,
fec_n: usize,
) -> Result<PayloadRuntimeKey, PayloadRouteError>
pub fn add_plain_route( &mut self, route_id: PayloadRouteId, channel_id: ChannelId, key_slot: u64, fec_k: usize, fec_n: usize, ) -> Result<PayloadRuntimeKey, PayloadRouteError>
Add a route that receives already-plain WFB fragments.
Routes with the same channel id and key slot share one runtime.
Sourcepub fn add_keyed_route(
&mut self,
route_id: PayloadRouteId,
channel_id: ChannelId,
key_slot: u64,
keypair: WfbKeypair,
minimum_epoch: u64,
) -> Result<PayloadRuntimeKey, PayloadRouteError>
pub fn add_keyed_route( &mut self, route_id: PayloadRouteId, channel_id: ChannelId, key_slot: u64, keypair: WfbKeypair, minimum_epoch: u64, ) -> Result<PayloadRuntimeKey, PayloadRouteError>
Add a route that receives encrypted WFB frames and session packets.
Routes with the same channel id and key slot share one runtime.
Sourcepub fn add_direct_route(
&mut self,
route_id: PayloadRouteId,
channel_id: ChannelId,
key_slot: u64,
) -> PayloadRuntimeKey
pub fn add_direct_route( &mut self, route_id: PayloadRouteId, channel_id: ChannelId, key_slot: u64, ) -> PayloadRuntimeKey
Add a direct recovered-payload route.
Direct routes skip 802.11, WFB decryption, and FEC. Push payload bytes
with Self::push_direct_payload; downstream route fanout and RTP
handling still run exactly like radio-backed routes. This is suitable
for RTP arriving from UDP as well as no-hardware tests.
Sourcepub fn add_mock_route(
&mut self,
route_id: PayloadRouteId,
channel_id: ChannelId,
key_slot: u64,
) -> PayloadRuntimeKey
pub fn add_mock_route( &mut self, route_id: PayloadRouteId, channel_id: ChannelId, key_slot: u64, ) -> PayloadRuntimeKey
Add a synthetic route for no-hardware tests and development.
This is an alias for Self::add_direct_route.
Sourcepub fn route_ids(&self, key: PayloadRuntimeKey) -> Option<&[PayloadRouteId]>
pub fn route_ids(&self, key: PayloadRuntimeKey) -> Option<&[PayloadRouteId]>
Return route ids attached to a runtime key.
Sourcepub fn fec_counters(&self, key: PayloadRuntimeKey) -> Option<FecCounters>
pub fn fec_counters(&self, key: PayloadRuntimeKey) -> Option<FecCounters>
Return cumulative FEC counters for a runtime key.
Sourcepub fn accepts_80211_frame(&self, key: PayloadRuntimeKey, frame: &[u8]) -> bool
pub fn accepts_80211_frame(&self, key: PayloadRuntimeKey, frame: &[u8]) -> bool
Return true when an 802.11 frame belongs to the selected runtime.
Sourcepub fn push_80211_frame(
&mut self,
frame: &[u8],
) -> Result<Vec<PayloadRouteEvent>, PayloadRouteError>
pub fn push_80211_frame( &mut self, frame: &[u8], ) -> Result<Vec<PayloadRouteEvent>, PayloadRouteError>
Route one raw 802.11 frame to every matching runtime.
Sourcepub fn push_wifi_frame(
&mut self,
frame_view: WifiFrame<'_>,
) -> Result<Vec<PayloadRouteEvent>, PayloadRouteError>
pub fn push_wifi_frame( &mut self, frame_view: WifiFrame<'_>, ) -> Result<Vec<PayloadRouteEvent>, PayloadRouteError>
Route an already-validated borrowed WiFi frame.
Sourcepub fn push_wifi_frame_into(
&mut self,
frame_view: WifiFrame<'_>,
route_events: &mut Vec<PayloadRouteEvent>,
) -> Result<(), PayloadRouteError>
pub fn push_wifi_frame_into( &mut self, frame_view: WifiFrame<'_>, route_events: &mut Vec<PayloadRouteEvent>, ) -> Result<(), PayloadRouteError>
Route a validated WiFi frame into a reusable event buffer.
Sourcepub fn push_decrypted_80211_frame(
&mut self,
key: PayloadRuntimeKey,
frame: &[u8],
decrypted_fragment: &[u8],
) -> Result<Vec<PayloadRouteEvent>, PayloadRouteError>
pub fn push_decrypted_80211_frame( &mut self, key: PayloadRuntimeKey, frame: &[u8], decrypted_fragment: &[u8], ) -> Result<Vec<PayloadRouteEvent>, PayloadRouteError>
Route one 802.11 frame with a caller-supplied decrypted fragment.
Sourcepub fn push_decrypted_fragment(
&mut self,
key: PayloadRuntimeKey,
data_nonce: u64,
decrypted_fragment: &[u8],
) -> Result<Vec<PayloadRouteEvent>, PayloadRouteError>
pub fn push_decrypted_fragment( &mut self, key: PayloadRuntimeKey, data_nonce: u64, decrypted_fragment: &[u8], ) -> Result<Vec<PayloadRouteEvent>, PayloadRouteError>
Push a decrypted fragment directly into one runtime.
Sourcepub fn push_direct_payload(
&mut self,
key: PayloadRuntimeKey,
packet_seq: u64,
data: &[u8],
) -> Result<Vec<PayloadRouteEvent>, PayloadRouteError>
pub fn push_direct_payload( &mut self, key: PayloadRuntimeKey, packet_seq: u64, data: &[u8], ) -> Result<Vec<PayloadRouteEvent>, PayloadRouteError>
Push an already-recovered payload into one direct runtime.
Sourcepub fn push_mock_payload(
&mut self,
key: PayloadRuntimeKey,
packet_seq: u64,
data: &[u8],
) -> Result<Vec<PayloadRouteEvent>, PayloadRouteError>
pub fn push_mock_payload( &mut self, key: PayloadRuntimeKey, packet_seq: u64, data: &[u8], ) -> Result<Vec<PayloadRouteEvent>, PayloadRouteError>
Push a synthetic recovered payload into one mock runtime.
This is an alias for Self::push_direct_payload.
Trait Implementations§
Source§impl Clone for PayloadRouteManager
impl Clone for PayloadRouteManager
Source§fn clone(&self) -> PayloadRouteManager
fn clone(&self) -> PayloadRouteManager
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more