You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CLAUDE.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# Intercom ClientPython
1
+
# Splintercom ClientPython
2
2
3
3
Python device client that streams video from a camera to a remote viewer (browser) using WebRTC, authenticated via OAuth 2.0 Device Authorization Grant, with continuous telemetry reporting.
4
4
@@ -16,7 +16,7 @@ Python device client that streams video from a camera to a remote viewer (browse
-`initiate_device_authorization()` — POSTs to `/oauth/device-authorization/` with device type/OS
34
34
-`poll_for_token()` — Polls `/oauth/token/` with device code until approved (timeout configurable via `MAX_POLLING_TIME_MINS`, default 5 min)
35
35
-`refresh_tokens()` — Refreshes access token using stored refresh token
36
-
-`TokenStore` — Stores access/refresh tokens + `device_code` to JSON file (permissions `0600`) at `~/.config/intercomclient/tokens.json`
36
+
-`TokenStore` — Stores access/refresh tokens + `device_code` to JSON file (permissions `0600`) at `~/.config/splintercomclient/tokens.json`
37
37
38
38
### WebRTC Signaling (`main.py` — `PiClient`)
39
39
- Connects to WebSocket signaling server at `{WEBSOCKET_API_BASE_URL}/ws/live_stream/{device_code}/`
@@ -51,7 +51,7 @@ ClientPython/
51
51
- Uses `if pc is not self.pc: return` guard in all event handlers to discard events from replaced PCs
52
52
- Signaling WebSocket is **never** closed by WebRTC state changes — only by unrecoverable signaling errors
53
53
54
-
### Video Capture (`intercomclient/camera_video_stream_track.py`)
54
+
### Video Capture (`splintercomclient/camera_video_stream_track.py`)
55
55
-`cv2.VideoCapture` can only be opened **once** per process on this hardware. Multi-viewer support is handled by `SharedCameraSource`:
56
56
- Opens the capture device once; runs a `_read_loop` background task that reads frames and fan-outs to per-viewer `asyncio.Queue(maxsize=4)`.
57
57
- Subscribers call `subscribe(key) → Queue` / `unsubscribe(key)`. If a queue is full, the oldest frame is dropped (never blocks the read loop).
@@ -60,7 +60,7 @@ ClientPython/
60
60
- Converts frames to `av.VideoFrame` (BGR24 format) with proper PTS/time_base timestamps.
61
61
-`PiClient._get_or_create_camera_source()` — lazily opens the camera; `_release_camera_if_idle()` — stops and nulls it when `peer_connections` is empty.
0 commit comments