fix(render): require HDR transfer metadata (#2377)

This commit is contained in:
Miguel Ángel
2026-07-13 20:46:59 -04:00
committed by GitHub
parent 3a020bf543
commit 9639824f4e
2 changed files with 6 additions and 8 deletions
+4 -6
View File
@@ -15,12 +15,10 @@ export type HdrTransfer = "hlg" | "pq";
*/
export function isHdrColorSpace(cs: VideoColorSpace | null): boolean {
if (!cs) return false;
return (
cs.colorPrimaries.includes("bt2020") ||
cs.colorSpace.includes("bt2020") ||
cs.colorTransfer === "smpte2084" ||
cs.colorTransfer === "arib-std-b67"
);
// BT.2020 describes a color gamut/matrix, not a dynamic range. SDR media
// can legitimately carry BT.2020 primaries with a BT.709 transfer. Only
// the transfer function distinguishes HDR here: PQ (SMPTE 2084) or HLG.
return cs.colorTransfer === "smpte2084" || cs.colorTransfer === "arib-std-b67";
}
/**