feat: add ffi datachannel & mute events (#88)
This commit is contained in:
@@ -106,7 +106,7 @@ pub fn run(rt: tokio::runtime::Runtime) {
|
||||
AsyncCmd::RoomConnect { url, token } => {
|
||||
state.connecting.store(true, Ordering::SeqCst);
|
||||
|
||||
let res = Room::connect(&url, &token).await;
|
||||
let res = Room::connect(&url, &token, RoomOptions::default()).await;
|
||||
if let Ok((room, room_events)) = res {
|
||||
let room = Arc::new(room);
|
||||
let (close_tx, close_rx) = oneshot::channel();
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
use image::ImageFormat;
|
||||
use image::RgbaImage;
|
||||
use livekit::options::{TrackPublishOptions, VideoCaptureOptions};
|
||||
use livekit::options::TrackPublishOptions;
|
||||
use livekit::prelude::*;
|
||||
use livekit::webrtc::video_source::RtcVideoSource;
|
||||
use livekit::webrtc::{
|
||||
native::yuv_helper,
|
||||
video_frame::native::I420BufferExt,
|
||||
@@ -61,8 +62,7 @@ impl LogoTrack {
|
||||
let (close_tx, close_rx) = oneshot::channel();
|
||||
let track = LocalVideoTrack::create_video_track(
|
||||
"livekit_logo",
|
||||
VideoCaptureOptions::default(),
|
||||
self.rtc_source.clone(),
|
||||
RtcVideoSource::Native(self.rtc_source.clone()),
|
||||
);
|
||||
|
||||
let task = tokio::spawn(Self::track_task(close_rx, self.rtc_source.clone()));
|
||||
@@ -118,7 +118,7 @@ impl LogoTrack {
|
||||
video_frame: Arc::new(Mutex::new(VideoFrame {
|
||||
rotation: VideoRotation::VideoRotation0,
|
||||
buffer: I420Buffer::new(FB_WIDTH as u32, FB_HEIGHT as u32),
|
||||
timestamp: 0,
|
||||
timestamp_us: 0,
|
||||
})),
|
||||
pos: (0, 0),
|
||||
direction: (1, 1),
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use livekit::options::{AudioCaptureOptions, TrackPublishOptions};
|
||||
use livekit::options::TrackPublishOptions;
|
||||
use livekit::webrtc::audio_frame::AudioFrame;
|
||||
use livekit::webrtc::audio_source::RtcAudioSource;
|
||||
use livekit::{prelude::*, webrtc::audio_source::native::NativeAudioSource};
|
||||
use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
@@ -54,12 +55,7 @@ impl SineTrack {
|
||||
let (close_tx, close_rx) = oneshot::channel();
|
||||
let track = LocalAudioTrack::create_audio_track(
|
||||
"sine_wave",
|
||||
AudioCaptureOptions {
|
||||
auto_gain_control: false,
|
||||
echo_cancellation: false,
|
||||
noise_suppression: false,
|
||||
},
|
||||
self.rtc_source.clone(),
|
||||
RtcAudioSource::Native(self.rtc_source.clone()),
|
||||
);
|
||||
|
||||
let task = tokio::spawn(Self::track_task(close_rx, self.rtc_source.clone()));
|
||||
|
||||
Reference in New Issue
Block a user