]> git.sesse.net Git - nageru/blobdiff - mux.h
Make it possible for file and HTTP streams to use different audio codecs.
[nageru] / mux.h
diff --git a/mux.h b/mux.h
index 2aefffcfeae704736a2ab1b8b3fd25593d1b1756..d818bdab8b8b92e24b481ea88cfcdba0d53f4cbc 100644 (file)
--- a/mux.h
+++ b/mux.h
@@ -9,16 +9,23 @@ extern "C" {
 #include <libavformat/avio.h>
 }
 
-class Mux {
+class PacketDestination {
+public:
+       virtual ~PacketDestination() {}
+       virtual void add_packet(const AVPacket &pkt, int64_t pts, int64_t dts) = 0;
+};
+
+class Mux : public PacketDestination {
 public:
        enum Codec {
                CODEC_H264,
                CODEC_NV12,  // Uncompressed 4:2:0.
        };
 
-       Mux(AVFormatContext *avctx, int width, int height, Codec video_codec, int time_base);  // Takes ownership of avctx.
+       // Takes ownership of avctx.
+       Mux(AVFormatContext *avctx, int width, int height, Codec video_codec, int time_base, int bit_rate);
        ~Mux();
-       void add_packet(const AVPacket &pkt, int64_t pts, int64_t dts);
+       void add_packet(const AVPacket &pkt, int64_t pts, int64_t dts) override;
 
 private:
        bool seen_keyframe = false;