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
impl ReceiverRuntime
Sourcepub fn from_routes(
routes: PayloadRouteManager,
video_runtime: PayloadRuntimeKey,
video_route_id: PayloadRouteId,
) -> Self
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.
Sourcepub 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>
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.
Sourcepub 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>
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.
Sourcepub const fn video_runtime(&self) -> PayloadRuntimeKey
pub const fn video_runtime(&self) -> PayloadRuntimeKey
Return the route-manager runtime key used for video.
Sourcepub const fn video_route_id(&self) -> PayloadRouteId
pub const fn video_route_id(&self) -> PayloadRouteId
Return the application route id used for video.
Sourcepub fn routes(&self) -> &PayloadRouteManager
pub fn routes(&self) -> &PayloadRouteManager
Borrow the underlying route manager.
Sourcepub fn routes_mut(&mut self) -> &mut PayloadRouteManager
pub fn routes_mut(&mut self) -> &mut PayloadRouteManager
Mutably borrow the underlying route manager.
Sourcepub fn rtp_mut(&mut self) -> &mut RtpDepacketizer
pub fn rtp_mut(&mut self) -> &mut RtpDepacketizer
Mutably borrow the RTP depacketizer for advanced video handling.
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 an unencrypted/plain raw-payload route.
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 an encrypted WFB raw-payload route.
Sourcepub fn video_fec_counters(&self) -> FecCounters
pub fn video_fec_counters(&self) -> FecCounters
Return cumulative FEC counters for the video runtime.
Sourcepub fn accepts_video_frame(&self, frame: &[u8]) -> bool
pub fn accepts_video_frame(&self, frame: &[u8]) -> bool
Return true if an 802.11 frame belongs to the configured video runtime.
Sourcepub fn push_rx_transfer(
&mut self,
transfer: &[u8],
options: &ReceiverBatchOptions,
) -> Result<ReceiverBatch, AggregateError>
pub fn push_rx_transfer( &mut self, transfer: &[u8], options: &ReceiverBatchOptions, ) -> Result<ReceiverBatch, AggregateError>
Parse and process one Realtek USB RX transfer.
Sourcepub fn push_rx_packets<'a>(
&mut self,
packets: impl IntoIterator<Item = RealtekRxPacket<'a>>,
options: &ReceiverBatchOptions,
) -> ReceiverBatch
pub fn push_rx_packets<'a>( &mut self, packets: impl IntoIterator<Item = RealtekRxPacket<'a>>, options: &ReceiverBatchOptions, ) -> ReceiverBatch
Process already parsed Realtek RX packets.
Sourcepub fn push_80211_frame(
&mut self,
frame: &[u8],
options: &ReceiverBatchOptions,
) -> Result<ReceiverBatch, PayloadRouteError>
pub fn push_80211_frame( &mut self, frame: &[u8], options: &ReceiverBatchOptions, ) -> Result<ReceiverBatch, PayloadRouteError>
Process one OpenIPC/WFB 802.11 frame.
Sourcepub fn push_decrypted_80211_frame(
&mut self,
runtime: PayloadRuntimeKey,
frame: &[u8],
decrypted_fragment: &[u8],
options: &ReceiverBatchOptions,
) -> Result<ReceiverBatch, PayloadRouteError>
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.
Sourcepub fn push_decrypted_fragment(
&mut self,
runtime: PayloadRuntimeKey,
data_nonce: u64,
decrypted_fragment: &[u8],
options: &ReceiverBatchOptions,
) -> Result<ReceiverBatch, PayloadRouteError>
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
impl Clone for ReceiverRuntime
Source§fn clone(&self) -> ReceiverRuntime
fn clone(&self) -> ReceiverRuntime
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more