整理代码
This commit is contained in:
commit
c7b4e178ec
364 changed files with 59691 additions and 0 deletions
52
video/ffmpeg/AudioResample.h
Normal file
52
video/ffmpeg/AudioResample.h
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
#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
|
||||
Loading…
Add table
Add a link
Reference in a new issue