4 // Wrapper around an AVFormat mux.
7 #include <libavcodec/avcodec.h>
8 #include <libavformat/avformat.h>
9 #include <libavformat/avio.h>
14 class KeyFrameSignalReceiver {
16 // Needs to automatically turn the flag off again after actually receiving data.
17 virtual void signal_keyframe() = 0;
24 CODEC_NV12, // Uncompressed 4:2:0.
27 // Takes ownership of avctx. <keyframe_signal_receiver> can be nullptr.
28 Mux(AVFormatContext *avctx, int width, int height, Codec video_codec, const AVCodec *codec_audio, int time_base, int bit_rate, KeyFrameSignalReceiver *keyframe_signal_receiver);
30 void add_packet(const AVPacket &pkt, int64_t pts, int64_t dts);
34 AVFormatContext *avctx; // Protected by <ctx_mu>.
35 AVStream *avstream_video, *avstream_audio;
36 KeyFrameSignalReceiver *keyframe_signal_receiver;
39 #endif // !defined(_MUX_H)