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
1bfecbc7
Commit
1bfecbc7
authored
Feb 22, 2017
by
Anne Heimes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
anpassung für latenz auf dem server - Client
parent
c1f56f7a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
7 deletions
+13
-7
include/ITANetAudioProtocol.h
include/ITANetAudioProtocol.h
+7
-1
include/ITANetAudioStream.h
include/ITANetAudioStream.h
+1
-1
src/ITANetAudioStream.cpp
src/ITANetAudioStream.cpp
+5
-5
No files found.
include/ITANetAudioProtocol.h
View file @
1bfecbc7
...
@@ -65,6 +65,7 @@ public:
...
@@ -65,6 +65,7 @@ public:
double
dSampleRate
;
double
dSampleRate
;
int
iBlockSize
;
int
iBlockSize
;
int
iRingBufferSize
;
int
iRingBufferSize
;
int
iTargetSampleLatency
;
inline
StreamingParameters
()
inline
StreamingParameters
()
{
{
...
@@ -72,11 +73,16 @@ public:
...
@@ -72,11 +73,16 @@ public:
dSampleRate
=
0.0
f
;
dSampleRate
=
0.0
f
;
iBlockSize
=
0
;
iBlockSize
=
0
;
iRingBufferSize
=
0
;
iRingBufferSize
=
0
;
iTargetSampleLatency
=
0
;
};
};
inline
bool
operator
==
(
const
StreamingParameters
&
rhs
)
inline
bool
operator
==
(
const
StreamingParameters
&
rhs
)
{
{
if
(
(
iChannels
==
rhs
.
iChannels
)
&&
(
dSampleRate
==
rhs
.
dSampleRate
)
&&
(
iBlockSize
==
rhs
.
iBlockSize
)
&&
(
iRingBufferSize
==
rhs
.
iRingBufferSize
)
)
if
(
(
iChannels
==
rhs
.
iChannels
)
&&
(
dSampleRate
==
rhs
.
dSampleRate
)
&&
(
iBlockSize
==
rhs
.
iBlockSize
)
&&
(
iRingBufferSize
==
rhs
.
iRingBufferSize
)
&&
(
iTargetSampleLatency
==
rhs
.
iTargetSampleLatency
))
return
true
;
return
true
;
else
else
return
false
;
return
false
;
...
...
include/ITANetAudioStream.h
View file @
1bfecbc7
...
@@ -204,7 +204,7 @@ private:
...
@@ -204,7 +204,7 @@ private:
int
m_iWriteCursor
;
//!< Cursor where samples will be fed into ring buffer from net audio producer (always ahead)
int
m_iWriteCursor
;
//!< Cursor where samples will be fed into ring buffer from net audio producer (always ahead)
bool
m_bRingBufferFull
;
//!< Indicator if ring buffer is full (and read cursor equals write cursor)
bool
m_bRingBufferFull
;
//!< Indicator if ring buffer is full (and read cursor equals write cursor)
ITASampleFrame
m_sfRingBuffer
;
//!< Ring buffer
ITASampleFrame
m_sfRingBuffer
;
//!< Ring buffer
int
m_iTargetSampleLatency
;
//!< Maximum allowed samples / target sample latency
int
m_iTargetSampleLatency
Server
;
//!< Maximum allowed samples / target sample latency
int
m_iStreamingStatus
;
//!< Current streaming status
int
m_iStreamingStatus
;
//!< Current streaming status
double
m_dLastStreamingTimeCode
;
double
m_dLastStreamingTimeCode
;
...
...
src/ITANetAudioStream.cpp
View file @
1bfecbc7
...
@@ -124,7 +124,7 @@ CITANetAudioStream::CITANetAudioStream( int iChannels, double dSamplingRate, int
...
@@ -124,7 +124,7 @@ CITANetAudioStream::CITANetAudioStream( int iChannels, double dSamplingRate, int
,
m_bRingBufferFull
(
false
)
,
m_bRingBufferFull
(
false
)
,
m_iStreamingStatus
(
INVALID
)
,
m_iStreamingStatus
(
INVALID
)
,
m_dLastStreamingTimeCode
(
0.0
f
)
,
m_dLastStreamingTimeCode
(
0.0
f
)
,
m_iTargetSampleLatency
(
iRingBufferCapacity
)
,
m_iTargetSampleLatency
Server
(
iRingBufferCapacity
)
{
{
m_bRingBufferFull
=
false
;
m_bRingBufferFull
=
false
;
if
(
iBufferSize
>
iRingBufferCapacity
)
if
(
iBufferSize
>
iRingBufferCapacity
)
...
@@ -157,7 +157,7 @@ CITANetAudioStream::CITANetAudioStream( int iChannels, double dSamplingRate, int
...
@@ -157,7 +157,7 @@ CITANetAudioStream::CITANetAudioStream( int iChannels, double dSamplingRate, int
oLog
.
dSampleRate
=
m_dSampleRate
;
oLog
.
dSampleRate
=
m_dSampleRate
;
oLog
.
iBufferSize
=
GetBlocklength
();
oLog
.
iBufferSize
=
GetBlocklength
();
oLog
.
iRingBufferSize
=
GetRingBufferSize
();
oLog
.
iRingBufferSize
=
GetRingBufferSize
();
oLog
.
iTargetSampleLatency
=
m_iTargetSampleLatency
;
oLog
.
iTargetSampleLatency
=
m_iTargetSampleLatency
Server
;
m_pAudioLogger
->
log
(
oLog
);
m_pAudioLogger
->
log
(
oLog
);
}
}
...
@@ -202,17 +202,17 @@ void CITANetAudioStream::SetAllowedLatencySamples( int iLatencySamples )
...
@@ -202,17 +202,17 @@ void CITANetAudioStream::SetAllowedLatencySamples( int iLatencySamples )
if
(
iLatencySamples
>
GetMaximumLatencySamples
()
)
if
(
iLatencySamples
>
GetMaximumLatencySamples
()
)
ITA_EXCEPT1
(
INVALID_PARAMETER
,
"Can not set latency greater than the maximum possible"
);
ITA_EXCEPT1
(
INVALID_PARAMETER
,
"Can not set latency greater than the maximum possible"
);
m_iTargetSampleLatency
=
iLatencySamples
;
m_iTargetSampleLatency
Server
=
iLatencySamples
;
}
}
float
CITANetAudioStream
::
GetAllowedLatencySeconds
()
const
float
CITANetAudioStream
::
GetAllowedLatencySeconds
()
const
{
{
return
float
(
m_iTargetSampleLatency
/
GetSampleRate
()
);
return
float
(
m_iTargetSampleLatencyServer
/
GetSampleRate
()
);
}
}
int
CITANetAudioStream
::
GetAllowedLatencySamples
()
const
int
CITANetAudioStream
::
GetAllowedLatencySamples
()
const
{
{
return
m_iTargetSampleLatency
;
return
m_iTargetSampleLatency
Server
;
}
}
int
CITANetAudioStream
::
GetMinimumLatencySamples
()
const
int
CITANetAudioStream
::
GetMinimumLatencySamples
()
const
...
...
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