Skip to content

Commit 1c7a83a

Browse files
committed
Return windows::core::Error and drop unused mut
1 parent 03afa27 commit 1c7a83a

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

crates/recording/src/output_pipeline/win.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,10 @@ impl Muxer for WindowsCameraMuxer {
905905
Ok(o) => o,
906906
Err(_) => {
907907
tracing::error!("Camera output mutex poisoned during write");
908-
return Err(anyhow!("Camera output mutex poisoned"));
908+
return Err(windows::core::Error::new(
909+
windows::core::HRESULT(-1),
910+
"Camera output mutex poisoned"
911+
));
909912
}
910913
};
911914
if let Err(e) = muxer.write_sample(&output_sample, &mut output)
@@ -1711,6 +1714,9 @@ pub fn upload_mf_buffer_to_texture(
17111714
unsafe {
17121715
let mut texture = None;
17131716
device.CreateTexture2D(&texture_desc, Some(&subresource_data), Some(&mut texture))?;
1714-
texture.ok_or_else(|| anyhow!("CreateTexture2D succeeded but returned no texture"))
1717+
texture.ok_or_else(|| windows::core::Error::new(
1718+
windows::core::HRESULT(-1),
1719+
"CreateTexture2D succeeded but returned no texture"
1720+
))
17151721
}
17161722
}

crates/recording/src/sources/screen_capture/windows.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ impl output_pipeline::VideoSource for VideoSource {
551551
settings,
552552
d3d_device,
553553
}: Self::Config,
554-
mut video_tx: mpsc::Sender<Self::Frame>,
554+
video_tx: mpsc::Sender<Self::Frame>,
555555
ctx: &mut output_pipeline::SetupCtx,
556556
) -> anyhow::Result<Self>
557557
where

0 commit comments

Comments
 (0)