+ }
+ for (unsigned i = 0; i < config.udpstreams.size(); ++i) {
+ const UDPStreamConfig &udpstream_config = config.udpstreams[i];
+ create_config_input(udpstream_config.src, Input::Encoding(udpstream_config.src_encoding), inputs);
+ }
+}
+
+void create_streams(const Config &config,
+ const set<string> &deserialized_urls,
+ multimap<InputKey, InputWithRefcount> *inputs)
+{
+ // HTTP streams.
+ set<string> expecting_urls = deserialized_urls;
+ for (unsigned i = 0; i < config.streams.size(); ++i) {
+ const StreamConfig &stream_config = config.streams[i];
+ int stream_index;
+
+ expecting_urls.erase(stream_config.url);
+
+ // Special-case deleted streams; they were never deserialized in the first place,
+ // so just ignore them.
+ if (stream_config.src == "delete") {
+ continue;
+ }
+
+ if (deserialized_urls.count(stream_config.url) == 0) {
+ stream_index = servers->add_stream(stream_config.url,
+ stream_config.backlog_size,
+ stream_config.prebuffering_bytes,
+ Stream::Encoding(stream_config.encoding),
+ Stream::Encoding(stream_config.src_encoding));
+ } else {
+ 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));
+ servers->set_src_encoding(stream_index,
+ Stream::Encoding(stream_config.src_encoding));