Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

Merge branch 'main' into camera-formats

Richie McIlroy4b2663187c20
diff --cc crates/recording/src/output_pipeline/win.rs
index 6fb0bb27d,15a3842c1..9a801344e
--- a/crates/recording/src/output_pipeline/win.rs
+++ b/crates/recording/src/output_pipeline/win.rs
@@@ -721,23 -721,7 +721,23 @@@ impl AudioMuxer for WindowsCameraMuxer
}
}
+fn convert_uyvy_to_yuyv(src: &[u8], width: u32, height: u32) -> Vec<u8> {
+ let total_bytes = (width * height * 2) as usize;
+ let mut dst = vec![0u8; total_bytes];
+
+ for i in (0..src.len().min(total_bytes)).step_by(4) {
+ if i + 3 < src.len() && i + 3 < total_bytes {
+ dst[i] = src[i + 1];
+ dst[i + 1] = src[i];
+ dst[i + 2] = src[i + 3];
+ dst[i + 3] = src[i + 2];
+ }
+ }
+
+ dst
+}
+
- fn upload_mf_buffer_to_texture(
+ pub fn upload_mf_buffer_to_texture(
device: &ID3D11Device,
frame: &NativeCameraFrame,
) -> windows::core::Result<windows::Win32::Graphics::Direct3D11::ID3D11Texture2D> {