adts.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef NULLSOFT_IN_MP3_ADTS_H
  2. #define NULLSOFT_IN_MP3_ADTS_H
  3. #include "ifc_mpeg_stream_reader.h"
  4. #include <bfc/std_mkncc.h> // for MKnCC()
  5. class adts
  6. {
  7. protected:
  8. adts() {}
  9. ~adts() {}
  10. public:
  11. static FOURCC getServiceType() { return MK4CC('a','d','t','s'); }
  12. virtual int Initialize(bool forceMono, bool reverseStereo, bool allowSurround, int maxBits, bool allowRG, bool _useFloat = false, bool _useCRC = false)=0;
  13. virtual bool Open(ifc_mpeg_stream_reader *file)=0;
  14. virtual int Sync(ifc_mpeg_stream_reader *file, unsigned __int8 *output, size_t outputSize, size_t *outputWritten, size_t *bitrate)=0;
  15. virtual void CalculateFrameSize(int *frameSize)=0;
  16. virtual void GetOutputParameters(size_t *numBits, int *numChannels, int *sampleRate)=0;
  17. virtual void Flush(ifc_mpeg_stream_reader *file)=0;
  18. virtual void Close() = 0;
  19. enum
  20. {
  21. SUCCESS = 0,
  22. FAILURE=1,
  23. ENDOFFILE = 2,
  24. NEEDMOREDATA = 3,
  25. NEEDSYNC = 4,
  26. };
  27. virtual int Decode(ifc_mpeg_stream_reader *file, unsigned __int8 *output, size_t outputSize, size_t *outputWritten, size_t *bitrate, size_t *endCut)=0;
  28. virtual size_t GetCurrentBitrate()=0;
  29. virtual size_t GetDecoderDelay()=0;
  30. virtual int GetLayer()=0;
  31. virtual void Release()=0;
  32. virtual void SetDecoderHooks(void *layer3_vis, void *layer2_eq, void *layer3_eq) {}
  33. };
  34. #endif