mirror of
https://github.com/iperov/DeepFaceLive
synced 2025-07-06 13:02:16 -07:00
CameraSource: added 'Compatible' driver
This commit is contained in:
parent
f2242f8ca3
commit
88c5224ac2
1 changed files with 8 additions and 9 deletions
|
@ -52,18 +52,17 @@ _ResolutionType_wh = {_ResolutionType.RES_320x240: (320,240),
|
||||||
_ResolutionType.RES_1920x1080: (1920,1080),
|
_ResolutionType.RES_1920x1080: (1920,1080),
|
||||||
}
|
}
|
||||||
class _DriverType(IntEnum):
|
class _DriverType(IntEnum):
|
||||||
DSHOW = 0
|
COMPATIBLE = 0
|
||||||
MSMF = 1
|
DSHOW = 1
|
||||||
GSTREAMER = 2
|
MSMF = 2
|
||||||
OPENCV = 3
|
GSTREAMER = 3
|
||||||
|
|
||||||
_DriverType_names = { _DriverType.DSHOW : 'DirectShow',
|
_DriverType_names = { _DriverType.COMPATIBLE : 'Compatible',
|
||||||
|
_DriverType.DSHOW : 'DirectShow',
|
||||||
_DriverType.MSMF : 'Microsoft Media Foundation',
|
_DriverType.MSMF : 'Microsoft Media Foundation',
|
||||||
_DriverType.GSTREAMER : 'GStreamer',
|
_DriverType.GSTREAMER : 'GStreamer',
|
||||||
_DriverType.OPENCV : 'OpenCV',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class _RotationType(IntEnum):
|
class _RotationType(IntEnum):
|
||||||
ROTATION_0 = 0
|
ROTATION_0 = 0
|
||||||
ROTATION_90 = 1
|
ROTATION_90 = 1
|
||||||
|
@ -112,10 +111,10 @@ class CameraSourceWorker(BackendWorker):
|
||||||
if state.device_idx is not None and \
|
if state.device_idx is not None and \
|
||||||
state.driver is not None:
|
state.driver is not None:
|
||||||
|
|
||||||
cv_api = {_DriverType.DSHOW: cv2.CAP_DSHOW,
|
cv_api = {_DriverType.COMPATIBLE: cv2.CAP_ANY,
|
||||||
|
_DriverType.DSHOW: cv2.CAP_DSHOW,
|
||||||
_DriverType.MSMF: cv2.CAP_MSMF,
|
_DriverType.MSMF: cv2.CAP_MSMF,
|
||||||
_DriverType.GSTREAMER: cv2.CAP_GSTREAMER,
|
_DriverType.GSTREAMER: cv2.CAP_GSTREAMER,
|
||||||
_DriverType.OPENCV: 0,
|
|
||||||
}[state.driver]
|
}[state.driver]
|
||||||
|
|
||||||
vcap = cv2.VideoCapture(state.device_idx, cv_api)
|
vcap = cv2.VideoCapture(state.device_idx, cv_api)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue