Ap4AtomSampleTable.h
上传用户:xjjlds
上传日期:2015-12-05
资源大小:22823k
文件大小:3k
源码类别:

多媒体编程

开发平台:

Visual C++

  1. /*****************************************************************
  2. |
  3. |    AP4 - Atom Based Sample Table
  4. |
  5. |    Copyright 2003 Gilles Boccon-Gibod & Julien Boeuf
  6. |
  7. |
  8. |    This atom is part of AP4 (MP4 Audio Proatom Library).
  9. |
  10. |    Unless you have obtained Bento4 under a difference license,
  11. |    this version of Bento4 is Bento4|GPL.
  12. |    Bento4|GPL is free software; you can redistribute it and/or modify
  13. |    it under the terms of the GNU General Public License as published by
  14. |    the Free Software Foundation; either version 2, or (at your option)
  15. |    any later version.
  16. |
  17. |    Bento4|GPL is distributed in the hope that it will be useful,
  18. |    but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. |    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  20. |    GNU General Public License for more details.
  21. |
  22. |    You should have received a copy of the GNU General Public License
  23. |    along with Bento4|GPL; see the atom COPYING.  If not, write to the
  24. |    Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
  25. |    02111-1307, USA.
  26. |
  27.  ****************************************************************/
  28. #ifndef _AP4_ATOM_SAMPLE_TABLE_H_
  29. #define _AP4_ATOM_SAMPLE_TABLE_H_
  30. /*----------------------------------------------------------------------
  31. |       includes
  32. +---------------------------------------------------------------------*/
  33. #include "Ap4Types.h"
  34. #include "Ap4SampleTable.h"
  35. /*----------------------------------------------------------------------
  36. |       forward declarations
  37. +---------------------------------------------------------------------*/
  38. class AP4_Atom;
  39. class AP4_ByteStream;
  40. class AP4_StscAtom;
  41. class AP4_StcoAtom;
  42. class AP4_Co64Atom;
  43. class AP4_StszAtom;
  44. class AP4_SttsAtom;
  45. class AP4_CttsAtom;
  46. class AP4_StssAtom;
  47. class AP4_StsdAtom;
  48. /*----------------------------------------------------------------------
  49. |       AP4_AtomSampleTable
  50. +---------------------------------------------------------------------*/
  51. class AP4_AtomSampleTable : public AP4_SampleTable
  52. {
  53.  public:
  54.     // methods
  55.              AP4_AtomSampleTable(AP4_ContainerAtom* stbl_atom, 
  56.                                  AP4_ByteStream&    sample_stream);
  57.     virtual ~AP4_AtomSampleTable();
  58.     // AP4_SampleTable methods
  59.     virtual AP4_Result GetSample(AP4_Ordinal index, AP4_Sample& sample);
  60.     virtual AP4_Cardinal GetSampleCount();
  61.     virtual AP4_SampleDescription* GetSampleDescription(AP4_Ordinal index);
  62.     virtual AP4_Cardinal GetSampleDescriptionCount();
  63.     virtual AP4_Result GetChunkForSample(AP4_Ordinal   sample,
  64.                                          AP4_Ordinal&  chunk,
  65.                                          AP4_Ordinal&  skip,
  66.                                          AP4_Ordinal&  sample_description);
  67.     virtual AP4_Result GetChunkOffset(AP4_Ordinal chunk, AP4_Offset& offset);
  68.     virtual AP4_Result SetChunkOffset(AP4_Ordinal chunk, AP4_Offset offset);
  69.     virtual AP4_Result SetSampleSize(AP4_Ordinal sample, AP4_Size size);
  70.     virtual AP4_Result GetSampleIndexForTimeStamp(AP4_TimeStamp ts,
  71.                                                   AP4_Ordinal& index);
  72. private:
  73.     // members
  74.     AP4_ByteStream& m_SampleStream;
  75.     AP4_StscAtom*   m_StscAtom;
  76.     AP4_StcoAtom*   m_StcoAtom;
  77.     AP4_Co64Atom*   m_Co64Atom;
  78.     AP4_StszAtom*   m_StszAtom;
  79.     AP4_SttsAtom*   m_SttsAtom;
  80.     AP4_CttsAtom*   m_CttsAtom;
  81.     AP4_StsdAtom*   m_StsdAtom;
  82.     AP4_StssAtom*   m_StssAtom;
  83. };
  84. #endif // _AP4_ATOM_SAMPLE_TABLE_H_