Streaming audio decoder (medialoader-backed). Owns the raw encoded bytes and decodes incrementally via decode(). Clones share immutable encoded storage and own independent playback positions. Each decoder is thread-affine; calls on one instance must be serialized. 更多...
#include <Decoder.h>
Public 成员函数 | |
| Decoder (std::unique_ptr< medialoader::Decoder > impl, std::vector< char > ownedData) | |
| Wraps a medialoader decoder and the encoded bytes it needs. | |
| ~Decoder () | |
| Decoder. | |
| Decoder * | clone () const |
| Creates a caller-owned decoder positioned at the start of the stream. | |
| int | decode () |
| Decodes the next chunk; returns bytes produced (0 = end/error). | |
| int | getSize () const |
| Bytes decoded so far into the internal buffer. | |
| void * | getBuffer () const |
| Internal decoded buffer. | |
| bool | seek (double seconds) |
| Seeks to a time in seconds; false when unsupported. | |
| bool | rewind () |
| Rewinds to the start; false when unsupported. | |
| bool | isSeekable () |
| True when seeking is supported. | |
| bool | isFinished () |
| True when the stream is fully decoded. | |
| int | getChannelCount () const |
| Format metadata. | |
| int | getBitDepth () const |
| Returns the bit depth. | |
| int | getSampleRate () const |
| Returns the sample rate. | |
| double | getDuration () |
| Total duration in seconds. | |
| medialoader::Decoder * | getImpl () |
| Underlying medialoader decoder (advanced). | |
详细描述
Streaming audio decoder (medialoader-backed). Owns the raw encoded bytes and decodes incrementally via decode(). Clones share immutable encoded storage and own independent playback positions. Each decoder is thread-affine; calls on one instance must be serialized.
构造及析构函数说明
◆ Decoder()
| eve::sound::Decoder::Decoder | ( | std::unique_ptr< medialoader::Decoder > | impl, |
| std::vector< char > | ownedData | ||
| ) |
Wraps a medialoader decoder and the encoded bytes it needs.
在文件 Decoder.cpp 第 9 行定义.
◆ ~Decoder()
|
default |
成员函数说明
◆ clone()
| Decoder * eve::sound::Decoder::clone | ( | ) | const |
Creates a caller-owned decoder positioned at the start of the stream.
- 返回
- Independent playback state retaining the encoded storage even after this decoder is destroyed. Either instance may be destroyed first.
- 异常
-
eve::Exception if the provider cannot clone the decoder. @reentrancy Does not invoke application callbacks.
在文件 Decoder.cpp 第 20 行定义.
引用了 impl.
◆ decode()
| int eve::sound::Decoder::decode | ( | ) |
Decodes the next chunk; returns bytes produced (0 = end/error).
在文件 Decoder.cpp 第 29 行定义.
引用了 impl.
被这些函数引用 eve::audio::Source::fillPendingFromDecoder() , 以及 eve::sound::Sound::newSoundDataFromDecoder().
◆ getBitDepth()
| int eve::sound::Decoder::getBitDepth | ( | ) | const |
◆ getBuffer()
| void * eve::sound::Decoder::getBuffer | ( | ) | const |
Internal decoded buffer.
在文件 Decoder.cpp 第 31 行定义.
引用了 impl.
被这些函数引用 eve::audio::Source::fillPendingFromDecoder() , 以及 eve::sound::Sound::newSoundDataFromDecoder().
◆ getChannelCount()
| int eve::sound::Decoder::getChannelCount | ( | ) | const |
◆ getDuration()
| double eve::sound::Decoder::getDuration | ( | ) |
Total duration in seconds.
在文件 Decoder.cpp 第 39 行定义.
引用了 impl.
被这些函数引用 eve::audio::Source::getDuration().
◆ getImpl()
|
inline |
◆ getSampleRate()
| int eve::sound::Decoder::getSampleRate | ( | ) | const |
◆ getSize()
| int eve::sound::Decoder::getSize | ( | ) | const |
◆ isFinished()
| bool eve::sound::Decoder::isFinished | ( | ) |
◆ isSeekable()
| bool eve::sound::Decoder::isSeekable | ( | ) |
True when seeking is supported.
在文件 Decoder.cpp 第 34 行定义.
引用了 impl.
被这些函数引用 eve::audio::Source::seek().
◆ rewind()
| bool eve::sound::Decoder::rewind | ( | ) |
Rewinds to the start; false when unsupported.
在文件 Decoder.cpp 第 33 行定义.
引用了 impl.
被这些函数引用 eve::audio::Source::fillPendingFromDecoder() , 以及 eve::audio::Source::stop().
◆ seek()
| bool eve::sound::Decoder::seek | ( | double | seconds | ) |
Seeks to a time in seconds; false when unsupported.
在文件 Decoder.cpp 第 32 行定义.
引用了 impl.
被这些函数引用 eve::audio::Source::seek().
该类的文档由以下文件生成:
- src/modules/sound/Decoder.h
- src/modules/sound/Decoder.cpp