(record: HevcDecoderConfigurationRecord)
| 852 | }; |
| 853 | |
| 854 | export const generateHevcCodecString = (record: HevcDecoderConfigurationRecord) => { |
| 855 | const generalProfileSpace = record.generalProfileSpace; |
| 856 | const generalProfileIdc = record.generalProfileIdc; |
| 857 | const compatibilityFlags = reverseBitsU32(record.generalProfileCompatibilityFlags); |
| 858 | const generalTierFlag = record.generalTierFlag; |
| 859 | const generalLevelIdc = record.generalLevelIdc; |
| 860 | const constraintFlags = [...record.generalConstraintIndicatorFlags]; |
| 861 | |
| 862 | let codecString = 'hev1.'; |
| 863 | |
| 864 | codecString += ['', 'A', 'B', 'C'][generalProfileSpace] + generalProfileIdc; |
| 865 | codecString += '.'; |
| 866 | codecString += compatibilityFlags.toString(16).toUpperCase(); |
| 867 | codecString += '.'; |
| 868 | codecString += generalTierFlag === 0 ? 'L' : 'H'; |
| 869 | codecString += generalLevelIdc; |
| 870 | |
| 871 | while (constraintFlags.length > 0 && constraintFlags[constraintFlags.length - 1] === 0) { |
| 872 | constraintFlags.pop(); |
| 873 | } |
| 874 | |
| 875 | if (constraintFlags.length > 0) { |
| 876 | codecString += '.'; |
| 877 | codecString += constraintFlags.map(x => x.toString(16).toUpperCase()).join('.'); |
| 878 | } |
| 879 | |
| 880 | return codecString; |
| 881 | }; |
| 882 | |
| 883 | /** Serializes an HevcDecoderConfigurationRecord into the format specified in Section 8.3.3.1 of ISO 14496-15. */ |
| 884 | export const serializeHevcDecoderConfigurationRecord = (record: HevcDecoderConfigurationRecord) => { |
no test coverage detected