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 fn with_direct_video_route( frame_layout: FrameLayout, video_route_id: PayloadRouteId, channel_id: ChannelId, key_slot: u64, ) -> Self

Create a runtime whose video route accepts already-recovered payloads.

Use Self::push_direct_payload to inject RTP or other recovered payload bytes. They still pass through route fanout and the built-in RTP depacketizer, making this suitable for UDP input and no-hardware tests.

Source

pub fn with_mock_video_route( frame_layout: FrameLayout, video_route_id: PayloadRouteId, channel_id: ChannelId, key_slot: u64, ) -> Self

Create a synthetic video payload route for tests and development.

This is an alias for Self::with_direct_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 rtp_status(&self) -> RtpDepacketizerStatus

Return cumulative RTP depacketizer diagnostics for the video route.

Source

pub fn rtp_reorder_status(&self) -> RtpReorderStatus

Return cumulative RTP reorder-buffer diagnostics for the video route.

Source

pub fn set_rtp_reorder_enabled(&mut self, enabled: bool)

Enable or disable the small RTP sequence reorder buffer.

Reordering can improve startup and fragmented-frame recovery on jittery links, but it may add a tiny amount of latency when packets arrive out of order. It is disabled by default for the lowest-latency path.

Source

pub const fn rtp_reorder_enabled(&self) -> bool

Return true when RTP packets pass through the reorder buffer.

Source

pub fn push_rtp_packet( &mut self, packet: &[u8], ) -> Result<Vec<DepacketizedFrame>, RtpError>

Process one raw RTP packet on the configured video route.

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 add_direct_route( &mut self, route_id: PayloadRouteId, channel_id: ChannelId, key_slot: u64, ) -> PayloadRuntimeKey

Add a route that accepts already-recovered payloads directly.

Source

pub fn add_mock_route( &mut self, route_id: PayloadRouteId, channel_id: ChannelId, key_slot: u64, ) -> PayloadRuntimeKey

Add a synthetic raw-payload route for tests and development.

This is an alias for Self::add_direct_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_transfer_with_kind( &mut self, transfer: &[u8], descriptor_kind: RxDescriptorKind, options: &ReceiverBatchOptions, ) -> Result<ReceiverBatch, AggregateError>

Parse and process one Realtek USB RX transfer with an explicit descriptor layout.

Use the layout reported by the hardware driver for Jaguar3 adapters. Self::push_rx_transfer remains the Jaguar1-compatible convenience method.

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.

Source

pub fn push_direct_payload( &mut self, runtime: PayloadRuntimeKey, packet_seq: u64, payload: &[u8], options: &ReceiverBatchOptions, ) -> Result<ReceiverBatch, PayloadRouteError>

Process one already-recovered payload through routes and RTP handling.

Source

pub fn push_mock_payload( &mut self, runtime: PayloadRuntimeKey, packet_seq: u64, payload: &[u8], options: &ReceiverBatchOptions, ) -> Result<ReceiverBatch, PayloadRouteError>

Process one synthetic recovered payload for tests and development.

This is an alias for Self::push_direct_payload.

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.