- Main Page
- Classes
- Files

# Ap4AtomSampleTable.h

Go to the documentation of this file.

    00001 /*****************************************************************
    00002 |
    00003 |    AP4 - Atom Based Sample Table
    00004 |
    00005 |    Copyright 2003 Gilles Boccon-Gibod & Julien Boeuf
    00006 |
    00007 |
    00008 |    This atom is part of AP4 (MP4 Audio Proatom 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     // methods
    00059              AP4_AtomSampleTable(AP4_ContainerAtom* stbl_atom,
    00060                                  AP4_ByteStream&    sample_stream);
    00061     virtual ~AP4_AtomSampleTable();
    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_TimeStamp ts,
    00072                                                     AP4_Ordinal&  sample_index);
    00073
    00074     // local methods
    00075     virtual AP4_Result GetChunkForSample(AP4_Ordinal   sample_index,
    00076                                          AP4_Ordinal&  chunk_index,
    00077                                          AP4_Ordinal&  position_in_chunk,
    00078                                          AP4_Ordinal&  sample_description_index);
    00079     virtual AP4_Result GetChunkOffset(AP4_Ordinal chunk_index, AP4_Position& offset);
    00080     virtual AP4_Result SetChunkOffset(AP4_Ordinal chunk_index, AP4_Position offset);
    00081     virtual AP4_Result SetSampleSize(AP4_Ordinal sample_index, AP4_Size size);
    00082
    00083 private:
    00084     // members
    00085     AP4_ByteStream& m_SampleStream;
    00086     AP4_StscAtom*   m_StscAtom;
    00087     AP4_StcoAtom*   m_StcoAtom;
    00088     AP4_StszAtom*   m_StszAtom;
    00089     AP4_SttsAtom*   m_SttsAtom;
    00090     AP4_CttsAtom*   m_CttsAtom;
    00091     AP4_StsdAtom*   m_StsdAtom;
    00092     AP4_StssAtom*   m_StssAtom;
    00093     AP4_Co64Atom*   m_Co64Atom;
    00094 };
    00095
    00096 #endif // _AP4_ATOM_SAMPLE_TABLE_H_