Skip to content

Commit

Permalink
Bump comtypes
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam committed Oct 20, 2024
1 parent 57f8e8c commit 7eaac33
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
5 changes: 4 additions & 1 deletion scripts/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@ PySide6-Essentials>=6.8.0.1 ; python_version <= '3.12' # Python 3.13 support
scipy>=1.14.1 # Python 3.13 support
tomli-w>=1.1.0 # Typing fixes
typing-extensions>=4.4.0 # @override decorator support

#
# Build and compile resources
pyinstaller>=6.10.0 # Python 3.13 support

#
# https://peps.python.org/pep-0508/#environment-markers
#
# Windows-only dependencies:
git+https://github.com/enthought/comtypes#egg=comtypes # Python 3.13 support # We don't use directly, just remove once 1.4.8 releases
typed-D3DShot[numpy] >= 1.0.1; sys_platform == 'win32'
pygrabber>=0.2 ; sys_platform == 'win32' # Completed types
pywin32>=307 ; sys_platform == 'win32' # Python 3.13 support
Expand All @@ -35,7 +38,7 @@ winrt-Windows.Graphics.DirectX.Direct3D11>=2.2.0 ; sys_platform == 'win32' # Py
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.Media.Capture>=2.2.0 ; sys_platform == 'win32' # Python 3.13 support
typed-D3DShot[numpy]>=1.0.1 ; sys_platform == 'win32'

#
# Linux-only dependencies
PyScreeze ; sys_platform == 'linux'
Expand Down
12 changes: 4 additions & 8 deletions src/capture_method/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,15 @@
if sys.platform == "win32":
from _ctypes import COMError # noqa: PLC2701 # comtypes is untyped

from pygrabber.dshow_graph import FilterGraph

from capture_method.BitBltCaptureMethod import BitBltCaptureMethod
from capture_method.DesktopDuplicationCaptureMethod import DesktopDuplicationCaptureMethod
from capture_method.ForceFullContentRenderingCaptureMethod import (
ForceFullContentRenderingCaptureMethod,
)
from capture_method.WindowsGraphicsCaptureMethod import WindowsGraphicsCaptureMethod

if sys.version_info < (3, 13):
# https://github.com/enthought/comtypes/issues/618
from capture_method.DesktopDuplicationCaptureMethod import DesktopDuplicationCaptureMethod

if sys.platform == "linux":
import pyscreeze
from PIL import UnidentifiedImageError, features
Expand Down Expand Up @@ -184,10 +183,7 @@ class CameraInfo:


def get_input_devices():
if sys.platform == "win32" and sys.version_info < (3, 13):
# https://github.com/enthought/comtypes/issues/618
from pygrabber.dshow_graph import FilterGraph # noqa: PLC0415

if sys.platform == "win32":
return FilterGraph().get_input_devices()

cameras: list[str] = []
Expand Down
2 changes: 1 addition & 1 deletion src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def get_window_bounds(hwnd: int) -> tuple[int, int, int, int]:
# Note: maybe reorganize capture_method module to have
# different helper modules and a methods submodule
def get_input_device_resolution(index: int) -> tuple[int, int] | None:
if sys.platform != "win32" or sys.version_info >= (3, 13):
if sys.platform != "win32":
return (0, 0)

# https://github.com/enthought/comtypes/issues/618
Expand Down

0 comments on commit 7eaac33

Please sign in to comment.