X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=audio_encoder.h;h=93adbafce954d6188f3d5ca86770ff7dace53f6c;hb=e284d1c7a2e18ee7e4aea082c4a57a3504a0f5e8;hp=c49cf9f761a0e3b0ebf3263242e460d46eafdcdb;hpb=8e3e40723b72bbf0c233167cee60b4959d6b08e7;p=nageru diff --git a/audio_encoder.h b/audio_encoder.h index c49cf9f..93adbaf 100644 --- a/audio_encoder.h +++ b/audio_encoder.h @@ -3,26 +3,34 @@ #ifndef _AUDIO_ENCODER_H #define _AUDIO_ENCODER_H 1 +#include +#include #include #include extern "C" { #include +#include #include #include } -#include "mux.h" +#include "ffmpeg_raii.h" + +class Mux; class AudioEncoder { public: - AudioEncoder(const std::string &codec_name, int bit_rate, const std::vector &muxes); + AudioEncoder(const std::string &codec_name, int bit_rate, const AVOutputFormat *oformat); ~AudioEncoder(); + void add_mux(Mux *mux) { // Does not take ownership. + muxes.push_back(mux); + } void encode_audio(const std::vector &audio, int64_t audio_pts); void encode_last_audio(); - const AVCodec *get_codec() { return ctx->codec; } + AVCodecParametersWithDeleter get_codec_parameters(); private: void encode_audio_one_frame(const float *audio, size_t num_samples, int64_t audio_pts);