52 lines
1.7 KiB
C++
52 lines
1.7 KiB
C++
#ifndef B4406D43_D00D_4DB9_91AB_1428F3FB104C
|
|
#define B4406D43_D00D_4DB9_91AB_1428F3FB104C
|
|
/*
|
|
*******************************************************************************
|
|
* INCLUDE
|
|
*******************************************************************************
|
|
*/
|
|
#include "../core/AudioResample.h"
|
|
extern "C"
|
|
{
|
|
#include <libswresample/swresample.h>
|
|
}
|
|
#include <functional>
|
|
|
|
namespace Video
|
|
{
|
|
namespace FFmpeg
|
|
{
|
|
/*
|
|
*******************************************************************************
|
|
* CLASS DECLARE
|
|
*******************************************************************************
|
|
*/
|
|
class AudioResample: public Core::AudioResample
|
|
{
|
|
protected:
|
|
using AssignPointersMethod = std::function<void(uint8_t*[], Core::Frame::Ptr)>;
|
|
using FrameCreator = std::function<Core::Frame::Ptr(void)>;
|
|
|
|
public:
|
|
AudioResample(Core::ChannelLayout ilayout, Core::SampleFormat iformat, int irate, Core::ChannelLayout olayout,
|
|
Core::SampleFormat oformat, int orate);
|
|
~AudioResample();
|
|
|
|
public:
|
|
Core::Frame::Ptr process(Core::Frame::Ptr in) override;
|
|
void setAssignPointersMethod(AssignPointersMethod& method, Video::Core::SampleFormat iformat,
|
|
Video::Core::ChannelLayout ilayout);
|
|
|
|
private:
|
|
SwrContext* _pSwrCtx;
|
|
AssignPointersMethod _assignInPointers;
|
|
AssignPointersMethod _assignOutPointers;
|
|
FrameCreator _frameCreator;
|
|
int _oBytesPerChannel;
|
|
int _iFrameSize;
|
|
int _oFrameSize;
|
|
int _oSampleSize;
|
|
};
|
|
}
|
|
}
|
|
#endif
|