]> git.sesse.net Git - nageru/blobdiff - nageru/audio_encoder.h
IWYU-fix nageru/*.h.
[nageru] / nageru / audio_encoder.h
index 3a47f99afb0c3fe2cc792af12152312919017b39..49cead7c4851dee82097fb2caed462373283ba6e 100644 (file)
@@ -3,12 +3,14 @@
 #ifndef _AUDIO_ENCODER_H
 #define _AUDIO_ENCODER_H 1
 
+#include <assert.h>
 #include <stddef.h>
 #include <stdint.h>
 #include <string>
 #include <vector>
 
 extern "C" {
+#include <libavcodec/codec.h>
 #include <libavcodec/avcodec.h>
 #include <libavformat/avformat.h>
 #include <libswresample/swresample.h>
@@ -25,11 +27,13 @@ public:
        ~AudioEncoder();
 
        void add_mux(Mux *mux) {  // Does not take ownership.
+               assert(mux != nullptr);
                muxes.push_back(mux);
        }
        void encode_audio(const std::vector<float> &audio, int64_t audio_pts);
        void encode_last_audio();
 
+       const AVCodec *get_codec() const { return ctx->codec; }
        AVCodecParametersWithDeleter get_codec_parameters();
 
 private: