From 6f528df70ca6ede847234fe58914950112f8b4b7 Mon Sep 17 00:00:00 2001 From: Tom Early Date: Tue, 7 Dec 2021 16:36:16 -0700 Subject: [PATCH] Transcoder stats reported on CCodecStream DTOR --- rconfig | 13 +++++++++++-- reflector/CodecStream.cpp | 31 ++++++++++++++++--------------- reflector/M17Protocol.cpp | 2 -- 3 files changed, 27 insertions(+), 19 deletions(-) diff --git a/rconfig b/rconfig index c0cbe83..8e2ba82 100755 --- a/rconfig +++ b/rconfig @@ -136,6 +136,11 @@ WriteSRCHFile () if [[ "$m" != true ]]; then echo "#define NO_G3" >> $file fi + if [ -n ${dbsupport+x} ]; then + if [ "$dbsupport" == true ]; then + echo "#define DEBUG" >> $file + fi + fi } WriteSRCMKFile () @@ -176,7 +181,11 @@ WriteTranscoderHFile () if [ -n ${tcaddress+x} ] && [[ "$tcaddress" != "local" ]]; then echo "#define TRANSCODER_IP \"${tcaddress}\"" >> $file fi - + if [ -n ${dbsupport+x} ]; then + if [ "$dbsupport" == true ]; then + echo "#define DEBUG" >> $file + fi + fi } WriteTranscoderMKFile () @@ -326,7 +335,7 @@ while [[ "$key" != q* ]] do clear echo - echo " Reflector Configuration, Version #211205" + echo " Reflector Configuration, Version #211207" echo echo " ******* REFLECTOR ********" echo -n "cs : Reflector Callsign = "; EvaluateVar callsign{,_d} diff --git a/reflector/CodecStream.cpp b/reflector/CodecStream.cpp index 691197a..b2bd912 100644 --- a/reflector/CodecStream.cpp +++ b/reflector/CodecStream.cpp @@ -55,6 +55,22 @@ CCodecStream::~CCodecStream() { m_Future.get(); } + + // display stats + if (m_fPingMin >= 0.0) + { + double min = m_fPingMin * 1000.0; + double max = m_fPingMax * 1000.0; + double ave = (m_fPingCount > 0) ? m_fPingSum / m_fPingCount * 1000.0 : 0.0; + auto prec = std::cout.precision(); + std::cout.precision(1); + std::cout << "Transcoder Stats (ms): " << min << "/" << ave << "/" << max << std::endl; + std::cout.precision(prec); + } + if (m_uiTimeoutPackets) + { + std::cout << m_uiTimeoutPackets << " of " << m_uiTotalPackets << " packets timed out" << std::endl; + } } //////////////////////////////////////////////////////////////////////////////////////// @@ -86,21 +102,6 @@ void CCodecStream::Thread() { Task(); } - // display stats - if (m_fPingMin >= 0.0) - { - double min = m_fPingMin * 1000.0; - double max = m_fPingMax * 1000.0; - double ave = (m_fPingCount > 0) ? m_fPingSum / m_fPingCount * 1000.0 : 0.0; - auto prec = std::cout.precision(); - std::cout.precision(1); - std::cout << "Transcoder Stats (ms): " << min << "/" << ave << "/" << max << std::endl; - std::cout.precision(prec); - } - if (m_uiTimeoutPackets) - { - std::cout << m_uiTimeoutPackets << " of " << m_uiTotalPackets << " packets timed out" << std::endl; - } } void CCodecStream::Task(void) diff --git a/reflector/M17Protocol.cpp b/reflector/M17Protocol.cpp index 552b3b6..4ba21d0 100644 --- a/reflector/M17Protocol.cpp +++ b/reflector/M17Protocol.cpp @@ -183,7 +183,6 @@ void CM17Protocol::OnDvHeaderPacketIn(std::unique_ptr &Header, CCallsign my(Header->GetMyCallsign()); CCallsign rpt1(Header->GetRpt1Callsign()); CCallsign rpt2(Header->GetRpt2Callsign()); - std::cout << "New Header: my=" << my << " Rpt1=" << rpt1 << " Rpt2=" << rpt2 << std::endl; // find this client std::shared_ptrclient = g_Reflector.GetClients()->FindClient(Ip, EProtocol::m17); @@ -192,7 +191,6 @@ void CM17Protocol::OnDvHeaderPacketIn(std::unique_ptr &Header, // get client callsign rpt1 = client->GetCallsign(); // and try to open the stream - std::cout << "Client has c/s=" << rpt1 << std::endl; if ( (stream = g_Reflector.OpenStream(Header, client)) != nullptr ) { // keep the handle