12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- #include "mp4common.h"
- MP4TrunAtom::MP4TrunAtom()
- : MP4Atom("trun")
- {
- AddVersionAndFlags();
- AddProperty(
- new MP4Integer32Property("sampleCount"));
- }
- void MP4TrunAtom::AddProperties(u_int32_t flags)
- {
- if (flags & 0x01) {
-
- AddProperty(
- new MP4Integer32Property("dataOffset"));
- }
- if (flags & 0x04) {
- AddProperty(
- new MP4Integer32Property("firstSampleFlags"));
- }
- MP4TableProperty* pTable =
- new MP4TableProperty("samples",
- (MP4Integer32Property *)m_pProperties[2]);
- AddProperty(pTable);
- if (flags & 0x100) {
- pTable->AddProperty(
- new MP4Integer32Property("sampleDuration"));
- }
- if (flags & 0x200) {
- pTable->AddProperty(
- new MP4Integer32Property("sampleSize"));
- }
- if (flags & 0x400) {
- pTable->AddProperty(
- new MP4Integer32Property("sampleFlags"));
- }
- if (flags & 0x800) {
- pTable->AddProperty(
- new MP4Integer32Property("sampleCompositionTimeOffset"));
- }
- }
- void MP4TrunAtom::Read()
- {
-
- ReadProperties(0, 3);
-
- AddProperties(GetFlags());
-
- ReadProperties(3);
- Skip();
- }
|