mpgadecoder.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /***************************************************************************\
  2. *
  3. * MPEG Layer3-Audio Decoder
  4. * © 1997-2006 by Fraunhofer IIS
  5. * All Rights Reserved
  6. *
  7. * filename: mpgadecoder.h
  8. * project : MPEG Decoder
  9. * author : Martin Sieler
  10. * date : 1998-05-26
  11. * contents/description: MPEG Decoder class - HEADER
  12. *
  13. *
  14. \***************************************************************************/
  15. /*
  16. * $Date: 2011/01/25 18:24:17 $
  17. * $Id: mpgadecoder.h,v 1.4 2011/01/25 18:24:17 audiodsp Exp $
  18. */
  19. #ifndef __MPGADECODER_H__
  20. #define __MPGADECODER_H__
  21. /* ------------------------ includes --------------------------------------*/
  22. #include "mp3sscdef.h"
  23. #include "mp3streaminfo.h"
  24. #include "mpegbitstream.h"
  25. #include "mp3decode.h"
  26. #include "mp2decode.h"
  27. /*-------------------------- defines --------------------------------------*/
  28. /*-------------------------------------------------------------------------*/
  29. //
  30. // Mp3 Decoder Top Level Object.
  31. //
  32. // This is the main ISO/MPEG decoder object that interfaces with the
  33. // application code.
  34. //
  35. // It is however recommended to use IMpgaDecoder (see mp3decifc.h) instead.
  36. // Define USE_MP3DECIFC when planning to use IMpgaDecoder.
  37. //
  38. enum
  39. {
  40. MPEGAUDIO_CRCCHECK_OFF = 0,
  41. MPEGAUDIO_CRCCHECK_ON = 1,
  42. };
  43. class CMpgaDecoder
  44. {
  45. public:
  46. CMpgaDecoder(int crcCheck = MPEGAUDIO_CRCCHECK_OFF);
  47. CMpgaDecoder(DecoderHooks *hooks, int crcCheck = MPEGAUDIO_CRCCHECK_OFF);
  48. CMpgaDecoder(unsigned char *pBuf, int cbSize, int crcCheck = MPEGAUDIO_CRCCHECK_OFF);
  49. ~CMpgaDecoder();
  50. void *operator new(size_t stAllocateBlock);
  51. void operator delete(void *);
  52. void Reset();
  53. SSC DecodeFrame(float *pPcm, size_t cbPcm, size_t *pcbUsed = 0, unsigned char *ancData = 0, size_t *numAncBytes = 0, int oflOn = 0, unsigned int *startDelay = 0, unsigned int *totalLength = 0);
  54. const CMp3StreamInfo *GetStreamInfo() const;
  55. void Connect(CGioBase *gf);
  56. int Fill(const unsigned char *pBuffer, int cbBuffer);
  57. int GetInputFree() const;
  58. int GetInputLeft() const;
  59. void SetInputEof();
  60. bool IsEof() const;
  61. #ifdef KSA_DRM
  62. int GetScfBuffer(const unsigned char** ppBuffer, unsigned int* pBufSize) const;
  63. #endif
  64. SSC GetLastAncData(unsigned char* ancData = 0, size_t *numAncBytes = 0);
  65. SSC GetOflVersion(int* oflVersion = 0);
  66. //protected:
  67. void SetStreamInfo(SSC dwReturn);
  68. CMp3StreamInfo m_Info;
  69. CMpegBitStream m_Mbs;
  70. NALIGN(16) CMp3Decode m_Mp3Decode;
  71. NALIGN(16) CMp2Decode m_Mp2Decode;
  72. bool m_IsEof;
  73. int m_Layer;
  74. private:
  75. };
  76. /*-------------------------------------------------------------------------*/
  77. #endif