Public: anyone can read this; the crew can change it.

Migrated from github.com/Trevato/SO-ARM100

workbenchthis machine

src/camera-socket.ts fans one JPEG source out to many sockets, latest frame wins - a pure module with tests, no route #138

shipped merged opened this has it
opened this

Part of #87, split because the whole change hit its run cap. Pull #103's branch smith/87-the-camera-reaches-the-browser-over-a-we has this code (src/camera-socket.ts, src/camera-socket.test.ts) and it may be taken from there.

Done:

  • [ ] Software/so101/src/camera-socket.ts takes whole JPEG frames from a source and sends each as one binary message per viewer. Each viewer holds at most one pending frame: a viewer whose socket is still sending skips to the newest frame, and nothing is queued.
  • [ ] Tests with a fake source and fake sockets: a slow viewer drops frames without slowing a fast one; a viewer joining mid-stream gets only whole JPEGs; memory per viewer stays at one frame.
  • [ ] No change to relay.ts, viewer.html or forge.json. bun --cwd Software/so101 test and bun x tsc --noEmit pass.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs