1use crate::impl_thread_safety;
16
17#[cxx::bridge(namespace = "livekit_ffi")]
18pub mod ffi {
19 #[derive(Debug)]
20 #[repr(i32)]
21 pub enum MediaType {
22 Audio,
23 Video,
24 Data,
25 Unsupported,
26 }
27
28 #[derive(Debug)]
29 #[repr(i32)]
30 pub enum Priority {
31 VeryLow,
32 Low,
33 Medium,
34 High,
35 }
36
37 #[derive(Debug)]
38 #[repr(i32)]
39 pub enum RtpTransceiverDirection {
40 SendRecv,
41 SendOnly,
42 RecvOnly,
43 Inactive,
44 Stopped,
45 }
46
47 #[derive(Debug)]
48 #[repr(i32)]
49 pub enum LoggingSeverity {
50 Verbose,
51 Info,
52 Warning,
53 Error,
54 None,
55 }
56
57 #[derive(Debug, Clone, Copy, PartialEq, Eq)]
58 #[repr(i32)]
59 pub enum VideoEncoderBackend {
60 Auto,
61 Software,
62 Hardware,
63 Nvenc,
64 Vaapi,
65 VideoToolbox,
66 }
67
68 unsafe extern "C++" {
69 include!("livekit/webrtc.h");
70
71 type LogSink;
72
73 fn create_random_uuid() -> String;
74 fn video_encoder_backend_list() -> Vec<VideoEncoderBackend>;
75 fn new_log_sink(fnc: fn(String, LoggingSeverity)) -> UniquePtr<LogSink>;
76 }
77}
78
79impl_thread_safety!(ffi::LogSink, Send + Sync);