summaryrefslogtreecommitdiffstats
path: root/src/ConfigParser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ConfigParser.cpp')
-rw-r--r--src/ConfigParser.cpp30
1 files changed, 22 insertions, 8 deletions
diff --git a/src/ConfigParser.cpp b/src/ConfigParser.cpp
index 2a8d3da..e48200a 100644
--- a/src/ConfigParser.cpp
+++ b/src/ConfigParser.cpp
@@ -56,6 +56,7 @@
#include "input/Prbs.h"
#include "input/Zmq.h"
#include "input/File.h"
+#include "input/Udp.h"
#ifdef _WIN32
@@ -922,16 +923,15 @@ static void setup_subchannel_from_ptree(DabSubchannel* subchan,
dabProtection* protection = &subchan->protection;
const bool nonblock = pt.get("nonblock", false);
+ if (nonblock) {
+ etiLog.level(warn) << "The nonblock option is not supported";
+ }
if (type == "dabplus" or type == "audio") {
subchan->type = subchannel_type_t::Audio;
subchan->bitrate = 0;
if (proto == "file") {
- if (nonblock) {
- // TODO
- }
-
if (type == "audio") {
subchan->input = make_shared<Inputs::MPEGFile>();
}
@@ -946,10 +946,6 @@ static void setup_subchannel_from_ptree(DabSubchannel* subchan,
proto == "epgm" ||
proto == "ipc") {
- if (nonblock) {
- etiLog.level(warn) << "The nonblock option is meaningless for the zmq input";
- }
-
auto zmqconfig = setup_zmq_input(pt, subchanuid);
if (type == "audio") {
@@ -983,6 +979,24 @@ static void setup_subchannel_from_ptree(DabSubchannel* subchan,
subchan->type = subchannel_type_t::DataDmb;
subchan->bitrate = DEFAULT_DATA_BITRATE;
}
+ else if (type == "data") {
+ if (proto == "udp") {
+ subchan->input = make_shared<Inputs::Udp>();
+ } else if (proto == "file") {
+ // TODO
+ } else if (proto == "fifo") {
+ // TODO
+ } else {
+ stringstream ss;
+ ss << "Subchannel with uid " << subchanuid <<
+ ": Invalid protocol for data input (" <<
+ proto << ")" << endl;
+ throw runtime_error(ss.str());
+ }
+
+ subchan->type = subchannel_type_t::DataDmb;
+ subchan->bitrate = DEFAULT_DATA_BITRATE;
+ }
else {
stringstream ss;
ss << "Subchannel with uid " << subchanuid << " has unknown type!";