123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- #include "mp4common.h"
- MP4HdlrAtom::MP4HdlrAtom()
- : MP4Atom("hdlr")
- {
- AddVersionAndFlags();
- AddReserved("reserved1", 4);
- MP4StringProperty* pProp = new MP4StringProperty("handlerType");
- pProp->SetFixedLength(4);
- AddProperty(pProp);
- AddReserved("reserved2", 12);
- AddProperty(
- new MP4StringProperty("name"));
- }
- void MP4HdlrAtom::Read()
- {
-
- ReadProperties(0, 5);
- uint64_t pos = m_pFile->GetPosition();
- uint64_t end = GetEnd();
- if (pos == end) return;
-
- u_int8_t strLength;
- m_pFile->PeekBytes(&strLength, 1);
-
- if (pos + strLength + 1 == end) {
-
- MP4StringProperty* pNameProp =
- (MP4StringProperty*)m_pProperties[5];
- pNameProp->SetCountedFormat(true);
- ReadProperties(5);
- pNameProp->SetCountedFormat(false);
- } else {
-
- ReadProperties(5);
- }
- Skip();
- }
|