44 lines
1.3 KiB
C++
44 lines
1.3 KiB
C++
#ifndef AD6CD053_01C0_4CD4_B6DE_4F9D3940E437
|
|
#define AD6CD053_01C0_4CD4_B6DE_4F9D3940E437
|
|
/*
|
|
*******************************************************************************
|
|
* INCLUDE
|
|
*******************************************************************************
|
|
*/
|
|
#include "../core/AudioDecoder.h"
|
|
extern "C"
|
|
{
|
|
#include <libavcodec/avcodec.h>
|
|
}
|
|
#include <functional>
|
|
|
|
namespace Video
|
|
{
|
|
namespace FFmpeg
|
|
{
|
|
/*
|
|
*******************************************************************************
|
|
* CLASS DECLARE
|
|
*******************************************************************************
|
|
*/
|
|
class AudioDecodeHandler: public Core::AudioDecodeHandler
|
|
{
|
|
public:
|
|
AudioDecodeHandler(Core::CodecID codecID, Core::AudioComponent::Ptr pPrevious);
|
|
~AudioDecodeHandler();
|
|
|
|
protected:
|
|
void write(Core::Packet::Ptr pPacket) override;
|
|
Core::Frame::Ptr read() override;
|
|
|
|
Core::Frame::Ptr convert(AVFrame* pFrame);
|
|
|
|
private:
|
|
AVCodecContext* _pCodecCtx;
|
|
AVFrame* _pFrame;
|
|
AVPacket* _pPacket;
|
|
std::function<void(AVFrame*, Core::Frame::Ptr)> _frameConvertor;
|
|
};
|
|
}
|
|
}
|
|
#endif
|