+ create_config_input(stream_config.src, Input::Encoding(stream_config.src_encoding), inputs);
+ }
+ for (const UDPStreamConfig &udpstream_config : config.udpstreams) {
+ create_config_input(udpstream_config.src, Input::INPUT_ENCODING_RAW, 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 (const StreamConfig &stream_config : config.streams) {
+ int stream_index;
+
+ expecting_urls.erase(stream_config.url);
+
+ if (stream_config.src == "delete") {
+ // Ignored for pre-1.4.0 configuration compatibility.
+ continue;
+ }
+
+ if (deserialized_urls.count(stream_config.url) == 0) {
+ stream_index = servers->add_stream(stream_config.url,
+ stream_config.hls_url,
+ stream_config.backlog_size,
+ stream_config.prebuffering_bytes,
+ Stream::Encoding(stream_config.encoding),
+ Stream::Encoding(stream_config.src_encoding),
+ stream_config.hls_frag_duration,
+ stream_config.hls_backlog_margin,
+ stream_config.allow_origin);
+ } 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);
+ if (!stream_config.hls_url.empty()) {
+ servers->register_hls_url(stream_index, stream_config.hls_url);
+ }
+ 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));
+ servers->set_hls_frag_duration(stream_index, stream_config.hls_frag_duration);
+ servers->set_hls_backlog_margin(stream_index, stream_config.hls_backlog_margin);
+ servers->set_allow_origin(stream_index, stream_config.allow_origin);