Added an option to disable escapi for video input on Windows.

This commit is contained in:
Emiliana 2020-07-02 01:39:46 +02:00
parent 935a5fdf91
commit 5c4d4b7b14
2 changed files with 8 additions and 4 deletions

View file

@ -24,12 +24,12 @@ class VideoReader():
self.cap.release()
class CameraReader(VideoReader):
def __init__(self, capture, width, height, fps):
def __init__(self, capture, width, height, fps, use_escapi=True):
self.device = None
self.width = width
self.height = height
self.fps = fps
if os.name == 'nt':
if os.name == 'nt' and use_escapi:
escapi.init()
self.device = capture
self.buffer = escapi.init_camera(self.device, self.width, self.height, self.fps)
@ -88,7 +88,7 @@ class RawReader:
self.open = False
class InputReader():
def __init__(self, capture, raw_rgb, width, height, fps):
def __init__(self, capture, raw_rgb, width, height, fps, use_escapi=False):
self.reader = None
try:
if raw_rgb > 0: