summaryrefslogtreecommitdiffstats
path: root/src/DabMux.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2015-07-03 08:51:42 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2015-07-03 08:51:42 +0200
commit85853c4ae5e48359feac44370b4c0f05fbb23147 (patch)
treec8f72bf013f6a9b687c5c5d0f4622f24a3cff983 /src/DabMux.cpp
parent93cb9dc6d1492ac2ed58c24a016b579813177a13 (diff)
downloaddabmux-85853c4ae5e48359feac44370b4c0f05fbb23147.tar.gz
dabmux-85853c4ae5e48359feac44370b4c0f05fbb23147.tar.bz2
dabmux-85853c4ae5e48359feac44370b4c0f05fbb23147.zip
Move some EDI things around
Diffstat (limited to 'src/DabMux.cpp')
-rw-r--r--src/DabMux.cpp45
1 files changed, 13 insertions, 32 deletions
diff --git a/src/DabMux.cpp b/src/DabMux.cpp
index a8f674b..20dc31d 100644
--- a/src/DabMux.cpp
+++ b/src/DabMux.cpp
@@ -299,6 +299,8 @@ int main(int argc, char *argv[])
" starting up";
+ edi_configuration_t edi_conf;
+
/******************** READ OUTPUT PARAMETERS ***************/
set<string> all_output_names;
ptree pt_outputs = pt.get_child("outputs");
@@ -319,15 +321,19 @@ int main(int argc, char *argv[])
#if HAVE_OUTPUT_EDI
ptree pt_edi = pt_outputs.get_child("edi");
- edi->enabled = true;
+ edi_conf.enabled = true;
+
+ edi_conf.dest_addr = pt_edi.get<string>("destination");
+ edi_conf.dest_port = pt_edi.get<unsigned int>("port");
+ edi_conf.source_port = pt_edi.get<unsigned int>("sourceport");
- edi->dest_addr = pt_edi.get<string>("destination");
- edi->dest_port = pt_edi.get<unsigned int>("port");
- edi->source_port = pt_edi.get<unsigned int>("sourceport");
+ edi_conf.dump = pt_edi.get<bool>("dump");
+ edi_conf.enable_pft = pt_edi.get<bool>("enable_pft");
+ edi_conf.verbose = pt_edi.get<bool>("verbose");
- edi->dump = pt_edi.get<bool>("dump");
- edi->enable_pft = pt_edi.get<bool>("enable_pft");
- edi->verbose = pt_edi.get<bool>("verbose");
+ mux.set_edi_config(edi_conf);
+#else
+ throw runtime_error("EDI output not compiled in");
#endif
}
else {
@@ -424,31 +430,6 @@ int main(int argc, char *argv[])
etiLog.level(info) << "source port " << edi_conf.source_port;
etiLog.level(info) << "verbose " << edi_conf.verbose;
}
-
-
- if (edi_conf.verbose) {
- etiLog.log(info, "Setup EDI debug");
- }
- std::ofstream edi_debug_file;
-
- if (edi_conf.dump) {
- edi_debug_file.open("./edi.debug");
- }
- UdpSocket edi_output;
-
- if (edi_conf.enabled) {
- edi_output.create(edi_conf.source_port);
- }
-
- if (edi_conf.verbose) {
- etiLog.log(info, "EDI debug set up");
- }
-
- // The TagPacket will then be placed into an AFPacket
- AFPacketiser edi_afPacketiser(edi_conf.verbose);
-
- // The AF Packet will be protected with reed-solomon and split in fragments
- PFT edi_pft(207, 3, edi_conf);
#endif
size_t limit = pt.get("general.nbframes", 0);