mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-09-29 03:43:50 +02:00
Address a bunch of TODOs and add parameter validation everywhere
This commit is contained in:
@@ -73,4 +73,9 @@ export const MATRIX_COEFFICIENTS_MAP: Record<VideoMatrixCoefficients, number> =
|
||||
|
||||
export const colorSpaceIsComplete = (colorSpace: VideoColorSpaceInit | undefined) => {
|
||||
return !!colorSpace && !!colorSpace.primaries && !!colorSpace.transfer && !!colorSpace.matrix && colorSpace.fullRange !== undefined;
|
||||
};
|
||||
|
||||
export const isAllowSharedBufferSource = (x: unknown) => {
|
||||
// Quite a mouthful:
|
||||
return x instanceof ArrayBuffer || (typeof SharedArrayBuffer !== 'undefined' && x instanceof SharedArrayBuffer) || (ArrayBuffer.isView(x) && !(x instanceof DataView));
|
||||
};
|
||||
Reference in New Issue
Block a user