Ap4ObjectDescriptor.h
Go to the documentation of this file.00001 /***************************************************************** 00002 | 00003 | AP4 - Object Descriptor 00004 | 00005 | Copyright 2002-2008 Axiomatic Systems, LLC 00006 | 00007 | 00008 | This file is part of Bento4/AP4 (MP4 Atom Processing Library). 00009 | 00010 | Unless you have obtained Bento4 under a difference license, 00011 | this version of Bento4 is Bento4|GPL. 00012 | Bento4|GPL is free software; you can redistribute it and/or modify 00013 | it under the terms of the GNU General Public License as published by 00014 | the Free Software Foundation; either version 2, or (at your option) 00015 | any later version. 00016 | 00017 | Bento4|GPL is distributed in the hope that it will be useful, 00018 | but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00020 | GNU General Public License for more details. 00021 | 00022 | You should have received a copy of the GNU General Public License 00023 | along with Bento4|GPL; see the file COPYING. If not, write to the 00024 | Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 00025 | 02111-1307, USA. 00026 | 00027 ****************************************************************/ 00028 00029 #ifndef _AP4_OBJECT_DESCRIPTOR_H_ 00030 #define _AP4_OBJECT_DESCRIPTOR_H_ 00031 00032 /*---------------------------------------------------------------------- 00033 | includes 00034 +---------------------------------------------------------------------*/ 00035 #include "Ap4List.h" 00036 #include "Ap4String.h" 00037 #include "Ap4Descriptor.h" 00038 #include "Ap4Command.h" 00039 00040 /*---------------------------------------------------------------------- 00041 | class references 00042 +---------------------------------------------------------------------*/ 00043 class AP4_ByteStream; 00044 00045 /*---------------------------------------------------------------------- 00046 | constants 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 | AP4_ObjectDescriptor 00055 +---------------------------------------------------------------------*/ 00056 class AP4_ObjectDescriptor : public AP4_Descriptor 00057 { 00058 public: 00059 AP4_IMPLEMENT_DYNAMIC_CAST_D(AP4_ObjectDescriptor, AP4_Descriptor) 00060 00061 // methods 00062 AP4_ObjectDescriptor(AP4_ByteStream& stream, 00063 AP4_UI08 tag, 00064 AP4_Size header_size, 00065 AP4_Size payload_size); 00066 AP4_ObjectDescriptor(AP4_UI08 tag, AP4_UI16 id); 00067 virtual ~AP4_ObjectDescriptor(); 00068 00073 virtual AP4_Result AddSubDescriptor(AP4_Descriptor* descriptor); 00074 00075 virtual AP4_Descriptor* FindSubDescriptor(AP4_UI08 tag) const; 00076 virtual AP4_Result WriteFields(AP4_ByteStream& stream); 00077 virtual AP4_Result Inspect(AP4_AtomInspector& inspector); 00078 00079 // accessors 00080 AP4_UI16 GetObjectDescriptorId() const { return m_ObjectDescriptorId; } 00081 bool GetUrlFlag() const { return m_UrlFlag; } 00082 const AP4_String& GetUrl() const { return m_Url;} 00083 00084 protected: 00085 // constructor 00086 AP4_ObjectDescriptor(AP4_UI08 tag, AP4_Size header_size, AP4_Size payload_size); 00087 00088 // members 00089 AP4_UI16 m_ObjectDescriptorId; 00090 bool m_UrlFlag; 00091 AP4_String m_Url; 00092 mutable AP4_List<AP4_Descriptor> m_SubDescriptors; 00093 }; 00094 00095 /*---------------------------------------------------------------------- 00096 | AP4_InitialObjectDescriptor 00097 +---------------------------------------------------------------------*/ 00098 class AP4_InitialObjectDescriptor : public AP4_ObjectDescriptor 00099 { 00100 public: 00101 // methods 00102 AP4_InitialObjectDescriptor(AP4_ByteStream& stream, 00103 AP4_UI08 tag, 00104 AP4_Size header_size, 00105 AP4_Size payload_size); 00106 AP4_InitialObjectDescriptor(AP4_UI08 tag, // should be AP4_DESCRIPTOR_TAG_IOD or AP4_DESCRIPTOR_TAG_MP4_IOD 00107 AP4_UI16 object_descriptor_id, 00108 bool include_inline_profile_level, 00109 AP4_UI08 od_profile_level_indication, 00110 AP4_UI08 scene_profile_level_indication, 00111 AP4_UI08 audio_profile_level_indication, 00112 AP4_UI08 visual_profile_level_indication, 00113 AP4_UI08 graphics_profile_level_indication); 00114 00115 virtual AP4_Result WriteFields(AP4_ByteStream& stream); 00116 virtual AP4_Result Inspect(AP4_AtomInspector& inspector); 00117 00118 // accessors 00119 bool GetIncludeProfileLevelFlag() const { return m_IncludeInlineProfileLevelFlag; } 00120 AP4_UI08 GetOdProfileLevelIndication() const { return m_OdProfileLevelIndication; } 00121 AP4_UI08 GetSceneProfileLevelIndication() const { return m_SceneProfileLevelIndication; } 00122 AP4_UI08 GetAudioProfileLevelIndication() const { return m_AudioProfileLevelIndication; } 00123 AP4_UI08 GetVisualProfileLevelIndication() const { return m_VisualProfileLevelIndication; } 00124 AP4_UI08 GetGraphicsProfileLevelIndication() const { return m_GraphicsProfileLevelIndication; } 00125 00126 private: 00127 // members 00128 bool m_IncludeInlineProfileLevelFlag; 00129 AP4_UI08 m_OdProfileLevelIndication; 00130 AP4_UI08 m_SceneProfileLevelIndication; 00131 AP4_UI08 m_AudioProfileLevelIndication; 00132 AP4_UI08 m_VisualProfileLevelIndication; 00133 AP4_UI08 m_GraphicsProfileLevelIndication; 00134 }; 00135 00136 /*---------------------------------------------------------------------- 00137 | AP4_DescriptorUpdateCommand 00138 +---------------------------------------------------------------------*/ 00143 class AP4_DescriptorUpdateCommand : public AP4_Command 00144 { 00145 public: 00146 AP4_IMPLEMENT_DYNAMIC_CAST_D(AP4_DescriptorUpdateCommand, AP4_Command) 00147 00148 // methods 00149 AP4_DescriptorUpdateCommand(AP4_UI08 tag); 00150 AP4_DescriptorUpdateCommand(AP4_ByteStream& stream, 00151 AP4_UI08 tag, 00152 AP4_Size header_size, 00153 AP4_Size payload_size); 00154 virtual ~AP4_DescriptorUpdateCommand(); 00155 virtual AP4_Result AddDescriptor(AP4_Descriptor* descriptor); 00156 virtual AP4_Result WriteFields(AP4_ByteStream& stream); 00157 virtual AP4_Result Inspect(AP4_AtomInspector& inspector); 00158 00159 // accessors 00160 const AP4_List<AP4_Descriptor>& GetDescriptors() { return m_Descriptors; } 00161 00162 protected: 00163 // members 00164 mutable AP4_List<AP4_Descriptor> m_Descriptors; 00165 }; 00166 00167 #endif // _AP4_OBJECT_DESCRIPTOR_H_
Generated on Thu May 13 16:36:33 2010 for Bento4 MP4 SDK by
