36 lines
813 B
C++
36 lines
813 B
C++
#ifndef FFCONV_RESAMPLER_H
|
|
#define FFCONV_RESAMPLER_H
|
|
|
|
#include "Frame.h"
|
|
#include "Codec.h"
|
|
|
|
extern "C" {
|
|
#include <libswresample/swresample.h>
|
|
}
|
|
|
|
namespace ffcpp {
|
|
|
|
typedef std::shared_ptr<class Resampler> ResamplerPtr;
|
|
|
|
class Resampler {
|
|
private:
|
|
SwrContext* _swrContext;
|
|
int _dstChannelCount;
|
|
int _dstChannelLayout;
|
|
AVSampleFormat _dstSampleFormat;
|
|
int _dstSampleRate;
|
|
|
|
public:
|
|
Resampler(int inChannelCount, int inChannelLayout, int inSampleRate, AVSampleFormat inSampleFormat,
|
|
int outChannelCount, int outChannelLayout, int outSampleRate, AVSampleFormat outSampleFormat);
|
|
Resampler(CodecPtr decoder, CodecPtr encoder);
|
|
~Resampler();
|
|
|
|
FramePtr resample(FramePtr inFrame);
|
|
static bool needResampling(CodecPtr decoder, CodecPtr encoder);
|
|
};
|
|
|
|
}
|
|
|
|
#endif //FFCONV_RESAMPLER_H
|