diff --git a/scripts/requirements-dev.txt b/scripts/requirements-dev.txt index c5b1530b..3f11be6e 100644 --- a/scripts/requirements-dev.txt +++ b/scripts/requirements-dev.txt @@ -22,7 +22,3 @@ types-pyinstaller types-python-xlib ; sys_platform == 'linux' types-pywin32>=306.0.0.20240130 ; sys_platform == 'win32' types-toml -# Type references not used at runtime -winrt-Windows.Foundation>=2.2.0 ; sys_platform == 'win32' # Python 3.13 support -winrt-Windows.Graphics>=2.2.0 ; sys_platform == 'win32' # Python 3.13 support -winrt-Windows.Graphics.DirectX.Direct3D11>=2.2.0 ; sys_platform == 'win32' # Python 3.13 support diff --git a/scripts/requirements.txt b/scripts/requirements.txt index 182234de..69d458a5 100644 --- a/scripts/requirements.txt +++ b/scripts/requirements.txt @@ -20,7 +20,6 @@ typing-extensions>=4.4.0 # @override decorator support # # Build and compile resources -# pyinstaller>=5.13 # Python 3.12 support # @@ -31,11 +30,15 @@ comtypes<1.4.5 ; sys_platform == 'win32' # https://github.com/pyinstaller/pyins pygrabber>=0.2 ; sys_platform == 'win32' # Completed types pywin32>=301 ; sys_platform == 'win32' typed-D3DShot[numpy]>=1.0.1 ; sys_platform == 'win32' -winrt-Windows.Graphics.Capture>=2.2.0 ; sys_platform == 'win32' # Python 3.13 support -winrt-Windows.Graphics.Capture.Interop>=2.2.0 ; sys_platform == 'win32' # Python 3.13 support -winrt-Windows.Graphics.DirectX>=2.2.0 ; sys_platform == 'win32' # Python 3.13 support +winrt-Windows.Foundation>=2.2.0 ; sys_platform == 'win32' # Python 3.13 support +winrt-Windows.Graphics.Capture>=2.3.0 ; sys_platform == 'win32' # Python 3.13 support +winrt-Windows.Graphics.Capture.Interop>=2.3.0 ; sys_platform == 'win32' # Python 3.13 support +winrt-Windows.Graphics.DirectX>=2.3.0 ; sys_platform == 'win32' # Python 3.13 support +winrt-Windows.Graphics.DirectX.Direct3D11>=2.3.0 ; sys_platform == 'win32' # Python 3.13 support winrt-Windows.Graphics.DirectX.Direct3D11.Interop>=2.3.0 ; sys_platform == 'win32' -winrt-Windows.Graphics.Imaging>=2.2.0 ; sys_platform == 'win32' # Python 3.13 support +winrt-Windows.Graphics>=2.2.0 ; sys_platform == 'win32' # Python 3.13 support +winrt-Windows.Graphics.Imaging>=2.3.0 ; sys_platform == 'win32' # Python 3.13 support + # # Linux-only dependencies PyScreeze ; sys_platform == 'linux' diff --git a/src/capture_method/WindowsGraphicsCaptureMethod.py b/src/capture_method/WindowsGraphicsCaptureMethod.py index 6e923695..aa905a32 100644 --- a/src/capture_method/WindowsGraphicsCaptureMethod.py +++ b/src/capture_method/WindowsGraphicsCaptureMethod.py @@ -9,9 +9,11 @@ import win32gui from cv2.typing import MatLike from typing_extensions import override +from winrt.windows.graphics import SizeInt32 from winrt.windows.graphics.capture import Direct3D11CaptureFramePool, GraphicsCaptureSession from winrt.windows.graphics.capture.interop import create_for_window from winrt.windows.graphics.directx import DirectXPixelFormat +from winrt.windows.graphics.directx.direct3d11 import IDirect3DSurface from winrt.windows.graphics.directx.direct3d11.interop import ( create_direct3d11_device_from_dxgi_device, ) @@ -22,15 +24,12 @@ from utils import BGRA_CHANNEL_COUNT, WGC_MIN_BUILD, WINDOWS_BUILD_NUMBER, is_valid_hwnd if TYPE_CHECKING: - from winrt.windows.graphics import SizeInt32 - from winrt.windows.graphics.directx.direct3d11 import IDirect3DSurface - from AutoSplit import AutoSplit WGC_NO_BORDER_MIN_BUILD = 20348 -async def convert_d3d_surface_to_software_bitmap(surface: "IDirect3DSurface | None"): +async def convert_d3d_surface_to_software_bitmap(surface: IDirect3DSurface | None): return await SoftwareBitmap.create_copy_from_surface_async(surface)