Skip to content

Commit

Permalink
reduce slip calculations
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Martin committed Aug 3, 2023
1 parent db6c5aa commit 7fd9e83
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
14 changes: 8 additions & 6 deletions plugins/aoip info/pnlQos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,11 @@ void pnlQos::QoSUpdated(qosData* pData)
m_pGraph->AddPeak(wxT("Timestamp Errors"), pData->nTimestampErrors);
m_pHistogram->AddPeak(wxT("Timestamp Errors"), pData->nTimestampErrors);


auto dSlip = m_dLatency-m_dInitialLatency;
m_pGraph->AddPeak("Slip", dSlip);
m_pHistogram->AddPeak("Slip", dSlip);

}

void pnlQos::OnbtnRangeClick(wxCommandEvent& event)
Expand Down Expand Up @@ -499,13 +504,10 @@ void pnlQos::RtpFrame(std::shared_ptr<const rtpFrame> pFrame)
m_pHistogram->AddPeak(wxT("TS-DF"), pFrame->dTSDF);
}

auto dLatency = static_cast<double>(pFrame->timeLatency.tv_sec)*1000000.0 + static_cast<double>(pFrame->timeLatency.tv_usec);
m_dLatency = static_cast<double>(pFrame->timeLatency.tv_sec)*1000000.0 + static_cast<double>(pFrame->timeLatency.tv_usec);
if(m_nLatencyCounter < 3)
{
++m_nLatencyCounter;
m_dInitialLatency = dLatency;
}
double dSlip = dLatency-m_dInitialLatency;
m_pGraph->AddPeak("Slip", dSlip);
m_pHistogram->AddPeak("Slip", dSlip);
m_dInitialLatency = m_dLatency;
}
}
1 change: 1 addition & 0 deletions plugins/aoip info/pnlQos.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ class pnlQos: public wxPanel
wxString m_sGroup;
wxString m_sGraph;

double m_dLatency=0.0;
double m_dInitialLatency=0.0;
unsigned short m_nLatencyCounter = 0;

Expand Down

0 comments on commit 7fd9e83

Please sign in to comment.