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

多媒体编程

开发平台:

Visual C++

  1. /*****************************************************************
  2. |
  3. |    AP4 - Synthetic Sample Table
  4. |
  5. |    Copyright 2003-2005 Gilles Boccon-Gibod & Julien Boeuf
  6. |
  7. |
  8. |    This file is part of Bento4/AP4 (MP4 Atom Processing 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 file 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_SYNTHETIC_SAMPLE_TABLE_H_
  29. #define _AP4_SYNTHETIC_SAMPLE_TABLE_H_
  30. /*----------------------------------------------------------------------
  31. |       includes
  32. +---------------------------------------------------------------------*/
  33. #include "Ap4.h"
  34. #include "Ap4Atom.h"
  35. #include "Ap4Array.h"
  36. #include "Ap4SampleTable.h"
  37. /*----------------------------------------------------------------------
  38. |       forward declarations
  39. +---------------------------------------------------------------------*/
  40. class AP4_ByteStream;
  41. /*----------------------------------------------------------------------
  42. |       AP4_SyntheticSampleTable
  43. +---------------------------------------------------------------------*/
  44. class AP4_SyntheticSampleTable : public AP4_SampleTable
  45. {
  46.  public:
  47.     // methods
  48.              AP4_SyntheticSampleTable();
  49.     virtual ~AP4_SyntheticSampleTable();
  50.     // AP4_SampleTable methods
  51.     virtual AP4_Result GetSample(AP4_Ordinal index, AP4_Sample& sample);
  52.     virtual AP4_Cardinal GetSampleCount();
  53.     virtual AP4_Cardinal GetSampleDescriptionCount();
  54.     virtual AP4_SampleDescription* GetSampleDescription(AP4_Ordinal index);
  55.     virtual AP4_Result GetSampleIndexForTimeStamp(AP4_TimeStamp ts,
  56.                                                   AP4_Ordinal& index);
  57.     // methods
  58.     virtual AP4_Result AddSampleDescription(AP4_SampleDescription* description);
  59.     virtual AP4_Result AddSample(AP4_ByteStream& data_stream,
  60.                                  AP4_Offset      offset,
  61.                                  AP4_Size        size,
  62.                                  AP4_Ordinal     description_index,
  63.                                  AP4_TimeStamp   cts = 0,
  64.                                  AP4_TimeStamp   dts = 0,
  65.                                  bool            sync = false);
  66. private:
  67.     // members
  68.     AP4_Array<AP4_Sample>           m_Samples;
  69.     AP4_List<AP4_SampleDescription> m_SampleDescriptions;
  70. };
  71. #endif // _AP4_SYNTHETIC_SAMPLE_TABLE_H_