]> git.sesse.net Git - nageru/blobdiff - httpd.h
Pull the Mux class out of HTTPD. (First step towards decoupling file and HTTP muxing.)
[nageru] / httpd.h
diff --git a/httpd.h b/httpd.h
index f5bf55f411574ab20dafc47bb9635728019a45fc..d5c805c0741f588df61e73ceecb999b3bcba0d01 100644 (file)
--- a/httpd.h
+++ b/httpd.h
@@ -27,6 +27,8 @@ extern "C" {
 #include <libavformat/avio.h>
 }
 
+#include "mux.h"
+
 class HTTPD {
 public:
        enum PacketDestination {
@@ -60,26 +62,10 @@ private:
 
        void request_completed(struct MHD_Connection *connection, void **con_cls, enum MHD_RequestTerminationCode toe);
 
-       class Mux {
-       public:
-               enum Codec {
-                       CODEC_H264,
-                       CODEC_NV12,  // Uncompressed 4:2:0.
-               };
-
-               Mux(AVFormatContext *avctx, int width, int height, Codec codec);  // Takes ownership of avctx.
-               ~Mux();
-               void add_packet(const AVPacket &pkt, int64_t pts, int64_t dts);
-
-       private:
-               bool seen_keyframe = false;
-               AVFormatContext *avctx;
-               AVStream *avstream_video, *avstream_audio;
-       };
 
        class Stream {
        public:
-               Stream(AVOutputFormat *oformat, int width, int height);
+               Stream(AVOutputFormat *oformat, int width, int height, int time_base);
 
                static ssize_t reader_callback_thunk(void *cls, uint64_t pos, char *buf, size_t max);
                ssize_t reader_callback(uint64_t pos, char *buf, size_t max);