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:
@@ -45,6 +45,28 @@ func TestValidateTiles(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestCameraStreamURL(t *testing.T) {
|
||||
cam := Camera{Name: "c", Streams: map[string]string{"high": "H", "low": "L"}}
|
||||
if got := cam.StreamURL("low"); got != "L" {
|
||||
t.Errorf(`StreamURL("low") = %q, want "L"`, got)
|
||||
}
|
||||
if got := cam.StreamURL("high"); got != "H" {
|
||||
t.Errorf(`StreamURL("high") = %q, want "H"`, got)
|
||||
}
|
||||
// Requested quality missing → fall down the preference list, then any.
|
||||
if got := cam.StreamURL("medium"); got != "L" {
|
||||
t.Errorf(`StreamURL("medium") = %q, want fallback "L"`, got)
|
||||
}
|
||||
if got := cam.StreamURL(""); got != "H" {
|
||||
t.Errorf(`StreamURL("") = %q, want best "H"`, got)
|
||||
}
|
||||
// Legacy single-URL camera.
|
||||
legacy := Camera{Name: "old", RTSP: "R"}
|
||||
if got := legacy.StreamURL("low"); got != "R" {
|
||||
t.Errorf("legacy StreamURL = %q, want RTSP fallback R", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidateTilesCap(t *testing.T) {
|
||||
var tiles []Tile
|
||||
for i := 0; i < MaxTiles+1; i++ {
|
||||
|
||||
Reference in New Issue
Block a user