aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/edi/Transport.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2019-08-21 10:08:51 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2019-08-21 10:08:51 +0200
commitfa5f92318e7cc08ac872be18d47387cf83c23cd0 (patch)
tree118b12cf95b478fd20916f745c0d1a7873e16040 /contrib/edi/Transport.cpp
parent781c2c69c62a434bed64ff3cfa6d009ed3c479c1 (diff)
downloadODR-AudioEnc-fa5f92318e7cc08ac872be18d47387cf83c23cd0.tar.gz
ODR-AudioEnc-fa5f92318e7cc08ac872be18d47387cf83c23cd0.tar.bz2
ODR-AudioEnc-fa5f92318e7cc08ac872be18d47387cf83c23cd0.zip
Add tist support for EDI output, take code from odr-mmbtools-common
Diffstat (limited to 'contrib/edi/Transport.cpp')
-rw-r--r--contrib/edi/Transport.cpp40
1 files changed, 19 insertions, 21 deletions
diff --git a/contrib/edi/Transport.cpp b/contrib/edi/Transport.cpp
index c2fb2a7..0d5c237 100644
--- a/contrib/edi/Transport.cpp
+++ b/contrib/edi/Transport.cpp
@@ -9,25 +9,23 @@
*/
/*
- This file is part of ODR-DabMux.
+ This file is part of the ODR-mmbTools.
- ODR-DabMux is free software: you can redistribute it and/or modify
+ This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
- ODR-DabMux is distributed in the hope that it will be useful,
+ This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with ODR-DabMux. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "edi/Transport.h"
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+#include "Transport.h"
#include <iterator>
-#include <iostream>
using namespace std;
@@ -35,31 +33,31 @@ namespace edi {
void configuration_t::print() const
{
- clog << "EDI" << endl;
- clog << " verbose " << verbose << endl;
+ etiLog.level(info) << "EDI";
+ etiLog.level(info) << " verbose " << verbose;
for (auto edi_dest : destinations) {
if (auto udp_dest = dynamic_pointer_cast<edi::udp_destination_t>(edi_dest)) {
- clog << " UDP to " << udp_dest->dest_addr << ":" << dest_port << endl;
+ etiLog.level(info) << " UDP to " << udp_dest->dest_addr << ":" << dest_port;
if (not udp_dest->source_addr.empty()) {
- clog << " source " << udp_dest->source_addr << endl;
- clog << " ttl " << udp_dest->ttl << endl;
+ etiLog.level(info) << " source " << udp_dest->source_addr;
+ etiLog.level(info) << " ttl " << udp_dest->ttl;
}
- clog << " source port " << udp_dest->source_port << endl;
+ etiLog.level(info) << " source port " << udp_dest->source_port;
}
else if (auto tcp_dest = dynamic_pointer_cast<edi::tcp_server_t>(edi_dest)) {
- clog << " TCP listening on port " << tcp_dest->listen_port << endl;
- clog << " max frames queued " << tcp_dest->max_frames_queued << endl;
+ etiLog.level(info) << " TCP listening on port " << tcp_dest->listen_port;
+ etiLog.level(info) << " max frames queued " << tcp_dest->max_frames_queued;
}
else if (auto tcp_dest = dynamic_pointer_cast<edi::tcp_client_t>(edi_dest)) {
- clog << " TCP client connecting to " << tcp_dest->dest_addr << ":" << tcp_dest->dest_port << endl;
- clog << " max frames queued " << tcp_dest->max_frames_queued << endl;
+ etiLog.level(info) << " TCP client connecting to " << tcp_dest->dest_addr << ":" << tcp_dest->dest_port;
+ etiLog.level(info) << " max frames queued " << tcp_dest->max_frames_queued;
}
else {
throw logic_error("EDI destination not implemented");
}
}
if (interleaver_enabled()) {
- clog << " interleave " << latency_frames * 24 << " ms" << endl;
+ etiLog.level(info) << " interleave " << latency_frames * 24 << " ms";
}
}
@@ -69,7 +67,7 @@ Sender::Sender(const configuration_t& conf) :
edi_pft(m_conf)
{
if (m_conf.verbose) {
- clog << "Setup EDI" << endl;
+ etiLog.log(info, "Setup EDI");
}
for (const auto& edi_dest : m_conf.destinations) {
@@ -107,7 +105,7 @@ Sender::Sender(const configuration_t& conf) :
}
if (m_conf.verbose) {
- clog << "EDI set up" << endl;
+ etiLog.log(info, "EDI set up");
}
}