AvTranscoder  0.9.4
C++APIforLibav/FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AudioGenerator.hpp
Go to the documentation of this file.
1 #ifndef _AV_TRANSCODER_DECODER_AUDIO_GENERATOR_HPP_
2 #define _AV_TRANSCODER_DECODER_AUDIO_GENERATOR_HPP_
3 
4 #include "IDecoder.hpp"
6 
7 namespace avtranscoder
8 {
9 
10 class AvExport AudioGenerator : public IDecoder
11 {
12 private:
13  AudioGenerator& operator=(const AudioGenerator& audioGenerator);
14  AudioGenerator(const AudioGenerator& audioGenerator);
15 
16 public:
17  AudioGenerator(const AudioFrameDesc& frameDesc);
18 
19  ~AudioGenerator();
20 
21  bool decodeNextFrame(Frame& frameBuffer);
22  bool decodeNextFrame(Frame& frameBuffer, const size_t subStreamIndex);
23 
24  void setNextFrame(Frame& inputFrame) { _inputFrame = &inputFrame; }
25 
26 private:
27  Frame* _inputFrame; ///< Has link (no ownership)
28  AudioFrame* _silent; ///< The generated silent (has ownership)
29  const AudioFrameDesc _frameDesc; ///< The description of the silence (sampleRate, channels...)
30 };
31 }
32 
33 #endif
const AudioFrameDesc _frameDesc
The description of the silence (sampleRate, channels...)
Description to create an audio frame. This corresponds to the number of samples, which corresponds to...
Definition: AudioFrame.hpp:14
This class describes decoded audio data.
Definition: AudioFrame.hpp:36
This class describes decoded (raw) audio or video data.
Definition: Frame.hpp:16
void setNextFrame(Frame &inputFrame)
Set the next frame of the input stream (which bypass the work of decoding)
Frame * _inputFrame
Has link (no ownership)
AudioFrame * _silent
The generated silent (has ownership)