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§
- Connection
Stats - Connection and performance statistics for a receiver.
- Ptz
- Pan, tilt, zoom, focus, white balance and exposure control of the source a
Receiveris connected to, fromReceiver::ptz. - Receive
Delay - A receiver’s native video or audio buffering delay.
- Receiver
- An owned NDI receiver. The default mode permits all raw capture kinds.
FrameSyncand the AdvancedAvSyncchange the mode of the receiver they hold while retaining the same resource core. The AdvancedPacketReceivercreates its receiver inPacketAttachedmode; seeReceiverMode. - Receiver
Options - Configuration for creating a
Receiver, including an optional initial source and how the receiver delivers media. - Receiver
Status - What a status-change notification reports: the current connection count.
- Tally
- Whether a source is shown on program output, on preview, or both.
Enums§
- Frame
Sync Attached - Receiver mode held exclusively by
crate::FrameSync, whose synchronizer takes the receiver’s video and audio. - RawCapture
- Ordinary receiver mode, permitting raw video capture.
- Receiver
Bandwidth - Operational bandwidth modes for receivers.
- Receiver
Color Format - Operational color formats for received video frames.
- Receiver
Event - A coalesced receiver invalidation, not an ordered event history.
- Receiver
Item - An owned item delivered by
Receiver::capture_anyor an async receiver’s combined capture. Media buffers and metadata can outlive the receiver and move between threads. - Receiver
Item Ref - 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. - Setting
Change - Whether a setting changed.
- Source
Name Change - A source-name change observed by the native receiver.
Traits§
- Audio
Mode - Sealed receiver mode in which the receiver’s own audio and metadata
capture are available:
RawCapture. - Event
Mode - Sealed receiver mode permitting event polling:
RawCapture. - Metadata
Mode - Sealed receiver mode permitting typed metadata capture:
RawCapture,FrameSyncAttachedand, withadvanced,AvSyncAttached. - Receiver
Mode - Sealed receiver capability mode: what a
Receivermay do besides its common controls. - Video
Mode - Sealed receiver mode in which the receiver’s own video capture is
available:
RawCaptureand, with theadvancedfeature, theAvSyncAttachedmode of an AdvancedAvSync’s receiver.