1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- #ifndef __MP4_DESCRIPTOR_INCLUDED__
- #define __MP4_DESCRIPTOR_INCLUDED__
- class MP4Descriptor {
- public:
- MP4Descriptor(u_int8_t tag = 0);
- virtual ~MP4Descriptor();
- u_int8_t GetTag() {
- return m_tag;
- }
- void SetTag(u_int8_t tag) {
- m_tag = tag;
- }
- void SetParentAtom(MP4Atom* pParentAtom) {
- m_pParentAtom = pParentAtom;
- for (u_int32_t i = 0; i < m_pProperties.Size(); i++) {
- m_pProperties[i]->SetParentAtom(pParentAtom);
- }
- }
- void AddProperty(MP4Property* pProperty);
- virtual void Generate();
- virtual void Read(MP4File* pFile);
- virtual void Write(MP4File* pFile);
- MP4Property* GetProperty(u_int32_t index) {
- return m_pProperties[index];
- }
-
- void SetProperty(u_int32_t index, MP4Property* pProperty) {
- m_pProperties[index] = pProperty;
- }
- bool FindProperty(const char* name,
- MP4Property** ppProperty, u_int32_t* pIndex = NULL) {
- return FindContainedProperty(name, ppProperty, pIndex);
- }
- void WriteToMemory(MP4File* pFile,
- u_int8_t** ppBytes, u_int64_t* pNumBytes);
- protected:
- void SetReadMutate(u_int32_t propIndex) {
- m_readMutatePoint = propIndex;
- }
- void ReadHeader(MP4File* pFile);
- void ReadProperties(MP4File* pFile,
- u_int32_t startIndex = 0, u_int32_t count = 0xFFFFFFFF);
- virtual void Mutate() {
-
- };
- bool FindContainedProperty(const char* name,
- MP4Property** ppProperty, u_int32_t* pIndex);
- u_int8_t GetDepth();
- protected:
- MP4Atom* m_pParentAtom;
- u_int8_t m_tag;
- u_int64_t m_start;
- u_int32_t m_size;
- MP4PropertyArray m_pProperties;
- u_int32_t m_readMutatePoint;
- };
- #endif
|