1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
//! SRT (Secure Reliable Transport) protocol implementation.
//!
//! This module provides a comprehensive implementation of the SRT protocol for
//! low-latency, secure, and reliable video streaming over UDP.
//!
//! # Key Types
//!
//! - [`SrtPacket`] - SRT packet structure (data or control)
//! - [`ControlPacket`] - Control packet types (handshake, ACK, NAK, etc.)
//! - [`DataPacket`] - Data packet with sequence numbers and timestamps
//! - [`SrtSocket`] - SRT socket state machine
//! - [`SrtConnection`] - High-level connection with async I/O
//! - [`SrtConfig`] - Configuration options
//!
//! # Protocol Features
//!
//! SRT provides UDP with reliability features:
//! - **Automatic Repeat Request (ARQ)** - Packet retransmission on loss
//! - **Congestion Control** - AIMD-based window management
//! - **Encryption** - AES-128/192/256 payload encryption
//! - **Loss Recovery** - Out-of-order packet handling and gap detection
//! - **Latency Control** - Configurable buffering and delivery
//!
//! # Architecture
//!
//! The implementation is organized into several modules:
//!
//! - `packet` - Packet encoding/decoding
//! - `socket` - State machine and protocol logic
//! - `connection` - UDP transport and async I/O
//! - `congestion` - Congestion control algorithm
//! - `crypto` - AES encryption
//! - `loss` - Loss detection and tracking
//!
//! # Example
//!
//! ```ignore
//! use oximedia_net::srt::{SrtConnection, SrtConfig};
//! use std::net::SocketAddr;
//!
//! async fn stream_video() -> NetResult<()> {
//! let local_addr: SocketAddr = "0.0.0.0:0".parse().expect("valid addr");
//! let peer_addr: SocketAddr = "127.0.0.1:9000".parse().expect("valid addr");
//!
//! let config = SrtConfig::new()
//! .with_latency(120)
//! .with_passphrase("secret");
//!
//! let conn = SrtConnection::new(local_addr, peer_addr, config).await?;
//! conn.connect(std::time::Duration::from_secs(3)).await?;
//!
//! conn.send(b"Hello, SRT!").await?;
//!
//! let mut buf = vec![0u8; 1316];
//! let len = conn.recv(&mut buf).await?;
//!
//! conn.close().await?;
//! Ok(())
//! }
//! ```
pub use CongestionControl;
pub use SrtConnection;
pub use ;
pub use ;
pub use ;
pub use KeyMaterial as KmxKeyMaterial;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;