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 fn with_mock_video_route(
frame_layout: FrameLayout,
video_route_id: PayloadRouteId,
channel_id: ChannelId,
key_slot: u64,
) -> Self
pub fn with_mock_video_route( frame_layout: FrameLayout, video_route_id: PayloadRouteId, channel_id: ChannelId, key_slot: u64, ) -> Self
Create a runtime with a fully synthetic video payload route.
Use Self::push_mock_payload to inject recovered payload bytes. The
bytes still pass through route fanout and the built-in RTP depacketizer,
so this is useful for no-hardware video, audio, and route tests.
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 rtp_status(&self) -> RtpDepacketizerStatus
pub fn rtp_status(&self) -> RtpDepacketizerStatus
Return cumulative RTP depacketizer diagnostics for the video route.
Sourcepub fn rtp_reorder_status(&self) -> RtpReorderStatus
pub fn rtp_reorder_status(&self) -> RtpReorderStatus
Return cumulative RTP reorder-buffer diagnostics for the video route.
Sourcepub fn set_rtp_reorder_enabled(&mut self, enabled: bool)
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.
Sourcepub const fn rtp_reorder_enabled(&self) -> bool
pub const fn rtp_reorder_enabled(&self) -> bool
Return true when RTP packets pass through the reorder buffer.
Sourcepub fn push_rtp_packet(
&mut self,
packet: &[u8],
) -> Result<Vec<DepacketizedFrame>, RtpError>
pub fn push_rtp_packet( &mut self, packet: &[u8], ) -> Result<Vec<DepacketizedFrame>, RtpError>
Process one raw RTP packet on the configured video route.
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 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 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_transfer_with_kind(
&mut self,
transfer: &[u8],
descriptor_kind: RxDescriptorKind,
options: &ReceiverBatchOptions,
) -> Result<ReceiverBatch, AggregateError>
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.
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.
Sourcepub fn push_mock_payload(
&mut self,
runtime: PayloadRuntimeKey,
packet_seq: u64,
payload: &[u8],
options: &ReceiverBatchOptions,
) -> Result<ReceiverBatch, PayloadRouteError>
pub fn push_mock_payload( &mut self, runtime: PayloadRuntimeKey, packet_seq: u64, payload: &[u8], options: &ReceiverBatchOptions, ) -> Result<ReceiverBatch, PayloadRouteError>
Process one fully synthetic recovered payload.
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