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

多媒体编程

开发平台:

Visual C++

  1. /*****************************************************************
  2. |
  3. |    AP4 - DecoderConfig Descriptor 
  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_DECODER_CONFIG_DESCRIPTOR_H_
  29. #define _AP4_DECODER_CONFIG_DESCRIPTOR_H_
  30. /*----------------------------------------------------------------------
  31. |       includes
  32. +---------------------------------------------------------------------*/
  33. #include "Ap4.h"
  34. #include "Ap4ByteStream.h"
  35. #include "Ap4List.h"
  36. #include "Ap4Descriptor.h"
  37. #include "Ap4DecoderSpecificInfoDescriptor.h"
  38. /*----------------------------------------------------------------------
  39. |       constants
  40. +---------------------------------------------------------------------*/
  41. const AP4_Descriptor::Tag AP4_DESCRIPTOR_TAG_DECODER_CONFIG = 0x04;
  42. /*----------------------------------------------------------------------
  43. |       AP4_DecoderConfigDescriptor
  44. +---------------------------------------------------------------------*/
  45. class AP4_DecoderConfigDescriptor : public AP4_Descriptor
  46. {
  47.  public:
  48.     // methods
  49.     AP4_DecoderConfigDescriptor(AP4_UI08 stream_type,
  50.                                 AP4_UI08 oti,
  51.                                 AP4_UI32 buffer_size,
  52.                                 AP4_UI32 max_bitrate,
  53.                                 AP4_UI32 avg_bitrate,
  54.                                 AP4_DecoderSpecificInfoDescriptor* dsi);
  55.     AP4_DecoderConfigDescriptor(AP4_ByteStream& stream, 
  56.                                 AP4_Size        header_size,
  57.                                 AP4_Size        payload_size);
  58.     virtual ~AP4_DecoderConfigDescriptor();
  59.     virtual AP4_Result WriteFields(AP4_ByteStream& stream);
  60.     virtual AP4_Result Inspect(AP4_AtomInspector& inspector);
  61.  
  62.     // accessors
  63.     virtual const AP4_DecoderSpecificInfoDescriptor*
  64.         GetDecoderSpecificInfoDescriptor() const;
  65.     virtual AP4_UI08 GetObjectTypeIndication() const { 
  66.         return m_ObjectTypeIndication; 
  67.     }
  68.     virtual AP4_UI08 GetStreamType() const { return m_StreamType; } 
  69.     virtual AP4_UI32 GetBufferSize() const { return m_BufferSize; }
  70.     virtual AP4_UI32 GetMaxBitrate() const { return m_MaxBitrate; }
  71.     virtual AP4_UI32 GetAvgBitrate() const { return m_AverageBitrate; }
  72.     
  73.  private:
  74.     // members
  75.     AP4_UI08                         m_StreamType;
  76.     AP4_UI08                         m_ObjectTypeIndication;
  77.     bool                             m_UpStream;
  78.     AP4_UI32                         m_BufferSize;
  79.     AP4_UI32                         m_MaxBitrate;
  80.     AP4_UI32                         m_AverageBitrate;
  81.     mutable AP4_List<AP4_Descriptor> m_SubDescriptors;
  82. };
  83. #endif // _AP4_DECODER_CONFIG_DESCRIPTOR_H_