From 8cfe9ffb0b3a2f4e8ef64318ec940f48232398e0 Mon Sep 17 00:00:00 2001 From: "Victor A." <52110451+cs50victor@users.noreply.github.com> Date: Wed, 24 Jan 2024 11:19:55 -0500 Subject: [PATCH] refactor: delete unused systems --- new_media/Cargo.toml | 10 +++++----- new_media/src/frame_capture.rs | 10 +++------- new_media/src/main.rs | 4 ---- new_media/src/video.rs | 24 ------------------------ 4 files changed, 8 insertions(+), 40 deletions(-) delete mode 100644 new_media/src/video.rs diff --git a/new_media/Cargo.toml b/new_media/Cargo.toml index 683d020..8bbe5f1 100644 --- a/new_media/Cargo.toml +++ b/new_media/Cargo.toml @@ -9,6 +9,11 @@ default-run = "new_media" anyhow = "1.0.75" async-net = "2.0.0" base64 = "0.21.5" +bevy = { version = "0.12.0", default-features = false, features = [ + "bevy_asset", + "bevy_core_pipeline", + "bevy_render", +] } bevy_ws_server = { git = "https://github.com/cs50victor/bevy-ws-server.git", branch = "main" } bevy_gaussian_splatting = { version = "2.0.2", default-features = true } bevy_panorbit_camera = "0.10.0" @@ -23,11 +28,6 @@ serde = { version = "1.0.192", features = ["derive"] } serde_json = "1.0.108" wgpu = "0.17.2" tungstenite = "0.21.0" -bevy = { version = "0.12", default-features = false, features = [ - "bevy_asset", - "bevy_core_pipeline", - "bevy_render", -] } # [target.i686-unknown-linux-gnu.dependencies] # winit = { version = "0.29.10", default-features = false, features = ["x11"]} diff --git a/new_media/src/frame_capture.rs b/new_media/src/frame_capture.rs index 7cb88ba..8229599 100644 --- a/new_media/src/frame_capture.rs +++ b/new_media/src/frame_capture.rs @@ -18,7 +18,6 @@ pub mod image_copy { }; use pollster::FutureExt; use wgpu::Maintain; - // use wgpu::Maintain; use std::sync::atomic::{AtomicBool, Ordering}; @@ -175,9 +174,9 @@ pub mod image_copy { texture_extent, ); - let render_queue = world.get_resource::().unwrap(); + let _render_queue = world.get_resource::().unwrap(); log::error!("0"); - render_queue.submit(std::iter::once(encoder.finish())); + // render_queue.submit(std::iter::once(encoder.finish())); log::error!("1"); } @@ -195,15 +194,12 @@ pub mod scene { prelude::*, render::{ camera::RenderTarget, - render_resource::{ - Extent3d, TextureDescriptor, TextureDimension, TextureFormat, TextureUsages, - }, renderer::RenderDevice, }, }; use image::{ImageBuffer, ImageOutputFormat, Rgba, RgbaImage}; - // use wgpu::{Extent3d, TextureDescriptor, TextureDimension, TextureFormat, TextureUsages}; + use wgpu::{Extent3d, TextureDescriptor, TextureDimension, TextureFormat, TextureUsages}; use super::image_copy::ImageCopier; diff --git a/new_media/src/main.rs b/new_media/src/main.rs index 79438b2..c4b5588 100644 --- a/new_media/src/main.rs +++ b/new_media/src/main.rs @@ -1,14 +1,10 @@ #![feature(ascii_char, async_closure, slice_pattern)] -#[allow(clippy::type_complexity)] mod controls; mod frame_capture; mod server; -mod video; use bevy_ws_server::WsPlugin; -// use actix_web::{middleware, web::Data, App, HttpServer}; - use bevy::{ app::ScheduleRunnerPlugin, core::Name, core_pipeline::tonemapping::Tonemapping, log::LogPlugin, prelude::*, render::renderer::RenderDevice, diff --git a/new_media/src/video.rs b/new_media/src/video.rs deleted file mode 100644 index 2ae09fd..0000000 --- a/new_media/src/video.rs +++ /dev/null @@ -1,24 +0,0 @@ -use bevy::ecs::system::Resource; - -pub struct ReceivedVideoFrame { - pub image_buffer: Vec, - pub timestamp: i64, // When the frame was captured in microseconds -} - -#[derive(Resource)] -pub struct VideoChannel { - pub tx: crossbeam_channel::Sender>, - rx: crossbeam_channel::Receiver>, -} - -impl Default for VideoChannel { - fn default() -> Self { - let (tx, rx) = crossbeam_channel::unbounded::>(); - Self { tx, rx } - } -} -impl VideoChannel { - pub fn new() -> Self { - Self::default() - } -}