整理代码
This commit is contained in:
commit
c7b4e178ec
364 changed files with 59691 additions and 0 deletions
45
video/ffmpeg/AudioEncoder.h
Normal file
45
video/ffmpeg/AudioEncoder.h
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
#ifndef D5F58729_9077_452E_ADC5_2D75E17601EA
|
||||
#define D5F58729_9077_452E_ADC5_2D75E17601EA
|
||||
/*
|
||||
*******************************************************************************
|
||||
* INCLUDE
|
||||
*******************************************************************************
|
||||
*/
|
||||
#include "../core/AudioEncoder.h"
|
||||
extern "C"
|
||||
{
|
||||
#include <libavcodec/avcodec.h>
|
||||
}
|
||||
#include <functional>
|
||||
|
||||
namespace Video
|
||||
{
|
||||
namespace FFmpeg
|
||||
{
|
||||
/*
|
||||
*******************************************************************************
|
||||
* CLASS DECLARE
|
||||
*******************************************************************************
|
||||
*/
|
||||
class AudioEncoder: public Core::AudioEncoder
|
||||
{
|
||||
public:
|
||||
AudioEncoder(Core::CodecID codecID);
|
||||
~AudioEncoder();
|
||||
|
||||
protected:
|
||||
void initialize() override;
|
||||
void deinitialize() override;
|
||||
Core::Packet::Ptr encode() override;
|
||||
void onConfigChanged(ParameterNames& names) override;
|
||||
uint64_t ts = 0;
|
||||
|
||||
private:
|
||||
AVCodecContext* _pCodecCtx;
|
||||
AVFrame* _pFrame;
|
||||
AVPacket* _pPacket;
|
||||
std::function<void(Core::Frame::Ptr, AVFrame*)> _frameConvertor;
|
||||
};
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue