ALACMP4Decoder.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* copyright 2006 Ben Allison */
  2. #ifndef NULLSOFT_ALAC_DECODER_H
  3. #define NULLSOFT_ALAC_DECODER_H
  4. #include "alac/ALACDecoder.h"
  5. #include "../Plugins/Input/in_mp4/mpeg4audio.h"
  6. #include "decomp.h"
  7. class ALACMP4Decoder : public MP4AudioDecoder
  8. {
  9. public:
  10. ALACMP4Decoder()
  11. : mpAlacDecoder(0),
  12. channels(0),
  13. bps(0),
  14. output_bits(0),
  15. use_rg(0),
  16. rg(0.0)
  17. {
  18. }
  19. int OpenMP4(MP4FileHandle mp4_file, MP4TrackId mp4_track, size_t output_bits, size_t maxChannels, bool useFloat);
  20. int GetCurrentBitrate(unsigned int *bitrate);
  21. int AudioSpecificConfiguration(void *buffer, size_t buffer_size); // reads ASC block from mp4 file
  22. void Flush();
  23. void Close();
  24. int GetOutputProperties(unsigned int *sampleRate, unsigned int *channels, unsigned int *bitsPerSample);
  25. int DecodeSample(void *inputBuffer, size_t inputBufferBytes, void *outputBuffer, size_t *outputBufferBytes);
  26. int OutputFrameSize(size_t *frameSize);
  27. const char *GetCodecInfoString();
  28. int CanHandleCodec(const char *codecName);
  29. int SetGain(float gain);
  30. unsigned char setinfo_sample_size = 0x10;
  31. private:
  32. ALACDecoder *mpAlacDecoder;
  33. int channels;
  34. int bps;
  35. int output_bits;
  36. bool use_rg;
  37. float rg;
  38. protected:
  39. RECVS_DISPATCH;
  40. };
  41. #endif