00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef _AP4_CONTAINER_ATOM_H_
00030 #define _AP4_CONTAINER_ATOM_H_
00031
00032
00033
00034
00035 #include "Ap4Types.h"
00036 #include "Ap4List.h"
00037 #include "Ap4Atom.h"
00038
00039
00040
00041
00042 class AP4_ByteStream;
00043 class AP4_AtomFactory;
00044
00045
00046
00047
00048 class AP4_ContainerAtom : public AP4_Atom, public AP4_AtomParent
00049 {
00050 public:
00051
00052 static AP4_ContainerAtom* Create(Type type,
00053 AP4_UI64 size,
00054 bool is_full,
00055 AP4_ByteStream& stream,
00056 AP4_AtomFactory& atom_factory);
00057
00058
00059 AP4_ContainerAtom(Type type, AP4_UI64 size = AP4_ATOM_HEADER_SIZE);
00060 AP4_ContainerAtom(Type type, AP4_UI64 size, AP4_UI32 version, AP4_UI32 flags);
00061 AP4_List<AP4_Atom>& GetChildren() { return m_Children; }
00062 virtual AP4_Result InspectFields(AP4_AtomInspector& inspector);
00063 virtual AP4_Result InspectChildren(AP4_AtomInspector& inspector);
00064 virtual AP4_Result WriteFields(AP4_ByteStream& stream);
00065 virtual AP4_Atom* Clone();
00066
00067
00068 void OnChildChanged(AP4_Atom* child);
00069 void OnChildAdded(AP4_Atom* child);
00070 void OnChildRemoved(AP4_Atom* child);
00071
00072 protected:
00073
00074 AP4_ContainerAtom(Type type,
00075 AP4_UI64 size,
00076 AP4_UI32 version,
00077 AP4_UI32 flags,
00078 AP4_ByteStream& stream,
00079 AP4_AtomFactory& atom_factory);
00080 AP4_ContainerAtom(Type type,
00081 AP4_UI64 size,
00082 AP4_ByteStream& stream,
00083 AP4_AtomFactory& atom_factory);
00084
00085
00086 void ReadChildren(AP4_AtomFactory& atom_factory,
00087 AP4_ByteStream& stream,
00088 AP4_UI64 size);
00089 };
00090
00091 #endif // _AP4_CONTAINER_ATOM_H_