Colour element: Matrix renamed to MatrixCoefficients.
Change-Id: I148e81be6c23f0d0e61dc5820a1ae80f685af57f
This commit is contained in:
parent
e0b11351fb
commit
f2fc28e044
10
mkvmuxer.cpp
10
mkvmuxer.cpp
@ -1003,8 +1003,8 @@ bool Colour::Write(IMkvWriter* writer) const {
|
||||
if (!WriteEbmlMasterElement(writer, kMkvColour, size))
|
||||
return false;
|
||||
|
||||
if (matrix != kUnspecifiedColourValue &&
|
||||
!WriteEbmlElement(writer, kMkvMatrix, matrix)) {
|
||||
if (matrix_coefficients != kUnspecifiedColourValue &&
|
||||
!WriteEbmlElement(writer, kMkvMatrixCoefficients, matrix_coefficients)) {
|
||||
return false;
|
||||
}
|
||||
if (bits_per_channel != kUnspecifiedColourValue &&
|
||||
@ -1087,8 +1087,8 @@ bool Colour::SetMasteringMetadata(const MasteringMetadata& mastering_metadata) {
|
||||
uint64 Colour::PayloadSize() const {
|
||||
uint64 size = 0;
|
||||
|
||||
if (matrix != kUnspecifiedColourValue)
|
||||
size += EbmlElementSize(kMkvMatrix, matrix);
|
||||
if (matrix_coefficients != kUnspecifiedColourValue)
|
||||
size += EbmlElementSize(kMkvMatrixCoefficients, matrix_coefficients);
|
||||
if (bits_per_channel != kUnspecifiedColourValue)
|
||||
size += EbmlElementSize(kMkvBitsPerChannel, bits_per_channel);
|
||||
if (chroma_subsampling_horz != kUnspecifiedColourValue)
|
||||
@ -1248,7 +1248,7 @@ bool VideoTrack::SetColour(const Colour& colour) {
|
||||
return false;
|
||||
}
|
||||
|
||||
colour_ptr->matrix = colour.matrix;
|
||||
colour_ptr->matrix_coefficients = colour.matrix_coefficients;
|
||||
colour_ptr->bits_per_channel = colour.bits_per_channel;
|
||||
colour_ptr->chroma_subsampling_horz = colour.chroma_subsampling_horz;
|
||||
colour_ptr->chroma_subsampling_vert = colour.chroma_subsampling_vert;
|
||||
|
@ -394,7 +394,7 @@ class Colour {
|
||||
public:
|
||||
static const uint64 kUnspecifiedColourValue;
|
||||
Colour()
|
||||
: matrix(kUnspecifiedColourValue),
|
||||
: matrix_coefficients(kUnspecifiedColourValue),
|
||||
bits_per_channel(kUnspecifiedColourValue),
|
||||
chroma_subsampling_horz(kUnspecifiedColourValue),
|
||||
chroma_subsampling_vert(kUnspecifiedColourValue),
|
||||
@ -421,7 +421,7 @@ class Colour {
|
||||
return mastering_metadata_;
|
||||
}
|
||||
|
||||
uint64 matrix;
|
||||
uint64 matrix_coefficients;
|
||||
uint64 bits_per_channel;
|
||||
uint64 chroma_subsampling_horz;
|
||||
uint64 chroma_subsampling_vert;
|
||||
|
@ -5111,9 +5111,10 @@ bool Colour::Parse(IMkvReader* reader, long long colour_start,
|
||||
if (status < 0)
|
||||
return false;
|
||||
|
||||
if (child_id == mkvmuxer::kMkvMatrix) {
|
||||
colour_ptr->matrix = UnserializeUInt(reader, read_pos, child_size);
|
||||
if (colour_ptr->matrix < 0)
|
||||
if (child_id == mkvmuxer::kMkvMatrixCoefficients) {
|
||||
colour_ptr->matrix_coefficients =
|
||||
UnserializeUInt(reader, read_pos, child_size);
|
||||
if (colour_ptr->matrix_coefficients < 0)
|
||||
return false;
|
||||
} else if (child_id == mkvmuxer::kMkvBitsPerChannel) {
|
||||
colour_ptr->bits_per_channel =
|
||||
|
@ -437,7 +437,7 @@ struct Colour {
|
||||
// Unless otherwise noted all values assigned upon construction are the
|
||||
// equivalent of unspecified/default.
|
||||
Colour()
|
||||
: matrix(kValueNotPresent),
|
||||
: matrix_coefficients(kValueNotPresent),
|
||||
bits_per_channel(kValueNotPresent),
|
||||
chroma_subsampling_horz(kValueNotPresent),
|
||||
chroma_subsampling_vert(kValueNotPresent),
|
||||
@ -459,7 +459,7 @@ struct Colour {
|
||||
static bool Parse(IMkvReader* reader, long long element_start,
|
||||
long long element_size, Colour** colour);
|
||||
|
||||
long long matrix;
|
||||
long long matrix_coefficients;
|
||||
long long bits_per_channel;
|
||||
long long chroma_subsampling_horz;
|
||||
long long chroma_subsampling_vert;
|
||||
|
@ -238,8 +238,9 @@ int main(int argc, char* argv[]) {
|
||||
const mkvparser::Colour* const colour = pVideoTrack->GetColour();
|
||||
if (colour) {
|
||||
printf("\t\tVideo Colour:\n");
|
||||
if (ColourValuePresent(colour->matrix))
|
||||
printf("\t\t\tMatrix: %lld\n", colour->matrix);
|
||||
if (ColourValuePresent(colour->matrix_coefficients))
|
||||
printf("\t\t\tMatrixCoefficients: %lld\n",
|
||||
colour->matrix_coefficients);
|
||||
if (ColourValuePresent(colour->bits_per_channel))
|
||||
printf("\t\t\tBitsPerChannel: %lld\n", colour->bits_per_channel);
|
||||
if (ColourValuePresent(colour->chroma_subsampling_horz))
|
||||
|
@ -201,8 +201,8 @@ bool CopyColour(const mkvparser::Colour& parser_colour,
|
||||
if (!muxer_colour)
|
||||
return false;
|
||||
|
||||
if (ColourValuePresent(parser_colour.matrix))
|
||||
muxer_colour->matrix = parser_colour.matrix;
|
||||
if (ColourValuePresent(parser_colour.matrix_coefficients))
|
||||
muxer_colour->matrix_coefficients = parser_colour.matrix_coefficients;
|
||||
if (ColourValuePresent(parser_colour.bits_per_channel))
|
||||
muxer_colour->bits_per_channel = parser_colour.bits_per_channel;
|
||||
if (ColourValuePresent(parser_colour.chroma_subsampling_horz))
|
||||
|
@ -97,7 +97,7 @@ enum MkvId {
|
||||
// end video
|
||||
// colour
|
||||
kMkvColour = 0x55B0,
|
||||
kMkvMatrix = 0x55B1,
|
||||
kMkvMatrixCoefficients = 0x55B1,
|
||||
kMkvBitsPerChannel = 0x55B2,
|
||||
kMkvChromaSubsamplingHorz = 0x55B3,
|
||||
kMkvChromaSubsamplingVert = 0x55B4,
|
||||
|
Loading…
x
Reference in New Issue
Block a user