Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
ITADataSources
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Institute of Technical Acoustics (ITA)
ITADataSources
Commits
fc01867c
Commit
fc01867c
authored
Apr 03, 2017
by
Anne Heimes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correction factor für die schätzung des servers
parent
4289aaf0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
2 deletions
+12
-2
include/ITANetAudioStreamingServer.h
include/ITANetAudioStreamingServer.h
+1
-0
src/ITANetAudioStreamingServer.cpp
src/ITANetAudioStreamingServer.cpp
+10
-1
tests/NetAudio/ITANetAudioTest.cpp
tests/NetAudio/ITANetAudioTest.cpp
+1
-1
No files found.
include/ITANetAudioStreamingServer.h
View file @
fc01867c
...
...
@@ -104,6 +104,7 @@ private:
int
m_iServerBlockId
;
double
m_dLastTimeStamp
;
double
m_dEstimatedCorrFactor
;
int
m_iTargetLatencySamples
;
int
m_iEstimatedClientRingBufferFreeSamples
;
...
...
src/ITANetAudioStreamingServer.cpp
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
;
...
...
tests/NetAudio/ITANetAudioTest.cpp
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.0
f
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment