X-Git-Url: https://git.sesse.net/?p=cubemap;a=blobdiff_plain;f=serverpool.cpp;h=a834e8c539eec3fadc0abbea91b7188a7da1b263;hp=70f8658f3e5ec3400a43f8815e5baa7eb347e38f;hb=d72af7eae68766b62560bdb171302bcc44d98ec2;hpb=5cc8cd703a637e276c2595953878fd9561592bfa diff --git a/serverpool.cpp b/serverpool.cpp index 70f8658..a834e8c 100644 --- a/serverpool.cpp +++ b/serverpool.cpp @@ -73,14 +73,14 @@ int ServerPool::lookup_stream_by_url(const std::string &url) const return servers[0].lookup_stream_by_url(url); } -int ServerPool::add_stream(const string &url, size_t backlog_size, Stream::Encoding encoding) +int ServerPool::add_stream(const string &url, size_t backlog_size, size_t prebuffering_bytes, Stream::Encoding encoding) { // Adding more HTTP streams after UDP streams would cause the UDP stream // indices to move around, which is obviously not good. assert(udp_streams.empty()); for (int i = 0; i < num_servers; ++i) { - int stream_index = servers[i].add_stream(url, backlog_size, encoding); + int stream_index = servers[i].add_stream(url, backlog_size, prebuffering_bytes, encoding); assert(stream_index == num_http_streams); } return num_http_streams++; @@ -121,9 +121,9 @@ int ServerPool::add_stream_from_serialized(const StreamProto &stream, const vect return num_http_streams++; } -int ServerPool::add_udpstream(const sockaddr_in6 &dst, int pacing_rate) +int ServerPool::add_udpstream(const sockaddr_in6 &dst, int pacing_rate, int ttl, int multicast_iface_index) { - udp_streams.push_back(new UDPStream(dst, pacing_rate)); + udp_streams.push_back(new UDPStream(dst, pacing_rate, ttl, multicast_iface_index)); return num_http_streams + udp_streams.size() - 1; } @@ -201,6 +201,13 @@ void ServerPool::set_backlog_size(int stream_index, size_t new_size) } } +void ServerPool::set_prebuffering_bytes(int stream_index, size_t new_amount) +{ + for (int i = 0; i < num_servers; ++i) { + servers[i].set_prebuffering_bytes(stream_index, new_amount); + } +} + void ServerPool::set_encoding(int stream_index, Stream::Encoding encoding) { for (int i = 0; i < num_servers; ++i) {