feat(render): auto-detect HDR from media probes, add --sdr flag (#526)

* feat(render): auto-detect HDR from media probes, add --sdr flag

Replace the --hdr opt-in model with automatic detection. When no flags
are passed, the renderer probes all video/image sources and enables HDR
output if any HDR color space is detected. Existing --hdr flag becomes
a force override. New --sdr flag forces SDR output.

Behavior matrix:
  (no flags) + HDR content → HDR output
  (no flags) + SDR content → SDR output
  --hdr → force HDR (defaults to HLG if no HDR sources)
  --sdr → force SDR (skips probing)
  --hdr --sdr → error

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: align HDR auto-detect docs and tests

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Vance Ingalls
2026-04-28 01:39:51 -07:00
committed by GitHub
co-authored by Claude Opus 4.6
parent 4d0e262eb3
commit 8e5593b6ba
11 changed files with 140 additions and 69 deletions
+8 -3
View File
@@ -58,9 +58,14 @@ function readCache<T>(path: string): T | undefined {
}
function writeCache<T>(path: string, data: T): void {
mkdirSync(dirname(path), { recursive: true });
const entry: CacheEntry<T> = { fetchedAt: Date.now(), data };
writeFileSync(path, JSON.stringify(entry), "utf-8");
try {
mkdirSync(dirname(path), { recursive: true });
const entry: CacheEntry<T> = { fetchedAt: Date.now(), data };
writeFileSync(path, JSON.stringify(entry), "utf-8");
} catch {
// Cache writes are opportunistic. A read-only home directory or sandboxed
// environment should not make the registry appear unreachable.
}
}
// ── Fetchers ────────────────────────────────────────────────────────────────