Per-tile stream quality (high/low), fps cap, latency flags

Cameras carry multiple stream URLs (streams: high/medium/low); each
tile picks one via Quality (auto/high/low). Small tiles can pull the
low substream to cut Pi decode load. discover --enable-rtsp takes a
comma list (high,low), enables each channel, records all enabled ones.
TUI: q cycles a tile quality (shown in the tile); discover enables
high+low. Player: --framedrop + low-delay demuxer flags; player.max_fps.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Levi Woodard
2026-07-01 21:55:25 -05:00
parent 780396076d
commit 8d95c944bd
10 changed files with 287 additions and 70 deletions

View File

@@ -96,6 +96,8 @@ func (m *model) updateLayoutEdit(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
m.screen, m.cursor = screenCameraPicker, 0
case "c":
m.clearAt()
case "q": // cycle this tile's stream quality (high/low/auto)
m.cycleQuality()
case "L": // grow wider (toward the right)
m.resizeTile(1, 0)
case "H": // shrink narrower (from the right)
@@ -149,6 +151,36 @@ func (m *model) clearAt() {
}
}
// cycleQuality steps the tile under the cursor through auto → its camera's
// available stream qualities (high/low/...). Small tiles → pick low; big tiles
// → high, to keep the Pi's decode load down.
func (m *model) cycleQuality() {
idx := m.tileIndexAt(m.edCol, m.edRow)
if idx < 0 {
m.setStatus("no tile here — assign a camera first", true)
return
}
t := &m.curLayout().Tiles[idx]
opts := []string{""} // "" = auto (best available)
if cam := m.cfg.CameraByName(t.Camera); cam != nil {
opts = append(opts, cam.AvailableQualities()...)
}
cur := 0
for i, q := range opts {
if q == t.Quality {
cur = i
break
}
}
t.Quality = opts[(cur+1)%len(opts)]
m.dirty = true
label := t.Quality
if label == "" {
label = "auto"
}
m.setStatus("tile quality: "+label, false)
}
// resizeTile grows/shrinks the tile under the cursor by the given span deltas,
// keeping it in-bounds and non-overlapping.
func (m *model) resizeTile(dCol, dRow int) {