Skip to main content

neteq/
lib.rs

1/*
2 * Copyright 2025 Security Union LLC
3 *
4 * Licensed under either of
5 *
6 * * Apache License, Version 2.0
7 *   (http://www.apache.org/licenses/LICENSE-2.0)
8 * * MIT license
9 *   (http://opensource.org/licenses/MIT)
10 *
11 * at your option.
12 *
13 * Unless you explicitly state otherwise, any contribution intentionally
14 * submitted for inclusion in the work by you, as defined in the Apache-2.0
15 * license, shall be dual licensed as above, without any additional terms or
16 * conditions.
17 */
18
19//! # Rust NetEQ
20//!
21//! A NetEQ-inspired adaptive jitter buffer implementation for audio decoding.
22//! This library provides functionality to handle network jitter, packet reordering,
23//! and adaptive buffering for real-time audio applications.
24
25pub mod buffer;
26pub mod buffer_level_filter;
27pub mod codec;
28pub mod delay_manager;
29pub mod error;
30pub mod expand;
31pub mod histogram;
32pub mod neteq;
33pub mod packet;
34pub mod signal;
35pub mod statistics;
36pub mod time_stretch;
37
38pub use statistics::q14;
39
40#[cfg(all(feature = "web", target_arch = "wasm32"))]
41pub mod web;
42
43pub use error::{NetEqError, Result};
44pub use neteq::{NetEq, NetEqConfig, NetEqStats, Operation};
45pub use packet::{AudioPacket, RtpHeader};
46
47#[cfg(all(feature = "web", target_arch = "wasm32"))]
48pub use web::WebNetEq;
49
50#[cfg(test)]
51mod tests {
52    use super::*;
53
54    #[test]
55    fn basic_functionality() {
56        let config = NetEqConfig::default();
57        let neteq = NetEq::new(config).unwrap();
58
59        // Test basic operations
60        assert_eq!(neteq.target_delay_ms(), 80); // Now starts with kStartDelayMs
61        assert!(neteq.is_empty());
62    }
63}