X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=httpd.h;h=695c7082cd36436b8bbf345f48fd53681f924a33;hb=8201518a4a7c20c820510fa888ca22f5d9612972;hp=88aeecc8263dffc2f4bc961db424324a9744b794;hpb=4b41f5983b5196589cb1ef6fa2bc0b93d28b8732;p=nageru diff --git a/httpd.h b/httpd.h index 88aeecc..695c708 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 video_codec); // Takes ownership of avctx. ~Mux(); void add_packet(const AVPacket &pkt, int64_t pts, int64_t dts);