Skip to main content

ReceiverRuntime

Struct ReceiverRuntime 

Source
pub struct ReceiverRuntime { /* private fields */ }
Expand description

Shared receive runtime for OpenIPC video plus optional raw payload taps.

This is the easiest core entry point for apps. It accepts Realtek RX transfers, 802.11 frames, or already-decrypted fragments; routes recovered WFB payloads by route id; and depacketizes the configured video route from RTP into Annex-B H.264/H.265 frames.

Implementations§

Source§

impl ReceiverRuntime

Source

pub fn from_routes( routes: PayloadRouteManager, video_runtime: PayloadRuntimeKey, video_route_id: PayloadRouteId, ) -> Self

Build a runtime around an existing route manager.

video_runtime and video_route_id identify the route whose recovered payloads are RTP video and should be depacketized into frames.

Source

pub fn with_plain_video_route( frame_layout: FrameLayout, video_route_id: PayloadRouteId, channel_id: ChannelId, key_slot: u64, fec_k: usize, fec_n: usize, ) -> Result<Self, PayloadRouteError>

Create a runtime with an unencrypted/plain video route.

This is mainly useful for tests and pre-decrypted captures.

Source

pub fn with_keyed_video_route( frame_layout: FrameLayout, video_route_id: PayloadRouteId, channel_id: ChannelId, key_slot: u64, keypair: WfbKeypair, minimum_epoch: u64, ) -> Result<Self, PayloadRouteError>

Create a runtime with an encrypted WFB video route.

Source

pub const fn video_runtime(&self) -> PayloadRuntimeKey

Return the route-manager runtime key used for video.

Source

pub const fn video_route_id(&self) -> PayloadRouteId

Return the application route id used for video.

Source

pub fn routes(&self) -> &PayloadRouteManager

Borrow the underlying route manager.

Source

pub fn routes_mut(&mut self) -> &mut PayloadRouteManager

Mutably borrow the underlying route manager.

Source

pub fn rtp_mut(&mut self) -> &mut RtpDepacketizer

Mutably borrow the RTP depacketizer for advanced video handling.

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 an unencrypted/plain raw-payload route.

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 an encrypted WFB raw-payload route.

Source

pub fn video_fec_counters(&self) -> FecCounters

Return cumulative FEC counters for the video runtime.

Source

pub fn accepts_video_frame(&self, frame: &[u8]) -> bool

Return true if an 802.11 frame belongs to the configured video runtime.

Source

pub fn push_rx_transfer( &mut self, transfer: &[u8], options: &ReceiverBatchOptions, ) -> Result<ReceiverBatch, AggregateError>

Parse and process one Realtek USB RX transfer.

Source

pub fn push_rx_packets<'a>( &mut self, packets: impl IntoIterator<Item = RealtekRxPacket<'a>>, options: &ReceiverBatchOptions, ) -> ReceiverBatch

Process already parsed Realtek RX packets.

Source

pub fn push_80211_frame( &mut self, frame: &[u8], options: &ReceiverBatchOptions, ) -> Result<ReceiverBatch, PayloadRouteError>

Process one OpenIPC/WFB 802.11 frame.

Source

pub fn push_decrypted_80211_frame( &mut self, runtime: PayloadRuntimeKey, frame: &[u8], decrypted_fragment: &[u8], options: &ReceiverBatchOptions, ) -> Result<ReceiverBatch, PayloadRouteError>

Process one 802.11 frame when the caller already decrypted the WFB fragment.

Source

pub fn push_decrypted_fragment( &mut self, runtime: PayloadRuntimeKey, data_nonce: u64, decrypted_fragment: &[u8], options: &ReceiverBatchOptions, ) -> Result<ReceiverBatch, PayloadRouteError>

Process one already-decrypted WFB fragment.

Trait Implementations§

Source§

impl Clone for ReceiverRuntime

Source§

fn clone(&self) -> ReceiverRuntime

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 ReceiverRuntime

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.