forked from avTranscoder/avTranscoder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAudioGenerator.hpp
More file actions
40 lines (31 loc) · 1.3 KB
/
Copy pathAudioGenerator.hpp
File metadata and controls
40 lines (31 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef _AV_TRANSCODER_DECODER_AUDIO_GENERATOR_HPP_
#define _AV_TRANSCODER_DECODER_AUDIO_GENERATOR_HPP_
#include "IDecoder.hpp"
#include <AvTranscoder/codec/AudioCodec.hpp>
#include <AvTranscoder/transform/AudioTransform.hpp>
namespace avtranscoder
{
class AvExport AudioGenerator : public IDecoder
{
private:
AudioGenerator& operator=(const AudioGenerator& audioGenerator);
AudioGenerator(const AudioGenerator& audioGenerator);
public:
AudioGenerator(const AudioFrameDesc& frameDesc);
~AudioGenerator();
bool decodeNextFrame(IFrame& frameBuffer);
bool decodeNextFrame(IFrame& frameBuffer, const std::vector<size_t> channelIndexArray);
/**
* @brief Force to return this frame when calling the decoding methods.
* @param inputFrame: could have other properties than the given frame when decoding (will be converted).
* @see decodeNextFrame
*/
void setNextFrame(IFrame& inputFrame) { _inputFrame = &inputFrame; }
private:
IFrame* _inputFrame; ///< Has link (no ownership)
AudioFrame* _silent; ///< The generated silent (has ownership)
const AudioFrameDesc _frameDesc; ///< The description of the given frame buffer when decoding.
AudioTransform _audioTransform; ///< To transform the specified data when decoding.
};
}
#endif