X-Git-Url: https://git.sesse.net/?p=cubemap;a=blobdiff_plain;f=server.h;h=a3e032d88f71a2f66b9613781d64053a6f32b143;hp=343adf9bfd28f1513fcd6c9ccbec011919b9e147;hb=5cd46e39b4063d94f6dc559ae350beeb8406a8f9;hpb=195dc469133d0daed6ac69cdef373dc8dade9637 diff --git a/server.h b/server.h index 343adf9..a3e032d 100644 --- a/server.h +++ b/server.h @@ -1,17 +1,23 @@ #ifndef _SERVER_H #define _SERVER_H 1 -#include #include +#include +#include #include +#include #include -#include #include +#include #include #include "client.h" +#include "stream.h" #include "thread.h" +class ClientProto; +struct Stream; + #define EPOLL_MAX_EVENTS 8192 #define EPOLL_TIMEOUT_MS 20 #define MAX_CLIENT_REQUEST 16384 @@ -29,7 +35,9 @@ public: std::vector get_client_stats() const; // Set header (both HTTP header and any stream headers) for the given stream. - void set_header(const std::string &stream_id, const std::string &header); + void set_header(const std::string &stream_id, + const std::string &http_header, + const std::string &stream_header); // Set that the given stream should use the given mark pool from now on. // NOTE: This should be set before any clients are connected! @@ -46,8 +54,10 @@ public: // at the same time). CubemapStateProto serialize(); void add_client_from_serialized(const ClientProto &client); - void add_stream(const std::string &stream_id, size_t bytes_received); - void add_stream_from_serialized(const StreamProto &stream); + void add_stream(const std::string &stream_id, size_t bytes_received, Stream::Encoding encoding); + void add_stream_from_serialized(const StreamProto &stream, int data_fd); + void set_backlog_size(const std::string &stream_id, size_t new_size); + void set_encoding(const std::string &stream_id, Stream::Encoding encoding); private: // Mutex protecting queued_data only. Note that if you want to hold both this @@ -118,7 +128,6 @@ private: void process_queued_data(); void add_client(int sock); - void add_data(const std::string &stream_id, const char *data, ssize_t bytes); }; #endif // !defined(_SERVER_H)