7 #include <packager/media/codecs/av1_codec_configuration_record.h>
9 #include <absl/strings/str_format.h>
11 #include <packager/media/base/bit_reader.h>
12 #include <packager/media/base/rcheck.h>
17 AV1CodecConfigurationRecord::AV1CodecConfigurationRecord() =
default;
19 AV1CodecConfigurationRecord::~AV1CodecConfigurationRecord() =
default;
46 RCHECK(data_size > 0);
55 RCHECK(reader.
ReadBits(7, &version));
58 RCHECK(reader.
ReadBits(3, &profile_));
64 RCHECK(reader.
ReadBits(1, &high_bitdepth));
65 RCHECK(reader.
ReadBits(1, &twelve_bit));
66 bit_depth_ = twelve_bit ? 12 : (high_bitdepth ? 10 : 8);
68 RCHECK(reader.
ReadBits(1, &mono_chrome_));
69 RCHECK(reader.
ReadBits(1, &chroma_subsampling_x_));
70 RCHECK(reader.
ReadBits(1, &chroma_subsampling_y_));
71 RCHECK(reader.
ReadBits(2, &chroma_sample_position_));
89 return absl::StrFormat(
"av01.%d.%02d%c.%02d", profile_, level_,
90 tier_ ?
'H' :
'M', bit_depth_);
96 uint16_t color_primaries,
97 uint16_t transfer_characteristics,
98 uint16_t matrix_coefficients,
99 uint8_t video_full_range_flag)
const {
100 return absl::StrFormat(
101 "av01.%d.%02d%c.%02d.%d.%d%d%d.%02d.%02d.%02d.%d", profile_, level_,
102 tier_ ?
'H' :
'M', bit_depth_, mono_chrome_, chroma_subsampling_x_,
103 chroma_subsampling_y_, chroma_sample_position_, color_primaries,
104 transfer_characteristics, matrix_coefficients, video_full_range_flag);
All the methods that are virtual are virtual for mocking.