diff options
Diffstat (limited to 'src/codecs/include')
| -rw-r--r-- | src/codecs/include/codec.hpp | 13 | ||||
| -rw-r--r-- | src/codecs/include/dr_flac.hpp | 8 | ||||
| -rw-r--r-- | src/codecs/include/mad.hpp | 4 | ||||
| -rw-r--r-- | src/codecs/include/opus.hpp | 6 | ||||
| -rw-r--r-- | src/codecs/include/source_buffer.hpp | 9 | ||||
| -rw-r--r-- | src/codecs/include/vorbis.hpp | 6 | ||||
| -rw-r--r-- | src/codecs/include/wav.hpp | 2 |
7 files changed, 22 insertions, 26 deletions
diff --git a/src/codecs/include/codec.hpp b/src/codecs/include/codec.hpp index e48e3c58..4d588a98 100644 --- a/src/codecs/include/codec.hpp +++ b/src/codecs/include/codec.hpp @@ -6,19 +6,16 @@ #pragma once -#include <stdint.h> -#include <sys/_stdint.h> - #include <cstddef> #include <cstdint> #include <memory> #include <optional> +#include <span> #include <string> #include <utility> #include "result.hpp" #include "sample.hpp" -#include "span.hpp" #include "types.hpp" #include "memory_resource.hpp" @@ -35,7 +32,7 @@ class IStream { auto type() -> StreamType { return t_; } - virtual auto Read(cpp::span<std::byte> dest) -> ssize_t = 0; + virtual auto Read(std::span<std::byte> dest) -> ssize_t = 0; virtual auto CanSeek() -> bool = 0; @@ -54,7 +51,7 @@ class IStream { /* * Called by codecs to indicate that they've finished parsing any header data * within this stream, and are about to begin decoding. - * + * * Currently used as a hint to the readahead stream to begin prefetching file * data. */ @@ -117,7 +114,7 @@ class ICodec { * Decodes metadata or headers from the given input stream, and returns the * format for the samples that will be decoded from it. */ - virtual auto OpenStream(std::shared_ptr<IStream> input,uint32_t offset) + virtual auto OpenStream(std::shared_ptr<IStream> input, uint32_t offset) -> cpp::result<OutputFormat, Error> = 0; struct OutputInfo { @@ -128,7 +125,7 @@ class ICodec { /* * Writes PCM samples to the given output buffer. */ - virtual auto DecodeTo(cpp::span<sample::Sample> destination) + virtual auto DecodeTo(std::span<sample::Sample> destination) -> cpp::result<OutputInfo, Error> = 0; }; diff --git a/src/codecs/include/dr_flac.hpp b/src/codecs/include/dr_flac.hpp index 547876f4..ac46e92f 100644 --- a/src/codecs/include/dr_flac.hpp +++ b/src/codecs/include/dr_flac.hpp @@ -10,13 +10,13 @@ #include <cstdint> #include <memory> #include <optional> +#include <span> #include <string> #include <utility> #include "dr_flac.h" #include "sample.hpp" #include "source_buffer.hpp" -#include "span.hpp" #include "codec.hpp" @@ -27,10 +27,10 @@ class DrFlacDecoder : public ICodec { DrFlacDecoder(); ~DrFlacDecoder(); - auto OpenStream(std::shared_ptr<IStream> input,uint32_t offset) + auto OpenStream(std::shared_ptr<IStream> input, uint32_t offset) -> cpp::result<OutputFormat, Error> override; - auto DecodeTo(cpp::span<sample::Sample> destination) + auto DecodeTo(std::span<sample::Sample> destination) -> cpp::result<OutputInfo, Error> override; DrFlacDecoder(const DrFlacDecoder&) = delete; @@ -38,7 +38,7 @@ class DrFlacDecoder : public ICodec { private: std::shared_ptr<IStream> input_; - drflac *flac_; + drflac* flac_; }; } // namespace codecs diff --git a/src/codecs/include/mad.hpp b/src/codecs/include/mad.hpp index ead0b2a2..d1d0aac5 100644 --- a/src/codecs/include/mad.hpp +++ b/src/codecs/include/mad.hpp @@ -11,11 +11,11 @@ #include <optional> #include <string> #include <utility> +#include <span> #include "mad.h" #include "sample.hpp" #include "source_buffer.hpp" -#include "span.hpp" #include "codec.hpp" @@ -29,7 +29,7 @@ class MadMp3Decoder : public ICodec { auto OpenStream(std::shared_ptr<IStream> input,uint32_t offset) -> cpp::result<OutputFormat, Error> override; - auto DecodeTo(cpp::span<sample::Sample> destination) + auto DecodeTo(std::span<sample::Sample> destination) -> cpp::result<OutputInfo, Error> override; MadMp3Decoder(const MadMp3Decoder&) = delete; diff --git a/src/codecs/include/opus.hpp b/src/codecs/include/opus.hpp index de2f7131..200b2d44 100644 --- a/src/codecs/include/opus.hpp +++ b/src/codecs/include/opus.hpp @@ -10,12 +10,12 @@ #include <cstdint> #include <memory> #include <optional> +#include <span> #include <string> #include <utility> #include "opusfile.h" #include "sample.hpp" -#include "span.hpp" #include "codec.hpp" @@ -26,10 +26,10 @@ class XiphOpusDecoder : public ICodec { XiphOpusDecoder(); ~XiphOpusDecoder(); - auto OpenStream(std::shared_ptr<IStream> input,uint32_t offset) + auto OpenStream(std::shared_ptr<IStream> input, uint32_t offset) -> cpp::result<OutputFormat, Error> override; - auto DecodeTo(cpp::span<sample::Sample> destination) + auto DecodeTo(std::span<sample::Sample> destination) -> cpp::result<OutputInfo, Error> override; XiphOpusDecoder(const XiphOpusDecoder&) = delete; diff --git a/src/codecs/include/source_buffer.hpp b/src/codecs/include/source_buffer.hpp index 7834834d..6444dd2c 100644 --- a/src/codecs/include/source_buffer.hpp +++ b/src/codecs/include/source_buffer.hpp @@ -9,8 +9,7 @@ #include <cstddef> #include <cstdint> #include <functional> - -#include "span.hpp" +#include <span> #include "codec.hpp" @@ -22,15 +21,15 @@ class SourceBuffer { ~SourceBuffer(); auto Refill(IStream* src) -> bool; - auto AddBytes(std::function<size_t(cpp::span<std::byte>)> writer) -> void; - auto ConsumeBytes(std::function<size_t(cpp::span<std::byte>)> reader) -> void; + auto AddBytes(std::function<size_t(std::span<std::byte>)> writer) -> void; + auto ConsumeBytes(std::function<size_t(std::span<std::byte>)> reader) -> void; auto Empty() -> void; SourceBuffer(const SourceBuffer&) = delete; SourceBuffer& operator=(const SourceBuffer&) = delete; private: - const cpp::span<std::byte> buffer_; + const std::span<std::byte> buffer_; size_t bytes_in_buffer_; size_t offset_of_bytes_; }; diff --git a/src/codecs/include/vorbis.hpp b/src/codecs/include/vorbis.hpp index 3cf0f9ce..e6f393dc 100644 --- a/src/codecs/include/vorbis.hpp +++ b/src/codecs/include/vorbis.hpp @@ -10,12 +10,12 @@ #include <cstdint> #include <memory> #include <optional> +#include <span> #include <string> #include <utility> #include "ivorbisfile.h" #include "sample.hpp" -#include "span.hpp" #include "codec.hpp" @@ -26,10 +26,10 @@ class TremorVorbisDecoder : public ICodec { TremorVorbisDecoder(); ~TremorVorbisDecoder(); - auto OpenStream(std::shared_ptr<IStream> input,uint32_t offset) + auto OpenStream(std::shared_ptr<IStream> input, uint32_t offset) -> cpp::result<OutputFormat, Error> override; - auto DecodeTo(cpp::span<sample::Sample> destination) + auto DecodeTo(std::span<sample::Sample> destination) -> cpp::result<OutputInfo, Error> override; TremorVorbisDecoder(const TremorVorbisDecoder&) = delete; diff --git a/src/codecs/include/wav.hpp b/src/codecs/include/wav.hpp index 40138968..c09a3bb3 100644 --- a/src/codecs/include/wav.hpp +++ b/src/codecs/include/wav.hpp @@ -34,7 +34,7 @@ class WavDecoder : public ICodec { auto OpenStream(std::shared_ptr<IStream> input,uint32_t offset) -> cpp::result<OutputFormat, Error> override; - auto DecodeTo(cpp::span<sample::Sample> destination) + auto DecodeTo(std::span<sample::Sample> destination) -> cpp::result<OutputInfo, Error> override; WavDecoder(const WavDecoder&) = delete; |
