1#![deny(missing_debug_implementations)]
48#![warn(clippy::return_self_not_must_use)]
49#![cfg_attr(
50 not(test),
51 deny(
52 clippy::unwrap_used,
53 clippy::expect_used,
54 clippy::unreachable,
55 clippy::panic,
56 clippy::disallowed_macros
57 )
58)]
59#![cfg_attr(
65 all(test, target_os = "android"),
66 allow(
67 clippy::missing_const_for_thread_local,
68 reason = "false positive: the OS-key thread_local! expansion hides the const initializer"
69 )
70)]
71
72macro_rules! const_assert {
73 (@value $body:block) => {{
74 #[allow(clippy::disallowed_macros, reason = "checks evaluated only at compile time")]
75 let value = const $body;
76 value
77 }};
78 ($body:block) => {
79 #[allow(clippy::disallowed_macros, reason = "checks evaluated only at compile time")]
80 const _: () = $body;
81 };
82 ($($assertion:tt)+) => {
83 const_assert!({ assert!($($assertion)+) });
84 };
85}
86
87macro_rules! debug_invariant {
88 ($($args:tt)+) => {{
89 #[allow(clippy::disallowed_macros, reason = "this check runs only with debug assertions enabled")]
91 {
92 std::debug_assert!($($args)+);
93 }
94 }};
95}
96
97mod capture;
98mod change_feed;
99mod color_info;
100mod connection_metadata;
101mod error;
102#[cfg(any(ndi_has_advanced_keyframe_demand, all(test, feature = "advanced")))]
103mod keyframe_changes;
104mod list_setting;
105mod marker;
106mod media;
107mod pixels;
108mod rejected;
109mod sdk_copy;
110mod source_retention;
111mod sys;
112mod time;
113mod timeout;
114
115pub mod framesync;
116
117pub mod audio_conversion;
118pub mod finder;
119pub mod frames;
120pub mod receiver;
121pub mod runtime;
122pub mod sender;
123pub mod video_conversion;
124
125pub mod capabilities;
126#[path = "discovery/mod.rs"]
127pub mod discovery_server;
128pub mod routing;
129
130#[cfg(feature = "advanced")]
131pub mod advanced;
132
133#[cfg(feature = "file-io")]
134pub mod file;
135
136#[cfg(any(feature = "tokio", feature = "smol"))]
137pub mod asynchronous;
138
139#[cfg(feature = "image-encoding")]
140#[path = "image/mod.rs"]
141pub mod image_encoding;
142
143pub use {
144 capabilities::{
145 Capabilities, Capability, CapabilityRefusal, CapabilityStatus, CapabilityUnavailable,
146 RuntimeFeature, RuntimeInfo, SdkEdition, SdkLinkage, SdkVersion,
147 },
148 error::*,
149 finder::{Finder, FinderOptions, Source, SourceAddress, SourceCache, SourceWatch},
150 frames::{
151 AudioChannels, AudioFormat, AudioFrame, AudioFrameBuilder, AudioFrameRef, AudioSource,
152 BorrowedAudioFrame, BorrowedAudioFrameBuilder, BorrowedVideoFrame,
153 BorrowedVideoFrameBuilder, FormatCategory, FrameMetadataStatus, MetadataFrame,
154 MetadataFrameRef, MetadataSource, PixelFormat, PixelFormatInfo, ScanType, VideoFrame,
155 VideoFrameBuilder, VideoFrameRef, VideoPlane, VideoPlanes, VideoRows, VideoSource,
156 },
157 framesync::{
158 AudioInputFormat, FrameSync, FrameSyncAudioRef, FrameSyncAudioRequest, FrameSyncVideoRef,
159 },
160 receiver::{
161 AudioMode, ConnectionStats, EventMode, FrameSyncAttached, MetadataMode, Ptz, RawCapture,
162 ReceiveDelay, Receiver, ReceiverBandwidth, ReceiverColorFormat, ReceiverEvent,
163 ReceiverItem, ReceiverItemRef, ReceiverMode, ReceiverOptions, ReceiverStatus,
164 SettingChange, SourceNameChange, Tally, VideoMode,
165 },
166 runtime::{Ndi, ProcessLifetimeRuntime, Runtime, RuntimeOptions},
167 sender::{AudioSendMode, RawSend, RawVideo, Sender, SenderMode, SenderOptions},
168};
169
170pub use color_info::{ColorInfo, ColorPrimaries, TransferFunction, YuvMatrix};
171pub use media::{FourCc, FrameRate, MediaTypes, PictureAspectRatio, StreamTier};
172pub use rejected::Rejected;
173pub use time::{ReceivedTimestamp, SdkTimestamp, Timecode};
174
175pub type Result<T> = std::result::Result<T, crate::error::Error>;
177
178pub const MAX_TIMEOUT: std::time::Duration =
192 std::time::Duration::from_millis(timeout::MAX_MILLIS as u64);
193
194pub(crate) use timeout::to_ms_checked;
195
196#[cfg(test)]
197#[path = "tests.rs"]
198mod tests;
199
200#[cfg(test)]
201mod test_alloc;
202
203#[cfg(test)]
204mod test_support;
205
206#[cfg(ndi_test_receiver_proofs)]
207#[path = "../tests/ui/internal/receiver_proofs.rs"]
208mod receiver_proofs;
209
210#[cfg(any(
211 ndi_test_runtime_binding,
212 ndi_test_runtime_binding_control,
213 ndi_test_runtime_binding_privacy
214))]
215#[path = "../tests/ui/internal/runtime_binding.rs"]
216mod runtime_binding_contract;
217
218#[cfg(ndi_test_frame_source)]
219#[path = "../tests/ui/internal/frame_source.rs"]
220mod frame_source_contract;
221
222#[cfg(ndi_test_assertion_policy)]
223#[path = "../tests/ui/internal/assertion_policy.rs"]
224mod assertion_policy_contract;