- vector<Input *> inputs;
- for (unsigned i = 0; i < config.size(); ++i) {
- if (config[i].keyword != "stream") {
- continue;
- }
- assert(config[i].arguments.size() == 1);
- string stream_id = config[i].arguments[0];
-
- map<string, string>::const_iterator src_it =
- config[i].parameters.find("src");
- if (src_it == config[i].parameters.end()) {
- fprintf(stderr, "WARNING: stream '%s' has no src= attribute, clients will not get any data.\n",
- stream_id.c_str());
- continue;
- }
-
- string src = src_it->second;
- Input *input = NULL;
- map<string, Input *>::iterator deserialized_input_it =
- deserialized_inputs->find(stream_id);
- if (deserialized_input_it != deserialized_inputs->end()) {
- input = deserialized_input_it->second;
- if (input->get_url() != src) {
- fprintf(stderr, "INFO: Stream '%s' has changed URL from '%s' to '%s', restarting input.\n",
- stream_id.c_str(), input->get_url().c_str(), src.c_str());
- delete input;
- input = NULL;
- }
- deserialized_inputs->erase(deserialized_input_it);
- }
- if (input == NULL) {
- input = new Input(stream_id, src);
- }
- input->run();
- inputs.push_back(input);
+ for (unsigned i = 0; i < config.streams.size(); ++i) {
+ const StreamConfig &stream_config = config.streams[i];
+ create_config_input(stream_config.src, inputs);
+ }
+ for (unsigned i = 0; i < config.udpstreams.size(); ++i) {
+ const UDPStreamConfig &udpstream_config = config.udpstreams[i];
+ create_config_input(udpstream_config.src, inputs);