载入中...
搜索中...
未找到
Decoder.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
5#include <memory>
6#include <vector>
7#include <string>
8
9namespace medialoader {
10class Decoder;
11}
12
13namespace eve {
14namespace sound {
15
23public:
25 Decoder(std::unique_ptr<medialoader::Decoder> impl, std::vector<char> ownedData);
28
36 Decoder *clone() const;
37
39 int decode();
41 int getSize() const;
43 void *getBuffer() const;
45 bool seek(double seconds);
47 bool rewind();
49 bool isSeekable();
51 bool isFinished();
53 int getChannelCount() const;
55 int getBitDepth() const;
57 int getSampleRate() const;
59 double getDuration();
60
62 medialoader::Decoder *getImpl() { return impl.get(); }
63
64private:
65 Decoder(std::unique_ptr<medialoader::Decoder> impl, std::shared_ptr<const std::vector<char>> ownedData);
66
67 // Providers borrow these bytes. Declare storage first so it outlives impl's
68 // destructor, including when this is the last clone.
69 std::shared_ptr<const std::vector<char>> ownedData;
70 std::unique_ptr<medialoader::Decoder> impl;
71};
72
73} // namespace sound
74} // namespace eve
void * impl
#define EVENGINE_API_PLATFORM
Definition Export.h:107
Streaming audio decoder (medialoader-backed). Owns the raw encoded bytes and decodes incrementally vi...
Definition Decoder.h:22
medialoader::Decoder * getImpl()
Underlying medialoader decoder (advanced).
Definition Decoder.h:62
Build metadata (engine git commit, build time, third-party version).
Definition Build.cpp:16