From c1cb78d574c0429aa5e3ff3a2b3886e4bc153212 Mon Sep 17 00:00:00 2001 From: bbergeron Date: Wed, 3 Apr 2024 17:32:01 -0400 Subject: Reset Git repo and use a pseudonym to sign commits I used to sign my commits with my real name and my personal email address, which I wanted scrubbed off the "B." pseudosphere. Re-creating a new git repository was safer than simpler than re-writing the history (although the latter could've also worked but, oh well). --- audio/resampler.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 audio/resampler.h (limited to 'audio/resampler.h') diff --git a/audio/resampler.h b/audio/resampler.h new file mode 100644 index 0000000..0bb471c --- /dev/null +++ b/audio/resampler.h @@ -0,0 +1,31 @@ +#ifndef AUDIO_RESAMPLER_H_ +#define AUDIO_RESAMPLER_H_ + +#include +#include +#include +#include "decoder.h" +#include "encoder.h" + +struct Resampler { + SwrContext *swr; + uint64_t stored; + uint64_t needed; + int in_sample_rate; + + /* Passed by *_init, used by *_conf */ + const AVChannelLayout *out_chlayout; + enum AVSampleFormat out_sample_fmt; + uint64_t out_sample_rate; + uint64_t out_frame_size; +}; + +int resampler_init_for_encoder (struct Resampler *resampler, const struct Encoder *encoder); +int resampler_conf_for_decoder (struct Resampler *resampler, const struct Decoder *decoder); +int resampler_send_frame (struct Resampler *resampler, AVFrame *in); +int resampler_send_empty (struct Resampler *resampler, unsigned int microsecond); +int resampler_convert (struct Resampler *resmapler, AVFrame *out); +int resampler_has_enough (struct Resampler *resampler); +void resampler_free (struct Resampler *resampler); + +#endif // AUDIO_RESAMPLER_H_ -- cgit v1.2.3