From acd6d7890051b9253007941733ea37e4011b1b5e Mon Sep 17 00:00:00 2001 From: jacqueline Date: Thu, 17 Nov 2022 17:36:37 +1100 Subject: Progress on own pipeline. Still very WIP --- src/audio/include/audio_decoder.hpp | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to 'src/audio/include/audio_decoder.hpp') 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 +#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 current_codec_; + + uint8_t *working_buffer_; + + QueueHandle_t input_queue_; + QueueHandle_t output_queue_; + StreamBufferHandle_t input_buffer_; + StreamBufferHandle_t output_buffer_; }; } // namespace audio -- cgit v1.2.3