Compare commits

...
3 Commits
Author SHA1 Message Date
VallierDevandClaude Opus 5.5 369b493e47 Release v0.1.28
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-17 02:38:28 +08:00
VallierDevandClaude Opus 5.5 ce28d7e230 Tests: run local WebRTC peers on a virtual network
The codec-negotiation and ICE/SCTP acceptance tests used real local sockets
and occasionally hit the 30 s connect timeout when the whole suite ran in
parallel. They now use webrtc-rs vnet (shared test_network helper), so they
are deterministic and the acceptance test no longer needs #[ignore].
Test-only change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-17 02:37:53 +08:00
VallierDevandClaude Opus 5.5 b0beba1a4e desktop-video-probe: fixed input via UU_PROBE_INPUT (#9)
UU_PROBE_INPUT=<video or image sequence> bypasses desktop capture and encodes
the file with the production FFmpeg encoder arguments, so encoder
measurements no longer depend on desktop content; UU_PROBE_LOOP=1 repeats the
input up to UU_PROBE_FRAMES. Missing/undecodable input exits non-zero. The
session path is unchanged. Verified with Y4M, MP4 and PNG sequences (repeat
runs byte-identical); NVENC/VAAPI not hardware-verified.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-17 01:50:24 +08:00
11 changed files with 202 additions and 31 deletions

No files matched your search

+1 -1
View File
@@ -145,7 +145,7 @@ every 60 s.
| `src/assist.rs`, `c_engine/assist_window.c` | remote assistance (guest + account) and the unified GTK main window (assist + account/QR card) |
Diagnostic subcommands: `login [--no-gui]`, `unlock-check` (password on stdin, prints only accepted/rejected),
`desktop-probe [new.png]`, `desktop-video-probe` (`UU_PROBE_FPS`, `UU_PROBE_FRAMES`, `UU_PROBE_QUALITY` 1-5 = viewer bitrate preset, 5 auto), `wayland-input-probe`, `clipboard-acceptance`,
`desktop-probe [new.png]`, `desktop-video-probe` (`UU_PROBE_FPS`, `UU_PROBE_FRAMES`, `UU_PROBE_QUALITY` 1-5 = viewer bitrate preset, 5 auto; `UU_PROBE_INPUT` fixed video/image sequence, `UU_PROBE_LOOP=1` repeats), `wayland-input-probe`, `clipboard-acceptance`,
`portal-acceptance`, `help`. Unknown arguments exit with code 2. Builds up to v0.1.0 did **not** reject them and
started a second full host server instead, so check that a subcommand exists in the binary you run.
Generated
+1 -1
View File
@@ -2717,7 +2717,7 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
[[package]]
name = "uu-remote-linux"
version = "0.1.27"
version = "0.1.28"
dependencies = [
"async-trait",
"base64 0.22.1",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "uu-remote-linux"
version = "0.1.27"
version = "0.1.28"
edition = "2021"
authors = ["uu-remote-linux contributors"]
description = "Unofficial Linux host for NetEase UU Remote: control a Linux desktop from the official clients"
+2
View File
@@ -272,6 +272,8 @@ If you use Claude Code, Codex, Cursor or a similar coding agent, have it read [A
It is written for language models: build and install steps, a code map, protocol notes and development rules,
enough to take over installation or development.
For local encoding diagnostics, `desktop-video-probe [output.h264]` accepts `UU_PROBE_FPS`, `UU_PROBE_FRAMES` (default 5), and `UU_PROBE_QUALITY` (1–5); set `UU_PROBE_INPUT=clip.y4m` (also `.mp4` or `frames/%05d.png`) to bypass desktop capture and measure fixed input with the same production FFmpeg encoding options, printing dimensions and encoding statistics, and optionally `UU_PROBE_LOOP=1` to repeat until the requested frame count (unreadable or short input exits nonzero; fixed input always uses the external FFmpeg pipeline).
## How it works
```mermaid
+2
View File
@@ -237,6 +237,8 @@ systemctl --user restart uuremote-native.service
选择码率档(原画 / 超清 / 高清 / 自定义)时,外部 FFmpeg 的 CPU 编码以平均码率(ABR)为目标,避免 4K 低码率下关键帧发灰;「自动」档仍使用恒定质量(CRF)。
本地编码诊断 `desktop-video-probe [output.h264]` 可设置 `UU_PROBE_FPS`、`UU_PROBE_FRAMES`(默认 5)和 `UU_PROBE_QUALITY`(1–5);设置 `UU_PROBE_INPUT=clip.y4m`(也支持 `.mp4`、`frames/%05d.png`)可绕过桌面采集,以相同的生产 FFmpeg 编码参数测量固定输入并打印分辨率和编码统计,`UU_PROBE_LOOP=1` 循环到指定帧数,输入无法打开或帧数不足时以非零状态退出(固定输入始终使用外部 FFmpeg 管线)。
## 让 AI 帮你安装或开发
如果你用 Claude Code、Codex、Cursor 等 AI 编程工具,让它先阅读 [AGENTS.md](AGENTS.md)。
+16
View File
@@ -0,0 +1,16 @@
编码探针支持固定输入,测试更稳定。/ Fixed-input encoder probe and deterministic WebRTC tests.
### 新增 / Added
- **`desktop-video-probe` 支持固定输入**(#9,感谢 @hiclaw 的建议):设置 `UU_PROBE_INPUT=<视频或图片序列>`(如 `clip.y4m`、
`clip.mp4`、`frames/%05d.png`)时不采集桌面,而是用与生产会话相同的 FFmpeg 编码参数(编码器、码率档、GOP、色度、缩放)
编码该输入,消除桌面内容对测量的影响;`UU_PROBE_LOOP=1` 循环输入直到 `UU_PROBE_FRAMES`。输入打不开或帧数不足时非零退出。
正常会话路径不变。已用 Y4M、MP4、PNG 序列验证,重复运行输出逐字节一致。⚠️ NVENC/VAAPI 下的固定输入未实机验证。
`desktop-video-probe` can encode a fixed input (`UU_PROBE_INPUT`) with the production encoder arguments.
### 内部 / Internal
- 本地 WebRTC 单测改用虚拟网络,修复全量并行测试时偶发的 30 秒超时。/ Local WebRTC tests run on a virtual network.
### 下载 / Download
`uu-remote-linux-v0.1.28-x86_64-linux.tar.gz`:X11 版可执行文件(x86_64,glibc ≥ 2.35),附带 `contrib/`。
**非官方项目,与网易无关。** / **Unofficial, not affiliated with NetEase.**
+5
View File
@@ -25,6 +25,8 @@ mod terminal;
mod webrtc;
mod video;
mod video_track;
#[cfg(test)]
mod test_network;
mod hevc;
#[cfg(feature = "inproc-av")]
mod damage_capture;
@@ -318,6 +320,9 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
return Ok(());
}
if std::env::args().nth(1).as_deref() == Some("desktop-video-probe") {
if let Some(input)=std::env::var_os("UU_PROBE_INPUT") {
return video::probe_input(input,std::env::args().nth(2)).await.map_err(|e|e.into());
}
let screen=ScreenCapture::new()?;
capture::keep_display_awake()?;
return video::probe((screen.width,screen.height),screen.display.clone(),screen.portal.clone(),std::env::args().nth(2)).await.map_err(|e|e.into());
+8 -8
View File
@@ -154,22 +154,21 @@ mod tests {
assert_eq!(rates.sample(now + std::time::Duration::from_secs(3), 0, 0), None);
}
/// Exercises actual ICE nomination and SCTP delivery between local peers, without
/// Exercises actual ICE nomination and SCTP delivery between virtual peers, without
/// login, public STUN, external endpoints or production configuration.
#[tokio::test]
#[ignore = "opens local UDP sockets; run explicitly for network acceptance"]
async fn local_selected_pair_and_payload() {
use std::sync::Arc;
use webrtc::api::{APIBuilder, setting_engine::SettingEngine};
use webrtc::api::APIBuilder;
use webrtc::peer_connection::configuration::RTCConfiguration;
let mut settings = SettingEngine::default();
// This crate excludes loopback addresses during ICE gathering. Both
// peers still run in this process and use only gathered local addresses.
settings.set_ice_multicast_dns_mode(webrtc::ice::mdns::MulticastDnsMode::Disabled);
let (left_setting, right_setting, router) = crate::test_network::virtual_network().await;
let mut media = webrtc::api::media_engine::MediaEngine::default();
media.register_default_codecs().unwrap();
let api = APIBuilder::new().with_media_engine(media).with_setting_engine(settings).build();
let api = APIBuilder::new().with_media_engine(media).with_setting_engine(left_setting).build();
let left = Arc::new(api.new_peer_connection(RTCConfiguration::default()).await.unwrap());
let mut media = webrtc::api::media_engine::MediaEngine::default();
media.register_default_codecs().unwrap();
let api = APIBuilder::new().with_media_engine(media).with_setting_engine(right_setting).build();
let right = Arc::new(api.new_peer_connection(RTCConfiguration::default()).await.unwrap());
for (label, peer) in [("left", &left), ("right", &right)] {
peer.on_peer_connection_state_change(Box::new(move |state| {
@@ -222,6 +221,7 @@ mod tests {
let outcome = tokio::time::timeout(std::time::Duration::from_secs(15), acceptance).await;
left.close().await.unwrap();
right.close().await.unwrap();
router.lock().await.stop().await.unwrap();
outcome.expect("isolated local ICE/SCTP did not connect within 15 seconds");
}
}
+26
View File
@@ -0,0 +1,26 @@
use std::sync::Arc;
use tokio::sync::Mutex;
use webrtc::{api::setting_engine::SettingEngine, ice::{mdns::MulticastDnsMode, network_type::NetworkType},
util::vnet::{net::{Net, NetConfig}, router::{Router, RouterConfig}}};
pub(crate) async fn virtual_network() -> (SettingEngine, SettingEngine, Arc<Mutex<Router>>) {
// Each pair owns its router and address space; no host interfaces or sockets are used.
let router = Arc::new(Mutex::new(Router::new(RouterConfig {
cidr: "192.0.2.0/24".into(), ..Default::default()
}).unwrap()));
let mut settings = Vec::new();
for ip in ["192.0.2.1", "192.0.2.2"] {
let net = Arc::new(Net::new(Some(NetConfig { static_ips: vec![ip.into()], ..Default::default() })));
let nic = net.get_nic().unwrap();
router.lock().await.add_net(nic.clone()).await.unwrap();
nic.lock().await.set_router(router.clone()).await.unwrap();
let mut setting = SettingEngine::default();
setting.set_vnet(Some(net));
setting.set_network_types(vec![NetworkType::Udp4]);
setting.set_ice_multicast_dns_mode(MulticastDnsMode::Disabled);
settings.push(setting);
}
router.lock().await.start().await.unwrap();
let right = settings.pop().unwrap();
(settings.pop().unwrap(), right, router)
}
+136 -13
View File
@@ -238,6 +238,11 @@ fn encoder_options(settings: &VideoSettings, encoder: Encoder, gop: &str, rgb: O
options.into_iter().map(str::to_owned).collect()
}
fn scale_options(settings: &VideoSettings, encoder: Encoder) -> Vec<String> {
if encoder == Encoder::Vaapi { return vec!["-vf".into(), vaapi_filter(settings.output)]; }
settings.output.map_or_else(Vec::new, |(w,h)| vec!["-vf".into(), format!("scale={w}:{h}:flags=bilinear")])
}
#[derive(Clone, Debug, Hash, PartialEq, Eq)]
struct FfmpegSpec {
program: PathBuf,
@@ -538,11 +543,7 @@ async fn read_encoder_with(
"-video_size",&size,"-i",&display,"-an"]);
}
// 其他分辨率: scale the captured desktop (the host display mode is left untouched).
if encoder == Encoder::Vaapi {
command.args(["-vf", &vaapi_filter(settings.output)]);
} else if let Some((width, height)) = settings.output {
command.args(["-vf", &format!("scale={width}:{height}:flags=bilinear")]);
}
command.args(scale_options(&settings, encoder));
command.args(encoder_options(&settings, encoder, &gop, rgb));
// x11grab paces against an absolute schedule; after a capture stall it grabs
// back-to-back to "catch up" (measured 69 frames in 200ms). vfr on a 1/FPS
@@ -677,6 +678,97 @@ fn transport_closed(pc: &RTCPeerConnection) -> bool {
|| pc.sctp().state() == webrtc::sctp_transport::sctp_transport_state::RTCSctpTransportState::Closed
}
fn probe_settings() -> Result<VideoSettings,String> {
let fps=crate::wayland::capture_fps(std::env::var("UU_PROBE_FPS").ok().as_deref())?;
// UU_PROBE_QUALITY selects a viewer preset (1 fast 1M, 2 general 2M, 3 HD 8M, 4 bluray 20M,
// 5 auto); bitrate presets exercise the capped/ABR encoder path instead of CRF.
let quality=match std::env::var("UU_PROBE_QUALITY").ok().as_deref() {
None=>crate::capture_setting::QUALITY_AUTO,
Some(v)=>v.parse::<u64>().ok().filter(|q|(1..=5).contains(q)).ok_or("UU_PROBE_QUALITY must be 1-5")?,
};
Ok(VideoSettings {fps,quality,..VideoSettings::default()})
}
fn probe_input_command(spec:&FfmpegSpec,input:&std::ffi::OsStr,loop_input:bool,settings:&VideoSettings,
encoder:Encoder,wanted:u64,timing:FfmpegTimingMode)->Command {
let mut command=spec.command();
command.args(["-hide_banner","-loglevel","error","-nostdin"]);
if encoder==Encoder::Vaapi { command.args(["-vaapi_device",&vaapi_device()]); }
if loop_input { command.args(["-stream_loop","-1"]); }
// Override source timestamps so clips and image sequences use the same nominal probe rate.
command.args(["-r",&settings.fps.to_string(),"-i"]).arg(input).args(["-map","0:v:0","-an"]);
command.args(scale_options(settings,encoder));
command.args(encoder_options(settings,encoder,&gop_frames(settings.fps,false).to_string(),None));
command.args(timing_args(timing,settings.fps));
command.args(["-frames:v",&wanted.to_string(),"-f","h264","pipe:1"]);
command
}
async fn probe_input_size(spec:&FfmpegSpec,input:&std::ffi::OsStr)->Result<(u32,u32),String> {
// Read only the PNG header; never log decoded pixels, input paths or FFmpeg diagnostics.
let mut child=spec.command().args(["-hide_banner","-loglevel","error","-nostdin","-i"]).arg(input)
.args(["-map","0:v:0","-frames:v","1","-c:v","png","-f","image2pipe","pipe:1"])
.stdin(std::process::Stdio::null()).stdout(std::process::Stdio::piped()).stderr(std::process::Stdio::null())
.kill_on_drop(true).spawn().map_err(|e|format!("Start fixed-input probe: {e}"))?;
let mut header=[0u8;24];
let result=tokio::time::timeout(Duration::from_secs(15),child.stdout.as_mut().unwrap().read_exact(&mut header)).await;
let _=child.kill().await;
if !matches!(result,Ok(Ok(_))) || &header[..8]!=b"\x89PNG\r\n\x1a\n" {
return Err("Cannot open/decode UU_PROBE_INPUT video input".into());
}
Ok((u32::from_be_bytes(header[16..20].try_into().unwrap()),u32::from_be_bytes(header[20..24].try_into().unwrap())))
}
/// Fixed input bypasses desktop initialization and always uses the FFmpeg process encoder.
pub async fn probe_input(input:OsString,path:Option<String>)->Result<(),String> {
use std::io::Write;
let settings=probe_settings()?;
let wanted:u64=std::env::var("UU_PROBE_FRAMES").ok().and_then(|v|v.parse().ok()).unwrap_or(5);
if wanted==0 { return Err("Fixed-input UU_PROBE_FRAMES must be positive".into()); }
let spec=ffmpeg_spec();
let size=probe_input_size(&spec,&input).await?;
let encoder=Encoder::requested();
let (maxrate,_)=rate_args(&settings,encoder);
let output=settings.output.unwrap_or(size);
println!("Fixed input probe: source={}x{} output={}x{} fps={} cq={} maxrate={} encoder={}",
size.0,size.1,output.0,output.1,settings.fps,settings.cq(),maxrate,encoder.name_for(settings.codec));
let mut file=match path {
Some(path)=>Some(std::fs::OpenOptions::new().write(true).create_new(true).open(path).map_err(|e|format!("Video probe file: {e}"))?),
None=>None,
};
let mut command=probe_input_command(&spec,&input,std::env::var("UU_PROBE_LOOP").as_deref()==Ok("1"),
&settings,encoder,wanted,ffmpeg_timing_mode(&spec).await);
let mut child=command.stdin(std::process::Stdio::null()).stdout(std::process::Stdio::piped())
.stderr(std::process::Stdio::null()).kill_on_drop(true).spawn().map_err(|e|format!("Start fixed-input encoder: {e}"))?;
let mut stdout=child.stdout.take().ok_or("Encoder stdout missing")?;
let (mut count,mut bytes)=(0u64,0usize);
tokio::time::timeout(Duration::from_secs(15+wanted/30),async {
let mut pending=Vec::new();
let mut chunk=[0u8;16384];
loop {
let n=stdout.read(&mut chunk).await.map_err(|e|format!("Encoder read: {e}"))?;
pending.extend_from_slice(&chunk[..n]);
loop {
let aud=aud_offsets_for(&pending,settings.codec);
let end=if aud.len()>1 { aud[1] } else if n==0 && !pending.is_empty() { pending.len() } else { break; };
if end>MAX_ACCESS_UNIT { return Err("Encoder access unit exceeds limit".into()); }
if count==0 && !is_independent_frame(&pending[..end]) { return Err("Video probe did not begin with IDR".into()); }
if let Some(file)=file.as_mut() { file.write_all(&pending[..end]).map_err(|e|e.to_string())?; }
bytes+=end; count+=1;
pending.drain(..end);
}
if pending.len()>MAX_ACCESS_UNIT { return Err("Encoder access unit exceeds limit".into()); }
if n==0 { break; }
}
let status=child.wait().await.map_err(|e|format!("Fixed-input encoder: {e}"))?;
if !status.success() { return Err(format!("Fixed-input encoder failed ({status}); check input and encoder availability")); }
if count!=wanted { return Err(format!("Fixed input ended after {count} frames; requested {wanted} (use UU_PROBE_LOOP=1 to repeat)")); }
Ok::<(),String>(())
}).await.map_err(|_|"Video probe timed out".to_owned())??;
println!("Encoded capture probe: frames={count} h264_bytes={bytes} first_frame_idr=true");
Ok(())
}
/// Exercise the real capture/encoder chain without UU auth or a network peer.
pub async fn probe(size:(u32,u32),display:String,portal:Option<Arc<crate::portal::PortalSession>>,path:Option<String>)->Result<(),String> {
use std::io::Write;
@@ -686,14 +778,7 @@ pub async fn probe(size:(u32,u32),display:String,portal:Option<Arc<crate::portal
};
let (tx,mut rx)=mpsc::channel(4);
let sequence=Arc::new(std::sync::atomic::AtomicU64::new(0));
let fps=crate::wayland::capture_fps(std::env::var("UU_PROBE_FPS").ok().as_deref())?;
// UU_PROBE_QUALITY selects a viewer preset (1 fast 1M, 2 general 2M, 3 HD 8M, 4 bluray 20M,
// 5 auto); bitrate presets exercise the capped/ABR encoder path instead of CRF.
let quality=match std::env::var("UU_PROBE_QUALITY").ok().as_deref() {
None=>crate::capture_setting::QUALITY_AUTO,
Some(v)=>v.parse::<u64>().ok().filter(|q|(1..=5).contains(q)).ok_or("UU_PROBE_QUALITY must be 1-5")?,
};
let settings=VideoSettings {fps,quality,..VideoSettings::default()};
let settings=probe_settings()?;
let _reader=EncoderTask(tokio::spawn(read_encoder(size,display,portal,tx,settings,sequence,Arc::new(AtomicBool::new(false)),Arc::new(Semaphore::new(4)))));
let mut count=0;
let mut bytes=0;
@@ -822,6 +907,44 @@ pub async fn stream_desktop(pc: Arc<RTCPeerConnection>, track: Arc<crate::video_
#[cfg(test)]
mod tests {
#[test]
fn fixed_input_arguments_share_production_encoding_options() {
let spec=FfmpegSpec {program:"ffmpeg".into(),ld_library_path:None,path:None};
for encoder in [Encoder::Cpu,Encoder::Nvenc,Encoder::Vaapi] {
for quality in 1..=5 {
for chroma in [crate::capture_setting::CHROMA_420,crate::capture_setting::CHROMA_444] {
let settings=VideoSettings {fps:30,quality,chroma,output:Some((640,360)),..Default::default()};
let command=probe_input_command(&spec,std::ffi::OsStr::new("frames/%05d.png"),false,
&settings,encoder,17,FfmpegTimingMode::Modern);
let args:Vec<_>=command.as_std().get_args().map(|a|a.to_str().unwrap().to_owned()).collect();
let expected=encoder_options(&settings,encoder,&gop_frames(30,false).to_string(),None);
assert!(args.windows(expected.len()).any(|w|w==expected));
let scale=scale_options(&settings,encoder);
assert!(args.windows(scale.len()).any(|w|w==scale));
assert!(args.windows(4).any(|w|w==["-r","30","-i","frames/%05d.png"]));
assert!(args.windows(2).any(|w|w==["-frames:v","17"]));
assert!(args.windows(4).any(|w|w==["-fps_mode","vfr","-enc_time_base","1/30"]));
assert!(!args.iter().any(|a|["x11grab","rawvideo","-stream_loop"].contains(&a.as_str())));
}
}
}
}
#[test]
fn fixed_input_loop_is_an_input_option_and_keeps_paths_literal() {
let spec=FfmpegSpec {program:"ffmpeg".into(),ld_library_path:None,path:None};
for input in ["clip.y4m","a clip.mp4","frames/%05d.png"] {
let command=probe_input_command(&spec,std::ffi::OsStr::new(input),true,&VideoSettings::default(),
Encoder::Cpu,5,FfmpegTimingMode::Legacy);
let args:Vec<_>=command.as_std().get_args().map(|a|a.to_str().unwrap()).collect();
assert!(args.windows(2).any(|w|w==["-i",input]));
assert!(args.windows(2).any(|w|w==["-stream_loop","-1"]));
assert!(args.iter().position(|a|*a=="-stream_loop")<args.iter().position(|a|*a=="-i"));
assert!(args.windows(2).any(|w|w==["-vsync","0"]));
assert!(!args.contains(&"-vf"));
}
}
#[test]
fn display_refresh_parsers() {
let xrandr = "Screen 0: minimum 8 x 8, current 5760 x 2160\nHDMI-1 connected 1920x1080+3840+0 (normal) 0mm x 0mm\n 1920x1080 60.00*+ 50.00\nDP-1 connected primary 3840x2160+0+0 (normal) 600mm x 340mm\n 3840x2160 60.00 + 143.98*\n 2560x1440 120.00\n";
+4 -7
View File
@@ -105,15 +105,11 @@ mod tests {
sdp_fmtp_line: "level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f".into(), ..Default::default()
}, payload_type: 102, ..Default::default() }, RTPCodecType::Video).unwrap(); }
if hevc { register_hevc(&mut remote_media).unwrap(); }
let mut setting = webrtc::api::setting_engine::SettingEngine::default();
setting.set_ice_multicast_dns_mode(webrtc::ice::mdns::MulticastDnsMode::Disabled);
// UDP over IPv4 only: pairing every host interface (VPNs, IPv6) made ICE exceed the
// connect timeout when the whole suite runs in parallel.
setting.set_network_types(vec![webrtc::ice::network_type::NetworkType::Udp4]);
let remote = APIBuilder::new().with_setting_engine(setting.clone()).with_media_engine(remote_media).build().new_peer_connection(RTCConfiguration::default()).await.unwrap();
let (remote_setting, host_setting, router) = crate::test_network::virtual_network().await;
let remote = APIBuilder::new().with_setting_engine(remote_setting).with_media_engine(remote_media).build().new_peer_connection(RTCConfiguration::default()).await.unwrap();
remote.add_transceiver_from_kind(RTPCodecType::Video, None).await.unwrap();
let mut media = MediaEngine::default(); media.register_default_codecs().unwrap(); register_hevc(&mut media).unwrap();
let host = APIBuilder::new().with_setting_engine(setting).with_media_engine(media).build().new_peer_connection(RTCConfiguration::default()).await.unwrap();
let host = APIBuilder::new().with_setting_engine(host_setting).with_media_engine(media).build().new_peer_connection(RTCConfiguration::default()).await.unwrap();
let (packets_tx, mut packets_rx) = tokio::sync::mpsc::unbounded_channel();
remote.on_track(Box::new(move |remote_track, _, _| {
let packets_tx = packets_tx.clone();
@@ -171,6 +167,7 @@ mod tests {
previous = Some(packet);
}
host.close().await.unwrap(); remote.close().await.unwrap();
router.lock().await.stop().await.unwrap();
}
#[tokio::test]
async fn negotiated_codecs_only_and_legacy_h264_offer() { negotiate(true, false).await; negotiate(true, true).await; negotiate(false, true).await; }