summaryrefslogtreecommitdiffstats
path: root/src/ConfigParser.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2016-11-04 14:27:50 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2016-11-04 14:27:50 +0100
commit51491533a312884862849082b3507e49c1829d22 (patch)
tree09afd1164350517eeacb53254b33db4249b1e41b /src/ConfigParser.cpp
parent7068a697b235f1ae05bc1a5cf93e7eeefbe7a1df (diff)
downloaddabmux-51491533a312884862849082b3507e49c1829d22.tar.gz
dabmux-51491533a312884862849082b3507e49c1829d22.tar.bz2
dabmux-51491533a312884862849082b3507e49c1829d22.zip
Add new UDP input
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!";