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

多媒体编程

开发平台:

Visual C++

  1. /*****************************************************************
  2. |
  3. |    AP4 - File Processor
  4. |
  5. |    Copyright 2003 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. /*----------------------------------------------------------------------
  29. |       includes
  30. +---------------------------------------------------------------------*/
  31. #include "Ap4.h"
  32. #include "Ap4AtomFactory.h"
  33. /*----------------------------------------------------------------------
  34. |       class references
  35. +---------------------------------------------------------------------*/
  36. class AP4_ContainerAtom;
  37. class AP4_Sample;
  38. class AP4_ByteStream;
  39. class AP4_DataBuffer;
  40. class AP4_TrakAtom;
  41. /*----------------------------------------------------------------------
  42. |       AP4_Processor
  43. +---------------------------------------------------------------------*/
  44. class AP4_Processor {
  45. public:
  46.     // types
  47.     class TrackHandler {
  48.     public:
  49.         virtual ~TrackHandler() {}
  50.         virtual AP4_Size   GetProcessedSampleSize(AP4_Sample& sample);
  51.         virtual AP4_Result ProcessTrack() { return AP4_SUCCESS; }
  52.         virtual AP4_Result ProcessSample(AP4_DataBuffer& data_in,
  53.                                          AP4_DataBuffer& data_out) = 0;
  54.     };
  55.     // constructor and destructor
  56.     virtual ~AP4_Processor() {}
  57.     // abstract base class methods
  58.     AP4_Result Process(AP4_ByteStream&  input, 
  59.                        AP4_ByteStream&  output,
  60.                        AP4_AtomFactory& atom_factory = 
  61.                        AP4_AtomFactory::DefaultFactory);
  62.     // overridable methods
  63.     virtual AP4_Result Initialize(AP4_AtomParent& top_level);
  64.     virtual AP4_Result Finalize(AP4_AtomParent& top_level);
  65.     virtual TrackHandler* CreateTrackHandler(AP4_TrakAtom* trak);
  66. };