(codecId: AVCodecID)
| 540 | |
| 541 | const hardwareDecoderCodecCache = new Map<AVCodecID, Codec | null>(); |
| 542 | export const getHardwareDecoderCodec = (codecId: AVCodecID): Codec | null => { |
| 543 | if (!hardwareDecoderCodecCache.has(codecId)) { |
| 544 | const hw = getHardwareContext(); |
| 545 | hardwareDecoderCodecCache.set(codecId, hw?.getDecoderCodec(codecId) ?? null); |
| 546 | } |
| 547 | return hardwareDecoderCodecCache.get(codecId)!; |
| 548 | }; |
| 549 | |
| 550 | export const clamp = (value: number, min: number, max: number) => { |
| 551 | return Math.max(min, Math.min(max, value)); |
no test coverage detected