X-Git-Url: https://git.sesse.net/?p=nageru;a=blobdiff_plain;f=audio_encoder.h;h=93adbafce954d6188f3d5ca86770ff7dace53f6c;hp=682cc47414698973e26646e260c8e3e2f1001c63;hb=refs%2Fheads%2Fcef;hpb=2804eb55c7d4f9f6d70203d106d0f1e69b19c2ee diff --git a/audio_encoder.h b/audio_encoder.h index 682cc47..93adbaf 100644 --- a/audio_encoder.h +++ b/audio_encoder.h @@ -3,20 +3,25 @@ #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); + AudioEncoder(const std::string &codec_name, int bit_rate, const AVOutputFormat *oformat); ~AudioEncoder(); void add_mux(Mux *mux) { // Does not take ownership. @@ -25,7 +30,7 @@ public: 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);