Add cleaning up the stream after cancellation_event was sent

This commit is contained in:
lorow 2022-06-16 13:35:59 +02:00 committed by qDot
parent 9d3424d20f
commit 789879f3df

View File

@ -41,6 +41,7 @@ class Camera:
while True:
if self.cancellation_event.is_set():
print("Exiting capture thread")
self.cleanup_stream()
return
# If things aren't open, retry until they are. Don't let read requests come in any earlier
@ -113,4 +114,4 @@ class Camera:
if qsize > 1:
print(f"CAPTURE QUEUE BACKPRESSURE OF {qsize}. CHECK FOR CRASH OR TIMING ISSUES IN ALGORITHM.")
self.camera_output_outgoing.put((image, frame_number, fps))
self.capture_event.clear()
self.capture_event.clear()