#ifndef FFCONV_RESAMPLER_H #define FFCONV_RESAMPLER_H #include "Frame.h" #include "Codec.h" extern "C" { #include } namespace ffcpp { typedef std::shared_ptr 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