stream_index = servers->lookup_stream_by_url(stream_config.url);
assert(stream_index != -1);
servers->set_backlog_size(stream_index, stream_config.backlog_size);
+ servers->set_prebuffering_bytes(stream_index, stream_config.prebuffering_bytes);
servers->set_encoding(stream_index,
Stream::Encoding(stream_config.encoding));
}
assert(stream_index >= 0 && stream_index < ssize_t(streams.size()));
streams[stream_index]->set_backlog_size(new_size);
}
+
+void Server::set_prebuffering_bytes(int stream_index, size_t new_amount)
+{
+ MutexLock lock(&mutex);
+ assert(stream_index >= 0 && stream_index < ssize_t(streams.size()));
+ streams[stream_index]->prebuffering_bytes = new_amount;
+}
void Server::set_encoding(int stream_index, Stream::Encoding encoding)
{
int add_stream_from_serialized(const StreamProto &stream, int data_fd);
int lookup_stream_by_url(const std::string &url) const;
void set_backlog_size(int stream_index, size_t new_size);
+ void set_prebuffering_bytes(int stream_index, size_t new_amount);
void set_encoding(int stream_index, Stream::Encoding encoding);
private:
}
}
+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) {
// Changes the given stream's backlog size on all the servers.
void set_backlog_size(int stream_index, size_t new_size);
+ // Changes the given stream's amount of forced prebuffering on all the servers.
+ void set_prebuffering_bytes(int stream_index, size_t new_amount);
+
// Changes the given stream's encoding type on all the servers.
void set_encoding(int stream_index, Stream::Encoding encoding);