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_OBJECT_DESCRIPTOR_H_
00030 #define _AP4_OBJECT_DESCRIPTOR_H_
00031
00032
00033
00034
00035 #include "Ap4List.h"
00036 #include "Ap4String.h"
00037 #include "Ap4Descriptor.h"
00038 #include "Ap4Command.h"
00039
00040
00041
00042
00043 class AP4_ByteStream;
00044
00045
00046
00047
00048 const AP4_UI08 AP4_DESCRIPTOR_TAG_OD = 0x01;
00049 const AP4_UI08 AP4_DESCRIPTOR_TAG_IOD = 0x02;
00050 const AP4_UI08 AP4_DESCRIPTOR_TAG_MP4_OD = 0x11;
00051 const AP4_UI08 AP4_DESCRIPTOR_TAG_MP4_IOD = 0x10;
00052
00053
00054
00055
00056 class AP4_ObjectDescriptor : public AP4_Descriptor
00057 {
00058 public:
00059
00060 AP4_ObjectDescriptor(AP4_ByteStream& stream,
00061 AP4_UI08 tag,
00062 AP4_Size header_size,
00063 AP4_Size payload_size);
00064 virtual ~AP4_ObjectDescriptor();
00065 virtual AP4_Result AddSubDescriptor(AP4_Descriptor* descriptor);
00066 virtual const AP4_Descriptor* FindSubDescriptor(AP4_UI08 tag) const;
00067 virtual AP4_Result WriteFields(AP4_ByteStream& stream);
00068 virtual AP4_Result Inspect(AP4_AtomInspector& inspector);
00069
00070
00071 AP4_UI16 GetObjectDescriptorId() const { return m_ObjectDescriptorId; }
00072 bool GetUrlFlag() const { return m_UrlFlag; }
00073 const AP4_String& GetUrl() const { return m_Url;}
00074
00075 protected:
00076
00077 AP4_ObjectDescriptor(AP4_UI08 tag, AP4_Size header_size, AP4_Size payload_size);
00078
00079
00080 AP4_UI16 m_ObjectDescriptorId;
00081 bool m_UrlFlag;
00082 AP4_String m_Url;
00083 mutable AP4_List<AP4_Descriptor> m_SubDescriptors;
00084 };
00085
00086
00087
00088
00089 class AP4_InitialObjectDescriptor : public AP4_ObjectDescriptor
00090 {
00091 public:
00092
00093 AP4_InitialObjectDescriptor(AP4_ByteStream& stream,
00094 AP4_UI08 tag,
00095 AP4_Size header_size,
00096 AP4_Size payload_size);
00097 virtual AP4_Result WriteFields(AP4_ByteStream& stream);
00098 virtual AP4_Result Inspect(AP4_AtomInspector& inspector);
00099
00100
00101 bool GetIncludeProfileLevelFlag() const { return m_IncludeInlineProfileLevelFlag; }
00102 AP4_UI08 GetOdProfileLevelIndication() const { return m_OdProfileLevelIndication; }
00103 AP4_UI08 GetSceneProfileLevelIndication() const { return m_SceneProfileLevelIndication; }
00104 AP4_UI08 GetAudioProfileLevelIndication() const { return m_AudioProfileLevelIndication; }
00105 AP4_UI08 GetVisualProfileLevelIndication() const { return m_VisualProfileLevelIndication; }
00106 AP4_UI08 GetGraphicsProfileLevelIndication() const { return m_GraphicsProfileLevelIndication; }
00107
00108 private:
00109
00110 bool m_IncludeInlineProfileLevelFlag;
00111 AP4_UI08 m_OdProfileLevelIndication;
00112 AP4_UI08 m_SceneProfileLevelIndication;
00113 AP4_UI08 m_AudioProfileLevelIndication;
00114 AP4_UI08 m_VisualProfileLevelIndication;
00115 AP4_UI08 m_GraphicsProfileLevelIndication;
00116 };
00117
00118
00119
00120
00125 class AP4_DescriptorUpdateCommand : public AP4_Command
00126 {
00127 public:
00128
00129 AP4_DescriptorUpdateCommand(AP4_ByteStream& stream,
00130 AP4_UI08 tag,
00131 AP4_Size header_size,
00132 AP4_Size payload_size);
00133 virtual ~AP4_DescriptorUpdateCommand();
00134 virtual AP4_Result AddDescriptor(AP4_Descriptor* descriptor);
00135 virtual AP4_Result WriteFields(AP4_ByteStream& stream);
00136 virtual AP4_Result Inspect(AP4_AtomInspector& inspector);
00137
00138
00139 const AP4_List<AP4_Descriptor>& GetDescriptors() { return m_Descriptors; }
00140
00141 protected:
00142
00143 mutable AP4_List<AP4_Descriptor> m_Descriptors;
00144 };
00145
00146 #endif // _AP4_OBJECT_DESCRIPTOR_H_