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:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user