summaryrefslogtreecommitdiff
path: root/src/audio/include/audio_decoder.hpp
blob: 2ee43fb725a71d03147530824b5df5ceaf6b5a30 (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
27
#pragma once

#include <cstddef>
#include "audio_element.hpp"
#include "ff.h"
#include "codec.hpp"

namespace audio {

class AudioDecoder : public IAudioElement {
 public:
  AudioDecoder();
  ~AudioDecoder();

  auto SetInputBuffer(StreamBufferHandle_t) -> void;
  auto SetOutputBuffer(StreamBufferHandle_t) -> void;

 private:
  std::unique_ptr<codecs::ICodec> current_codec_;

  uint8_t *working_buffer_;

  StreamBufferHandle_t input_buffer_;
  StreamBufferHandle_t output_buffer_;
};

}  // namespace audio