Added lock acquisition to preview functions
This commit is contained in:
parent
4bf866b66b
commit
fccc58fd62
1 changed files with 24 additions and 21 deletions
|
|
@ -327,6 +327,7 @@ class PiCameraStreamer(BaseCamera):
|
|||
"""Start the on board GPU camera preview."""
|
||||
logging.info("Starting the GPU preview")
|
||||
|
||||
with self.lock():
|
||||
try:
|
||||
if not self.camera.preview:
|
||||
logging.debug("Starting preview")
|
||||
|
|
@ -351,6 +352,8 @@ class PiCameraStreamer(BaseCamera):
|
|||
|
||||
def stop_preview(self):
|
||||
"""Stop the on board GPU camera preview."""
|
||||
with self.lock():
|
||||
if self.camera.preview:
|
||||
self.camera.stop_preview()
|
||||
self.preview_active = False
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue