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

多媒体编程

开发平台:

Visual C++

  1. /*****************************************************************
  2. |
  3. |    AP4 - trak Atoms 
  4. |
  5. |    Copyright 2002 Gilles Boccon-Gibod
  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_TRAK_ATOM_H_
  29. #define _AP4_TRAK_ATOM_H_
  30. /*----------------------------------------------------------------------
  31. |       includes
  32. +---------------------------------------------------------------------*/
  33. #include "Ap4.h"
  34. #include "Ap4ByteStream.h"
  35. #include "Ap4List.h"
  36. #include "Ap4Atom.h"
  37. #include "Ap4HdlrAtom.h"
  38. #include "Ap4TkhdAtom.h"
  39. #include "Ap4ContainerAtom.h"
  40. #include "Ap4SampleTable.h"
  41. /*----------------------------------------------------------------------
  42. |       AP4_TrakAtom
  43. +---------------------------------------------------------------------*/
  44. class AP4_TrakAtom : public AP4_ContainerAtom
  45. {
  46.  public:
  47.     // methods
  48.      AP4_TrakAtom(AP4_SampleTable* sample_table,
  49.                   AP4_Atom::Type   hdlr_type,
  50.                   const char*      hdlr_name,
  51.                   AP4_UI32         track_id, 
  52.                   AP4_UI32         creation_time,
  53.                   AP4_UI32         modification_time,
  54.                   AP4_UI32         track_duration,
  55.                   AP4_UI32         media_time_scale,
  56.                   AP4_UI32         media_duration,
  57.                   AP4_UI16         volume,
  58.                   const char*      language,
  59.                   AP4_UI32         width,
  60.                   AP4_UI32         heigh);
  61.     AP4_TrakAtom(AP4_Size         size,
  62.                  AP4_ByteStream&  stream,
  63.                  AP4_AtomFactory& atom_factory);
  64.     AP4_Result AdjustChunkOffsets(AP4_Offset offset);
  65.     AP4_UI32   GetId() { 
  66.         return m_TkhdAtom->GetTrackId(); 
  67.     }
  68.     AP4_Result SetId(AP4_UI32 track_id) {
  69.         return m_TkhdAtom->SetTrackId(track_id);
  70.     }
  71.     AP4_UI32   GetDuration();
  72.     AP4_Result SetDuration(AP4_UI32 duration);
  73.     AP4_TkhdAtom* GetTkhdAtom() { return m_TkhdAtom; }
  74.     AP4_HdlrAtom* GetHdlrAtom() { return m_HdlrAtom; }
  75.  private:
  76.     // members
  77.     AP4_HdlrAtom* m_HdlrAtom;
  78.     AP4_TkhdAtom* m_TkhdAtom;
  79. };
  80. #endif // _AP4_TRAK_ATOM_H_