Optimised captures by using greenlets for disk IO
This commit is contained in:
parent
1a0ede609d
commit
7c9f42f7f3
8 changed files with 86 additions and 41 deletions
|
|
@ -197,19 +197,14 @@ class MissingCamera(BaseCamera):
|
|||
bayer (bool): Store raw bayer data in capture
|
||||
"""
|
||||
|
||||
if isinstance(output, CaptureObject):
|
||||
target = output.file
|
||||
else:
|
||||
target = output
|
||||
|
||||
with self.lock:
|
||||
if isinstance(target, str):
|
||||
target = open(target, "wb")
|
||||
if isinstance(output, str):
|
||||
output = open(output, "wb")
|
||||
|
||||
target.write(self.stream.getvalue())
|
||||
output.write(self.stream.getvalue())
|
||||
|
||||
if isinstance(target, str):
|
||||
target.close()
|
||||
if isinstance(output, str):
|
||||
output.close()
|
||||
|
||||
# HANDLE STREAM FRAMES
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue