- // Warn about any servers we've lost.
- // TODO: Make an option (delete=yes?) to actually shut down streams.
- for (set<string>::const_iterator stream_it = expecting_stream_ids.begin();
- stream_it != expecting_stream_ids.end();
- ++stream_it) {
- string stream_id = *stream_it;
- fprintf(stderr, "WARNING: stream '%s' disappeared from the configuration file.\n",
- stream_id.c_str());
- fprintf(stderr, " It will not be deleted, but clients will not get any new inputs.\n");
- if (deserialized_inputs->count(stream_id) != 0) {
- delete (*deserialized_inputs)[stream_id];
- deserialized_inputs->erase(stream_id);
+ // UDP streams.
+ for (const UDPStreamConfig &udpstream_config : config.udpstreams) {
+ int stream_index = servers->add_udpstream(
+ udpstream_config.dst,
+ udpstream_config.pacing_rate,
+ udpstream_config.ttl,
+ udpstream_config.multicast_iface_index);
+
+ string src = udpstream_config.src;
+ if (!src.empty()) {
+ auto input_it = inputs->find(make_pair(src, Input::INPUT_ENCODING_RAW));
+ assert(input_it != inputs->end());
+ input_it->second.input->add_destination(stream_index);
+ ++input_it->second.refcount;
+ }
+ }
+
+ // HTTP gen204 endpoints.
+ for (const Gen204Config &ping_config : config.pings) {
+ servers->add_gen204(ping_config.url, ping_config.allow_origin);
+ }
+}
+
+void open_logs(const vector<LogConfig> &log_destinations)
+{
+ for (const LogConfig &log_destination : log_destinations) {
+ if (log_destination.type == LogConfig::LOG_TYPE_FILE) {
+ add_log_destination_file(log_destination.filename);
+ } else if (log_destination.type == LogConfig::LOG_TYPE_CONSOLE) {
+ add_log_destination_console();
+ } else if (log_destination.type == LogConfig::LOG_TYPE_SYSLOG) {
+ add_log_destination_syslog();
+ } else {
+ assert(false);