added overall delay measurement
This commit is contained in:
parent
8d77d11ff9
commit
b807d001de
2 changed files with 216 additions and 168 deletions
|
@ -58,12 +58,14 @@ CClientSettingsDlg::CClientSettingsDlg ( CClient* pNCliP, QWidget* parent,
|
|||
GroupBoxNetwBuf->setWhatsThis ( strNetwBlockSize );
|
||||
|
||||
// init timing jitter text label
|
||||
TextLabelStdDevTimer->setText ( "" );
|
||||
//TextLabelStdDevTimer->setText ( "" );
|
||||
|
||||
// ping time controls
|
||||
CLEDPingTime->SetUpdateTime ( 2 * PING_UPDATE_TIME );
|
||||
CLEDPingTime->Reset();
|
||||
// init delay information controls
|
||||
CLEDOverallDelay->SetUpdateTime ( 2 * PING_UPDATE_TIME );
|
||||
CLEDOverallDelay->Reset();
|
||||
TextLabelPingTime->setText ( "" );
|
||||
TextLabelBufferDelay->setText ( "" );
|
||||
TextLabelOverallDelay->setText ( "" );
|
||||
|
||||
// init slider controls ---
|
||||
// sound buffer in
|
||||
|
@ -291,23 +293,50 @@ void CClientSettingsDlg::OnTimerPing()
|
|||
|
||||
void CClientSettingsDlg::OnPingTimeResult ( int iPingTime )
|
||||
{
|
||||
// color definition: < 27 ms green, < 50 ms yellow, otherwise red
|
||||
if ( iPingTime < 27 )
|
||||
{
|
||||
CLEDPingTime->SetLight ( MUL_COL_LED_GREEN );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( iPingTime < 50 )
|
||||
{
|
||||
CLEDPingTime->SetLight ( MUL_COL_LED_YELLOW );
|
||||
}
|
||||
else
|
||||
{
|
||||
CLEDPingTime->SetLight ( MUL_COL_LED_RED );
|
||||
}
|
||||
}
|
||||
/*
|
||||
For estimating the overall delay, use the following assumptions:
|
||||
- the mean delay of a cyclic buffer is half the buffer size (since
|
||||
for the average it is assumed that the buffer is half filled)
|
||||
- consider the jitter buffer on the server side, too
|
||||
- assume that the sound card introduces an additional delay of 2 * MIN_BLOCK_DURATION_MS
|
||||
*/
|
||||
const int iTotalJitterBufferDelayMS = MIN_BLOCK_DURATION_MS *
|
||||
( 2 * pClient->GetSockBufSize() + pClient->GetNetwBufSizeFactIn() +
|
||||
pClient->GetNetwBufSizeFactOut() ) / 2;
|
||||
|
||||
const int iTotalSoundCardDelayMS = 2 * MIN_BLOCK_DURATION_MS +
|
||||
MIN_BLOCK_DURATION_MS * ( pClient->GetSndInterface()->GetInNumBuf() +
|
||||
pClient->GetSndInterface()->GetOutNumBuf() ) / 2;
|
||||
|
||||
const int iDelayToFillNetworkPackets = MIN_BLOCK_DURATION_MS *
|
||||
( pClient->GetNetwBufSizeFactIn() + pClient->GetNetwBufSizeFactOut() );
|
||||
|
||||
const int iTotalBufferDelay = iDelayToFillNetworkPackets +
|
||||
iTotalJitterBufferDelayMS + iTotalSoundCardDelayMS;
|
||||
|
||||
const int iOverallDelay = iTotalBufferDelay + iPingTime;
|
||||
|
||||
// apply values to GUI labels
|
||||
TextLabelPingTime->setText ( QString().setNum ( iPingTime ) + " ms" );
|
||||
TextLabelBufferDelay->setText ( QString().setNum ( iTotalBufferDelay ) + " ms" );
|
||||
TextLabelOverallDelay->setText ( QString().setNum ( iOverallDelay ) + " ms" );
|
||||
|
||||
// color definition: < 40 ms green, < 60 ms yellow, otherwise red
|
||||
if ( iOverallDelay <= 40 )
|
||||
{
|
||||
CLEDOverallDelay->SetLight ( MUL_COL_LED_GREEN );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( iOverallDelay <= 60 )
|
||||
{
|
||||
CLEDOverallDelay->SetLight ( MUL_COL_LED_YELLOW );
|
||||
}
|
||||
else
|
||||
{
|
||||
CLEDOverallDelay->SetLight ( MUL_COL_LED_RED );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CClientSettingsDlg::UpdateDisplay()
|
||||
|
@ -315,14 +344,16 @@ void CClientSettingsDlg::UpdateDisplay()
|
|||
if ( pClient->IsRunning() )
|
||||
{
|
||||
// response time
|
||||
TextLabelStdDevTimer->setText ( QString().
|
||||
setNum ( pClient->GetTimingStdDev(), 'f', 2 ) + " ms" );
|
||||
//TextLabelStdDevTimer->setText ( QString().
|
||||
// setNum ( pClient->GetTimingStdDev(), 'f', 2 ) + " ms" );
|
||||
}
|
||||
else
|
||||
{
|
||||
// clear text labels with client parameters
|
||||
TextLabelStdDevTimer->setText ( "" );
|
||||
//TextLabelStdDevTimer->setText ( "" );
|
||||
TextLabelPingTime->setText ( "" );
|
||||
TextLabelBufferDelay->setText ( "" );
|
||||
TextLabelOverallDelay->setText ( "" );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -346,15 +377,11 @@ void CClientSettingsDlg::SetStatus ( const int iMessType, const int iStatus )
|
|||
CLEDNetwGet->SetLight ( iStatus );
|
||||
break;
|
||||
|
||||
case MS_PROTOCOL:
|
||||
CLEDProtocolStatus->SetLight ( iStatus );
|
||||
|
||||
case MS_RESET_ALL:
|
||||
CLEDSoundIn->Reset();
|
||||
CLEDSoundOut->Reset();
|
||||
CLEDNetwPut->Reset();
|
||||
CLEDNetwGet->Reset();
|
||||
CLEDProtocolStatus->Reset();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>506</width>
|
||||
<height>329</height>
|
||||
<width>552</width>
|
||||
<height>340</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle" >
|
||||
|
@ -750,33 +750,6 @@
|
|||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" >
|
||||
<item>
|
||||
<widget class="QCheckBox" name="cbOpenChatOnNewMessage" >
|
||||
<property name="text" >
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lOpenChat" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Open chat on new message</string>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBoxAudioCompressionType" >
|
||||
<property name="title" >
|
||||
|
@ -807,6 +780,17 @@
|
|||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" >
|
||||
<item>
|
||||
<widget class="QCheckBox" name="cbOpenChatOnNewMessage" >
|
||||
<property name="text" >
|
||||
<string>Open chat on new message</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
|
@ -815,20 +799,80 @@
|
|||
<property name="sizeHint" >
|
||||
<size>
|
||||
<width>116</width>
|
||||
<height>20</height>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="spacing" >
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="spacing" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="lPingTime_2" >
|
||||
<property name="text" >
|
||||
<string>Buffer Delay</string>
|
||||
</property>
|
||||
<property name="alignment" >
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="TextLabelBufferDelay" >
|
||||
<property name="minimumSize" >
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape" >
|
||||
<enum>QFrame::Panel</enum>
|
||||
</property>
|
||||
<property name="frameShadow" >
|
||||
<enum>QFrame::Sunken</enum>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>val</string>
|
||||
</property>
|
||||
<property name="alignment" >
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label" >
|
||||
<property name="text" >
|
||||
<string>+</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="spacing" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="lPingTime" >
|
||||
<property name="text" >
|
||||
<string>Ping Time:</string>
|
||||
<string>Ping Time</string>
|
||||
</property>
|
||||
<property name="alignment" >
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>false</bool>
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -840,16 +884,79 @@
|
|||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape" >
|
||||
<enum>QFrame::Panel</enum>
|
||||
</property>
|
||||
<property name="frameShadow" >
|
||||
<enum>QFrame::Sunken</enum>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>val</string>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>false</bool>
|
||||
<property name="alignment" >
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2" >
|
||||
<property name="text" >
|
||||
<string>=</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="CMultiColorLED" native="1" name="CLEDPingTime" >
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="spacing" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="lPingTime_3" >
|
||||
<property name="text" >
|
||||
<string>Overall Delay</string>
|
||||
</property>
|
||||
<property name="alignment" >
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" >
|
||||
<item>
|
||||
<widget class="QLabel" name="TextLabelOverallDelay" >
|
||||
<property name="minimumSize" >
|
||||
<size>
|
||||
<width>45</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font" >
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="frameShape" >
|
||||
<enum>QFrame::Panel</enum>
|
||||
</property>
|
||||
<property name="frameShadow" >
|
||||
<enum>QFrame::Sunken</enum>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>val</string>
|
||||
</property>
|
||||
<property name="alignment" >
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="CMultiColorLED" native="1" name="CLEDOverallDelay" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
|
||||
<horstretch>0</horstretch>
|
||||
|
@ -872,94 +979,8 @@
|
|||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="leftMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="lProtocolStat" >
|
||||
<property name="text" >
|
||||
<string>Protocol Status:</string>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="CMultiColorLED" native="1" name="CLEDProtocolStatus" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize" >
|
||||
<size>
|
||||
<width>13</width>
|
||||
<height>13</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize" >
|
||||
<size>
|
||||
<width>13</width>
|
||||
<height>13</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="leftMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="TextLabelStdDevTimerLabel" >
|
||||
<property name="text" >
|
||||
<string>StdDev:</string>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="TextLabelStdDevTimer" >
|
||||
<property name="text" >
|
||||
<string>val</string>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
|
|
Loading…
Reference in a new issue