BlueGit

ict rusty-teams

Files

rusty-teams / vendor / libwebrtc / src / native / mod.rs

mod.rs

mod.rs 2.1 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
15#[cfg(target_os = "android")]
16pub mod android;
17pub mod apm;
18pub mod audio_mixer;
19pub mod audio_resampler;
20pub mod audio_source;
21pub mod audio_stream;
22pub mod audio_track;
23pub mod data_channel;
24#[cfg(any(target_os = "macos", target_os = "windows", target_os = "linux"))]
25pub mod desktop_capturer;
26pub mod frame_cryptor;
27pub mod ice_candidate;
28pub mod media_stream;
29pub mod media_stream_track;
30pub mod packet_trailer;
31pub mod peer_connection;
32pub mod peer_connection_factory;
33pub mod rtp_parameters;
34pub mod rtp_receiver;
35pub mod rtp_sender;
36pub mod rtp_transceiver;
37pub mod session_description;
38pub mod video_frame;
39pub mod video_source;
40pub mod video_stream;
41pub mod video_track;
42pub mod yuv_helper;
43
44use webrtc_sys::{rtc_error as sys_err, webrtc as sys_rtc};
45
46use crate::{MediaType, RtcError, RtcErrorType};
47
48impl From<sys_err::ffi::RtcErrorType> for RtcErrorType {
49 fn from(value: sys_err::ffi::RtcErrorType) -> Self {
50 match value {
51 sys_err::ffi::RtcErrorType::InvalidState => Self::InvalidState,
52 _ => Self::Internal,
53 }
54 }
55}
56
57impl From<sys_err::ffi::RtcError> for RtcError {
58 fn from(value: sys_err::ffi::RtcError) -> Self {
59 Self { error_type: value.error_type.into(), message: value.message }
60 }
61}
62
63impl From<MediaType> for sys_rtc::ffi::MediaType {
64 fn from(value: MediaType) -> Self {
65 match value {
66 MediaType::Audio => Self::Audio,
67 MediaType::Video => Self::Video,
68 MediaType::Data => Self::Data,
69 MediaType::Unsupported => Self::Unsupported,
70 }
71 }
72}