// A class dealing with stream output to HTTP.
-#include <stddef.h>
-#include <stdint.h>
-#include <sys/types.h>
#include <atomic>
#include <condition_variable>
#include <deque>
#include <functional>
#include <mutex>
#include <set>
+#include <stddef.h>
+#include <stdint.h>
#include <string>
+#include <sys/types.h>
#include <unordered_map>
#include <utility>
~HTTPD();
// Should be called before start().
- void set_header(const std::string &data) {
+ void set_header(const std::string &data)
+ {
header = data;
}
NO_CORS_POLICY,
ALLOW_ALL_ORIGINS
};
- void add_endpoint(const std::string &url, const EndpointCallback &callback, CORSPolicy cors_policy) {
+ void add_endpoint(const std::string &url, const EndpointCallback &callback, CORSPolicy cors_policy)
+ {
endpoints[url] = Endpoint{ callback, cors_policy };
}
void start(int port);
void stop();
void add_data(const char *buf, size_t size, bool keyframe, int64_t time, AVRational timebase);
- int64_t get_num_connected_clients() const {
+ int64_t get_num_connected_clients() const
+ {
return metric_num_connected_clients.load();
}