diff options
Diffstat (limited to 'src/codecs/include/mad.hpp')
| -rw-r--r-- | src/codecs/include/mad.hpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/codecs/include/mad.hpp b/src/codecs/include/mad.hpp index 241ea6c3..aa24f3c9 100644 --- a/src/codecs/include/mad.hpp +++ b/src/codecs/include/mad.hpp @@ -1,5 +1,11 @@ #pragma once +#include <cstddef> +#include <cstdint> +#include <string> + +#include "mad.h" + #include "codec.hpp" namespace codecs { @@ -9,10 +15,14 @@ class MadMp3Decoder : public ICodec { MadMp3Decoder(); ~MadMp3Decoder(); - auto ProcessInput(Result* res, uint8_t* input, std::size_t input_len) -> void; - auto WriteOutputSamples(Result* res, - uint8_t* output, - std::size_t output_length) -> void; + auto CanHandleFile(const std::string& path) -> bool override; + auto GetOutputFormat() -> OutputFormat override; + auto ResetForNewStream() -> void override; + auto SetInput(uint8_t* buffer, std::size_t length) -> void override; + auto GetInputPosition() -> std::size_t override; + auto ProcessNextFrame() -> cpp::result<bool, ProcessingError> override; + auto WriteOutputSamples(uint8_t* output, std::size_t output_length) + -> std::pair<std::size_t, bool> override; private: mad_stream stream_; @@ -22,7 +32,7 @@ class MadMp3Decoder : public ICodec { mad_header header_; bool has_decoded_header_; - int current_sample_ = -1; + int current_sample_; }; } // namespace codecs |
