summaryrefslogtreecommitdiff
path: root/src/audio/include/audio_decoder.hpp
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2023-02-21 14:40:18 +1100
committerjacqueline <me@jacqueline.id.au>2023-02-21 14:40:18 +1100
commit47ae601d417d0ef99eb6fe433ef695614d8d2786 (patch)
treef536ecc214c012c0d69b3a8d350a7a1cadb2f671 /src/audio/include/audio_decoder.hpp
parent941bafca17b13547a88668b787ce4c8e064ef7ff (diff)
downloadtangara-fw-47ae601d417d0ef99eb6fe433ef695614d8d2786.tar.gz
Tidy up pipeline and use arena capacity to test for overruns
Diffstat (limited to 'src/audio/include/audio_decoder.hpp')
-rw-r--r--src/audio/include/audio_decoder.hpp17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/audio/include/audio_decoder.hpp b/src/audio/include/audio_decoder.hpp
index 9cc40162..47642469 100644
--- a/src/audio/include/audio_decoder.hpp
+++ b/src/audio/include/audio_decoder.hpp
@@ -24,21 +24,13 @@ class AudioDecoder : public IAudioElement {
auto StackSizeBytes() const -> std::size_t override { return 10 * 1024; };
- auto InputMinChunkSize() const -> std::size_t override {
- // 128 kbps MPEG-1 @ 44.1 kHz is approx. 418 bytes according to the
- // internet.
- // TODO(jacqueline): tune as more codecs are added.
- return 1024;
- }
-
auto HasUnprocessedInput() -> bool override;
+ auto IsOverBuffered() -> bool override;
- auto ProcessStreamInfo(const StreamInfo& info)
- -> cpp::result<void, AudioProcessingError> override;
- auto ProcessChunk(const cpp::span<std::byte>& chunk)
- -> cpp::result<std::size_t, AudioProcessingError> override;
+ auto ProcessStreamInfo(const StreamInfo& info) -> void override;
+ auto ProcessChunk(const cpp::span<std::byte>& chunk) -> void override;
auto ProcessEndOfStream() -> void override;
- auto Process() -> cpp::result<void, AudioProcessingError> override;
+ auto Process() -> void override;
AudioDecoder(const AudioDecoder&) = delete;
AudioDecoder& operator=(const AudioDecoder&) = delete;
@@ -50,7 +42,6 @@ class AudioDecoder : public IAudioElement {
std::optional<ChunkReader> chunk_reader_;
bool has_sent_stream_info_;
- std::size_t chunk_size_;
bool has_samples_to_send_;
bool needs_more_input_;
};