Ap4AtomSampleTable.h
Go to the documentation of this file.00001 /***************************************************************** 00002 | 00003 | AP4 - Atom Based Sample Table 00004 | 00005 | Copyright 2002-2008 Axiomatic Systems, LLC 00006 | 00007 | 00008 | This atom is part of AP4 (MP4 Audio 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 atom 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_ATOM_SAMPLE_TABLE_H_ 00030 #define _AP4_ATOM_SAMPLE_TABLE_H_ 00031 00032 /*---------------------------------------------------------------------- 00033 | includes 00034 +---------------------------------------------------------------------*/ 00035 #include "Ap4Types.h" 00036 #include "Ap4SampleTable.h" 00037 00038 /*---------------------------------------------------------------------- 00039 | forward declarations 00040 +---------------------------------------------------------------------*/ 00041 class AP4_Atom; 00042 class AP4_ByteStream; 00043 class AP4_StscAtom; 00044 class AP4_StcoAtom; 00045 class AP4_StszAtom; 00046 class AP4_SttsAtom; 00047 class AP4_CttsAtom; 00048 class AP4_StssAtom; 00049 class AP4_StsdAtom; 00050 class AP4_Co64Atom; 00051 00052 /*---------------------------------------------------------------------- 00053 | AP4_AtomSampleTable 00054 +---------------------------------------------------------------------*/ 00055 class AP4_AtomSampleTable : public AP4_SampleTable 00056 { 00057 public: 00058 AP4_IMPLEMENT_DYNAMIC_CAST_D(AP4_AtomSampleTable, AP4_SampleTable) 00059 00060 // methods 00061 AP4_AtomSampleTable(AP4_ContainerAtom* stbl_atom, 00062 AP4_ByteStream& sample_stream); 00063 virtual ~AP4_AtomSampleTable(); 00064 00065 // AP4_SampleTable methods 00066 virtual AP4_Result GetSample(AP4_Ordinal sample_index, AP4_Sample& sample); 00067 virtual AP4_Cardinal GetSampleCount(); 00068 virtual AP4_SampleDescription* GetSampleDescription(AP4_Ordinal sd_index); 00069 virtual AP4_Cardinal GetSampleDescriptionCount(); 00070 virtual AP4_Result GetSampleChunkPosition(AP4_Ordinal sample_index, 00071 AP4_Ordinal& chunk_index, 00072 AP4_Ordinal& position_in_chunk); 00073 virtual AP4_Result GetSampleIndexForTimeStamp(AP4_UI64 ts, AP4_Ordinal& sample_index); 00074 virtual AP4_Ordinal GetNearestSyncSampleIndex(AP4_Ordinal index, bool before=true); 00075 00076 // local methods 00077 virtual AP4_Result GetChunkForSample(AP4_Ordinal sample_index, 00078 AP4_Ordinal& chunk_index, 00079 AP4_Ordinal& position_in_chunk, 00080 AP4_Ordinal& sample_description_index); 00081 virtual AP4_Result GetChunkOffset(AP4_Ordinal chunk_index, AP4_Position& offset); 00082 virtual AP4_Result SetChunkOffset(AP4_Ordinal chunk_index, AP4_Position offset); 00083 virtual AP4_Result SetSampleSize(AP4_Ordinal sample_index, AP4_Size size); 00084 00085 private: 00086 // members 00087 AP4_ByteStream& m_SampleStream; 00088 AP4_StscAtom* m_StscAtom; 00089 AP4_StcoAtom* m_StcoAtom; 00090 AP4_StszAtom* m_StszAtom; 00091 AP4_SttsAtom* m_SttsAtom; 00092 AP4_CttsAtom* m_CttsAtom; 00093 AP4_StsdAtom* m_StsdAtom; 00094 AP4_StssAtom* m_StssAtom; 00095 AP4_Co64Atom* m_Co64Atom; 00096 }; 00097 00098 #endif // _AP4_ATOM_SAMPLE_TABLE_H_
Generated on Thu May 13 16:36:31 2010 for Bento4 MP4 SDK by
