summaryrefslogtreecommitdiff
path: root/src/audio/include/audio_decoder.hpp
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2022-11-17 17:36:37 +1100
committerjacqueline <me@jacqueline.id.au>2022-11-17 17:36:37 +1100
commitacd6d7890051b9253007941733ea37e4011b1b5e (patch)
tree5a542b3c98fe2a37dd9c10d9093a6e46b2267875 /src/audio/include/audio_decoder.hpp
parentddcbcad6d4771e0ec8228dc1848ebd1dfe303a0b (diff)
downloadtangara-fw-acd6d7890051b9253007941733ea37e4011b1b5e.tar.gz
Progress on own pipeline. Still very WIP
Diffstat (limited to 'src/audio/include/audio_decoder.hpp')
-rw-r--r--src/audio/include/audio_decoder.hpp34
1 files changed, 18 insertions, 16 deletions
diff --git a/src/audio/include/audio_decoder.hpp b/src/audio/include/audio_decoder.hpp
index f460f9e9..083bd564 100644
--- a/src/audio/include/audio_decoder.hpp
+++ b/src/audio/include/audio_decoder.hpp
@@ -1,34 +1,36 @@
#pragma once
#include <cstddef>
+#include "audio_element.hpp"
#include "ff.h"
+#include "codec.hpp"
namespace audio {
-enum SampleRate {};
-enum BitDepth {};
-
-struct PcmStreamHeader {
- SampleRate sample_rate;
- BitDepth bit_depth;
- bool configure_now;
-};
-
-class AudioDecoder {
+class AudioDecoder : public IAudioElement {
public:
AudioDecoder();
~AudioDecoder();
- auto SetSource(RingbufHandle_t& source) -> void;
+ auto Pause() -> void;
+ auto IsPaused() -> bool;
- enum Status {};
- auto ProcessChunk() -> Status;
+ auto Resume() -> void;
- auto GetOutputStream() const -> RingbufHandle_t;
+ auto SetInputCommandQueue(QueueHandle_t) -> void;
+ auto SetOutputCommandQueue(QueueHandle_t) -> void;
+ auto SetInputBuffer(StreamBufferHandle_t) -> void;
+ auto SetOutputBuffer(StreamBufferHandle_t) -> void;
private:
- RingbufHandle_t input_;
- RingbufHandle_t output_;
+ 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