Commit 827c66a1 authored by vertighel's avatar vertighel
Browse files
parents 8ae14ecb 5b03cddd
Loading
Loading
Loading
Loading
+17 −5
Original line number Diff line number Diff line
@@ -103,15 +103,27 @@ class Guider(Mako):
        self._streamer = None

        
    # def _frame_handler(self, cam, stream, frame):
    #     """Callback to handle frames during streaming."""
        
    #     if frame.get_status() == FrameStatus.Complete:
    #         with self._lock:
    #             self._last_frame = frame.as_numpy_ndarray().copy()
    #     cam.queue_frame(frame)
    def _frame_handler(self, cam, stream, frame):
        """Callback to handle frames during streaming."""
        try:
            status = frame.get_status()
        except ValueError:
            # Frame incompleto (-4 VmbErrorIncomplete) — pacchetti persi in rete
            cam.queue_frame(frame)
            return
            
        if frame.get_status() == FrameStatus.Complete:
        if status == FrameStatus.Complete:
            with self._lock:
                self._last_frame = frame.as_numpy_ndarray().copy()
        cam.queue_frame(frame)
            
        
    @property
    def streaming(self):
        """Get the current streaming status."""