| 1154 | const VP9_DEFAULT_SUFFIX = '.01.01.01.01.00'; |
| 1155 | |
| 1156 | export const generateVp9CodecString = (codecInfo: Vp9CodecInfo) => { |
| 1157 | const profile = codecInfo.profile.toString().padStart(2, '0'); |
| 1158 | const level = codecInfo.level.toString().padStart(2, '0'); |
| 1159 | const bitDepth = codecInfo.bitDepth.toString().padStart(2, '0'); |
| 1160 | const chromaSubsampling = codecInfo.chromaSubsampling.toString().padStart(2, '0'); |
| 1161 | const colourPrimaries = codecInfo.colourPrimaries.toString().padStart(2, '0'); |
| 1162 | const transferCharacteristics = codecInfo.transferCharacteristics.toString().padStart(2, '0'); |
| 1163 | const matrixCoefficients = codecInfo.matrixCoefficients.toString().padStart(2, '0'); |
| 1164 | const videoFullRangeFlag = codecInfo.videoFullRangeFlag.toString().padStart(2, '0'); |
| 1165 | |
| 1166 | let string = `vp09.${profile}.${level}.${bitDepth}.${chromaSubsampling}`; |
| 1167 | string += `.${colourPrimaries}.${transferCharacteristics}.${matrixCoefficients}.${videoFullRangeFlag}`; |
| 1168 | |
| 1169 | if (string.endsWith(VP9_DEFAULT_SUFFIX)) { |
| 1170 | string = string.slice(0, -VP9_DEFAULT_SUFFIX.length); |
| 1171 | } |
| 1172 | |
| 1173 | return string; |
| 1174 | }; |
| 1175 | |
| 1176 | export type Av1CodecInfo = { |
| 1177 | profile: number; |