Skip to main content

PayloadRouteManager

Struct PayloadRouteManager 

Source
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

Source

pub fn new(frame_layout: FrameLayout) -> Self

Create an empty route manager for frames with the given layout.

Source

pub const fn frame_layout(&self) -> FrameLayout

Return the frame layout used for all registered routes.

Source

pub fn runtime_count(&self) -> usize

Return the number of distinct WFB runtimes.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn route_ids(&self, key: PayloadRuntimeKey) -> Option<&[PayloadRouteId]>

Return route ids attached to a runtime key.

Source

pub fn fec_counters(&self, key: PayloadRuntimeKey) -> Option<FecCounters>

Return cumulative FEC counters for a runtime key.

Source

pub fn accepts_80211_frame(&self, key: PayloadRuntimeKey, frame: &[u8]) -> bool

Return true when an 802.11 frame belongs to the selected runtime.

Source

pub fn push_80211_frame( &mut self, frame: &[u8], ) -> Result<Vec<PayloadRouteEvent>, PayloadRouteError>

Route one raw 802.11 frame to every matching runtime.

Source

pub fn push_wifi_frame( &mut self, frame_view: WifiFrame<'_>, ) -> Result<Vec<PayloadRouteEvent>, PayloadRouteError>

Route an already-validated borrowed WiFi frame.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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

Source§

fn clone(&self) -> PayloadRouteManager

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PayloadRouteManager

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.