Ap4FragmentSampleTable.h
Go to the documentation of this file.00001 /***************************************************************** 00002 | 00003 | AP4 - Fragment Based Sample Table 00004 | 00005 | Copyright 2002-2009 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_FRAGMENT_SAMPLE_TABLE_H_ 00030 #define _AP4_FRAGMENT_SAMPLE_TABLE_H_ 00031 00032 /*---------------------------------------------------------------------- 00033 | includes 00034 +---------------------------------------------------------------------*/ 00035 #include "Ap4Types.h" 00036 #include "Ap4SampleTable.h" 00037 #include "Ap4Array.h" 00038 00039 /*---------------------------------------------------------------------- 00040 | forward declarations 00041 +---------------------------------------------------------------------*/ 00042 class AP4_Atom; 00043 class AP4_ByteStream; 00044 class AP4_TrunAtom; 00045 class AP4_TrexAtom; 00046 class AP4_TfhdAtom; 00047 00048 /*---------------------------------------------------------------------- 00049 | AP4_FragmentSampleTable 00050 +---------------------------------------------------------------------*/ 00051 class AP4_FragmentSampleTable : public AP4_SampleTable 00052 { 00053 public: 00054 // methods 00055 AP4_FragmentSampleTable(AP4_ContainerAtom* traf, 00056 AP4_TrexAtom* trex, 00057 AP4_ByteStream* sample_stream, 00058 AP4_Position moof_offset, 00059 AP4_Position mdat_payload_offset, // hack because MS doesn't implement the spec correctly 00060 AP4_UI64 dts_origin=0); 00061 virtual ~AP4_FragmentSampleTable(); 00062 00063 // AP4_SampleTable methods 00064 virtual AP4_Result GetSample(AP4_Ordinal sample_index, AP4_Sample& sample); 00065 virtual AP4_Cardinal GetSampleCount(); 00066 virtual AP4_SampleDescription* GetSampleDescription(AP4_Ordinal sd_index); 00067 virtual AP4_Cardinal GetSampleDescriptionCount(); 00068 virtual AP4_Result GetSampleChunkPosition(AP4_Ordinal sample_index, 00069 AP4_Ordinal& chunk_index, 00070 AP4_Ordinal& position_in_chunk); 00071 virtual AP4_Result GetSampleIndexForTimeStamp(AP4_UI64 ts, AP4_Ordinal& sample_index); 00072 virtual AP4_Ordinal GetNearestSyncSampleIndex(AP4_Ordinal index, bool before=true); 00073 00074 // methods 00075 AP4_UI64 GetDuration() { return m_Duration; } 00076 00077 private: 00078 // members 00079 AP4_TrunAtom* m_TrunAtom; 00080 AP4_Array<AP4_Sample> m_Samples; 00081 AP4_UI64 m_Duration; 00082 00083 // methods 00084 AP4_Result AddTrun(AP4_TrunAtom* trun, 00085 AP4_TfhdAtom* tfhd, 00086 AP4_TrexAtom* trex, 00087 AP4_ByteStream* sample_stream, 00088 AP4_Position moof_offset, 00089 AP4_Position& payload_offset, 00090 AP4_UI64& dts_origin); 00091 00092 }; 00093 00094 #endif // _AP4_FRAGMENT_SAMPLE_TABLE_H_
Generated on Thu May 13 16:36:32 2010 for Bento4 MP4 SDK by
