Added support for a fully mocked device
This commit is contained in:
parent
eaa37f70e0
commit
4733b250ed
12 changed files with 283 additions and 41 deletions
|
|
@ -529,6 +529,15 @@ class StreamingCamera(BaseCamera):
|
|||
|
||||
# HANDLE STREAM FRAMES
|
||||
|
||||
def wait_for_camera(self, timeout=5):
|
||||
"""Wait for camera object, with 5 second timeout."""
|
||||
timeout_time = time.time() + timeout
|
||||
while not self.camera:
|
||||
if time.time() > timeout_time:
|
||||
raise TimeoutError("Timeout waiting for camera")
|
||||
else:
|
||||
pass
|
||||
|
||||
def frames(self):
|
||||
"""
|
||||
Create generator that returns frames from the camera.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue