summaryrefslogtreecommitdiff
path: root/src/codecs/include/mad.hpp
blob: cfe4eab7bbbb9fb22a47dc7cb5d78ed97417399d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#pragma once

#include "codec.hpp"

namespace codecs {

  class MadMp3Decoder : public ICodec {
    public:
      MadMp3Decoder();
      ~MadMp3Decoder();

      auto ProcessInput(Result *res, uint8_t *input, std::size_t input_len) -> void;
      auto WriteOutputSamples(Result *res, uint8_t *output, std::size_t output_length) -> void;

    private:
      mad_stream stream_;
      mad_frame	frame_;
      mad_synth	synth_;

      mad_header header_;
      bool has_decoded_header_;

      int current_sample_ = -1;
  };

} // namespace codecs