summaryrefslogtreecommitdiffstats
path: root/contrib/edioutput/Transport.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2022-08-19 17:19:03 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2022-08-19 17:19:03 +0200
commit4c4c53c954fdb5d1a78aac23e1ac33e311f9924b (patch)
treefeef32b569ff6c30d40d75c424f15849e033fa6e /contrib/edioutput/Transport.cpp
parent5ba01f05ecfcf5990da3eaf4cae02679590890c6 (diff)
downloadODR-AudioEnc-4c4c53c954fdb5d1a78aac23e1ac33e311f9924b.tar.gz
ODR-AudioEnc-4c4c53c954fdb5d1a78aac23e1ac33e311f9924b.tar.bz2
ODR-AudioEnc-4c4c53c954fdb5d1a78aac23e1ac33e311f9924b.zip
Common c23bfcb, fe2a905, 036201c with socket changes
Diffstat (limited to 'contrib/edioutput/Transport.cpp')
-rw-r--r--contrib/edioutput/Transport.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/contrib/edioutput/Transport.cpp b/contrib/edioutput/Transport.cpp
index 5d34814..a870aa0 100644
--- a/contrib/edioutput/Transport.cpp
+++ b/contrib/edioutput/Transport.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2020
+ Copyright (C) 2022
Matthias P. Braendli, matthias.braendli@mpb.li
http://www.opendigitalradio.org
@@ -66,7 +66,7 @@ Sender::Sender(const configuration_t& conf) :
edi_pft(m_conf)
{
if (m_conf.verbose) {
- etiLog.log(info, "Setup EDI Output");
+ etiLog.level(info) << "Setup EDI Output, TCP output preroll " << m_conf.tcp_server_preroll_buffers;
}
for (const auto& edi_dest : m_conf.destinations) {
@@ -81,7 +81,9 @@ Sender::Sender(const configuration_t& conf) :
udp_sockets.emplace(udp_dest.get(), udp_socket);
}
else if (auto tcp_dest = dynamic_pointer_cast<edi::tcp_server_t>(edi_dest)) {
- auto dispatcher = make_shared<Socket::TCPDataDispatcher>(tcp_dest->max_frames_queued);
+ auto dispatcher = make_shared<Socket::TCPDataDispatcher>(
+ tcp_dest->max_frames_queued, m_conf.tcp_server_preroll_buffers);
+
dispatcher->start(tcp_dest->listen_port, "0.0.0.0");
tcp_dispatchers.emplace(tcp_dest.get(), dispatcher);
}
@@ -135,9 +137,10 @@ void Sender::write(const AFPacket& af_packet)
// Apply PFT layer to AF Packet (Reed Solomon FEC and Fragmentation)
vector<edi::PFTFragment> edi_fragments = edi_pft.Assemble(af_packet);
- if (m_conf.verbose) {
- fprintf(stderr, "EDI Output: Number of PFT fragments %zu\n",
+ if (m_conf.verbose and m_last_num_pft_fragments != edi_fragments.size()) {
+ etiLog.log(debug, "EDI Output: Number of PFT fragments %zu\n",
edi_fragments.size());
+ m_last_num_pft_fragments = edi_fragments.size();
}
/* Spread out the transmission of all fragments over part of the 24ms AF packet duration