summaryrefslogtreecommitdiff
path: root/src/audio/include/audio_decoder.hpp
blob: 083bd564a2f7e1cedd3b1806362638ef54e1f2f0 (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
28
29
30
31
32
33
34
35
36
#pragma once

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

namespace audio {

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

  auto Pause() -> void;
  auto IsPaused() -> bool;

  auto Resume() -> void;

  auto SetInputCommandQueue(QueueHandle_t) -> void;
  auto SetOutputCommandQueue(QueueHandle_t) -> void;
  auto SetInputBuffer(StreamBufferHandle_t) -> void;
  auto SetOutputBuffer(StreamBufferHandle_t) -> void;

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

  uint8_t *working_buffer_;

  QueueHandle_t input_queue_;
  QueueHandle_t output_queue_;
  StreamBufferHandle_t input_buffer_;
  StreamBufferHandle_t output_buffer_;
};

}  // namespace audio