feat: add recording toggle, stream stats UI
This commit is contained in:
@@ -30,6 +30,8 @@ class StreamReader:
|
||||
self._thread: threading.Thread | None = None
|
||||
self._stop = threading.Event()
|
||||
self.error_count = 0
|
||||
# Cumulative count of resync events (lost sync marker) for stream stats.
|
||||
self.resync_count = 0
|
||||
|
||||
def start(self) -> None:
|
||||
self._stop.clear()
|
||||
@@ -158,6 +160,7 @@ class StreamReader:
|
||||
else:
|
||||
# Resync: keep only trailing 0xAA if present, then read more.
|
||||
resync_attempts += 1
|
||||
self.resync_count += 1
|
||||
if resync_attempts > _MAX_RESYNC_ATTEMPTS:
|
||||
log.error(
|
||||
"StreamReader: giving up after %d resync attempts "
|
||||
|
||||
Reference in New Issue
Block a user