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
74604554
Commit
74604554
authored
Mar 23, 2017
by
Anne Heimes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfixes server
parent
65752f4f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
src/ITANetAudioStreamingServer.cpp
src/ITANetAudioStreamingServer.cpp
+9
-9
tests/NetAudio/ITANetAudioStreamingServerTest.cpp
tests/NetAudio/ITANetAudioStreamingServerTest.cpp
+1
-1
No files found.
src/ITANetAudioStreamingServer.cpp
View file @
74604554
...
...
@@ -115,7 +115,7 @@ bool CITANetAudioStreamingServer::Start( const std::string& sAddress, int iPort
m_pServerLogger
->
setOutputFile
(
paras
);
m_pMessage
->
SetMessageType
(
CITANetAudioProtocol
::
NP_SERVER_OPEN
);
m_pMessage
->
Write
StreamingParameters
(
m_oServerParams
);
m_pMessage
->
Write
Double
(
dTimeIntervalCientSendStatus
);
m_pMessage
->
WriteMessage
(
);
m_sfTempTransmitBuffer
.
init
(
m_pInputStream
->
GetNumberOfChannels
(
),
m_oServerParams
.
iRingBufferSize
,
true
);
...
...
@@ -135,28 +135,28 @@ bool CITANetAudioStreamingServer::LoopBody( )
oLog
.
uiBlockId
=
++
iServerBlockId
;
int
iMsgType
;
// Sending Samples
unsigned
int
u
iBlockLength
=
m_pInputStream
->
GetBlocklength
(
);
int
iBlockLength
=
m_pInputStream
->
GetBlocklength
(
);
int
iClientRingBufferTargetLatencyFreeSamples
=
m_iClientRingBufferFreeSamples
-
(
m_oServerParams
.
iRingBufferSize
-
m_oServerParams
.
iTargetSampleLatency
);
if
(
iClientRingBufferTargetLatencyFreeSamples
>=
u
iBlockLength
)
if
(
iClientRingBufferTargetLatencyFreeSamples
>=
iBlockLength
)
{
// Send Samples
int
iSendBlocks
=
iClientRingBufferTargetLatencyFreeSamples
/
u
iBlockLength
;
int
iSendBlocks
=
iClientRingBufferTargetLatencyFreeSamples
/
iBlockLength
;
bAskClient
=
true
;
if
(
m_sfTempTransmitBuffer
.
GetLength
(
)
!=
iSendBlocks
*
u
iBlockLength
)
m_sfTempTransmitBuffer
.
init
(
m_pInputStream
->
GetNumberOfChannels
(
),
iSendBlocks
*
u
iBlockLength
,
false
);
if
(
m_sfTempTransmitBuffer
.
GetLength
(
)
!=
iSendBlocks
*
iBlockLength
)
m_sfTempTransmitBuffer
.
init
(
m_pInputStream
->
GetNumberOfChannels
(
),
iSendBlocks
*
iBlockLength
,
false
);
for
(
int
j
=
0
;
j
<
iSendBlocks
;
j
++
)
{
for
(
int
i
=
0
;
i
<
int
(
m_pInputStream
->
GetNumberOfChannels
(
)
);
i
++
)
{
ITAStreamInfo
oStreamInfo
;
oStreamInfo
.
nSamples
=
u
iBlockLength
;
oStreamInfo
.
nSamples
=
iBlockLength
;
const
float
*
pfData
=
m_pInputStream
->
GetBlockPointer
(
i
,
&
oStreamInfo
);
if
(
pfData
!=
0
)
m_sfTempTransmitBuffer
[
i
].
write
(
pfData
,
uiBlockLength
,
j
*
u
iBlockLength
);
m_sfTempTransmitBuffer
[
i
].
write
(
pfData
,
iBlockLength
,
j
*
iBlockLength
);
}
m_pInputStream
->
IncrementBlockPointer
(
);
}
...
...
@@ -164,7 +164,7 @@ bool CITANetAudioStreamingServer::LoopBody( )
m_pMessage
->
SetMessageType
(
iMsgType
);
m_pMessage
->
WriteSampleFrame
(
&
m_sfTempTransmitBuffer
);
m_pMessage
->
WriteMessage
();
m_iClientRingBufferFreeSamples
-=
iSendBlocks
*
u
iBlockLength
;
m_iClientRingBufferFreeSamples
-=
iSendBlocks
*
iBlockLength
;
#ifdef NET_AUDIO_SHOW_TRAFFIC
vstr
::
out
()
<<
"[ITANetAudioStreamingServer] Transmitted "
<<
iSendSamples
<<
" samples for "
<<
m_pInputStream
->
GetNumberOfChannels
()
<<
" channels"
<<
std
::
endl
;
...
...
tests/NetAudio/ITANetAudioStreamingServerTest.cpp
View file @
74604554
...
...
@@ -30,7 +30,7 @@ int main(int argc, char** argv)
oStreamingServer
.
SetInputStream
(
&
oMuliplier
);
cout
<<
"Starting net audio server and waiting for connections on '"
<<
sServerName
<<
"' on port "
<<
iServerPort
<<
endl
;
oStreamingServer
.
Start
(
sServerName
,
iServerPort
,
100
);
oStreamingServer
.
Start
(
sServerName
,
iServerPort
,
0.1
);
while
(
!
oStreamingServer
.
IsClientConnected
())
{
...
...
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