1use thiserror::Error;
16
17#[cfg_attr(target_arch = "wasm32", path = "web/mod.rs")]
18#[cfg_attr(not(target_arch = "wasm32"), path = "native/mod.rs")]
19mod imp;
20
21#[derive(Debug, Copy, Clone, PartialEq, Eq)]
22pub enum MediaType {
23 Audio,
24 Video,
25 Data,
26 Unsupported,
27}
28
29#[derive(Debug, Copy, Clone, PartialEq, Eq)]
30pub enum RtcErrorType {
31 Internal,
32 InvalidSdp,
33 InvalidState,
34}
35
36#[derive(Error, Debug)]
37#[error("an RtcError occured: {error_type:?} - {message}")]
38pub struct RtcError {
39 pub error_type: RtcErrorType,
40 pub message: String,
41}
42
43pub mod audio_frame;
44pub mod audio_source;
45pub mod audio_stream;
46pub mod audio_track;
47pub mod data_channel;
48#[cfg(any(target_os = "macos", target_os = "windows", target_os = "linux"))]
49pub mod desktop_capturer;
50pub mod ice_candidate;
51pub mod media_stream;
52pub mod media_stream_track;
53pub mod peer_connection;
54pub mod peer_connection_factory;
55pub mod prelude;
56pub mod rtp_parameters;
57pub mod rtp_receiver;
58pub mod rtp_sender;
59pub mod rtp_transceiver;
60pub mod session_description;
61pub mod stats;
62pub mod video_frame;
63pub mod video_source;
64pub mod video_stream;
65pub mod video_track;
66
67#[cfg(not(target_arch = "wasm32"))]
68pub mod native {
69 pub use gosuto_webrtc_sys::webrtc::ffi::create_random_uuid;
70
71 pub use crate::imp::{apm, audio_mixer, audio_resampler, frame_cryptor, yuv_helper};
72}
73
74#[cfg(target_os = "android")]
75pub mod android {
76 pub use crate::imp::android::*;
77}