Added start/stop preview camera actions

This commit is contained in:
Fabio Manganiello 2019-08-16 18:38:04 +02:00
parent c93af07333
commit 6465a6f282
1 changed files with 19 additions and 0 deletions

View File

@ -76,6 +76,25 @@ class CameraPiPlugin(CameraPlugin):
return self._camera
@action
def start_preview(self, **opts):
"""
Start camera preview.
:param opts: Extra options to pass to the camera (see
https://www.raspberrypi.org/documentation/usage/camera/python/README.md)
"""
camera = self._get_camera(**opts)
camera.start_preview()
@action
def stop_preview(self):
"""
Stop camera preview.
"""
camera = self._get_camera()
camera.stop_preview()
@action
def take_picture(self, image_file, preview=False, warmup_time=2, resize=None, **opts):
"""