]> git.sesse.net Git - nageru/blobdiff - httpd.h
Hook up the OK button in the about dialog.
[nageru] / httpd.h
diff --git a/httpd.h b/httpd.h
index 524c8d61637e41fd059732271dc0d5d5938f82cd..e8efc030b4706d92b64e89e7ea748c056d8f7c85 100644 (file)
--- a/httpd.h
+++ b/httpd.h
@@ -9,22 +9,34 @@
 // way, namely having one ffmpeg mux per output.
 
 #include <microhttpd.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <sys/types.h>
+#include <condition_variable>
 #include <deque>
-#include <string>
+#include <memory>
 #include <mutex>
-#include <condition_variable>
+#include <string>
 #include <vector>
 
+struct MHD_Connection;
+
 extern "C" {
+#include <libavcodec/avcodec.h>
 #include <libavformat/avformat.h>
+#include <libavformat/avio.h>
 }
 
 class HTTPD {
 public:
-       HTTPD(const char *output_filename, int width, int height);
+       HTTPD(int width, int height);
        void start(int port);
        void add_packet(const AVPacket &pkt, int64_t pts, int64_t dts);
 
+       // You can only have one going at the same time.
+       void open_output_file(const std::string &filename);
+       void close_output_file();
+
 private:
        static int answer_to_connection_thunk(void *cls, MHD_Connection *connection,
                                              const char *url, const char *method,
@@ -62,7 +74,6 @@ private:
                static int write_packet_thunk(void *opaque, uint8_t *buf, int buf_size);
                int write_packet(uint8_t *buf, int buf_size);
 
-               AVIOContext *avio;
                std::unique_ptr<Mux> mux;
 
                std::mutex buffer_mutex;