summaryrefslogtreecommitdiff
path: root/src/codecs/include/codec.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/codecs/include/codec.hpp
parent4887f3789817f87bf1272af0b52684e3364270c2 (diff)
parent5575378c1c8171cd716b79d3ab89df1e56ceb9d3 (diff)
downloadtangara-fw-7972bd4567a99179338259e9e6ce19168c2c0db3.tar.gz
Merge branch 'main' into leveldb
Diffstat (limited to 'src/codecs/include/codec.hpp')
-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