Commit ee1bd86d authored by James Zern's avatar James Zern

Revert "third_party: Roll libwebm snapshot."

This reverts commit 80ddeb28.

breaks Android build and causes valgrind failures in the examples

Change-Id: Ie13ceed2f9f8970af87339b807032a52083f27fe
parent aa1132d1
...@@ -36,30 +36,21 @@ LIBYUV_SRCS += third_party/libyuv/include/libyuv/basic_types.h \ ...@@ -36,30 +36,21 @@ LIBYUV_SRCS += third_party/libyuv/include/libyuv/basic_types.h \
third_party/libyuv/source/scale_neon64.cc \ third_party/libyuv/source/scale_neon64.cc \
third_party/libyuv/source/scale_win.cc \ third_party/libyuv/source/scale_win.cc \
LIBWEBM_COMMON_SRCS += third_party/libwebm/common/hdr_util.cc \ LIBWEBM_COMMON_SRCS += third_party/libwebm/webmids.hpp
third_party/libwebm/common/hdr_util.h \
third_party/libwebm/common/webmids.h
LIBWEBM_MUXER_SRCS += third_party/libwebm/mkvmuxer/mkvmuxer.cc \ LIBWEBM_MUXER_SRCS += third_party/libwebm/mkvmuxer.cpp \
third_party/libwebm/mkvmuxer/mkvmuxerutil.cc \ third_party/libwebm/mkvmuxerutil.cpp \
third_party/libwebm/mkvmuxer/mkvwriter.cc \ third_party/libwebm/mkvwriter.cpp \
third_party/libwebm/mkvmuxer/mkvmuxer.h \ third_party/libwebm/mkvmuxer.hpp \
third_party/libwebm/mkvmuxer/mkvmuxertypes.h \ third_party/libwebm/mkvmuxertypes.hpp \
third_party/libwebm/mkvmuxer/mkvmuxerutil.h \ third_party/libwebm/mkvmuxerutil.hpp \
third_party/libwebm/mkvparser/mkvparser.h \ third_party/libwebm/mkvparser.hpp \
third_party/libwebm/mkvmuxer/mkvwriter.h third_party/libwebm/mkvwriter.hpp
LIBWEBM_PARSER_SRCS = third_party/libwebm/mkvparser/mkvparser.cc \
third_party/libwebm/mkvparser/mkvreader.cc \
third_party/libwebm/mkvparser/mkvparser.h \
third_party/libwebm/mkvparser/mkvreader.h
# Add compile flags and include path for libwebm sources.
ifeq ($(CONFIG_WEBM_IO),yes)
CXXFLAGS += -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS
INC_PATH-yes += $(SRC_PATH_BARE)/third_party/libwebm
endif
LIBWEBM_PARSER_SRCS = third_party/libwebm/mkvparser.cpp \
third_party/libwebm/mkvreader.cpp \
third_party/libwebm/mkvparser.hpp \
third_party/libwebm/mkvreader.hpp
# List of examples to build. UTILS are tools meant for distribution # List of examples to build. UTILS are tools meant for distribution
# while EXAMPLES demonstrate specific portions of the API. # while EXAMPLES demonstrate specific portions of the API.
...@@ -79,7 +70,6 @@ ifeq ($(CONFIG_LIBYUV),yes) ...@@ -79,7 +70,6 @@ ifeq ($(CONFIG_LIBYUV),yes)
endif endif
ifeq ($(CONFIG_WEBM_IO),yes) ifeq ($(CONFIG_WEBM_IO),yes)
vpxdec.SRCS += $(LIBWEBM_COMMON_SRCS) vpxdec.SRCS += $(LIBWEBM_COMMON_SRCS)
vpxdec.SRCS += $(LIBWEBM_MUXER_SRCS)
vpxdec.SRCS += $(LIBWEBM_PARSER_SRCS) vpxdec.SRCS += $(LIBWEBM_PARSER_SRCS)
vpxdec.SRCS += webmdec.cc webmdec.h vpxdec.SRCS += webmdec.cc webmdec.h
endif endif
...@@ -103,7 +93,6 @@ endif ...@@ -103,7 +93,6 @@ endif
ifeq ($(CONFIG_WEBM_IO),yes) ifeq ($(CONFIG_WEBM_IO),yes)
vpxenc.SRCS += $(LIBWEBM_COMMON_SRCS) vpxenc.SRCS += $(LIBWEBM_COMMON_SRCS)
vpxenc.SRCS += $(LIBWEBM_MUXER_SRCS) vpxenc.SRCS += $(LIBWEBM_MUXER_SRCS)
vpxenc.SRCS += $(LIBWEBM_PARSER_SRCS)
vpxenc.SRCS += webmenc.cc webmenc.h vpxenc.SRCS += webmenc.cc webmenc.h
endif endif
vpxenc.GUID = 548DEC74-7A15-4B2B-AFC3-AA102E7C25C1 vpxenc.GUID = 548DEC74-7A15-4B2B-AFC3-AA102E7C25C1
......
...@@ -394,12 +394,6 @@ $(filter %$(ASM).o,$(OBJS-yes)): $(BUILD_PFX)vpx_config.asm ...@@ -394,12 +394,6 @@ $(filter %$(ASM).o,$(OBJS-yes)): $(BUILD_PFX)vpx_config.asm
$(shell $(SRC_PATH_BARE)/build/make/version.sh "$(SRC_PATH_BARE)" $(BUILD_PFX)vpx_version.h) $(shell $(SRC_PATH_BARE)/build/make/version.sh "$(SRC_PATH_BARE)" $(BUILD_PFX)vpx_version.h)
CLEAN-OBJS += $(BUILD_PFX)vpx_version.h CLEAN-OBJS += $(BUILD_PFX)vpx_version.h
#
# Add include path for libwebm sources.
#
ifeq ($(CONFIG_WEBM_IO),yes)
CXXFLAGS += -I$(SRC_PATH_BARE)/third_party/libwebm
endif
## ##
## libvpx test directives ## libvpx test directives
...@@ -475,7 +469,6 @@ test_libvpx.$(VCPROJ_SFX): $(LIBVPX_TEST_SRCS) vpx.$(VCPROJ_SFX) gtest.$(VCPROJ_ ...@@ -475,7 +469,6 @@ test_libvpx.$(VCPROJ_SFX): $(LIBVPX_TEST_SRCS) vpx.$(VCPROJ_SFX) gtest.$(VCPROJ_
$(if $(CONFIG_STATIC_MSVCRT),--static-crt) \ $(if $(CONFIG_STATIC_MSVCRT),--static-crt) \
--out=$@ $(INTERNAL_CFLAGS) $(CFLAGS) \ --out=$@ $(INTERNAL_CFLAGS) $(CFLAGS) \
-I. -I"$(SRC_PATH_BARE)/third_party/googletest/src/include" \ -I. -I"$(SRC_PATH_BARE)/third_party/googletest/src/include" \
$(if $(CONFIG_WEBM_IO),-I"$(SRC_PATH_BARE)/third_party/libwebm") \
-L. -l$(CODEC_LIB) -l$(GTEST_LIB) $^ -L. -l$(CODEC_LIB) -l$(GTEST_LIB) $^
PROJECTS-$(CONFIG_MSVS) += test_libvpx.$(VCPROJ_SFX) PROJECTS-$(CONFIG_MSVS) += test_libvpx.$(VCPROJ_SFX)
......
...@@ -59,10 +59,10 @@ LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += y4m_test.cc ../y4menc.c ../y4menc.h ...@@ -59,10 +59,10 @@ LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += y4m_test.cc ../y4menc.c ../y4menc.h
## WebM Parsing ## WebM Parsing
ifeq ($(CONFIG_WEBM_IO), yes) ifeq ($(CONFIG_WEBM_IO), yes)
LIBWEBM_PARSER_SRCS += ../third_party/libwebm/mkvparser/mkvparser.cc LIBWEBM_PARSER_SRCS += ../third_party/libwebm/mkvparser.cpp
LIBWEBM_PARSER_SRCS += ../third_party/libwebm/mkvparser/mkvreader.cc LIBWEBM_PARSER_SRCS += ../third_party/libwebm/mkvreader.cpp
LIBWEBM_PARSER_SRCS += ../third_party/libwebm/mkvparser/mkvparser.h LIBWEBM_PARSER_SRCS += ../third_party/libwebm/mkvparser.hpp
LIBWEBM_PARSER_SRCS += ../third_party/libwebm/mkvparser/mkvreader.h LIBWEBM_PARSER_SRCS += ../third_party/libwebm/mkvreader.hpp
LIBVPX_TEST_SRCS-$(CONFIG_DECODERS) += $(LIBWEBM_PARSER_SRCS) LIBVPX_TEST_SRCS-$(CONFIG_DECODERS) += $(LIBWEBM_PARSER_SRCS)
LIBVPX_TEST_SRCS-$(CONFIG_DECODERS) += ../tools_common.h LIBVPX_TEST_SRCS-$(CONFIG_DECODERS) += ../tools_common.h
LIBVPX_TEST_SRCS-$(CONFIG_DECODERS) += ../webmdec.cc LIBVPX_TEST_SRCS-$(CONFIG_DECODERS) += ../webmdec.cc
......
...@@ -2,10 +2,9 @@ LOCAL_PATH:= $(call my-dir) ...@@ -2,10 +2,9 @@ LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS) include $(CLEAR_VARS)
LOCAL_MODULE:= libwebm LOCAL_MODULE:= libwebm
LOCAL_SRC_FILES:= common/hdr_util.cc \ LOCAL_SRC_FILES:= mkvparser.cpp \
mkvparser/mkvparser.cc \ mkvreader.cpp \
mkvparser/mkvreader.cc \ mkvmuxer.cpp \
mkvmuxer/mkvmuxer.cc \ mkvmuxerutil.cpp \
mkvmuxer/mkvmuxerutil.cc \ mkvwriter.cpp
mkvmuxer/mkvwriter.cc
include $(BUILD_STATIC_LIBRARY) include $(BUILD_STATIC_LIBRARY)
URL: https://chromium.googlesource.com/webm/libwebm URL: https://chromium.googlesource.com/webm/libwebm
Version: 4ff57859383705fa697fb1a15bab8ef728d0fa74 Version: 476366249e1fda7710a389cd41c57db42305e0d4
License: BSD License: BSD
License File: LICENSE.txt License File: LICENSE.txt
......
1.0.0.5
* Handled case when no duration
* Handled empty clusters
* Handled empty clusters when seeking
* Implemented check lacing bits
1.0.0.4
* Made Cues member variables mutables
* Defined against badly-formatted cue points
* Segment::GetCluster returns CuePoint too
* Separated cue-based searches
1.0.0.3
* Added Block::GetOffset() to get a frame's offset in a block
* Changed cluster count type from size_t to long
* Parsed SeekHead to find cues
* Allowed seeking beyond end of cluster cache
* Added not to attempt to reparse cues element
* Restructured Segment::LoadCluster
* Marked position of cues without parsing cues element
* Allowed cue points to be loaded incrementally
* Implemented to load lazily cue points as they're searched
* Merged Cues::LoadCuePoint into Cues::Find
* Lazy init cues
* Loaded cue point during find
1.0.0.2
* added support for Cues element
* seeking was improved
1.0.0.1
* fixed item 141
* added item 142
* added this file, RELEASE.TXT, to repository
// Copyright (c) 2016 The WebM project authors. All Rights Reserved.
//
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file in the root of the source
// tree. An additional intellectual property rights grant can be found
// in the file PATENTS. All contributing project authors may
// be found in the AUTHORS file in the root of the source tree.
#include "common/file_util.h"
#include <sys/stat.h>
#ifndef _MSC_VER
#include <unistd.h> // close()
#endif
#include <cstdio>
#include <cstdlib>
#include <fstream>
#include <ios>
namespace libwebm {
std::string GetTempFileName() {
#ifndef _MSC_VER
char temp_file_name_template[] = "libwebm_temp.XXXXXX";
int fd = mkstemp(temp_file_name_template);
if (fd != -1) {
close(fd);
return std::string(temp_file_name_template);
}
return std::string();
#else
char tmp_file_name[_MAX_PATH];
errno_t err = tmpnam_s(tmp_file_name);
if (err == 0) {
return std::string(tmp_file_name);
}
return std::string();
#endif
}
uint64_t GetFileSize(const std::string& file_name) {
uint64_t file_size = 0;
#ifndef _MSC_VER
struct stat st;
st.st_size = 0;
if (stat(file_name.c_str(), &st) == 0) {
#else
struct _stat st;
st.st_size = 0;
if (_stat(file_name.c_str(), &st) == 0) {
#endif
file_size = st.st_size;
}
return file_size;
}
TempFileDeleter::TempFileDeleter() { file_name_ = GetTempFileName(); }
TempFileDeleter::~TempFileDeleter() {
std::ifstream file(file_name_.c_str());
if (file.good()) {
file.close();
std::remove(file_name_.c_str());
}
}
} // namespace libwebm
// Copyright (c) 2016 The WebM project authors. All Rights Reserved.
//
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file in the root of the source
// tree. An additional intellectual property rights grant can be found
// in the file PATENTS. All contributing project authors may
// be found in the AUTHORS file in the root of the source tree.
#ifndef LIBWEBM_COMMON_FILE_UTIL_H_
#define LIBWEBM_COMMON_FILE_UTIL_H_
#include <stdint.h>
#include <string>
#include "mkvmuxer/mkvmuxertypes.h" // LIBWEBM_DISALLOW_COPY_AND_ASSIGN()
namespace libwebm {
// Returns a temporary file name.
std::string GetTempFileName();
// Returns size of file specified by |file_name|, or 0 upon failure.
uint64_t GetFileSize(const std::string& file_name);
// Manages life of temporary file specified at time of construction. Deletes
// file upon destruction.
class TempFileDeleter {
public:
TempFileDeleter();
explicit TempFileDeleter(std::string file_name) : file_name_(file_name) {}
~TempFileDeleter();
const std::string& name() const { return file_name_; }
private:
std::string file_name_;
LIBWEBM_DISALLOW_COPY_AND_ASSIGN(TempFileDeleter);
};
} // namespace libwebm
#endif // LIBWEBM_COMMON_FILE_UTIL_H_
\ No newline at end of file
// Copyright (c) 2016 The WebM project authors. All Rights Reserved.
//
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file in the root of the source
// tree. An additional intellectual property rights grant can be found
// in the file PATENTS. All contributing project authors may
// be found in the AUTHORS file in the root of the source tree.
#include "hdr_util.h"
#include <cstddef>
#include <new>
#include "mkvparser/mkvparser.h"
namespace libwebm {
bool CopyPrimaryChromaticity(const mkvparser::PrimaryChromaticity& parser_pc,
PrimaryChromaticityPtr* muxer_pc) {
muxer_pc->reset(new (std::nothrow)
mkvmuxer::PrimaryChromaticity(parser_pc.x, parser_pc.y));
if (!muxer_pc->get())
return false;
return true;
}
bool MasteringMetadataValuePresent(double value) {
return value != mkvparser::MasteringMetadata::kValueNotPresent;
}
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;
if (MasteringMetadataValuePresent(parser_mm.luminance_min))
muxer_mm->luminance_min = parser_mm.luminance_min;
PrimaryChromaticityPtr r_ptr(NULL);
PrimaryChromaticityPtr g_ptr(NULL);
PrimaryChromaticityPtr b_ptr(NULL);
PrimaryChromaticityPtr wp_ptr(NULL);
if (parser_mm.r) {
if (!CopyPrimaryChromaticity(*parser_mm.r, &r_ptr))
return false;
}
if (parser_mm.g) {
if (!CopyPrimaryChromaticity(*parser_mm.g, &g_ptr))
return false;
}
if (parser_mm.b) {
if (!CopyPrimaryChromaticity(*parser_mm.b, &b_ptr))
return false;
}
if (parser_mm.white_point) {
if (!CopyPrimaryChromaticity(*parser_mm.white_point, &wp_ptr))
return false;
}
if (!muxer_mm->SetChromaticity(r_ptr.get(), g_ptr.get(), b_ptr.get(),
wp_ptr.get())) {
return false;
}
return true;
}
bool ColourValuePresent(long long value) {
return value != mkvparser::Colour::kValueNotPresent;
}
bool CopyColour(const mkvparser::Colour& parser_colour,
mkvmuxer::Colour* muxer_colour) {
if (!muxer_colour)
return false;
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))
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;
if (ColourValuePresent(parser_colour.cb_subsampling_horz))
muxer_colour->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;
if (ColourValuePresent(parser_colour.chroma_siting_horz))
muxer_colour->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;
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;
if (ColourValuePresent(parser_colour.primaries))
muxer_colour->primaries = parser_colour.primaries;
if (ColourValuePresent(parser_colour.max_cll))
muxer_colour->max_cll = parser_colour.max_cll;
if (ColourValuePresent(parser_colour.max_fall))
muxer_colour->max_fall = parser_colour.max_fall;
if (parser_colour.mastering_metadata) {
mkvmuxer::MasteringMetadata muxer_mm;
if (!CopyMasteringMetadata(*parser_colour.mastering_metadata, &muxer_mm))
return false;
if (!muxer_colour->SetMasteringMetadata(muxer_mm))
return false;
}
return true;
}
} // namespace libwebm
// Copyright (c) 2016 The WebM project authors. All Rights Reserved.
//
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file in the root of the source
// tree. An additional intellectual property rights grant can be found
// in the file PATENTS. All contributing project authors may
// be found in the AUTHORS file in the root of the source tree.
#ifndef LIBWEBM_COMMON_HDR_UTIL_H_
#define LIBWEBM_COMMON_HDR_UTIL_H_
#include <memory>
#include "mkvmuxer/mkvmuxer.h"
namespace mkvparser {
struct Colour;
struct MasteringMetadata;
struct PrimaryChromaticity;
} // namespace mkvparser
namespace libwebm {
// Utility types and functions for working with the Colour element and its
// children. Copiers return true upon success. Presence functions return true
// when the specified element is present.
// TODO(tomfinegan): These should be moved to libwebm_utils once c++11 is
// required by libwebm.
typedef std::auto_ptr<mkvmuxer::PrimaryChromaticity> PrimaryChromaticityPtr;
bool CopyPrimaryChromaticity(const mkvparser::PrimaryChromaticity& parser_pc,
PrimaryChromaticityPtr* muxer_pc);
bool MasteringMetadataValuePresent(double value);
bool CopyMasteringMetadata(const mkvparser::MasteringMetadata& parser_mm,
mkvmuxer::MasteringMetadata* muxer_mm);
bool ColourValuePresent(long long value);
bool CopyColour(const mkvparser::Colour& parser_colour,
mkvmuxer::Colour* muxer_colour);
} // namespace libwebm
#endif // LIBWEBM_COMMON_HDR_UTIL_H_
...@@ -6,21 +6,19 @@ ...@@ -6,21 +6,19 @@
// in the file PATENTS. All contributing project authors may // in the file PATENTS. All contributing project authors may
// be found in the AUTHORS file in the root of the source tree. // be found in the AUTHORS file in the root of the source tree.
#include "mkvmuxer/mkvmuxer.h" #include "mkvmuxer.hpp"
#include <cfloat>
#include <climits> #include <climits>
#include <cstdio> #include <cstdio>
#include <cstdlib>
#include <cstring> #include <cstring>
#include <ctime> #include <ctime>
#include <memory>
#include <new> #include <new>
#include <vector>
#include "common/webmids.h" #include "mkvmuxerutil.hpp"
#include "mkvmuxer/mkvmuxerutil.h" #include "mkvparser.hpp"
#include "mkvmuxer/mkvwriter.h" #include "mkvwriter.hpp"
#include "mkvparser/mkvparser.h" #include "webmids.hpp"
#ifdef _MSC_VER #ifdef _MSC_VER
// Disable MSVC warnings that suggest making code non-portable. // Disable MSVC warnings that suggest making code non-portable.
...@@ -29,9 +27,6 @@ ...@@ -29,9 +27,6 @@
namespace mkvmuxer { namespace mkvmuxer {
const float MasteringMetadata::kValueNotPresent = FLT_MAX;
const uint64_t Colour::kValueNotPresent = UINT64_MAX;
namespace { namespace {
// Deallocate the string designated by |dst|, and then copy the |src| // Deallocate the string designated by |dst|, and then copy the |src|
// string to |dst|. The caller owns both the |src| string and the // string to |dst|. The caller owns both the |src| string and the
...@@ -60,20 +55,6 @@ bool StrCpy(const char* src, char** dst_ptr) { ...@@ -60,20 +55,6 @@ bool StrCpy(const char* src, char** dst_ptr) {
strcpy(dst, src); // NOLINT strcpy(dst, src); // NOLINT
return true; return true;
} }
typedef std::auto_ptr<PrimaryChromaticity> PrimaryChromaticityPtr;
bool CopyChromaticity(const PrimaryChromaticity* src,
PrimaryChromaticityPtr* dst) {
if (!dst)
return false;
dst->reset(new (std::nothrow) PrimaryChromaticity(src->x, src->y));
if (!dst->get())
return false;
return true;
}
} // namespace } // namespace
/////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////
...@@ -84,31 +65,31 @@ IMkvWriter::IMkvWriter() {} ...@@ -84,31 +65,31 @@ IMkvWriter::IMkvWriter() {}
IMkvWriter::~IMkvWriter() {} IMkvWriter::~IMkvWriter() {}
bool WriteEbmlHeader(IMkvWriter* writer, uint64_t doc_type_version) { bool WriteEbmlHeader(IMkvWriter* writer, uint64 doc_type_version) {
// Level 0 // Level 0
uint64_t size = EbmlElementSize(libwebm::kMkvEBMLVersion, UINT64_C(1)); uint64 size = EbmlElementSize(kMkvEBMLVersion, 1ULL);
size += EbmlElementSize(libwebm::kMkvEBMLReadVersion, UINT64_C(1)); size += EbmlElementSize(kMkvEBMLReadVersion, 1ULL);
size += EbmlElementSize(libwebm::kMkvEBMLMaxIDLength, UINT64_C(4)); size += EbmlElementSize(kMkvEBMLMaxIDLength, 4ULL);
size += EbmlElementSize(libwebm::kMkvEBMLMaxSizeLength, UINT64_C(8)); size += EbmlElementSize(kMkvEBMLMaxSizeLength, 8ULL);
size += EbmlElementSize(libwebm::kMkvDocType, "webm"); size += EbmlElementSize(kMkvDocType, "webm");
size += EbmlElementSize(libwebm::kMkvDocTypeVersion, doc_type_version); size += EbmlElementSize(kMkvDocTypeVersion, doc_type_version);
size += EbmlElementSize(libwebm::kMkvDocTypeReadVersion, UINT64_C(2)); size += EbmlElementSize(kMkvDocTypeReadVersion, 2ULL);
if (!WriteEbmlMasterElement(writer, libwebm::kMkvEBML, size)) if (!WriteEbmlMasterElement(writer, kMkvEBML, size))
return false; return false;
if (!WriteEbmlElement(writer, libwebm::kMkvEBMLVersion, UINT64_C(1))) if (!WriteEbmlElement(writer, kMkvEBMLVersion, 1ULL))
return false; return false;
if (!WriteEbmlElement(writer, libwebm::kMkvEBMLReadVersion, UINT64_C(1))) if (!WriteEbmlElement(writer, kMkvEBMLReadVersion, 1ULL))
return false; return false;
if (!WriteEbmlElement(writer, libwebm::kMkvEBMLMaxIDLength, UINT64_C(4))) if (!WriteEbmlElement(writer, kMkvEBMLMaxIDLength, 4ULL))
return false; return false;
if (!WriteEbmlElement(writer, libwebm::kMkvEBMLMaxSizeLength, UINT64_C(8))) if (!WriteEbmlElement(writer, kMkvEBMLMaxSizeLength, 8ULL))
return false; return false;
if (!WriteEbmlElement(writer, libwebm::kMkvDocType, "webm")) if (!WriteEbmlElement(writer, kMkvDocType, "webm"))
return false; return false;
if (!WriteEbmlElement(writer, libwebm::kMkvDocTypeVersion, doc_type_version)) if (!WriteEbmlElement(writer, kMkvDocTypeVersion, doc_type_version))
return false; return false;
if (!WriteEbmlElement(writer, libwebm::kMkvDocTypeReadVersion, UINT64_C(2))) if (!WriteEbmlElement(writer, kMkvDocTypeReadVersion, 2ULL))
return false; return false;
return true; return true;
...@@ -119,16 +100,16 @@ bool WriteEbmlHeader(IMkvWriter* writer) { ...@@ -119,16 +100,16 @@ bool WriteEbmlHeader(IMkvWriter* writer) {
} }
bool ChunkedCopy(mkvparser::IMkvReader* source, mkvmuxer::IMkvWriter* dst, bool ChunkedCopy(mkvparser::IMkvReader* source, mkvmuxer::IMkvWriter* dst,
int64_t start, int64_t size) { mkvmuxer::int64 start, int64 size) {
// TODO(vigneshv): Check if this is a reasonable value. // TODO(vigneshv): Check if this is a reasonable value.
const uint32_t kBufSize = 2048; const uint32 kBufSize = 2048;
uint8_t* buf = new uint8_t[kBufSize]; uint8* buf = new uint8[kBufSize];
int64_t offset = start; int64 offset = start;
while (size > 0) { while (size > 0) {
const int64_t read_len = (size > kBufSize) ? kBufSize : size; const int64 read_len = (size > kBufSize) ? kBufSize : size;
if (source->Read(offset, static_cast<long>(read_len), buf)) if (source->Read(offset, static_cast<long>(read_len), buf))
return false; return false;
dst->Write(buf, static_cast<uint32_t>(read_len)); dst->Write(buf, static_cast<uint32>(read_len));
offset += read_len; offset += read_len;
size -= read_len; size -= read_len;
} }
...@@ -145,7 +126,6 @@ Frame::Frame() ...@@ -145,7 +126,6 @@ Frame::Frame()
additional_(NULL), additional_(NULL),
additional_length_(0), additional_length_(0),
duration_(0), duration_(0),
duration_set_(false),
frame_(NULL), frame_(NULL),
is_key_(false), is_key_(false),
length_(0),