mirror of
https://github.com/kkroening/ffmpeg-python.git
synced 2025-08-10 13:10:03 +08:00
Detect: Checkpoint untested Windows GPU detection
This commit is contained in:
parent
7121906e62
commit
999d047bfe
@ -54,6 +54,8 @@ HWACCEL_OUTPUT_FORMATS = {
|
|||||||
'vaapi': 'vaapi'}
|
'vaapi': 'vaapi'}
|
||||||
|
|
||||||
GPU_PRODUCT_RE = re.compile(r'(?P<chip>[^[]+)(\[(?P<board>[^]]+)\]|)')
|
GPU_PRODUCT_RE = re.compile(r'(?P<chip>[^[]+)(\[(?P<board>[^]]+)\]|)')
|
||||||
|
GPU_WMI_PROPERTIES = dict(
|
||||||
|
vendor='AdapterCompatibility', board='VideoProcessor')
|
||||||
|
|
||||||
# Loaded from JSON
|
# Loaded from JSON
|
||||||
DATA = None
|
DATA = None
|
||||||
@ -86,6 +88,17 @@ def detect_gpus():
|
|||||||
if not gpu['board']:
|
if not gpu['board']:
|
||||||
gpu['board'] = gpu.pop('chip')
|
gpu['board'] = gpu.pop('chip')
|
||||||
|
|
||||||
|
elif plat_sys == 'Windows':
|
||||||
|
import wmi
|
||||||
|
for controller in wmi.WMI().Win32_VideoController():
|
||||||
|
gpu = {}
|
||||||
|
for key, wmi_prop in GPU_WMI_PROPERTIES.items():
|
||||||
|
value = controller.wmi_property(wmi_prop).value
|
||||||
|
if value:
|
||||||
|
gpu[key] = value
|
||||||
|
if gpu:
|
||||||
|
gpus.append(gpu)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# TODO Other platforms
|
# TODO Other platforms
|
||||||
raise NotImplementedError(
|
raise NotImplementedError(
|
||||||
|
3
setup.py
3
setup.py
@ -72,6 +72,9 @@ setup(
|
|||||||
long_description=long_description,
|
long_description=long_description,
|
||||||
install_requires=['future'],
|
install_requires=['future'],
|
||||||
extras_require={
|
extras_require={
|
||||||
|
'detect': [
|
||||||
|
"pywin32; sys_platform == 'Windows'",
|
||||||
|
"wmi; sys_platform == 'Windows'"],
|
||||||
'dev': [
|
'dev': [
|
||||||
'future==0.17.1',
|
'future==0.17.1',
|
||||||
'numpy==1.16.4',
|
'numpy==1.16.4',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user