Commit 69eab5cd authored by James Zern's avatar James Zern

roll libwebm snapshot

git log --no-merges --oneline 32d5ac4..a97c484
9096786 mkvparser: fix float conversion warning
84e8257 disable -Wdeprecated-declarations in legacy code
a98f495 AddGenericFrame: fix memory leak on failure
da131dd AddCuePoint: fix memory leak on failure
b0cea9c Add(Audio|Video)Track: fix memory leak on failure
5261a67 webm_info: check vp9 ParseUncompressedHeader return
85f7e2e webm_info,PrintVP9Info: validate alt ref sizes
9b97ca1 vp9_header_parser_tests: check parser return
300d6d8 CuePoint::Find: check Track pointer
50c44bb webm_info,OutputCues: fix indexing of tracks
a0d27f0 mkvparser,Block::Parse: remove incorrect assert
784fc1b vttdemux,CloseFiles: check file pointer before closing
b4522c1 .gitattributes: force mkv/webm to be treated as binary
a118f3d Add test for projection parse failures.
d398479 Add test for primary chromaticity parse failures.
9bbec4c Fix permissions on test file.
2cef4d5 mkvparser:Parse: s/FLT_MIN/-FLT_MAX/
35a3c88 mkvmuxer: Turn off estimate_file_duration_ by default
5a41830 mkvparser: Avoid double free when Chromaticity parse fails.
67e3ffa mkvparser: Avoid casts of values too large for float in
Projection elements.
...

Change-Id: I45acb22902ff0a46a5d339dc51181d5d141a8dcc
parent e3afdd89
URL: https://chromium.googlesource.com/webm/libwebm
Version: 32d5ac49414a8914ec1e1f285f3f927c6e8ec29d
Version: a97c484bfd6b5de4b1b61efe33089b55d810b412
License: BSD
License File: LICENSE.txt
......@@ -7,4 +7,4 @@ Description:
libwebm is used to handle WebM container I/O.
Local Changes:
* <none>
* Add V_AV1 codec id
......@@ -14,6 +14,7 @@
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <ios>
......@@ -21,13 +22,23 @@ namespace libwebm {
std::string GetTempFileName() {
#if !defined _MSC_VER && !defined __MINGW32__
char temp_file_name_template[] = "libwebm_temp.XXXXXX";
std::string temp_file_name_template_str =
std::string(std::getenv("TEST_TMPDIR") ? std::getenv("TEST_TMPDIR") :
".") +
"/libwebm_temp.XXXXXX";
char* temp_file_name_template =
new char[temp_file_name_template_str.length() + 1];
memset(temp_file_name_template, 0, temp_file_name_template_str.length() + 1);
temp_file_name_template_str.copy(temp_file_name_template,
temp_file_name_template_str.length(), 0);
int fd = mkstemp(temp_file_name_template);
std::string temp_file_name =
(fd != -1) ? std::string(temp_file_name_template) : std::string();
delete[] temp_file_name_template;
if (fd != -1) {
close(fd);
return std::string(temp_file_name_template);
}
return std::string();
return temp_file_name;
#else
char tmp_file_name[_MAX_PATH];
errno_t err = tmpnam_s(tmp_file_name);
......
......@@ -7,12 +7,15 @@
// be found in the AUTHORS file in the root of the source tree.
#include "hdr_util.h"
#include <climits>
#include <cstddef>
#include <new>
#include "mkvparser/mkvparser.h"
namespace libwebm {
const int Vp9CodecFeatures::kValueNotPresent = INT_MAX;
bool CopyPrimaryChromaticity(const mkvparser::PrimaryChromaticity& parser_pc,
PrimaryChromaticityPtr* muxer_pc) {
muxer_pc->reset(new (std::nothrow)
......@@ -29,9 +32,9 @@ bool MasteringMetadataValuePresent(double value) {
bool CopyMasteringMetadata(const mkvparser::MasteringMetadata& parser_mm,
mkvmuxer::MasteringMetadata* muxer_mm) {
if (MasteringMetadataValuePresent(parser_mm.luminance_max))
muxer_mm->luminance_max = parser_mm.luminance_max;
muxer_mm->set_luminance_max(parser_mm.luminance_max);
if (MasteringMetadataValuePresent(parser_mm.luminance_min))
muxer_mm->luminance_min = parser_mm.luminance_min;
muxer_mm->set_luminance_min(parser_mm.luminance_min);
PrimaryChromaticityPtr r_ptr(NULL);
PrimaryChromaticityPtr g_ptr(NULL);
......@@ -73,34 +76,37 @@ bool CopyColour(const mkvparser::Colour& parser_colour,
return false;
if (ColourValuePresent(parser_colour.matrix_coefficients))
muxer_colour->matrix_coefficients = parser_colour.matrix_coefficients;
muxer_colour->set_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))
muxer_colour->chroma_subsampling_horz =
parser_colour.chroma_subsampling_horz;
if (ColourValuePresent(parser_colour.chroma_subsampling_vert))
muxer_colour->chroma_subsampling_vert =
parser_colour.chroma_subsampling_vert;
muxer_colour->set_bits_per_channel(parser_colour.bits_per_channel);
if (ColourValuePresent(parser_colour.chroma_subsampling_horz)) {
muxer_colour->set_chroma_subsampling_horz(
parser_colour.chroma_subsampling_horz);
}
if (ColourValuePresent(parser_colour.chroma_subsampling_vert)) {
muxer_colour->set_chroma_subsampling_vert(
parser_colour.chroma_subsampling_vert);
}
if (ColourValuePresent(parser_colour.cb_subsampling_horz))
muxer_colour->cb_subsampling_horz = parser_colour.cb_subsampling_horz;
muxer_colour->set_cb_subsampling_horz(parser_colour.cb_subsampling_horz);
if (ColourValuePresent(parser_colour.cb_subsampling_vert))
muxer_colour->cb_subsampling_vert = parser_colour.cb_subsampling_vert;
muxer_colour->set_cb_subsampling_vert(parser_colour.cb_subsampling_vert);
if (ColourValuePresent(parser_colour.chroma_siting_horz))
muxer_colour->chroma_siting_horz = parser_colour.chroma_siting_horz;
muxer_colour->set_chroma_siting_horz(parser_colour.chroma_siting_horz);
if (ColourValuePresent(parser_colour.chroma_siting_vert))
muxer_colour->chroma_siting_vert = parser_colour.chroma_siting_vert;
muxer_colour->set_chroma_siting_vert(parser_colour.chroma_siting_vert);
if (ColourValuePresent(parser_colour.range))
muxer_colour->range = parser_colour.range;
if (ColourValuePresent(parser_colour.transfer_characteristics))
muxer_colour->transfer_characteristics =
parser_colour.transfer_characteristics;
muxer_colour->set_range(parser_colour.range);
if (ColourValuePresent(parser_colour.transfer_characteristics)) {
muxer_colour->set_transfer_characteristics(
parser_colour.transfer_characteristics);
}
if (ColourValuePresent(parser_colour.primaries))
muxer_colour->primaries = parser_colour.primaries;
muxer_colour->set_primaries(parser_colour.primaries);
if (ColourValuePresent(parser_colour.max_cll))
muxer_colour->max_cll = parser_colour.max_cll;
muxer_colour->set_max_cll(parser_colour.max_cll);
if (ColourValuePresent(parser_colour.max_fall))
muxer_colour->max_fall = parser_colour.max_fall;
muxer_colour->set_max_fall(parser_colour.max_fall);
if (parser_colour.mastering_metadata) {
mkvmuxer::MasteringMetadata muxer_mm;
......@@ -116,8 +122,8 @@ bool CopyColour(const mkvparser::Colour& parser_colour,
//
// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
// | ID Byte | Length | |
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
// | ID Byte | Length | |
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
// | |
// : Bytes 1..Length of Codec Feature :
// | |
......@@ -132,51 +138,83 @@ bool CopyColour(const mkvparser::Colour& parser_colour,
//
// The X bit is reserved.
//
// Currently only profile level is supported. ID byte must be set to 1, and
// length must be 1. Supported values are:
//
// 10: Level 1
// 11: Level 1.1
// 20: Level 2
// 21: Level 2.1
// 30: Level 3
// 31: Level 3.1
// 40: Level 4
// 41: Level 4.1
// 50: Level 5
// 51: Level 5.1
// 52: Level 5.2
// 60: Level 6
// 61: Level 6.1
// 62: Level 6.2
//
// See the following link for more information:
// http://www.webmproject.org/vp9/profiles/
int ParseVpxCodecPrivate(const uint8_t* private_data, int32_t length) {
const int kVpxCodecPrivateLength = 3;
if (!private_data || length != kVpxCodecPrivateLength)
return 0;
const uint8_t id_byte = *private_data;
if (id_byte != 1)
return 0;
const int kVpxProfileLength = 1;
const uint8_t length_byte = private_data[1];
if (length_byte != kVpxProfileLength)
return 0;
const int level = static_cast<int>(private_data[2]);
const int kNumLevels = 14;
const int levels[kNumLevels] = {10, 11, 20, 21, 30, 31, 40,
41, 50, 51, 52, 60, 61, 62};
bool ParseVpxCodecPrivate(const uint8_t* private_data, int32_t length,
Vp9CodecFeatures* features) {
const int kVpxCodecPrivateMinLength = 3;
if (!private_data || !features || length < kVpxCodecPrivateMinLength)
return false;
for (int i = 0; i < kNumLevels; ++i) {
if (level == levels[i])
return level;
}
const uint8_t kVp9ProfileId = 1;
const uint8_t kVp9LevelId = 2;
const uint8_t kVp9BitDepthId = 3;
const uint8_t kVp9ChromaSubsamplingId = 4;
const int kVpxFeatureLength = 1;
int offset = 0;
// Set features to not set.
features->profile = Vp9CodecFeatures::kValueNotPresent;
features->level = Vp9CodecFeatures::kValueNotPresent;
features->bit_depth = Vp9CodecFeatures::kValueNotPresent;
features->chroma_subsampling = Vp9CodecFeatures::kValueNotPresent;
do {
const uint8_t id_byte = private_data[offset++];
const uint8_t length_byte = private_data[offset++];
if (length_byte != kVpxFeatureLength)
return false;
if (id_byte == kVp9ProfileId) {
const int priv_profile = static_cast<int>(private_data[offset++]);
if (priv_profile < 0 || priv_profile > 3)
return false;
if (features->profile != Vp9CodecFeatures::kValueNotPresent &&
features->profile != priv_profile) {
return false;
}
features->profile = priv_profile;
} else if (id_byte == kVp9LevelId) {
const int priv_level = static_cast<int>(private_data[offset++]);
const int kNumLevels = 14;
const int levels[kNumLevels] = {10, 11, 20, 21, 30, 31, 40,
41, 50, 51, 52, 60, 61, 62};
for (int i = 0; i < kNumLevels; ++i) {
if (priv_level == levels[i]) {
if (features->level != Vp9CodecFeatures::kValueNotPresent &&
features->level != priv_level) {
return false;
}
features->level = priv_level;
break;
}
}
if (features->level == Vp9CodecFeatures::kValueNotPresent)
return false;
} else if (id_byte == kVp9BitDepthId) {
const int priv_profile = static_cast<int>(private_data[offset++]);
if (priv_profile != 8 && priv_profile != 10 && priv_profile != 12)
return false;
if (features->bit_depth != Vp9CodecFeatures::kValueNotPresent &&
features->bit_depth != priv_profile) {
return false;
}
features->bit_depth = priv_profile;
} else if (id_byte == kVp9ChromaSubsamplingId) {
const int priv_profile = static_cast<int>(private_data[offset++]);
if (priv_profile != 0 && priv_profile != 2 && priv_profile != 3)
return false;
if (features->chroma_subsampling != Vp9CodecFeatures::kValueNotPresent &&
features->chroma_subsampling != priv_profile) {
return false;
}
features->chroma_subsampling = priv_profile;
} else {
// Invalid ID.
return false;
}
} while (offset + kVpxCodecPrivateMinLength <= length);
return 0;
return true;
}
} // namespace libwebm
......@@ -28,7 +28,34 @@ namespace libwebm {
// TODO(tomfinegan): These should be moved to libwebm_utils once c++11 is
// required by libwebm.
// Features of the VP9 codec that may be set in the CodecPrivate of a VP9 video
// stream. A value of kValueNotPresent represents that the value was not set in
// the CodecPrivate.
struct Vp9CodecFeatures {
static const int kValueNotPresent;
Vp9CodecFeatures()
: profile(kValueNotPresent),
level(kValueNotPresent),
bit_depth(kValueNotPresent),
chroma_subsampling(kValueNotPresent) {}
~Vp9CodecFeatures() {}
int profile;
int level;
int bit_depth;
int chroma_subsampling;
};
// disable deprecation warnings for auto_ptr
#if defined(__GNUC__) && __GNUC__ >= 5
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
typedef std::auto_ptr<mkvmuxer::PrimaryChromaticity> PrimaryChromaticityPtr;
#if defined(__GNUC__) && __GNUC__ >= 5
#pragma GCC diagnostic pop
#endif
bool CopyPrimaryChromaticity(const mkvparser::PrimaryChromaticity& parser_pc,
PrimaryChromaticityPtr* muxer_pc);
......@@ -43,8 +70,9 @@ bool ColourValuePresent(long long value);
bool CopyColour(const mkvparser::Colour& parser_colour,
mkvmuxer::Colour* muxer_colour);
// Returns VP9 profile upon success or 0 upon failure.
int ParseVpxCodecPrivate(const uint8_t* private_data, int32_t length);
// Returns true if |features| is set to one or more valid values.
bool ParseVpxCodecPrivate(const uint8_t* private_data, int32_t length,
Vp9CodecFeatures* features);
} // namespace libwebm
......
......@@ -124,6 +124,14 @@ enum MkvId {
kMkvLuminanceMin = 0x55DA,
// end mastering metadata
// end colour
// projection
kMkvProjection = 0x7670,
kMkvProjectionType = 0x7671,
kMkvProjectionPrivate = 0x7672,
kMkvProjectionPoseYaw = 0x7673,
kMkvProjectionPosePitch = 0x7674,
kMkvProjectionPoseRoll = 0x7675,
// end projection
// audio
kMkvAudio = 0xE1,
kMkvSamplingFrequency = 0xB5,
......
......@@ -16,6 +16,7 @@
#include <ctime>
#include <memory>
#include <new>
#include <string>
#include <vector>
#include "common/webmids.h"
......@@ -23,12 +24,26 @@
#include "mkvmuxer/mkvwriter.h"
#include "mkvparser/mkvparser.h"
// disable deprecation warnings for auto_ptr
#if defined(__GNUC__) && __GNUC__ >= 5
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
namespace mkvmuxer {
const float PrimaryChromaticity::kChromaticityMin = 0.0f;
const float PrimaryChromaticity::kChromaticityMax = 1.0f;
const float MasteringMetadata::kMinLuminance = 0.0f;
const float MasteringMetadata::kMinLuminanceMax = 999.99f;
const float MasteringMetadata::kMaxLuminanceMax = 9999.99f;
const float MasteringMetadata::kValueNotPresent = FLT_MAX;
const uint64_t Colour::kValueNotPresent = UINT64_MAX;
namespace {
const char kDocTypeWebm[] = "webm";
const char kDocTypeMatroska[] = "matroska";
// Deallocate the string designated by |dst|, and then copy the |src|
// string to |dst|. The caller owns both the |src| string and the
// |dst| copy (hence the caller is responsible for eventually
......@@ -63,7 +78,7 @@ bool CopyChromaticity(const PrimaryChromaticity* src,
if (!dst)
return false;
dst->reset(new (std::nothrow) PrimaryChromaticity(src->x, src->y));
dst->reset(new (std::nothrow) PrimaryChromaticity(src->x(), src->y()));
if (!dst->get())
return false;
......@@ -80,36 +95,57 @@ IMkvWriter::IMkvWriter() {}
IMkvWriter::~IMkvWriter() {}
bool WriteEbmlHeader(IMkvWriter* writer, uint64_t doc_type_version) {
bool WriteEbmlHeader(IMkvWriter* writer, uint64_t doc_type_version,
const char* const doc_type) {
// Level 0
uint64_t size = EbmlElementSize(libwebm::kMkvEBMLVersion, UINT64_C(1));
size += EbmlElementSize(libwebm::kMkvEBMLReadVersion, UINT64_C(1));
size += EbmlElementSize(libwebm::kMkvEBMLMaxIDLength, UINT64_C(4));
size += EbmlElementSize(libwebm::kMkvEBMLMaxSizeLength, UINT64_C(8));
size += EbmlElementSize(libwebm::kMkvDocType, "webm");
size += EbmlElementSize(libwebm::kMkvDocTypeVersion, doc_type_version);
size += EbmlElementSize(libwebm::kMkvDocTypeReadVersion, UINT64_C(2));
uint64_t size =
EbmlElementSize(libwebm::kMkvEBMLVersion, static_cast<uint64>(1));
size += EbmlElementSize(libwebm::kMkvEBMLReadVersion, static_cast<uint64>(1));
size += EbmlElementSize(libwebm::kMkvEBMLMaxIDLength, static_cast<uint64>(4));
size +=
EbmlElementSize(libwebm::kMkvEBMLMaxSizeLength, static_cast<uint64>(8));
size += EbmlElementSize(libwebm::kMkvDocType, doc_type);
size += EbmlElementSize(libwebm::kMkvDocTypeVersion,
static_cast<uint64>(doc_type_version));
size +=
EbmlElementSize(libwebm::kMkvDocTypeReadVersion, static_cast<uint64>(2));
if (!WriteEbmlMasterElement(writer, libwebm::kMkvEBML, size))
return false;
if (!WriteEbmlElement(writer, libwebm::kMkvEBMLVersion, UINT64_C(1)))
if (!WriteEbmlElement(writer, libwebm::kMkvEBMLVersion,
static_cast<uint64>(1))) {
return false;
if (!WriteEbmlElement(writer, libwebm::kMkvEBMLReadVersion, UINT64_C(1)))
}
if (!WriteEbmlElement(writer, libwebm::kMkvEBMLReadVersion,
static_cast<uint64>(1))) {
return false;
if (!WriteEbmlElement(writer, libwebm::kMkvEBMLMaxIDLength, UINT64_C(4)))
}
if (!WriteEbmlElement(writer, libwebm::kMkvEBMLMaxIDLength,
static_cast<uint64>(4))) {
return false;
if (!WriteEbmlElement(writer, libwebm::kMkvEBMLMaxSizeLength, UINT64_C(8)))
}
if (!WriteEbmlElement(writer, libwebm::kMkvEBMLMaxSizeLength,
static_cast<uint64>(8))) {
return false;
if (!WriteEbmlElement(writer, libwebm::kMkvDocType, "webm"))
}
if (!WriteEbmlElement(writer, libwebm::kMkvDocType, doc_type))
return false;
if (!WriteEbmlElement(writer, libwebm::kMkvDocTypeVersion, doc_type_version))
if (!WriteEbmlElement(writer, libwebm::kMkvDocTypeVersion,
static_cast<uint64>(doc_type_version))) {
return false;
if (!WriteEbmlElement(writer, libwebm::kMkvDocTypeReadVersion, UINT64_C(2)))
}
if (!WriteEbmlElement(writer, libwebm::kMkvDocTypeReadVersion,
static_cast<uint64>(2))) {
return false;
}
return true;
}
bool WriteEbmlHeader(IMkvWriter* writer, uint64_t doc_type_version) {
return WriteEbmlHeader(writer, doc_type_version, kDocTypeWebm);
}
bool WriteEbmlHeader(IMkvWriter* writer) {
return WriteEbmlHeader(writer, mkvmuxer::Segment::kDefaultDocTypeVersion);
}
......@@ -262,15 +298,17 @@ bool CuePoint::Write(IMkvWriter* writer) const {
if (!writer || track_ < 1 || cluster_pos_ < 1)
return false;
uint64_t size =
EbmlElementSize(libwebm::kMkvCueClusterPosition, cluster_pos_);
size += EbmlElementSize(libwebm::kMkvCueTrack, track_);
uint64_t size = EbmlElementSize(libwebm::kMkvCueClusterPosition,
static_cast<uint64>(cluster_pos_));
size += EbmlElementSize(libwebm::kMkvCueTrack, static_cast<uint64>(track_));
if (output_block_number_ && block_number_ > 1)
size += EbmlElementSize(libwebm::kMkvCueBlockNumber, block_number_);
size += EbmlElementSize(libwebm::kMkvCueBlockNumber,
static_cast<uint64>(block_number_));
const uint64_t track_pos_size =
EbmlMasterElementSize(libwebm::kMkvCueTrackPositions, size) + size;
const uint64_t payload_size =
EbmlElementSize(libwebm::kMkvCueTime, time_) + track_pos_size;
EbmlElementSize(libwebm::kMkvCueTime, static_cast<uint64>(time_)) +
track_pos_size;
if (!WriteEbmlMasterElement(writer, libwebm::kMkvCuePoint, payload_size))
return false;
......@@ -279,18 +317,27 @@ bool CuePoint::Write(IMkvWriter* writer) const {
if (payload_position < 0)
return false;
if (!WriteEbmlElement(writer, libwebm::kMkvCueTime, time_))
if (!WriteEbmlElement(writer, libwebm::kMkvCueTime,
static_cast<uint64>(time_))) {
return false;
}
if (!WriteEbmlMasterElement(writer, libwebm::kMkvCueTrackPositions, size))
return false;
if (!WriteEbmlElement(writer, libwebm::kMkvCueTrack, track_))
if (!WriteEbmlElement(writer, libwebm::kMkvCueTrack,
static_cast<uint64>(track_))) {
return false;
if (!WriteEbmlElement(writer, libwebm::kMkvCueClusterPosition, cluster_pos_))
}
if (!WriteEbmlElement(writer, libwebm::kMkvCueClusterPosition,
static_cast<uint64>(cluster_pos_))) {
return false;
if (output_block_number_ && block_number_ > 1)
if (!WriteEbmlElement(writer, libwebm::kMkvCueBlockNumber, block_number_))
}
if (output_block_number_ && block_number_ > 1) {
if (!WriteEbmlElement(writer, libwebm::kMkvCueBlockNumber,
static_cast<uint64>(block_number_))) {
return false;
}
}
const int64_t stop_position = writer->Position();
if (stop_position < 0)
......@@ -303,15 +350,17 @@ bool CuePoint::Write(IMkvWriter* writer) const {
}
uint64_t CuePoint::PayloadSize() const {
uint64_t size =
EbmlElementSize(libwebm::kMkvCueClusterPosition, cluster_pos_);
size += EbmlElementSize(libwebm::kMkvCueTrack, track_);
uint64_t size = EbmlElementSize(libwebm::kMkvCueClusterPosition,
static_cast<uint64>(cluster_pos_));
size += EbmlElementSize(libwebm::kMkvCueTrack, static_cast<uint64>(track_));
if (output_block_number_ && block_number_ > 1)
size += EbmlElementSize(libwebm::kMkvCueBlockNumber, block_number_);
size += EbmlElementSize(libwebm::kMkvCueBlockNumber,
static_cast<uint64>(block_number_));
const uint64_t track_pos_size =
EbmlMasterElementSize(libwebm::kMkvCueTrackPositions, size) + size;
const uint64_t payload_size =
EbmlElementSize(libwebm::kMkvCueTime, time_) + track_pos_size;
EbmlElementSize(libwebm::kMkvCueTime, static_cast<uint64>(time_)) +
track_pos_size;
return payload_size;
}
......@@ -456,8 +505,9 @@ bool ContentEncAESSettings::Write(IMkvWriter* writer) const {
return false;
if (!WriteEbmlElement(writer, libwebm::kMkvAESSettingsCipherMode,
cipher_mode_))
static_cast<uint64>(cipher_mode_))) {
return false;
}
const int64_t stop_position = writer->Position();
if (stop_position < 0 ||
......@@ -468,8 +518,8 @@ bool ContentEncAESSettings::Write(IMkvWriter* writer) const {
}
uint64_t ContentEncAESSettings::PayloadSize() const {
uint64_t size =
EbmlElementSize(libwebm::kMkvAESSettingsCipherMode, cipher_mode_);
uint64_t size = EbmlElementSize(libwebm::kMkvAESSettingsCipherMode,
static_cast<uint64>(cipher_mode_));
return size;
}
......@@ -529,20 +579,22 @@ bool ContentEncoding::Write(IMkvWriter* writer) const {
encoding_size))
return false;
if (!WriteEbmlElement(writer, libwebm::kMkvContentEncodingOrder,
encoding_order_))
static_cast<uint64>(encoding_order_)))
return false;
if (!WriteEbmlElement(writer, libwebm::kMkvContentEncodingScope,
encoding_scope_))
static_cast<uint64>(encoding_scope_)))
return false;
if (!WriteEbmlElement(writer, libwebm::kMkvContentEncodingType,
encoding_type_))
static_cast<uint64>(encoding_type_)))
return false;
if (!WriteEbmlMasterElement(writer, libwebm::kMkvContentEncryption,
encryption_size))
return false;
if (!WriteEbmlElement(writer, libwebm::kMkvContentEncAlgo, enc_algo_))
if (!WriteEbmlElement(writer, libwebm::kMkvContentEncAlgo,
static_cast<uint64>(enc_algo_))) {
return false;
}
if (!WriteEbmlElement(writer, libwebm::kMkvContentEncKeyID, enc_key_id_,
enc_key_id_length_))
return false;
......@@ -571,12 +623,12 @@ uint64_t ContentEncoding::EncodingSize(uint64_t compresion_size,
EbmlMasterElementSize(libwebm::kMkvContentEncryption, encryption_size) +
encryption_size;
}
encoding_size +=
EbmlElementSize(libwebm::kMkvContentEncodingType, encoding_type_);
encoding_size +=
EbmlElementSize(libwebm::kMkvContentEncodingScope, encoding_scope_);
encoding_size +=
EbmlElementSize(libwebm::kMkvContentEncodingOrder, encoding_order_);
encoding_size += EbmlElementSize(libwebm::kMkvContentEncodingType,
static_cast<uint64>(encoding_type_));
encoding_size += EbmlElementSize(libwebm::kMkvContentEncodingScope,
static_cast<uint64>(encoding_scope_));
encoding_size += EbmlElementSize(libwebm::kMkvContentEncodingOrder,
static_cast<uint64>(encoding_order_));
return encoding_size;
}
......@@ -586,7 +638,8 @@ uint64_t ContentEncoding::EncryptionSize() const {
uint64_t encryption_size = EbmlElementSize(libwebm::kMkvContentEncKeyID,
enc_key_id_, enc_key_id_length_);