#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "media/formats/mp4/box_reader.h"
#include <stddef.h>
#include <string.h>
#include <algorithm>
#include <set>
#include "base/numerics/byte_conversions.h"
#include "media/formats/mp4/box_definitions.h"
namespace media {
namespace mp4 {
Box::~Box() = default;
BufferReader::BufferReader(const uint8_t* buf, const size_t buf_size)
: … { … }
BufferReader::~BufferReader() = default;
BufferReader::BufferReader(const BufferReader& other) = default;
bool BufferReader::Read1(uint8_t* v) { … }
bool BufferReader::Read2(uint16_t* v) { … }
bool BufferReader::Read2s(int16_t* v) { … }
bool BufferReader::Read4(uint32_t* v) { … }
bool BufferReader::Read4s(int32_t* v) { … }
bool BufferReader::Read8(uint64_t* v) { … }
bool BufferReader::Read8s(int64_t* v) { … }
bool BufferReader::ReadFourCC(FourCC* v) { … }
bool BufferReader::ReadVec(std::vector<uint8_t>* vec, uint64_t count) { … }
bool BufferReader::SkipBytes(uint64_t bytes) { … }
bool BufferReader::Read4Into8(uint64_t* v) { … }
bool BufferReader::Read4sInto8s(int64_t* v) { … }
BoxReader::BoxReader(const uint8_t* buf,
const size_t buf_size,
MediaLog* media_log,
bool is_EOS)
: … { … }
BoxReader::BoxReader(const BoxReader& other) = default;
BoxReader::~BoxReader() { … }
ParseResult BoxReader::ReadTopLevelBox(const uint8_t* buf,
const size_t buf_size,
MediaLog* media_log,
std::unique_ptr<BoxReader>* out_reader) { … }
ParseResult BoxReader::StartTopLevelBox(const uint8_t* buf,
const size_t buf_size,
MediaLog* media_log,
FourCC* out_type,
size_t* out_box_size) { … }
BoxReader* BoxReader::ReadConcatentatedBoxes(const uint8_t* buf,
const size_t buf_size,
MediaLog* media_log) { … }
bool BoxReader::IsValidTopLevelBox(const FourCC& type, MediaLog* media_log) { … }
bool BoxReader::ScanChildren() { … }
bool BoxReader::ReadDisplayMatrix(DisplayMatrix matrix) { … }
bool BoxReader::HasChild(Box* child) { … }
bool BoxReader::ReadChild(Box* child) { … }
bool BoxReader::MaybeReadChild(Box* child) { … }
bool BoxReader::ReadFullBoxHeader() { … }
ParseResult BoxReader::ReadHeader() { … }
}
}