Attempt to start the stream if it's stopped.

This commit is contained in:
Richard Bowman 2020-04-23 11:22:14 +01:00
parent 5a4aae8ed1
commit be85d07210

View file

@ -50,6 +50,9 @@ class JPEGSharpnessMonitor:
def start(self):
"Start monitoring sharpness by looking at JPEG size"
if not self.camera.stream_active:
logging.warn("Autofocus sharpness monitor was started but the camera isn't streaming. Attempting to start the stream...")
self.camera.start_stream_recording()
self.background_thread = Thread(target=self._measure_jpegs)
self.background_thread.start()
return self