feat: add recording toggle, stream stats UI

This commit is contained in:
jack
2026-07-06 12:44:43 -07:00
parent 3cc10ea7fe
commit 6996df73f8
7 changed files with 186 additions and 81 deletions
+3
View File
@@ -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 "