diff options
Diffstat (limited to 'src/audio/include/audio_decoder.hpp')
| -rw-r--r-- | src/audio/include/audio_decoder.hpp | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/src/audio/include/audio_decoder.hpp b/src/audio/include/audio_decoder.hpp index 47642469..6a1b5177 100644 --- a/src/audio/include/audio_decoder.hpp +++ b/src/audio/include/audio_decoder.hpp @@ -3,6 +3,7 @@ #include <cstddef> #include <cstdint> #include <memory> +#include <vector> #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,19 @@ 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<std::byte>& chunk) -> void override; - auto ProcessEndOfStream() -> void override; - auto Process() -> void override; + auto Process(const std::vector<InputStream>& inputs, OutputStream* output) + -> void override; AudioDecoder(const AudioDecoder&) = delete; AudioDecoder& operator=(const AudioDecoder&) = delete; private: - memory::Arena arena_; std::unique_ptr<codecs::ICodec> current_codec_; - std::optional<StreamInfo> stream_info_; - std::optional<ChunkReader> chunk_reader_; - - bool has_sent_stream_info_; + std::optional<StreamInfo::Format> current_input_format_; + std::optional<StreamInfo::Format> current_output_format_; bool has_samples_to_send_; - bool needs_more_input_; + + auto ProcessStreamInfo(const StreamInfo& info) -> bool; }; } // namespace audio |
