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
4927a426
Commit
4927a426
authored
Feb 06, 2017
by
Dipl.-Ing. Jonas Stienen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ba_2016_heimes' of
https://git.rwth-aachen.de/ita/ITADataSources
into ba_2016_heimes
parents
0e455385
dc1fb0c0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
18 deletions
+23
-18
src/ITANetAudioStream.cpp
src/ITANetAudioStream.cpp
+6
-9
src/ITANetAudioStreamingClient.cpp
src/ITANetAudioStreamingClient.cpp
+10
-3
src/ITANetAudioStreamingServer.cpp
src/ITANetAudioStreamingServer.cpp
+5
-5
tests/NetAudio/ITANetAudioStreamingServerTest.cpp
tests/NetAudio/ITANetAudioStreamingServerTest.cpp
+2
-1
No files found.
src/ITANetAudioStream.cpp
View file @
4927a426
...
...
@@ -137,15 +137,18 @@ CITANetAudioStream::CITANetAudioStream( int iChannels, double dSamplingRate, int
m_iStreamingStatus
=
STOPPED
;
// Logging
std
::
string
paras
=
std
::
string
(
"NetAudioLogBaseData"
)
+
std
::
string
(
"_BS"
)
+
std
::
to_string
(
iBufferSize
)
+
std
::
string
(
"_Ch"
)
+
std
::
to_string
(
iChannels
)
+
std
::
string
(
".txt"
);
m_pAudioLogger
=
new
ITABufferedDataLoggerImplAudio
(
);
m_pAudioLogger
->
setOutputFile
(
"NetAudioLogBaseData.txt"
);
m_pAudioLogger
->
setOutputFile
(
paras
);
paras
=
std
::
string
(
"NetAudioLogStream"
)
+
std
::
string
(
"_BS"
)
+
std
::
to_string
(
iBufferSize
)
+
std
::
string
(
"_Ch"
)
+
std
::
to_string
(
iChannels
)
+
std
::
string
(
".txt"
);
m_pStreamLogger
=
new
ITABufferedDataLoggerImplStream
();
m_pStreamLogger
->
setOutputFile
(
"NetAudioLogStream.txt"
);
m_pStreamLogger
->
setOutputFile
(
paras
);
iAudioStreamingBlockID
=
0
;
paras
=
std
::
string
(
"NetAudioLogNet"
)
+
std
::
string
(
"_BS"
)
+
std
::
to_string
(
iBufferSize
)
+
std
::
string
(
"_Ch"
)
+
std
::
to_string
(
iChannels
)
+
std
::
string
(
".txt"
);
m_pNetLogger
=
new
ITABufferedDataLoggerImplNet
();
m_pNetLogger
->
setOutputFile
(
"NetAudioLogNet.txt"
);
m_pNetLogger
->
setOutputFile
(
paras
);
iNetStreamingBlockID
=
0
;
// Logging Base Data
...
...
@@ -332,7 +335,6 @@ int CITANetAudioStream::Transmit( const ITASampleFrame& sfNewSamples, int iNumSa
{
// BufferFull
m_iStreamingStatus
=
BUFFER_OVERRUN
;
oLog
.
iBufferStatus
=
1
;
#if NET_AUDIO_SHOW_TRAFFIC
vstr
::
out
()
<<
"[ NetAudio ] Buffer overrun"
<<
std
::
endl
;
#endif
...
...
@@ -344,14 +346,12 @@ int CITANetAudioStream::Transmit( const ITASampleFrame& sfNewSamples, int iNumSa
m_iStreamingStatus
=
BUFFER_OVERRUN
;
m_iWriteCursor
=
m_iReadCursor
;
oLog
.
iBufferStatus
=
2
;
}
else
{
// write samples into ring buffer
m_sfRingBuffer
.
cyclic_write
(
sfNewSamples
,
iNumSamples
,
0
,
iCurrentWriteCursor
);
m_bRingBufferFull
=
false
;
oLog
.
iBufferStatus
=
1
;
m_iStreamingStatus
=
STREAMING
;
#if NET_AUDIO_SHOW_TRAFFIC
vstr
::
out
()
<<
"[ NetAudio ] Buffer write"
<<
std
::
endl
;
...
...
@@ -362,9 +362,6 @@ int CITANetAudioStream::Transmit( const ITASampleFrame& sfNewSamples, int iNumSa
if
(
m_iWriteCursor
==
m_iReadCursor
)
{
m_bRingBufferFull
=
true
;
oLog
.
iBufferStatus
=
1
;
m_iStreamingStatus
=
BUFFER_OVERRUN
;
#if NET_AUDIO_SHOW_TRAFFIC
vstr
::
out
()
<<
"[ NetAudio ] Buffer overrun"
<<
std
::
endl
;
#endif
...
...
src/ITANetAudioStreamingClient.cpp
View file @
4927a426
...
...
@@ -18,6 +18,7 @@ struct ITAClientLog : public ITALogDataBase
os
<<
"
\t
"
<<
"WorldTimeStamp"
;
os
<<
"
\t
"
<<
"ProtocolStatus"
;
os
<<
"
\t
"
<<
"FreeSamples"
;
os
<<
"
\t
"
<<
"Channel"
;
os
<<
std
::
endl
;
return
os
;
};
...
...
@@ -28,6 +29,7 @@ struct ITAClientLog : public ITALogDataBase
os
<<
"
\t
"
<<
std
::
setprecision
(
12
)
<<
dWorldTimeStamp
;
os
<<
"
\t
"
<<
iProtocolStatus
;
os
<<
"
\t
"
<<
iFreeSamples
;
os
<<
"
\t
"
<<
iChannel
;
os
<<
std
::
endl
;
return
os
;
};
...
...
@@ -36,6 +38,7 @@ struct ITAClientLog : public ITALogDataBase
double
dWorldTimeStamp
;
int
iProtocolStatus
;
//!< ... usw
int
iFreeSamples
;
int
iChannel
;
};
...
...
@@ -53,8 +56,10 @@ CITANetAudioStreamingClient::CITANetAudioStreamingClient( CITANetAudioStream* pP
m_oParams
.
iChannels
=
pParent
->
GetNumberOfChannels
();
m_oParams
.
dSampleRate
=
pParent
->
GetSampleRate
();
m_oParams
.
iBlockSize
=
pParent
->
GetBlocklength
();
std
::
string
paras
=
std
::
string
(
"NetAudioLogClient"
)
+
std
::
string
(
"_BS"
)
+
std
::
to_string
(
pParent
->
GetBlocklength
())
+
std
::
string
(
"_Ch"
)
+
std
::
to_string
(
pParent
->
GetNumberOfChannels
())
+
std
::
string
(
".txt"
);
m_pClientLogger
=
new
ITABufferedDataLoggerImplClient
(
);
m_pClientLogger
->
setOutputFile
(
"NetAudioLogClient.txt"
);
m_pClientLogger
->
setOutputFile
(
paras
);
iStreamingBlockId
=
0
;
m_pMessage
=
new
CITANetAudioMessage
(
VistaSerializingToolset
::
SWAPS_MULTIBYTE_VALUES
);
}
...
...
@@ -67,8 +72,9 @@ CITANetAudioStreamingClient::~CITANetAudioStreamingClient()
m_pMessage
->
ResetMessage
();
m_pMessage
->
SetConnection
(
m_pConnection
);
m_pMessage
->
SetMessageType
(
CITANetAudioProtocol
::
NP_CLIENT_CLOSE
);
//
m_pMessage->WriteMessage();
m_pMessage
->
WriteMessage
();
m_pClient
->
Disconnect
();
//Disconnect();
}
//}
//catch (ITAException e){
...
...
@@ -159,6 +165,7 @@ bool CITANetAudioStreamingClient::LoopBody()
case
CITANetAudioProtocol
::
NP_SERVER_GET_RINGBUFFER_FREE
:
break
;
}
oLog
.
iChannel
=
m_pStream
->
GetNumberOfChannels
();
oLog
.
iProtocolStatus
=
iAnswerType
;
oLog
.
dWorldTimeStamp
=
ITAClock
::
getDefaultClock
(
)
->
getTime
(
);
m_pClientLogger
->
log
(
oLog
);
...
...
@@ -180,7 +187,7 @@ void CITANetAudioStreamingClient::Disconnect()
m_bStopIndicated
=
true
;
StopGently
(
true
);
delete
m_pConnection
;
//
delete m_pConnection;
m_pConnection
=
NULL
;
m_bStopIndicated
=
false
;
...
...
src/ITANetAudioStreamingServer.cpp
View file @
4927a426
...
...
@@ -120,11 +120,11 @@ bool CITANetAudioStreamingServer::LoopBody()
}
case
CITANetAudioProtocol
::
NP_CLIENT_CLOSE
:
{
m_pMessage
->
SetAnswerType
(
CITANetAudioProtocol
::
NP_SERVER_CLOSE
);
m_pMessage
->
WriteAnswer
();
m_pConnection
=
NULL
;
StopGently
(
true
);
//
m_pMessage->SetAnswerType( CITANetAudioProtocol::NP_SERVER_CLOSE );
//
m_pMessage->WriteAnswer();
StopGently
(
false
);
//
m_pConnection = NULL;
Stop
();
return
false
;
...
...
tests/NetAudio/ITANetAudioStreamingServerTest.cpp
View file @
4927a426
...
...
@@ -41,6 +41,7 @@ int main(int argc, char** argv)
VistaTimeUtils
::
Sleep
(
100
);
}
VistaTimeUtils
::
Sleep
(
1000
);
VistaTimeUtils
::
Sleep
(
2000
);
return
0
;
}
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