added upstream rate calculation
This commit is contained in:
parent
2e81acfc3d
commit
78d518bf75
5 changed files with 28 additions and 1 deletions
|
@ -1153,3 +1153,23 @@ CVector<unsigned char> CChannel::PrepSendPacket ( const CVector<short>& vecsNPac
|
||||||
|
|
||||||
return vecbySendBuf;
|
return vecbySendBuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int CChannel::GetUploadRateKbps()
|
||||||
|
{
|
||||||
|
int iAudioSizeOut;
|
||||||
|
|
||||||
|
if ( bIsServer )
|
||||||
|
{
|
||||||
|
iAudioSizeOut = iCurNetwOutBlSiFact * MIN_SERVER_BLOCK_SIZE_SAMPLES;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
iAudioSizeOut = iCurAudioBlockSizeOut;
|
||||||
|
}
|
||||||
|
|
||||||
|
// we assume that the UDP packet which is transported via IP has an
|
||||||
|
// additional header size of
|
||||||
|
// 8 (UDP) + 20 (IP without optional fields) = 28 bytes
|
||||||
|
return ( iAudComprSizeOut + 28 /* header */ ) * 8 /* bits per byte */ *
|
||||||
|
SYSTEM_SAMPLE_RATE / iAudioSizeOut / 1000;
|
||||||
|
}
|
||||||
|
|
|
@ -114,6 +114,7 @@ public:
|
||||||
int GetNetwBufSizeOut() { return iCurAudioBlockSizeOut; }
|
int GetNetwBufSizeOut() { return iCurAudioBlockSizeOut; }
|
||||||
|
|
||||||
int GetAudioBlockSizeIn() { return iCurAudioBlockSizeIn; }
|
int GetAudioBlockSizeIn() { return iCurAudioBlockSizeIn; }
|
||||||
|
int GetUploadRateKbps();
|
||||||
|
|
||||||
void SetNetwBufSizeFactOut ( const int iNewNetwBlSiFactOut );
|
void SetNetwBufSizeFactOut ( const int iNewNetwBlSiFactOut );
|
||||||
int GetNetwBufSizeFactOut() { return iCurNetwOutBlSiFact; }
|
int GetNetwBufSizeFactOut() { return iCurNetwOutBlSiFact; }
|
||||||
|
|
|
@ -116,6 +116,7 @@ public:
|
||||||
|
|
||||||
int GetNetwBufSizeOut() { return Channel.GetNetwBufSizeOut(); }
|
int GetNetwBufSizeOut() { return Channel.GetNetwBufSizeOut(); }
|
||||||
int GetAudioBlockSizeIn() { return Channel.GetAudioBlockSizeIn(); }
|
int GetAudioBlockSizeIn() { return Channel.GetAudioBlockSizeIn(); }
|
||||||
|
int GetUploadRateKbps() { return Channel.GetUploadRateKbps(); }
|
||||||
|
|
||||||
void SetAudioCompressionOut ( const EAudComprType eNewAudComprTypeOut )
|
void SetAudioCompressionOut ( const EAudComprType eNewAudComprTypeOut )
|
||||||
{
|
{
|
||||||
|
|
|
@ -321,6 +321,11 @@ void CClientSettingsDlg::UpdateDisplay()
|
||||||
// update slider controls (settings might have been changed)
|
// update slider controls (settings might have been changed)
|
||||||
UpdateJitterBufferFrame();
|
UpdateJitterBufferFrame();
|
||||||
|
|
||||||
|
|
||||||
|
// TEST
|
||||||
|
TextUpstreamValue->setText ( QString().setNum ( pClient->GetUploadRateKbps() ) + " kbps" );
|
||||||
|
|
||||||
|
|
||||||
if ( !pClient->IsRunning() )
|
if ( !pClient->IsRunning() )
|
||||||
{
|
{
|
||||||
// clear text labels with client parameters
|
// clear text labels with client parameters
|
||||||
|
|
|
@ -463,7 +463,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="TextUpstream" >
|
<widget class="QLabel" name="TextUpstream" >
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
<string>Upstream</string>
|
<string>Upstream Rate</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
Loading…
Reference in a new issue