diff --git a/apps/desktop/src-tauri/src/windows.rs b/apps/desktop/src-tauri/src/windows.rs index 9ccc4252..67a3e2eb 100644 --- a/apps/desktop/src-tauri/src/windows.rs +++ b/apps/desktop/src-tauri/src/windows.rs @@ -306,7 +306,6 @@ impl CapWindow { let window = window_builder.build()?; window.set_ignore_cursor_events(true).unwrap(); - window.open_devtools(); #[cfg(target_os = "macos")] { diff --git a/crates/editor/Cargo.toml b/crates/editor/Cargo.toml index 836a0a44..c860a490 100644 --- a/crates/editor/Cargo.toml +++ b/crates/editor/Cargo.toml @@ -15,4 +15,4 @@ serde_json = "1.0.128" axum = { version = "0.7.5", features = ["ws"] } ffmpeg.workspace = true specta.workspace = true -serde = { version = "1", features = ["derive"] } +serde = { version = "1", features = ["derive"] } \ No newline at end of file diff --git a/crates/rendering/src/decoder.rs b/crates/rendering/src/decoder.rs index 1b57e51d..fd05de35 100644 --- a/crates/rendering/src/decoder.rs +++ b/crates/rendering/src/decoder.rs @@ -20,11 +20,6 @@ use ffmpeg_sys_next::{ pub type DecodedFrame = Arc>; -#[cfg(target_os = "windows")] -const TARGET_HWDEVICE: AVHWDeviceType = AVHWDeviceType::AV_HWDEVICE_TYPE_D3D11VA; -#[cfg(target_os = "macos")] -const TARGET_HWDEVICE: AVHWDeviceType = AVHWDeviceType::AV_HWDEVICE_TYPE_VIDEOTOOLBOX; - enum VideoDecoderMessage { GetFrame(u32, tokio::sync::oneshot::Sender>>>), } @@ -58,8 +53,6 @@ impl AsyncVideoDecoder { let mut context = codec::context::Context::new_with_codec(decoder_codec); context.set_parameters(input_stream.parameters()).unwrap(); - // context.print_supported_hw_modes(); - let hw_device: Option = { #[cfg(target_os = "macos")] { @@ -70,22 +63,11 @@ impl AsyncVideoDecoder { ) .ok() } - #[cfg(target_os = "windows")] - { - context - .try_use_hw_device(AVHWDeviceType::AV_HWDEVICE_TYPE_D3D11VA, Pixel::NV12) - .ok() - } - #[cfg(not(any(target_os = "macos", target_os = "windows")))] + #[cfg(not(target_os = "macos"))] None }; - println!( - "-t HW Device: {:?}", - hw_device.as_ref().and_then(|hwd| Some(hwd.device_type)) - ); - let input_stream_index = input_stream.index(); let time_base = input_stream.time_base(); let frame_rate = input_stream.rate(); @@ -101,11 +83,6 @@ impl AsyncVideoDecoder { .map(|d| d.pix_fmt) .unwrap_or(decoder.format()); - // println!("-t Scalar input pixel format"); - // dbg!(scaler_input_format); - // println!("-t HWDevice input pixel format"); - // dbg!(hw_device.as_ref().map(|d| d.pix_fmt)); - let mut scaler = Context::get( scaler_input_format, decoder.width(), @@ -195,7 +172,7 @@ impl AsyncVideoDecoder { let start_offset = stream.start_time(); let packet_frame = ts_to_frame(packet.pts().unwrap(), time_base, frame_rate); - println!("sending frame {packet_frame} packet"); + // println!("sending frame {packet_frame} packet"); decoder.send_packet(&packet).ok(); // decode failures are ok, we just fail to return a frame @@ -449,8 +426,6 @@ trait CodecContextExt { device_type: AVHWDeviceType, pix_fmt: Pixel, ) -> Result; - - fn print_supported_hw_modes(&mut self); } impl CodecContextExt for codec::context::Context { @@ -462,22 +437,16 @@ impl CodecContextExt for codec::context::Context { let codec = self.codec().ok_or("no codec")?; unsafe { - println!("Codec is: {}", codec.name()); let mut i = 0; loop { let config = avcodec_get_hw_config(codec.as_ptr(), i); - // println!("-t AVCodecHWConfig: "); - if config.is_null() { - dbg!(*config); return Err("no hw config"); } if (*config).methods & (AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX as i32) == 1 - && (*config).device_type == TARGET_HWDEVICE + && (*config).device_type == AVHWDeviceType::AV_HWDEVICE_TYPE_VIDEOTOOLBOX { - // println!("Setting PIX_FMT to "); - // dbg!((*config).pix_fmt); HW_PIX_FMT.set((*config).pix_fmt); break; } @@ -504,33 +473,4 @@ impl CodecContextExt for codec::context::Context { }) } } - - fn print_supported_hw_modes(&mut self) { - println!("Checking supported hardware acceleration modes:"); - - let codec = self.codec().ok_or("no codec").unwrap(); - println!("T---- Context Codec is: {}", codec.name()); - unsafe { - for i in 0.. { - let config = avcodec_get_hw_config(codec.as_ptr(), i); - if config.is_null() { - break; - } - - println!("Got AVCodecHWConfig: "); - dbg!(*config); - - if (*config).methods & (AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX as i32) == 1 - && (*config).device_type == TARGET_HWDEVICE - { - println!("Can set PIX_FMT for config: "); - dbg!((*config).pix_fmt); - // break; - } - println!("T--"); - } - } - - println!("T---- End of HW devices"); - } }