feat: update simple_room wgpu (#61)
This commit is contained in:
Generated
+368
-511
File diff suppressed because it is too large
Load Diff
@@ -9,12 +9,12 @@ tracing = "0.1"
|
||||
tracing-subscriber = "0.3"
|
||||
livekit = { path = "../../livekit", version = "0.1.1" }
|
||||
futures = "0.3"
|
||||
wgpu = "0.14.0"
|
||||
winit = "0.27.5"
|
||||
wgpu = "0.16"
|
||||
winit = "0.28"
|
||||
parking_lot = "0.12.1"
|
||||
|
||||
egui = "0.20.1"
|
||||
egui-wgpu = { version = "0.20.0", features = ["winit"] }
|
||||
egui-winit = "0.20.1"
|
||||
egui = { git = "https://github.com/emilk/egui" }
|
||||
egui-wgpu = { git = "https://github.com/emilk/egui", features = ["winit"] }
|
||||
egui-winit = { git = "https://github.com/emilk/egui" }
|
||||
|
||||
image = "0.24.5"
|
||||
image = "0.24"
|
||||
|
||||
@@ -6,14 +6,14 @@ use crate::{events::AsyncCmd, video_grid::VideoGrid};
|
||||
use egui::{Rounding, Stroke};
|
||||
use egui_wgpu::WgpuConfiguration;
|
||||
use futures::StreamExt;
|
||||
use image::ImageFormat;
|
||||
use livekit::options::{TrackPublishOptions, VideoCaptureOptions};
|
||||
|
||||
|
||||
use livekit::prelude::*;
|
||||
use livekit::webrtc::audio_stream::native::NativeAudioStream;
|
||||
use livekit::webrtc::native::yuv_helper;
|
||||
|
||||
use livekit::webrtc::video_frame::native::I420BufferExt;
|
||||
use livekit::webrtc::video_frame::{I420Buffer, VideoFrame, VideoRotation};
|
||||
use livekit::webrtc::video_source::native::NativeVideoSource;
|
||||
|
||||
|
||||
use livekit::SimulateScenario;
|
||||
use parking_lot::Mutex;
|
||||
use std::collections::HashMap;
|
||||
@@ -21,7 +21,7 @@ use std::sync::{
|
||||
atomic::{AtomicBool, Ordering},
|
||||
Arc,
|
||||
};
|
||||
use std::time::Duration;
|
||||
|
||||
use tokio::sync::{mpsc, oneshot};
|
||||
|
||||
// Useful default constants for developing
|
||||
@@ -77,11 +77,10 @@ pub fn run(rt: tokio::runtime::Runtime) {
|
||||
|
||||
let egui_context = egui::Context::default();
|
||||
let egui_state = egui_winit::State::new(&event_loop);
|
||||
let mut egui_painter = egui_wgpu::winit::Painter::new(WgpuConfiguration::default(), 1, 32);
|
||||
let mut egui_painter =
|
||||
egui_wgpu::winit::Painter::new(WgpuConfiguration::default(), 1, None, false);
|
||||
|
||||
unsafe {
|
||||
egui_painter.set_window(Some(&window));
|
||||
}
|
||||
egui_painter.set_window(Some(&window)).await.unwrap();
|
||||
|
||||
let (async_cmd_tx, mut async_cmd_rx) = mpsc::unbounded_channel::<AsyncCmd>();
|
||||
let (ui_cmd_tx, ui_cmd_rx) = mpsc::unbounded_channel::<UiCmd>();
|
||||
@@ -497,9 +496,10 @@ impl App {
|
||||
|
||||
self.egui_painter.paint_and_update_textures(
|
||||
egui_winit::native_pixels_per_point(&self.window),
|
||||
egui::Rgba::BLACK,
|
||||
[0.0, 0.0, 0.0, 0.0],
|
||||
&clipped_primitives,
|
||||
&full_output.textures_delta,
|
||||
false,
|
||||
);
|
||||
|
||||
self.egui_state.handle_platform_output(
|
||||
|
||||
@@ -190,7 +190,8 @@ impl LogoTrack {
|
||||
source.capture_frame(&*video_frame);
|
||||
}
|
||||
})
|
||||
.await;
|
||||
.await
|
||||
.unwrap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ impl SineTrack {
|
||||
}
|
||||
|
||||
async fn track_task(
|
||||
mut close_rx: oneshot::Receiver<()>,
|
||||
_close_rx: oneshot::Receiver<()>,
|
||||
rtc_source: NativeAudioSource,
|
||||
frame_options: Arc<Mutex<FrameData>>,
|
||||
) {
|
||||
|
||||
@@ -7,11 +7,11 @@ struct State {
|
||||
|
||||
impl State {
|
||||
pub fn load(ctx: &egui::Context, id: egui::Id) -> Option<Self> {
|
||||
ctx.data().get_temp(id)
|
||||
ctx.data(|i| i.get_temp(id))
|
||||
}
|
||||
|
||||
pub fn store(self, ctx: &egui::Context, id: egui::Id) {
|
||||
ctx.data().insert_temp(id, self);
|
||||
ctx.data_mut(|i| i.insert_temp(id, self))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ use futures::StreamExt;
|
||||
use livekit::webrtc::native::yuv_helper;
|
||||
use livekit::webrtc::prelude::*;
|
||||
use livekit::webrtc::video_stream::native::NativeVideoStream;
|
||||
use std::num::NonZeroU32;
|
||||
|
||||
use std::{
|
||||
ops::DerefMut,
|
||||
sync::{Arc, Mutex},
|
||||
@@ -49,6 +49,7 @@ impl RendererInternal {
|
||||
sample_count: 1,
|
||||
mip_level_count: 1,
|
||||
format: wgpu::TextureFormat::Rgba8UnormSrgb,
|
||||
view_formats: &[wgpu::TextureFormat::Rgba8UnormSrgb],
|
||||
}),
|
||||
);
|
||||
|
||||
@@ -57,8 +58,8 @@ impl RendererInternal {
|
||||
label: Some("lk-videotexture-view"),
|
||||
format: Some(wgpu::TextureFormat::Rgba8UnormSrgb),
|
||||
dimension: Some(wgpu::TextureViewDimension::D2),
|
||||
mip_level_count: NonZeroU32::new(1),
|
||||
array_layer_count: NonZeroU32::new(1),
|
||||
mip_level_count: Some(1),
|
||||
array_layer_count: Some(1),
|
||||
..Default::default()
|
||||
},
|
||||
));
|
||||
@@ -144,7 +145,7 @@ impl VideoRenderer {
|
||||
};
|
||||
|
||||
let copy_layout = wgpu::ImageDataLayout {
|
||||
bytes_per_row: Some(NonZeroU32::new(width * 4).unwrap()),
|
||||
bytes_per_row: Some(width * 4),
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user