From aca2e647a6887d95d21723d614c21545a7cdfe94 Mon Sep 17 00:00:00 2001 From: cloudwebrtc Date: Tue, 23 Sep 2025 10:39:24 +0800 Subject: [PATCH 1/6] fix tests CI. --- libwebrtc/src/video_source.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libwebrtc/src/video_source.rs b/libwebrtc/src/video_source.rs index 4efb9e365..c9e7e9729 100644 --- a/libwebrtc/src/video_source.rs +++ b/libwebrtc/src/video_source.rs @@ -58,7 +58,7 @@ pub mod native { impl Default for NativeVideoSource { fn default() -> Self { - Self::new(VideoResolution::default()) + Self::new(VideoResolution { width: 640, height: 480 }) } } From 8240702deb039aa7db6e486329c430de26eef70b Mon Sep 17 00:00:00 2001 From: CloudWebRTC Date: Tue, 23 Sep 2025 14:06:24 +0800 Subject: [PATCH 2/6] Update builds.yml --- .github/workflows/builds.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 99acf50c4..cbb194093 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -75,6 +75,11 @@ jobs: sudo apt update -y sudo apt install -y libssl-dev libx11-dev libgl1-mesa-dev libxext-dev + - name: Install VA-API/NVIDIA drivers for linux x64 build + if: ${{ matrix.os == 'ubuntu-latest'}} + run: | + sudo apt install -y libva-dev libdrm-dev libnvidia-compute-570 libnvidia-decode-570 nvidia-cuda-dev -y + - uses: actions-rs/toolchain@v1 with: toolchain: stable From 599abf302fb0edc5c1973049e8eb998c18e8fc95 Mon Sep 17 00:00:00 2001 From: cloudwebrtc Date: Tue, 23 Sep 2025 14:32:05 +0800 Subject: [PATCH 3/6] fix build for ios. --- webrtc-sys/build.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/webrtc-sys/build.rs b/webrtc-sys/build.rs index e2a3dcdfd..03bdbd700 100644 --- a/webrtc-sys/build.rs +++ b/webrtc-sys/build.rs @@ -219,6 +219,7 @@ fn main() { .flag("-std=c++20"); } "ios" => { + println!("cargo:rustc-link-lib=framework=Foundation"); println!("cargo:rustc-link-lib=framework=CoreFoundation"); println!("cargo:rustc-link-lib=framework=AVFoundation"); println!("cargo:rustc-link-lib=framework=CoreAudio"); From 5b860a6ed09ae5fc19bea661620feb2a6d75dafd Mon Sep 17 00:00:00 2001 From: cloudwebrtc Date: Tue, 23 Sep 2025 15:02:23 +0800 Subject: [PATCH 4/6] add VideoResolution::default(). --- libwebrtc/src/video_source.rs | 11 +++++++++-- livekit/tests/data_channel_test.rs | 6 ++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/libwebrtc/src/video_source.rs b/libwebrtc/src/video_source.rs index c9e7e9729..aff6bf1b7 100644 --- a/libwebrtc/src/video_source.rs +++ b/libwebrtc/src/video_source.rs @@ -16,12 +16,19 @@ use livekit_protocol::enum_dispatch; use crate::imp::video_source as vs_imp; -#[derive(Default, Debug, Clone)] +#[derive(Debug, Clone)] pub struct VideoResolution { pub width: u32, pub height: u32, } +impl Default for VideoResolution { + // Default to 720p + fn default() -> Self { + VideoResolution{width: 1280, height: 720} + } +} + #[non_exhaustive] #[derive(Debug, Clone)] pub enum RtcVideoSource { @@ -58,7 +65,7 @@ pub mod native { impl Default for NativeVideoSource { fn default() -> Self { - Self::new(VideoResolution { width: 640, height: 480 }) + Self::new(VideoResolution::default()) } } diff --git a/livekit/tests/data_channel_test.rs b/livekit/tests/data_channel_test.rs index 921386f31..eeb622a91 100644 --- a/livekit/tests/data_channel_test.rs +++ b/livekit/tests/data_channel_test.rs @@ -51,6 +51,7 @@ async fn test_reliable_retry() -> Result<()> { if let RoomEvent::DataReceived { payload, .. } = event { assert_eq!(payload.len(), PAYLOAD_SIZE); packets_received += 1; + println!("Received packet {}/{}", packets_received, ITERATIONS); if packets_received == ITERATIONS { fulfill.send(()).ok(); break; @@ -60,7 +61,7 @@ async fn test_reliable_retry() -> Result<()> { } }); - for _ in 0..ITERATIONS { + for i in 0..ITERATIONS { let packet = DataPacket { reliable: true, payload: [0xFA; PAYLOAD_SIZE].to_vec(), @@ -68,10 +69,11 @@ async fn test_reliable_retry() -> Result<()> { ..Default::default() }; sending_room.local_participant().publish_data(packet).await?; + println!("Sent packet {}/{}", i + 1, ITERATIONS); time::sleep(Duration::from_millis(10)).await; } - match time::timeout(Duration::from_secs(15), expectation).await { + match time::timeout(Duration::from_secs(20), expectation).await { Ok(Ok(())) => Ok(()), Ok(Err(_)) => Err(anyhow!("Not all packets were received")), Err(_) => Err(anyhow!("Timed out waiting for packets")), From 8306a02407d5ba96a1cc59c2d0073003dd4bd2cb Mon Sep 17 00:00:00 2001 From: cloudwebrtc Date: Tue, 23 Sep 2025 15:04:44 +0800 Subject: [PATCH 5/6] revert changes. --- livekit/tests/data_channel_test.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/livekit/tests/data_channel_test.rs b/livekit/tests/data_channel_test.rs index eeb622a91..921386f31 100644 --- a/livekit/tests/data_channel_test.rs +++ b/livekit/tests/data_channel_test.rs @@ -51,7 +51,6 @@ async fn test_reliable_retry() -> Result<()> { if let RoomEvent::DataReceived { payload, .. } = event { assert_eq!(payload.len(), PAYLOAD_SIZE); packets_received += 1; - println!("Received packet {}/{}", packets_received, ITERATIONS); if packets_received == ITERATIONS { fulfill.send(()).ok(); break; @@ -61,7 +60,7 @@ async fn test_reliable_retry() -> Result<()> { } }); - for i in 0..ITERATIONS { + for _ in 0..ITERATIONS { let packet = DataPacket { reliable: true, payload: [0xFA; PAYLOAD_SIZE].to_vec(), @@ -69,11 +68,10 @@ async fn test_reliable_retry() -> Result<()> { ..Default::default() }; sending_room.local_participant().publish_data(packet).await?; - println!("Sent packet {}/{}", i + 1, ITERATIONS); time::sleep(Duration::from_millis(10)).await; } - match time::timeout(Duration::from_secs(20), expectation).await { + match time::timeout(Duration::from_secs(15), expectation).await { Ok(Ok(())) => Ok(()), Ok(Err(_)) => Err(anyhow!("Not all packets were received")), Err(_) => Err(anyhow!("Timed out waiting for packets")), From 8e1040a7efbfb80ffbeec059f34b23aa80f51261 Mon Sep 17 00:00:00 2001 From: cloudwebrtc Date: Tue, 23 Sep 2025 15:16:25 +0800 Subject: [PATCH 6/6] fmt. --- libwebrtc/src/video_source.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libwebrtc/src/video_source.rs b/libwebrtc/src/video_source.rs index aff6bf1b7..ff2d8826f 100644 --- a/libwebrtc/src/video_source.rs +++ b/libwebrtc/src/video_source.rs @@ -25,7 +25,7 @@ pub struct VideoResolution { impl Default for VideoResolution { // Default to 720p fn default() -> Self { - VideoResolution{width: 1280, height: 720} + VideoResolution { width: 1280, height: 720 } } }