From 51491533a312884862849082b3507e49c1829d22 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 4 Nov 2016 14:27:50 +0100 Subject: Add new UDP input --- src/ConfigParser.cpp | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) (limited to 'src/ConfigParser.cpp') 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(); } @@ -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(); + } 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!"; -- cgit v1.2.3