ffconv/include/ffcpp/Resampler.h

33 lines
697 B
C++

#ifndef FFCONV_RESAMPLER_H
#define FFCONV_RESAMPLER_H
#include "Frame.h"
#include "Codec.h"
extern "C" {
#include <libswresample/swresample.h>
}
namespace ffcpp {
class Resampler {
private:
SwrContext* _swrContext;
int _dstChannelLayout;
AVSampleFormat _dstSampleFormat;
int _dstSampleRate;
public:
Resampler(int inChannelLayout, int inSampleRate, AVSampleFormat inSampleFormat,
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