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
1cf47aea
Commit
1cf47aea
authored
Dec 20, 2016
by
Anne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
streaming server überarbeitet
parent
81a58b72
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
95 additions
and
95 deletions
+95
-95
src/ITANetAudioStreamingServer.cpp
src/ITANetAudioStreamingServer.cpp
+95
-95
No files found.
src/ITANetAudioStreamingServer.cpp
View file @
1cf47aea
#include <ITANetAudioStreamingServer.h>
#include <ITANetAudioStreamingServer.h>
#include <ITANetAudioServer.h>
#include <ITANetAudioServer.h>
// ITA includes
// ITA includes
#include <ITADataSource.h>
#include <ITADataSource.h>
#include <ITAException.h>
#include <ITAException.h>
#include <ITAStreamInfo.h>
#include <ITAStreamInfo.h>
// Vista includes
// Vista includes
#include <VistaInterProcComm/Concurrency/VistaThreadLoop.h>
#include <VistaInterProcComm/Concurrency/VistaThreadLoop.h>
#include <VistaInterProcComm/Connections/VistaConnectionIP.h>
#include <VistaInterProcComm/Connections/VistaConnectionIP.h>
#include <VistaInterProcComm/IPNet/VistaTCPServer.h>
#include <VistaInterProcComm/IPNet/VistaTCPServer.h>
#include <VistaInterProcComm/IPNet/VistaTCPSocket.h>
#include <VistaInterProcComm/IPNet/VistaTCPSocket.h>
#include <VistaBase/VistaTimeUtils.h>
#include <VistaBase/VistaTimeUtils.h>
#include <VistaInterProcComm/IPNet/VistaIPAddress.h>
#include <VistaInterProcComm/IPNet/VistaIPAddress.h>
// STL
// STL
#include <cmath>
#include <cmath>
#include <cassert>
#include <cassert>
CITANetAudioStreamingServer
::
CITANetAudioStreamingServer
()
CITANetAudioStreamingServer
::
CITANetAudioStreamingServer
()
:
m_pInputStream
(
NULL
)
:
m_pInputStream
(
NULL
)
,
m_iUpdateStrategy
(
AUTO
)
,
m_iUpdateStrategy
(
AUTO
)
,
m_pSocket
(
NULL
)
,
m_pSocket
(
NULL
)
{
{
m_pNetAudioServer
=
new
CITANetAudioServer
();
m_pNetAudioServer
=
new
CITANetAudioServer
();
// TODO: Init members
// TODO: Init members
}
}
bool
CITANetAudioStreamingServer
::
Start
(
const
std
::
string
&
sAddress
,
int
iPort
)
bool
CITANetAudioStreamingServer
::
Start
(
const
std
::
string
&
sAddress
,
int
iPort
)
{
{
// TODO: vorrckgabe noch anfangen zu senden (Samples)
// TODO: vorrckgabe noch anfangen zu senden (Samples)
if
(
m_pNetAudioServer
->
Start
(
sAddress
,
iPort
))
if
(
m_pNetAudioServer
->
Start
(
sAddress
,
iPort
))
{
{
m_pSocket
=
m_pNetAudioServer
->
GetSocket
();
m_pSocket
=
m_pNetAudioServer
->
GetSocket
();
// TODO: Init neu mit Netmessage
// TODO: Init neu mit Netmessage
long
nIncomingBytes
=
m_pSocket
->
WaitForIncomingData
(
0
);
long
nIncomingBytes
=
m_pSocket
->
WaitForIncomingData
(
0
);
int
iBytesReceived
=
m_pSocket
->
ReceiveRaw
(
&
m_initData
,
sizeof
(
InitData
));
int
iBytesReceived
=
m_pSocket
->
ReceiveRaw
(
&
m_initData
,
sizeof
(
InitData
));
...
@@ -43,63 +43,63 @@ bool CITANetAudioStreamingServer::Start(const std::string& sAddress, int iPort)
...
@@ -43,63 +43,63 @@ bool CITANetAudioStreamingServer::Start(const std::string& sAddress, int iPort)
Run
();
Run
();
return
true
;
return
true
;
return
true
;
return
true
;
}
}
return
false
;
return
false
;
}
}
bool
CITANetAudioStreamingServer
::
IsClientConnected
()
const
bool
CITANetAudioStreamingServer
::
IsClientConnected
()
const
{
{
return
m_pNetAudioServer
->
IsConnected
();
return
m_pNetAudioServer
->
IsConnected
();
}
}
std
::
string
CITANetAudioStreamingServer
::
GetNetworkAddress
()
const
std
::
string
CITANetAudioStreamingServer
::
GetNetworkAddress
()
const
{
{
return
m_pNetAudioServer
->
GetServerAddress
();
return
m_pNetAudioServer
->
GetServerAddress
();
}
}
int
CITANetAudioStreamingServer
::
GetNetworkPort
()
const
int
CITANetAudioStreamingServer
::
GetNetworkPort
()
const
{
{
return
m_pNetAudioServer
->
GetNetworkPort
();
return
m_pNetAudioServer
->
GetNetworkPort
();
}
}
void
CITANetAudioStreamingServer
::
Stop
()
void
CITANetAudioStreamingServer
::
Stop
()
{
{
m_pNetAudioServer
->
Disconnect
();
m_pNetAudioServer
->
Disconnect
();
}
}
void
CITANetAudioStreamingServer
::
SetInputStream
(
ITADatasource
*
pInStream
)
void
CITANetAudioStreamingServer
::
SetInputStream
(
ITADatasource
*
pInStream
)
{
{
m_pInputStream
=
pInStream
;
m_pInputStream
=
pInStream
;
}
}
int
CITANetAudioStreamingServer
::
GetNetStreamBlocklength
()
const
int
CITANetAudioStreamingServer
::
GetNetStreamBlocklength
()
const
{
{
return
m_sfTempTransmitBuffer
.
GetLength
();
return
m_sfTempTransmitBuffer
.
GetLength
();
}
}
int
CITANetAudioStreamingServer
::
GetNetStreamNumberOfChannels
()
const
int
CITANetAudioStreamingServer
::
GetNetStreamNumberOfChannels
()
const
{
{
return
m_sfTempTransmitBuffer
.
channels
();
return
m_sfTempTransmitBuffer
.
channels
();
}
}
double
CITANetAudioStreamingServer
::
GetNetStreamSampleRate
()
const
double
CITANetAudioStreamingServer
::
GetNetStreamSampleRate
()
const
{
{
return
m_
dClientSampleRate
;
return
m_
initData
.
dClientSampleRate
;
}
}
void
CITANetAudioStreamingServer
::
SetAutomaticUpdateRate
()
void
CITANetAudioStreamingServer
::
SetAutomaticUpdateRate
()
{
{
m_iUpdateStrategy
=
AUTO
;
m_iUpdateStrategy
=
AUTO
;
}
}
ITADatasource
*
CITANetAudioStreamingServer
::
GetInputStream
()
const
ITADatasource
*
CITANetAudioStreamingServer
::
GetInputStream
()
const
{
{
return
m_pInputStream
;
return
m_pInputStream
;
}
}
int
CITANetAudioStreamingServer
::
Transmit
(
const
ITASampleFrame
&
sfNewSamples
,
int
iNumSamples
)
int
CITANetAudioStreamingServer
::
Transmit
(
const
ITASampleFrame
&
sfNewSamples
,
int
iNumSamples
)
{
{
return
0
;
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