Verify a decoded colour transition in native WebRTC loopback

This commit is contained in:
omar committed 2026-11-27 08:00:29 +03:00
1 parent 6053e8b315
commit f0ed160cd0
3 files changed
+26 -13

No files matched your search

+2
View File
@@ -2,6 +2,8 @@
## Current Windows account-free checkpoint (2026-11-26) ## Current Windows account-free checkpoint (2026-11-26)
**Two-colour WebRTC loopback:** The Windows `webrtc_smoke` example sent 14 generated 64×48 frames between two native PeerConnections. The software decoder reported libvpx and 14 decoded frames; the display path presented seven red frames followed by six green frames. The ended source rejected further input, its stop callback ran once, and the closed surface had no pending image. No physical audio device was started. Screenshots: `target/codec-fixtures/peer-loopback-red.png` and `peer-loopback-green.png` in the same directory. This tests local video transport, not audio delivery, TS6 server signaling, an official peer, AV1 or H264 High negotiation.
**Clock format:** On Windows, switching the Chats setting changed the time shown on an already loaded history row. After restart the saved format was restored; switching back updated the same row, and reopening the profile returned the original millisecond timestamp. Recent Server Events showed the same event in both clock formats in English and Russian, retaining its row ID and raw log. Seven focused tests passed using isolated profiles and fixture events. **Clock format:** On Windows, switching the Chats setting changed the time shown on an already loaded history row. After restart the saved format was restored; switching back updated the same row, and reopening the profile returned the original millisecond timestamp. Recent Server Events showed the same event in both clock formats in English and Russian, retaining its row ID and raw log. Seven focused tests passed using isolated profiles and fixture events.
**Server-target send on beta14:** In the extended Windows Slint send test, the two disposable guests exchanged the private and channel messages. Sending from the server conversation returned `PermissionsClientInsufficient`. The sender saw the refusal, with no own echo; revisiting that server conversation restored its unsent draft. No matching message was visible in the recipient's server conversation. This is evidence of server-target refusal, not successful broadcast. The live test and three focused core validation tests passed. **Server-target send on beta14:** In the extended Windows Slint send test, the two disposable guests exchanged the private and channel messages. Sending from the server conversation returned `PermissionsClientInsufficient`. The sender saw the refusal, with no own echo; revisiting that server conversation restored its unsent draft. No matching message was visible in the recipient's server conversation. This is evidence of server-target refusal, not successful broadcast. The live test and three focused core validation tests passed.
+2
View File
@@ -4,6 +4,8 @@
## Возврат к разработке на ПК, 2026-11-26 ## Возврат к разработке на ПК, 2026-11-26
Windows, база `6053e8b`: `webrtc_smoke` прошёл с локальным архивом WebRTC. Из 14 отправленных кадров libvpx декодировал 14, на выходе проверены 7 красных и 6 зелёных кадров. Источник после остановки отклонил новый кадр, callback вызван один раз. Это два локальных пира без TeamSpeak-сервера, физического захвата и передачи аудио.
Windows, база `5933297`: остановка зарегистрированной публикации по своему `clid` освобождает источник сразу. До получения ID начало и остановка обрабатываются в порядке получения; события старого издателя не перенаправляются новому. Прошли 22 теста каталога и сигнализации с тестовыми источниками. Реальный захват и передача на сервер не проверялись. Windows, база `5933297`: остановка зарегистрированной публикации по своему `clid` освобождает источник сразу. До получения ID начало и остановка обрабатываются в порядке получения; события старого издателя не перенаправляются новому. Прошли 22 теста каталога и сигнализации с тестовыми источниками. Реальный захват и передача на сервер не проверялись.
Windows, база `5e646fc`: подтверждение и отклонение заявки на просмотр сверяют UID из меню до изменения очереди. Проверка повторной выдачи номера подтвердила, что оба устаревших действия сохраняют заявку нового зрителя, а подтверждение по актуальному UID работает. Прошли 19 тестов сигнализации; живой обмен WebRTC в этом прогоне не проверялся. Windows, база `5e646fc`: подтверждение и отклонение заявки на просмотр сверяют UID из меню до изменения очереди. Проверка повторной выдачи номера подтвердила, что оба устаревших действия сохраняют заявку нового зрителя, а подтверждение по актуальному UID работает. Прошли 19 тестов сигнализации; живой обмен WebRTC в этом прогоне не проверялся.
+22 -13
View File
@@ -27,21 +27,30 @@ async fn main()->Result<(),Box<dyn std::error::Error>> {
let a=tokio::spawn(async move{while let Some(event)=outgoing.recv().await{if let SignalPeerEvent::LocalCandidate(candidate)=event{target.add_candidate(candidate).await?;}}Ok::<_,teamspeach_native::media::stream::signal::StreamError>(())}); let a=tokio::spawn(async move{while let Some(event)=outgoing.recv().await{if let SignalPeerEvent::LocalCandidate(candidate)=event{target.add_candidate(candidate).await?;}}Ok::<_,teamspeach_native::media::stream::signal::StreamError>(())});
let target=publisher.clone(); let target=publisher.clone();
let b=tokio::spawn(async move{while let Some(event)=incoming.recv().await{if let SignalPeerEvent::LocalCandidate(candidate)=event{target.add_candidate(candidate).await?;}}Ok::<_,teamspeach_native::media::stream::signal::StreamError>(())}); let b=tokio::spawn(async move{while let Some(event)=incoming.recv().await{if let SignalPeerEvent::LocalCandidate(candidate)=event{target.add_candidate(candidate).await?;}}Ok::<_,teamspeach_native::media::stream::signal::StreamError>(())});
let mut pixels=I420Buffer::new(64,48); let mut frames=[(81,90,240),(145,54,34)].map(|(luma,cb,cr)|{
{let(y,u,v)=pixels.data_mut();y.fill(81);u.fill(90);v.fill(240);} let mut pixels=I420Buffer::new(64,48);
let mut frame=VideoFrame::new(VideoRotation::VideoRotation0,pixels); let(y,u,v)=pixels.data_mut();y.fill(luma);u.fill(cb);v.fill(cr);
frame.color_matrix=6;frame.color_range=1; let mut frame=VideoFrame::new(VideoRotation::VideoRotation0,pixels);
let started=Instant::now();let mut shown=0;let mut sent=0; frame.color_matrix=6;frame.color_range=1;frame
while started.elapsed()<Duration::from_secs(12)&&shown<12 { });
let output=std::path::Path::new("target/codec-fixtures");std::fs::create_dir_all(output)?;
let started=Instant::now();let mut shown=[0usize;2];let mut sent=0;
while started.elapsed()<Duration::from_secs(12)&&shown[1]<6 {
let phase=usize::from(shown[0]>=6);
let frame=&mut frames[phase];
frame.timestamp_us=started.elapsed().as_micros().max(1) as i64; frame.timestamp_us=started.elapsed().as_micros().max(1) as i64;
source.capture_video(&frame)?;sent+=1; source.capture_video(frame)?;sent+=1;
let surface=surfaces.lock().unwrap().clone(); let surface=surfaces.lock().unwrap().clone();
if let Some(surface)=surface { if let Some(surface)=surface {
if let Some(image)=surface.take_image(64,48)?{ if let Some(image)=surface.take_image(64,48)?{
let bytes=image.pixels.as_bytes();let at=((24*64+32)*4) as usize; let bytes=image.pixels.as_bytes();let at=((24*64+32)*4) as usize;
if bytes[at]<220||bytes[at+1]>30||bytes[at+2]>30{return Err(format!("Wrong decoded red pixel {:?}",&bytes[at..at+4]).into())} let colour=match bytes[at..at+3] {
if shown==0{image::save_buffer("target/codec-fixtures/peer-loopback.png",bytes,image.pixels.width(),image.pixels.height(),image::ColorType::Rgba8)?;} [220..=255,0..=30,0..=30] if shown[1]==0=>0,
shown+=1;drop(image.image);surface.recycle(image.pixels); [0..=30,220..=255,0..=30] if phase==1=>1,
_=>return Err(format!("Unexpected decoded pixel {:?} in phase {phase}",&bytes[at..at+4]).into()),
};
if shown[colour]==0{image::save_buffer(output.join(["peer-loopback-red.png","peer-loopback-green.png"][colour]),bytes,image.pixels.width(),image.pixels.height(),image::ColorType::Rgba8)?;}
shown[colour]+=1;drop(image.image);surface.recycle(image.pixels);
} }
} }
for event in events.try_iter(){if matches!(event,AudioEvent::Started{..}){return Err("A physical audio device was unexpectedly started".into())}} for event in events.try_iter(){if matches!(event,AudioEvent::Started{..}){return Err("A physical audio device was unexpectedly started".into())}}
@@ -49,13 +58,13 @@ async fn main()->Result<(),Box<dyn std::error::Error>> {
tokio::time::sleep(Duration::from_millis(34)).await; tokio::time::sleep(Duration::from_millis(34)).await;
} }
let statistics=viewer.decoder_status().await?; let statistics=viewer.decoder_status().await?;
source.ended();assert!(source.capture_video(&frame).is_err()); source.ended();assert!(source.capture_video(&frames[1]).is_err());
publisher.close();viewer.close();a.abort();b.abort();let _=a.await;let _=b.await; publisher.close();viewer.close();a.abort();b.abort();let _=a.await;let _=b.await;
if let Some(surface)=surfaces.lock().unwrap().take(){assert!(surface.take_image(64,48)?.is_none());} if let Some(surface)=surfaces.lock().unwrap().take(){assert!(surface.take_image(64,48)?.is_none());}
assert_eq!(stopped.load(Ordering::SeqCst),1); assert_eq!(stopped.load(Ordering::SeqCst),1);
audio.shutdown().await?;manager.shutdown().await?; audio.shutdown().await?;manager.shutdown().await?;
if shown<12{return Err(format!("Only {shown} decoded frames from {sent} generated frames; stats={statistics:?}").into())} if shown[0]<6||shown[1]<6{return Err(format!("Only {shown:?} red/green frames from {sent} generated frames; stats={statistics:?}").into())}
if !statistics.iter().any(|stat|stat.frames_decoded>=12&&!stat.implementation.is_empty()){return Err(format!("Missing actual decoder statistics: {statistics:?}").into())} if !statistics.iter().any(|stat|stat.frames_decoded>=12&&!stat.implementation.is_empty()){return Err(format!("Missing actual decoder statistics: {statistics:?}").into())}
println!("native_peer_loopback sent={sent} presented={shown} stop_callbacks=1 no_physical_audio=true stats={statistics:?}"); println!("native_peer_loopback sent={sent} red={} green={} stop_callbacks=1 no_physical_audio=true stats={statistics:?}",shown[0],shown[1]);
Ok(()) Ok(())
} }