summaryrefslogtreecommitdiff
path: root/src/codecs/include/foxenflac.hpp
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2023-08-10 15:33:00 +1000
committerjacqueline <me@jacqueline.id.au>2023-08-10 15:33:00 +1000
commitd8fc77101dcf80a3643a00b3446dca1e390ce997 (patch)
tree9e03881f3857c7b4c6a0b6e3a062947daecc69d1 /src/codecs/include/foxenflac.hpp
parent67caeb6e3cda44205ba8fe783274b20dc7ea216e (diff)
downloadtangara-fw-d8fc77101dcf80a3643a00b3446dca1e390ce997.tar.gz
Give codecs complete control of their input files
Diffstat (limited to 'src/codecs/include/foxenflac.hpp')
-rw-r--r--src/codecs/include/foxenflac.hpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/codecs/include/foxenflac.hpp b/src/codecs/include/foxenflac.hpp
index abfa6d80..7522d967 100644
--- a/src/codecs/include/foxenflac.hpp
+++ b/src/codecs/include/foxenflac.hpp
@@ -15,6 +15,7 @@
#include "foxen/flac.h"
#include "sample.hpp"
+#include "source_buffer.hpp"
#include "span.hpp"
#include "codec.hpp"
@@ -26,13 +27,21 @@ class FoxenFlacDecoder : public ICodec {
FoxenFlacDecoder();
~FoxenFlacDecoder();
- auto BeginStream(cpp::span<const std::byte>) -> Result<OutputFormat> override;
- auto ContinueStream(cpp::span<const std::byte>, cpp::span<sample::Sample>)
- -> Result<OutputInfo> override;
- auto SeekStream(cpp::span<const std::byte> input, std::size_t target_sample)
- -> Result<void> override;
+ auto OpenStream(std::shared_ptr<IStream> input)
+ -> cpp::result<OutputFormat, Error> override;
+
+ auto DecodeTo(cpp::span<sample::Sample> destination)
+ -> cpp::result<OutputInfo, Error> override;
+
+ auto SeekTo(std::size_t target_sample) -> cpp::result<void, Error> override;
+
+ FoxenFlacDecoder(const FoxenFlacDecoder&) = delete;
+ FoxenFlacDecoder& operator=(const FoxenFlacDecoder&) = delete;
private:
+ std::shared_ptr<IStream> input_;
+ SourceBuffer buffer_;
+
fx_flac_t* flac_;
};