X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=httpd.h;fp=httpd.h;h=f5bf55f411574ab20dafc47bb9635728019a45fc;hb=bb8cf44c90b78921e6c6b2f62e232addff78b5ed;hp=88aeecc8263dffc2f4bc961db424324a9744b794;hpb=d6c0853940f64de5b9d6b55a663db58871c6d7d9;p=nageru diff --git a/httpd.h b/httpd.h index 88aeecc..f5bf55f 100644 --- a/httpd.h +++ b/httpd.h @@ -29,9 +29,15 @@ extern "C" { class HTTPD { public: + enum PacketDestination { + DESTINATION_FILE_ONLY, + DESTINATION_HTTP_ONLY, + DESTINATION_FILE_AND_HTTP + }; + HTTPD(int width, int height); void start(int port); - void add_packet(const AVPacket &pkt, int64_t pts, int64_t dts); + void add_packet(const AVPacket &pkt, int64_t pts, int64_t dts, PacketDestination destination); // You can only have one going at the same time. void open_output_file(const std::string &filename); @@ -56,7 +62,12 @@ private: class Mux { public: - Mux(AVFormatContext *avctx, int width, int height); // Takes ownership of avctx. + 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);