From a9531c86a433c8b7ae1f77ff0266c27c39eca7f4 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Fri, 10 Mar 2023 11:28:33 +1100 Subject: mostly single task pipeline --- src/audio/include/audio_decoder.hpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 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 47642469..be8daf99 100644 --- a/src/audio/include/audio_decoder.hpp +++ b/src/audio/include/audio_decoder.hpp @@ -3,6 +3,7 @@ #include #include #include +#include #include "chunk.hpp" #include "ff.h" @@ -10,6 +11,7 @@ #include "audio_element.hpp" #include "codec.hpp" +#include "stream_info.hpp" namespace audio { @@ -22,28 +24,21 @@ class AudioDecoder : public IAudioElement { AudioDecoder(); ~AudioDecoder(); - auto StackSizeBytes() const -> std::size_t override { return 10 * 1024; }; - - auto HasUnprocessedInput() -> bool override; - auto IsOverBuffered() -> bool override; - - auto ProcessStreamInfo(const StreamInfo& info) -> void override; - auto ProcessChunk(const cpp::span& chunk) -> void override; - auto ProcessEndOfStream() -> void override; - auto Process() -> void override; + auto Process(std::vector* inputs, MutableStream* output) + -> void override; AudioDecoder(const AudioDecoder&) = delete; AudioDecoder& operator=(const AudioDecoder&) = delete; private: - memory::Arena arena_; std::unique_ptr current_codec_; std::optional stream_info_; - std::optional chunk_reader_; - bool has_sent_stream_info_; + bool has_set_stream_info_; bool has_samples_to_send_; bool needs_more_input_; + + auto ProcessStreamInfo(const StreamInfo& info) -> bool; }; } // namespace audio -- cgit v1.2.3 From 7c6fd654f50e6665efa4226c6b927f9762734182 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Sat, 1 Apr 2023 13:22:21 +1100 Subject: New pipeline building, still needs proper control --- src/audio/include/audio_decoder.hpp | 8 +++----- 1 file changed, 3 insertions(+), 5 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 be8daf99..6a1b5177 100644 --- a/src/audio/include/audio_decoder.hpp +++ b/src/audio/include/audio_decoder.hpp @@ -24,7 +24,7 @@ class AudioDecoder : public IAudioElement { AudioDecoder(); ~AudioDecoder(); - auto Process(std::vector* inputs, MutableStream* output) + auto Process(const std::vector& inputs, OutputStream* output) -> void override; AudioDecoder(const AudioDecoder&) = delete; @@ -32,11 +32,9 @@ class AudioDecoder : public IAudioElement { private: std::unique_ptr current_codec_; - std::optional stream_info_; - - bool has_set_stream_info_; + std::optional current_input_format_; + std::optional current_output_format_; bool has_samples_to_send_; - bool needs_more_input_; auto ProcessStreamInfo(const StreamInfo& info) -> bool; }; -- cgit v1.2.3