BlueGit

ict rusty-teams

Files

rusty-teams / vendor / libwebrtc / src / lib.rs

lib.rs

lib.rs 2.0 KiB Download Raw
1// Copyright 2025 LiveKit, Inc.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15use 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
21mod enum_dispatch;
22
23#[derive(Debug, Copy, Clone, PartialEq, Eq)]
24pub enum MediaType {
25 Audio,
26 Video,
27 Data,
28 Unsupported,
29}
30
31#[derive(Debug, Copy, Clone, PartialEq, Eq)]
32pub enum RtcErrorType {
33 Internal,
34 InvalidSdp,
35 InvalidState,
36}
37
38#[derive(Error, Debug)]
39#[error("an RtcError occurred: {error_type:?} - {message}")]
40pub struct RtcError {
41 pub error_type: RtcErrorType,
42 pub message: String,
43}
44
45pub mod audio_frame;
46pub mod audio_source;
47pub mod audio_stream;
48pub mod audio_track;
49pub mod data_channel;
50#[cfg(any(target_os = "macos", target_os = "windows", target_os = "linux"))]
51pub mod desktop_capturer;
52pub mod ice_candidate;
53pub mod media_stream;
54pub mod media_stream_track;
55pub mod peer_connection;
56pub mod peer_connection_factory;
57pub mod prelude;
58pub mod rtp_parameters;
59pub mod rtp_receiver;
60pub mod rtp_sender;
61pub mod rtp_transceiver;
62pub mod session_description;
63pub mod stats;
64pub mod video_frame;
65pub mod video_source;
66pub mod video_stream;
67pub mod video_track;
68
69#[cfg(not(target_arch = "wasm32"))]
70pub mod native {
71 pub use webrtc_sys::webrtc::ffi::create_random_uuid;
72
73 pub use crate::imp::{
74 apm, audio_mixer, audio_resampler, frame_cryptor, packet_trailer, yuv_helper,
75 };
76}
77
78#[cfg(target_os = "android")]
79pub mod android {
80 pub use crate::imp::android::*;
81}