Make some changes to make it work

This commit is contained in:
Wouter Heerwegh
2023-05-10 12:25:38 +02:00
parent 848313c3fc
commit c5b55e3df4

View File

@@ -1065,7 +1065,7 @@ class BackgroundFrameRead:
self.frames.append(np.array(frame.to_image()))
else:
with self.lock:
self.frame = frame
self.frame = np.array(frame.to_image())
if self.stopped:
self.container.close()
@@ -1088,12 +1088,16 @@ class BackgroundFrameRead:
"""
Access the frame variable directly
"""
if self._with_queue:
if self.with_queue:
return self.get_queued_frame()
with self._lock:
with self.lock:
return self._frame
@frame.setter
def frame(self, value):
self._frame = value
def stop(self):
"""Stop the frame update worker
Internal method, you normally wouldn't call this yourself.