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