From e0096b0f86a4922097e8eed29ace7086b8303cdc Mon Sep 17 00:00:00 2001 From: oiupoyt Date: Thu, 3 Sep 2026 21:15:33 +0530 Subject: [PATCH] fix(windows): Fix D3D11CreateDevice software arg, IDXGIOutput::GetDesc signature, and SWS flags --- src/capture/windows.rs | 5 +++-- src/encoder.rs | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/capture/windows.rs b/src/capture/windows.rs index c854aba..2067e7f 100644 --- a/src/capture/windows.rs +++ b/src/capture/windows.rs @@ -38,7 +38,7 @@ impl WindowsCapture { D3D11CreateDevice( None, D3D_DRIVER_TYPE_HARDWARE, - None, + HMODULE(std::ptr::null_mut()), D3D11_CREATE_DEVICE_BGRA_SUPPORT, Some(&[D3D_FEATURE_LEVEL_11_1, D3D_FEATURE_LEVEL_11_0]), D3D11_SDK_VERSION, @@ -56,7 +56,8 @@ impl WindowsCapture { let output = adapter.EnumOutputs(0)?; let output1: IDXGIOutput1 = output.cast()?; - let desc = output.GetDesc()?; + let mut desc = DXGI_OUTPUT_DESC::default(); + output.GetDesc(&mut desc)?; let width = (desc.DesktopCoordinates.right - desc.DesktopCoordinates.left) as u32; let height = (desc.DesktopCoordinates.bottom - desc.DesktopCoordinates.top) as u32; diff --git a/src/encoder.rs b/src/encoder.rs index 2defd75..6021b4e 100644 --- a/src/encoder.rs +++ b/src/encoder.rs @@ -384,10 +384,10 @@ impl WindowsHwEncoder { width as i32, height as i32, (*codec_ctx).pix_fmt, - SWS_FAST_BILINEAR, + 2, + ptr::null_mut(), ptr::null_mut(), ptr::null_mut(), - ptr::null(), ); Ok(Self {