summaryrefslogtreecommitdiff
path: root/src/audio/include/audio_decoder.hpp
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2023-04-26 08:49:02 +1000
committerjacqueline <me@jacqueline.id.au>2023-04-26 08:49:02 +1000
commit7972bd4567a99179338259e9e6ce19168c2c0db3 (patch)
treef46642afd36011d3d064e022232e77744b82c6ae /src/audio/include/audio_decoder.hpp
parent4887f3789817f87bf1272af0b52684e3364270c2 (diff)
parent5575378c1c8171cd716b79d3ab89df1e56ceb9d3 (diff)
downloadtangara-fw-7972bd4567a99179338259e9e6ce19168c2c0db3.tar.gz
Merge branch 'main' into leveldb
Diffstat (limited to 'src/audio/include/audio_decoder.hpp')
-rw-r--r--src/audio/include/audio_decoder.hpp23
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