4 // Wrapper around an AVFormat mux.
7 #include <libavcodec/avcodec.h>
8 #include <libavformat/avformat.h>
9 #include <libavformat/avio.h>
12 class PacketDestination {
14 virtual ~PacketDestination() {}
15 virtual void add_packet(const AVPacket &pkt, int64_t pts, int64_t dts) = 0;
18 class Mux : public PacketDestination {
22 CODEC_NV12, // Uncompressed 4:2:0.
25 // Takes ownership of avctx.
26 Mux(AVFormatContext *avctx, int width, int height, Codec video_codec, const AVCodec *codec_audio, int time_base, int bit_rate);
28 void add_packet(const AVPacket &pkt, int64_t pts, int64_t dts) override;
31 bool seen_keyframe = false;
32 AVFormatContext *avctx;
33 AVStream *avstream_video, *avstream_audio;
36 #endif // !defined(_MUX_H)