summaryrefslogtreecommitdiff
path: root/src/audio/include/audio_decoder.hpp
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2024-05-02 19:12:26 +1000
committerjacqueline <me@jacqueline.id.au>2024-05-02 19:12:26 +1000
commit1573a8c4cde1cd9528b422b2dcc598e37ffe94a7 (patch)
treed162822b8fd7054f81bace0c7a65ab4d5e6f93ef /src/audio/include/audio_decoder.hpp
parenta231fd1c8afedbeb14b0bc77d76bad61db986059 (diff)
downloadtangara-fw-1573a8c4cde1cd9528b422b2dcc598e37ffe94a7.tar.gz
WIP merge cyclically dependent components into one big component
Diffstat (limited to 'src/audio/include/audio_decoder.hpp')
-rw-r--r--src/audio/include/audio_decoder.hpp56
1 files changed, 0 insertions, 56 deletions
diff --git a/src/audio/include/audio_decoder.hpp b/src/audio/include/audio_decoder.hpp
deleted file mode 100644
index 8e955f74..00000000
--- a/src/audio/include/audio_decoder.hpp
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright 2023 jacqueline <me@jacqueline.id.au>
- *
- * SPDX-License-Identifier: GPL-3.0-only
- */
-
-#pragma once
-
-#include <cstdint>
-#include <memory>
-
-#include "audio_converter.hpp"
-#include "audio_events.hpp"
-#include "audio_sink.hpp"
-#include "audio_source.hpp"
-#include "codec.hpp"
-#include "track.hpp"
-#include "types.hpp"
-
-namespace audio {
-
-/*
- * Handle to a persistent task that takes bytes from the given source, decodes
- * them into sample::Sample (normalised to 16 bit signed PCM), and then
- * forwards the resulting stream to the given converter.
- */
-class Decoder {
- public:
- static auto Start(std::shared_ptr<IAudioSource> source,
- std::shared_ptr<SampleConverter> converter) -> Decoder*;
-
- auto Main() -> void;
-
- Decoder(const Decoder&) = delete;
- Decoder& operator=(const Decoder&) = delete;
-
- private:
- Decoder(std::shared_ptr<IAudioSource> source,
- std::shared_ptr<SampleConverter> converter);
-
- auto BeginDecoding(std::shared_ptr<TaggedStream>) -> bool;
- auto ContinueDecoding() -> bool;
-
- std::shared_ptr<IAudioSource> source_;
- std::shared_ptr<SampleConverter> converter_;
-
- std::shared_ptr<codecs::IStream> stream_;
- std::unique_ptr<codecs::ICodec> codec_;
-
- std::optional<codecs::ICodec::OutputFormat> current_format_;
- std::optional<IAudioOutput::Format> current_sink_format_;
-
- std::span<sample::Sample> codec_buffer_;
-};
-
-} // namespace audio