LibMedia/Matroska: Actually read out the video color range

Apparently I forgot to put read the value for this field, though this
generally doesn't matter since video bitstreams usually specify CICP as
well.
This commit is contained in:
Zaggy1024 2024-06-20 21:47:44 -05:00 committed by Andrew Kaster
commit d3f88b4987
Notes: sideshowbarker 2024-07-16 22:18:54 +09:00

View file

@ -62,6 +62,7 @@ constexpr u32 COLOR_ENTRY_ID = 0x55B0;
constexpr u32 PRIMARIES_ID = 0x55BB;
constexpr u32 TRANSFER_CHARACTERISTICS_ID = 0x55BA;
constexpr u32 MATRIX_COEFFICIENTS_ID = 0x55B1;
constexpr u32 RANGE_ID = 0x55B9;
constexpr u32 BITS_PER_CHANNEL_ID = 0x55B2;
// Audio
@ -385,6 +386,10 @@ static DecoderErrorOr<TrackEntry::ColorFormat> parse_video_color_information(Str
color_format.matrix_coefficients = static_cast<MatrixCoefficients>(TRY_READ(streamer.read_u64()));
dbgln_if(MATROSKA_TRACE_DEBUG, "Read Colour's MatrixCoefficients attribute: {}", matrix_coefficients_to_string(color_format.matrix_coefficients));
break;
case RANGE_ID:
color_format.range = static_cast<TrackEntry::ColorRange>(TRY_READ(streamer.read_u64()));
dbgln_if(MATROSKA_TRACE_DEBUG, "Read Colour's Range attribute: {}", to_underlying(color_format.range));
break;
case BITS_PER_CHANNEL_ID:
color_format.bits_per_channel = TRY_READ(streamer.read_u64());
dbgln_if(MATROSKA_TRACE_DEBUG, "Read Colour's BitsPerChannel attribute: {}", color_format.bits_per_channel);