7 #include "packager/media/formats/mp4/box.h"
9 #include "packager/base/logging.h"
10 #include "packager/media/formats/mp4/box_buffer.h"
12 namespace edash_packager {
16 Box::Box() : atom_size(0) {}
20 DCHECK(reader != NULL);
26 DCHECK(writer != NULL);
30 size_t buffer_size_before_write = writer->Size();
33 DCHECK_EQ(this->
atom_size, writer->Size() - buffer_size_before_write);
40 CHECK(buffer->ReadWriteUInt32(&this->atom_size));
41 FourCC fourcc = BoxType();
42 CHECK(buffer->ReadWriteFourCC(&fourcc));
47 FullBox::FullBox() : version(0), flags(0) {}
48 FullBox::~FullBox() {}
55 RCHECK(buffer->ReadWriteUInt32(&vflags));
56 this->version = vflags >> 24;
57 this->flags = vflags & 0x00FFFFFF;
59 vflags = (this->version << 24) | this->flags;
60 RCHECK(buffer->ReadWriteUInt32(&vflags));