summaryrefslogtreecommitdiff
path: root/src/codecs/include
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2023-03-10 11:28:33 +1100
committerjacqueline <me@jacqueline.id.au>2023-04-19 10:27:59 +1000
commita9531c86a433c8b7ae1f77ff0266c27c39eca7f4 (patch)
tree11835552aa2ecb400537781d8eb3851118c47e61 /src/codecs/include
parent2a46eecdc6334c31cee2b40427d2536b48cbb6be (diff)
downloadtangara-fw-a9531c86a433c8b7ae1f77ff0266c27c39eca7f4.tar.gz
mostly single task pipeline
Diffstat (limited to 'src/codecs/include')
-rw-r--r--src/codecs/include/codec.hpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/codecs/include/codec.hpp b/src/codecs/include/codec.hpp
index 6897acf2..4595f877 100644
--- a/src/codecs/include/codec.hpp
+++ b/src/codecs/include/codec.hpp
@@ -10,6 +10,7 @@
#include "result.hpp"
#include "span.hpp"
+#include "types.hpp"
namespace codecs {
@@ -17,7 +18,7 @@ class ICodec {
public:
virtual ~ICodec() {}
- virtual auto CanHandleFile(const std::string& path) -> bool = 0;
+ virtual auto CanHandleType(StreamType type) -> bool = 0;
struct OutputFormat {
uint8_t num_channels;
@@ -31,7 +32,7 @@ class ICodec {
virtual auto ResetForNewStream() -> void = 0;
- virtual auto SetInput(cpp::span<std::byte> input) -> void = 0;
+ virtual auto SetInput(cpp::span<const std::byte> input) -> void = 0;
/*
* Returns the codec's next read position within the input buffer. If the
@@ -63,7 +64,7 @@ class ICodec {
enum CreateCodecError { UNKNOWN_EXTENSION };
-auto CreateCodecForFile(const std::string& file)
+auto CreateCodecForType(StreamType type)
-> cpp::result<std::unique_ptr<ICodec>, CreateCodecError>;
} // namespace codecs