AACDecoder.h 780 B

123456789101112131415161718192021222324252627282930
  1. #pragma once
  2. #include <stdint.h> // for uint8_t, uint32_t, int16_t
  3. #include <vector>
  4. #include "BaseCodec.h" // for BaseCodec
  5. #include "pvmp4audiodecoder_api.h" // for tPVMP4AudioDecoderExternal
  6. namespace bell {
  7. class AudioContainer;
  8. class AACDecoder : public BaseCodec {
  9. private:
  10. tPVMP4AudioDecoderExternal* aacDecoder;
  11. std::vector<uint8_t> inputBuffer;
  12. std::vector<int16_t> outputBuffer;
  13. void* pMem;
  14. bool firstFrame = true;
  15. int getDecodedStreamType();
  16. public:
  17. AACDecoder();
  18. ~AACDecoder();
  19. bool setup(uint32_t sampleRate, uint8_t channelCount,
  20. uint8_t bitDepth) override;
  21. bool setup(AudioContainer* container) override;
  22. uint8_t* decode(uint8_t* inData, uint32_t& inLen, uint32_t& outLen) override;
  23. };
  24. } // namespace bell