00001 /***************************************************************** 00002 | 00003 | AP4 - IPMP 00004 | 00005 | Copyright 2002-2008 Gilles Boccon-Gibod & Julien Boeuf 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_IPMP_H_ 00030 #define _AP4_IPMP_H_ 00031 00032 /*---------------------------------------------------------------------- 00033 | includes 00034 +---------------------------------------------------------------------*/ 00035 #include "Ap4Types.h" 00036 #include "Ap4String.h" 00037 #include "Ap4Descriptor.h" 00038 00039 /*---------------------------------------------------------------------- 00040 | constants 00041 +---------------------------------------------------------------------*/ 00042 const AP4_UI08 AP4_DESCRIPTOR_TAG_IPMP_DESCRIPTOR_POINTER = 0x0A; 00043 const AP4_UI08 AP4_DESCRIPTOR_TAG_IPMP_DESCRIPTOR = 0x0B; 00044 00045 /*---------------------------------------------------------------------- 00046 | AP4_IpmpDescriptorPointer 00047 +---------------------------------------------------------------------*/ 00048 class AP4_IpmpDescriptorPointer : public AP4_Descriptor 00049 { 00050 public: 00051 // methods 00052 AP4_IpmpDescriptorPointer(AP4_ByteStream& stream, 00053 AP4_Size header_size, 00054 AP4_Size payload_size); 00055 virtual AP4_Result WriteFields(AP4_ByteStream& stream); 00056 virtual AP4_Result Inspect(AP4_AtomInspector& inspector); 00057 00058 // accessors 00059 AP4_UI08 GetDescriptorId() const { return m_DescriptorId; } 00060 AP4_UI16 GetDescriptorIdEx() const { return m_DescriptorIdEx; } 00061 AP4_UI16 GetEsId() const { return m_EsId; } 00062 00063 private: 00064 // members 00065 AP4_UI08 m_DescriptorId; 00066 AP4_UI16 m_DescriptorIdEx; 00067 AP4_UI16 m_EsId; 00068 }; 00069 00070 /*---------------------------------------------------------------------- 00071 | AP4_IpmpDescriptor 00072 +---------------------------------------------------------------------*/ 00073 class AP4_IpmpDescriptor : public AP4_Descriptor 00074 { 00075 public: 00076 // methods 00077 AP4_IpmpDescriptor(AP4_ByteStream& stream, 00078 AP4_Size header_size, 00079 AP4_Size payload_size); 00080 virtual AP4_Result WriteFields(AP4_ByteStream& stream); 00081 virtual AP4_Result Inspect(AP4_AtomInspector& inspector); 00082 00083 // accessors 00084 AP4_UI08 GetDescriptorId() const { return m_DescriptorId; } 00085 AP4_UI16 GetIpmpsType() const { return m_IpmpsType; } 00086 AP4_UI16 GetDescriptorIdEx() const { return m_DescriptorIdEx; } 00087 const AP4_UI08* GetToolId() const { return m_ToolId; } 00088 AP4_UI08 GetControlPointCode() const { return m_ControlPointCode; } 00089 AP4_UI08 GetSequenceCode() const { return m_SequenceCode; } 00090 const AP4_String& GetUrl() const { return m_Url; } 00091 const AP4_DataBuffer& GetData() const { return m_Data; } 00092 00093 private: 00094 // members 00095 AP4_UI08 m_DescriptorId; 00096 AP4_UI16 m_IpmpsType; 00097 AP4_UI16 m_DescriptorIdEx; 00098 AP4_UI08 m_ToolId[16]; 00099 AP4_UI08 m_ControlPointCode; 00100 AP4_UI08 m_SequenceCode; 00101 AP4_String m_Url; 00102 AP4_DataBuffer m_Data; 00103 }; 00104 00105 #endif // _AP4_IPMP_H_