diff options
author | Jef <jef@targetspot.com> | 2024-09-24 08:54:57 -0400 |
---|---|---|
committer | Jef <jef@targetspot.com> | 2024-09-24 08:54:57 -0400 |
commit | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (patch) | |
tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/replicant/nsmp3dec/mpgadecoder.h | |
parent | 537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff) | |
download | winamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz |
Initial community commit
Diffstat (limited to 'Src/replicant/nsmp3dec/mpgadecoder.h')
-rw-r--r-- | Src/replicant/nsmp3dec/mpgadecoder.h | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/Src/replicant/nsmp3dec/mpgadecoder.h b/Src/replicant/nsmp3dec/mpgadecoder.h new file mode 100644 index 00000000..3466cf76 --- /dev/null +++ b/Src/replicant/nsmp3dec/mpgadecoder.h @@ -0,0 +1,100 @@ +/***************************************************************************\ + * +* MPEG Layer3-Audio Decoder +* © 1997-2006 by Fraunhofer IIS + * All Rights Reserved + * + * filename: mpgadecoder.h + * project : MPEG Decoder + * author : Martin Sieler + * date : 1998-05-26 + * contents/description: MPEG Decoder class - HEADER + * + * +\***************************************************************************/ + +/* + * $Date: 2011/01/25 18:24:17 $ + * $Id: mpgadecoder.h,v 1.4 2011/01/25 18:24:17 audiodsp Exp $ + */ + +#ifndef __MPGADECODER_H__ +#define __MPGADECODER_H__ + +/* ------------------------ includes --------------------------------------*/ + +#include "mp3sscdef.h" +#include "mp3streaminfo.h" +#include "mpegbitstream.h" +#include "mp3decode.h" +#include "mp2decode.h" + + +/*-------------------------- defines --------------------------------------*/ + +/*-------------------------------------------------------------------------*/ + +// +// Mp3 Decoder Top Level Object. +// +// This is the main ISO/MPEG decoder object that interfaces with the +// application code. +// +// It is however recommended to use IMpgaDecoder (see mp3decifc.h) instead. +// Define USE_MP3DECIFC when planning to use IMpgaDecoder. +// + +enum +{ + MPEGAUDIO_CRCCHECK_OFF = 0, + MPEGAUDIO_CRCCHECK_ON = 1, +}; + +class CMpgaDecoder +{ +public: + CMpgaDecoder(int crcCheck = MPEGAUDIO_CRCCHECK_OFF); + CMpgaDecoder(DecoderHooks *hooks, int crcCheck = MPEGAUDIO_CRCCHECK_OFF); + CMpgaDecoder(unsigned char *pBuf, int cbSize, int crcCheck = MPEGAUDIO_CRCCHECK_OFF); + ~CMpgaDecoder(); + void *operator new(size_t stAllocateBlock); + void operator delete(void *); + + void Reset(); + + 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); + + const CMp3StreamInfo *GetStreamInfo() const; + + void Connect(CGioBase *gf); + int Fill(const unsigned char *pBuffer, int cbBuffer); + int GetInputFree() const; + int GetInputLeft() const; + void SetInputEof(); + bool IsEof() const; + +#ifdef KSA_DRM + int GetScfBuffer(const unsigned char** ppBuffer, unsigned int* pBufSize) const; +#endif + + SSC GetLastAncData(unsigned char* ancData = 0, size_t *numAncBytes = 0); + + SSC GetOflVersion(int* oflVersion = 0); +//protected: + + void SetStreamInfo(SSC dwReturn); + + + CMp3StreamInfo m_Info; + CMpegBitStream m_Mbs; + NALIGN(16) CMp3Decode m_Mp3Decode; + NALIGN(16) CMp2Decode m_Mp2Decode; + bool m_IsEof; + int m_Layer; + +private: + +}; + +/*-------------------------------------------------------------------------*/ +#endif |