Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ITADataSources
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Institute of Technical Acoustics (ITA)
ITADataSources
Commits
fc01867c
Commit
fc01867c
authored
Apr 3, 2017
by
Anne Heimes
Browse files
Options
Downloads
Patches
Plain Diff
correction factor für die schätzung des servers
parent
4289aaf0
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/ITANetAudioStreamingServer.h
+1
-0
1 addition, 0 deletions
include/ITANetAudioStreamingServer.h
src/ITANetAudioStreamingServer.cpp
+10
-1
10 additions, 1 deletion
src/ITANetAudioStreamingServer.cpp
tests/NetAudio/ITANetAudioTest.cpp
+1
-1
1 addition, 1 deletion
tests/NetAudio/ITANetAudioTest.cpp
with
12 additions
and
2 deletions
include/ITANetAudioStreamingServer.h
+
1
−
0
View file @
fc01867c
...
...
@@ -104,6 +104,7 @@ private:
int
m_iServerBlockId
;
double
m_dLastTimeStamp
;
double
m_dEstimatedCorrFactor
;
int
m_iTargetLatencySamples
;
int
m_iEstimatedClientRingBufferFreeSamples
;
...
...
This diff is collapsed.
Click to expand it.
src/ITANetAudioStreamingServer.cpp
+
10
−
1
View file @
fc01867c
...
...
@@ -31,6 +31,7 @@ struct CITAServerLog : public ITALogDataBase
os
<<
"
\t
"
<<
"ProtocolStatus"
;
os
<<
"
\t
"
<<
"EstimatedFreeSamples"
;
os
<<
"
\t
"
<<
"TransmittedSamples"
;
os
<<
"
\t
"
<<
"EstimatedCorrFactor"
;
os
<<
std
::
endl
;
return
os
;
};
...
...
@@ -42,6 +43,7 @@ struct CITAServerLog : public ITALogDataBase
os
<<
"
\t
"
<<
sProtocolStatus
;
os
<<
"
\t
"
<<
iEstimatedFreeSamples
;
os
<<
"
\t
"
<<
iTransmittedSamples
;
os
<<
"
\t
"
<<
dEstimatedCorrFactor
;
os
<<
std
::
endl
;
return
os
;
};
...
...
@@ -51,6 +53,7 @@ struct CITAServerLog : public ITALogDataBase
std
::
string
sProtocolStatus
;
int
iEstimatedFreeSamples
;
int
iTransmittedSamples
;
double
dEstimatedCorrFactor
;
};
class
CITABufferedDataLoggerImplServer
:
public
ITABufferedDataLogger
<
CITAServerLog
>
{};
...
...
@@ -67,6 +70,7 @@ CITANetAudioStreamingServer::CITANetAudioStreamingServer()
,
m_iServerBlockId
(
0
)
,
m_iEstimatedClientRingBufferFreeSamples
(
0
)
,
m_iClientRingBufferSize
(
0
)
,
m_dEstimatedCorrFactor
(
1
)
{
// Careful with this:
//SetPriority( VistaPriority::VISTA_MID_PRIORITY );
...
...
@@ -214,7 +218,11 @@ bool CITANetAudioStreamingServer::LoopBody()
{
case
CITANetAudioProtocol
::
NP_CLIENT_SENDING_RINGBUFFER_FREE_SAMPLES
:
{
int
iOldEstimatedRingBufferFreeSamples
=
m_iEstimatedClientRingBufferFreeSamples
;
m_iEstimatedClientRingBufferFreeSamples
=
m_pMessage
->
ReadInt
();
double
dEstimatedDiffSamples
=
(
dNow
-
m_dLastTimeStamp
)
*
44100
;
double
dRealDiffSamples
=
m_iEstimatedClientRingBufferFreeSamples
-
iOldEstimatedRingBufferFreeSamples
;
m_dEstimatedCorrFactor
=
dRealDiffSamples
/
dEstimatedDiffSamples
;
m_dLastTimeStamp
=
dNow
;
break
;
}
...
...
@@ -246,7 +254,7 @@ bool CITANetAudioStreamingServer::LoopBody()
// There is no status message, so we estimate the client-side ring buffer status
const
double
dTimeDiff
=
dNow
-
m_dLastTimeStamp
;
m_dLastTimeStamp
=
dNow
;
double
dEstimatedSamples
=
dTimeDiff
*
m_pInputStream
->
GetSampleRate
();
double
dEstimatedSamples
=
m_dEstimatedCorrFactor
*
dTimeDiff
*
m_pInputStream
->
GetSampleRate
();
m_iEstimatedClientRingBufferFreeSamples
+=
(
int
)
dEstimatedSamples
;
oLog
.
sProtocolStatus
=
"SERVER_ESTIMATION"
;
}
...
...
@@ -254,6 +262,7 @@ bool CITANetAudioStreamingServer::LoopBody()
m_swTryReadBlockStats
.
stop
();
oLog
.
iEstimatedFreeSamples
=
m_iEstimatedClientRingBufferFreeSamples
;
oLog
.
dEstimatedCorrFactor
=
m_dEstimatedCorrFactor
;
m_pServerLogger
->
log
(
oLog
);
return
false
;
...
...
This diff is collapsed.
Click to expand it.
tests/NetAudio/ITANetAudioTest.cpp
+
1
−
1
View file @
fc01867c
...
...
@@ -24,7 +24,7 @@ const static string g_sInputFilePath = "gershwin-mono.wav";
const
static
int
g_iServerPort
=
12480
;
const
static
double
g_dSampleRate
=
44100
;
const
static
int
g_iBlockLength
=
128
;
const
static
int
g_iChannels
=
10
0
;
const
static
int
g_iChannels
=
10
;
const
static
int
g_iTargetLatencySamples
=
g_iBlockLength
*
10
;
const
static
int
g_iRingerBufferCapacity
=
g_iBlockLength
*
20
;
const
static
double
g_dDuration
=
10.0f
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment