Skip to main content

oximedia_net/
lib.rs

1//! Network streaming for `OxiMedia`.
2//!
3//! This crate provides network streaming protocols for the `OxiMedia` multimedia
4//! framework. It supports various streaming protocols including:
5//!
6//! - **HLS** (HTTP Live Streaming) - Apple's adaptive streaming protocol
7//! - **DASH** (Dynamic Adaptive Streaming over HTTP) - MPEG-DASH streaming
8//! - **RTMP** (Real-Time Messaging Protocol) - Flash streaming protocol
9//! - **SRT** (Secure Reliable Transport) - Low-latency streaming
10//! - **WebRTC** - Real-time browser communication
11//! - **SMPTE ST 2110** - Professional media over IP (uncompressed video/audio/ANC)
12//! - **CDN** - Multi-CDN failover and load balancing
13//!
14//! # Overview
15//!
16//! Each streaming protocol module provides:
17//! - Protocol-specific packet/message types
18//! - Parsing and serialization
19//! - Session management
20//! - Adaptive bitrate support where applicable
21//!
22//! The CDN module provides:
23//! - Multi-CDN provider support (Cloudflare, Fastly, Akamai, CloudFront, Custom)
24//! - Real-time health monitoring
25//! - Automatic failover with circuit breaker pattern
26//! - Intelligent routing strategies
27//! - Performance metrics and SLA monitoring
28//!
29//! The SMPTE ST 2110 module provides:
30//! - Uncompressed video transport (ST 2110-20)
31//! - PCM audio transport (ST 2110-30)
32//! - Ancillary data transport (ST 2110-40)
33//! - PTP synchronization (IEEE 1588)
34//! - SDP session description
35//! - Broadcast-quality professional media over IP
36//!
37//! # Example
38//!
39//! ```ignore
40//! use oximedia_net::hls::{MasterPlaylist, MediaPlaylist};
41//! use oximedia_net::error::NetResult;
42//!
43//! async fn fetch_playlist(url: &str) -> NetResult<MasterPlaylist> {
44//!     // Fetch and parse HLS master playlist
45//!     todo!()
46//! }
47//! ```
48
49#![warn(missing_docs)]
50#![allow(
51    clippy::cast_possible_truncation,
52    clippy::cast_precision_loss,
53    clippy::cast_sign_loss,
54    dead_code,
55    clippy::pedantic,
56    clippy::must_use_candidate,
57    clippy::missing_errors_doc,
58    clippy::missing_panics_doc,
59    clippy::similar_names,
60    clippy::items_after_statements,
61    clippy::option_map_unit_fn
62)]
63
64pub mod abr;
65pub mod abr_buffer;
66pub mod bandwidth_adaptation;
67pub mod bandwidth_estimator;
68pub mod bandwidth_probe;
69pub mod bandwidth_throttle;
70pub mod bandwidth_trigger;
71pub mod buffer_model;
72pub mod cdn;
73pub mod connection_pool;
74pub mod dash;
75pub mod error;
76pub mod fec;
77pub mod fec_interleave;
78pub mod flow_control;
79pub mod hls;
80pub mod http2;
81pub mod ice;
82pub mod live;
83pub mod ll_dash;
84pub mod ll_dash_config;
85pub mod manifest_cache;
86pub mod mdns;
87pub mod multicast;
88pub mod multicast_manager;
89pub mod multipath;
90pub mod network_path;
91pub mod network_simulator;
92pub mod pacing;
93pub mod packet_buffer;
94pub mod playlist_parser;
95pub mod protocol_detect;
96pub mod qos_monitor;
97pub mod quic;
98pub mod quic_datagram;
99pub mod relay;
100pub mod retry_policy;
101pub mod rist;
102pub mod rtmp;
103pub mod rtp_session;
104pub mod rtsp;
105pub mod session_tracker;
106pub mod smpte2022_7;
107pub mod smpte2110;
108pub mod srt;
109pub mod srt_aes256gcm;
110pub mod srt_config;
111pub mod srt_group;
112pub mod srt_pacing;
113pub mod stream_health_monitor;
114pub mod stream_mux;
115pub mod webrtc;
116pub mod websocket;
117pub mod whep_client;
118pub mod whip;
119pub mod whip_whep;
120pub mod zero_copy_serve;
121pub mod zixi;
122
123// Re-export commonly used items
124pub use error::{NetError, NetResult};
125
126// Re-export SRT stats and key exchange types
127pub use srt::{DirectionStats, RttStats, SrtStreamStats, StreamQuality};
128pub use srt::{EncryptionSession, EncryptionState, KmxKeyMaterial, KwAlgorithm};
129
130// Re-export streaming ABR types
131pub use abr::streaming::{
132    AbrBandwidthEstimator as BandwidthEstimator, AbrController, AbrSwitchReason, AbrVariant,
133    BandwidthSample, BufferedSegment, SegmentFetcher, SelectionResult,
134};