Skip to main content

Module receiver

Module receiver 

Source
Expand description

NDI receiving functionality for video, audio, and metadata.

§Connection state and SDK status reports

Poll Receiver::is_connected or Receiver::connection_stats to track connections. Losing a connection can produce no ReceiverEvent::StatusChanged event; that event reports SDK status information, such as source capabilities:

let options = ReceiverOptions::new(source).bandwidth(ReceiverBandwidth::MetadataOnly);
let receiver = Receiver::new(&ndi, &options)?;

if let Some(ReceiverEvent::StatusChanged(_)) =
    receiver.next_event(Duration::from_millis(1000))?
{
    println!("The SDK reported a status change");
}
// Query connection state even when no status event arrived.
println!("Connected: {}", receiver.is_connected());
println!("Active connections: {}", receiver.connection_stats()?.connections());

See status_monitor.rs for a runnable connection monitor.

Structs§

ConnectionStats
Connection and performance statistics for a receiver.
Ptz
Pan, tilt, zoom, focus, white balance and exposure control of the source a Receiver is connected to, from Receiver::ptz.
ReceiveDelay
A receiver’s native video or audio buffering delay.
Receiver
An owned NDI receiver. The default mode permits all raw capture kinds. FrameSync and the Advanced AvSync change the mode of the receiver they hold while retaining the same resource core. The Advanced PacketReceiver creates its receiver in PacketAttached mode; see ReceiverMode.
ReceiverOptions
Configuration for creating a Receiver, including an optional initial source and how the receiver delivers media.
ReceiverStatus
What a status-change notification reports: the current connection count.
Tally
Whether a source is shown on program output, on preview, or both.

Enums§

FrameSyncAttached
Receiver mode held exclusively by crate::FrameSync, whose synchronizer takes the receiver’s video and audio.
RawCapture
Ordinary receiver mode, permitting raw video capture.
ReceiverBandwidth
Operational bandwidth modes for receivers.
ReceiverColorFormat
Operational color formats for received video frames.
ReceiverEvent
A coalesced receiver invalidation, not an ordered event history.
ReceiverItem
An owned item delivered by Receiver::capture_any or an async receiver’s combined capture. Media buffers and metadata can outlive the receiver and move between threads.
ReceiverItemRef
An item delivered by Receiver::capture_any_ref. Media borrows native storage and keeps the receiver borrowed until its matching guard is dropped. Borrowed capture allocates and copies no payload; video row and audio channel padding are never exposed as initialized slices.
SettingChange
Whether a setting changed.
SourceNameChange
A source-name change observed by the native receiver.

Traits§

AudioMode
Sealed receiver mode in which the receiver’s own audio and metadata capture are available: RawCapture.
EventMode
Sealed receiver mode permitting event polling: RawCapture.
MetadataMode
Sealed receiver mode permitting typed metadata capture: RawCapture, FrameSyncAttached and, with advanced, AvSyncAttached.
ReceiverMode
Sealed receiver capability mode: what a Receiver may do besides its common controls.
VideoMode
Sealed receiver mode in which the receiver’s own video capture is available: RawCapture and, with the advanced feature, the AvSyncAttached mode of an Advanced AvSync’s receiver.