Fix remaining API issues and borrow conflicts

- Rename display param to target_display to avoid tracing conflict
- Refactor session loop to avoid holding borrow across handle_message
This commit is contained in:
AZ Computer Guru
2025-12-28 12:43:54 -07:00
parent b1de7be632
commit d2c8cf1c0b
2 changed files with 18 additions and 6 deletions

View File

@@ -55,7 +55,7 @@ impl DxgiCapturer {
/// Create D3D device and output duplication
fn create_duplication(
display: &Display,
target_display: &Display,
) -> Result<(ID3D11Device, ID3D11DeviceContext, IDXGIOutputDuplication, DXGI_OUTDUPL_DESC)> {
unsafe {
// Create DXGI factory
@@ -63,7 +63,7 @@ impl DxgiCapturer {
.context("Failed to create DXGI factory")?;
// Find the adapter and output for this display
let (adapter, output) = Self::find_adapter_output(&factory, display)?;
let (adapter, output) = Self::find_adapter_output(&factory, target_display)?;
// Create D3D11 device
let mut device: Option<ID3D11Device> = None;
@@ -100,7 +100,7 @@ impl DxgiCapturer {
"Created DXGI duplication: {}x{}, display: {}",
desc.ModeDesc.Width,
desc.ModeDesc.Height,
&display.name
target_display.name
);
Ok((device, context, duplication, desc))