Adding switchens for UDP connection, not yet finished on UDP side, but TCP...

Adding switchens for UDP connection, not yet finished on UDP side, but TCP still works fine and is the default option
parent 960e909f
...@@ -70,7 +70,7 @@ public: ...@@ -70,7 +70,7 @@ public:
* *
* @note Accept for more memory usage, oversizing the buffer does not require more CPU. * @note Accept for more memory usage, oversizing the buffer does not require more CPU.
*/ */
CITANetAudioStream( int iChannels, double dSamplingRate, int iBufferSize, int iRingBufferCapacity = 2048 ); CITANetAudioStream( const int iChannels, const double dSamplingRate, const int iBufferSize, const int iRingBufferCapacity = 2048 );
virtual ~CITANetAudioStream(); virtual ~CITANetAudioStream();
...@@ -91,7 +91,7 @@ public: ...@@ -91,7 +91,7 @@ public:
* @iPort[in] Server socket port, defaults to 12480 * @iPort[in] Server socket port, defaults to 12480
* @return True, if connection could be established and streaming parameters match * @return True, if connection could be established and streaming parameters match
*/ */
bool Connect( const std::string& sAddress, int iPort = 12480 ); bool Connect( const std::string& sAddress, const int iPort = 12480, const bool bUseUDP = false );
//! Disconnct safely from server //! Disconnct safely from server
void Disconnect(); void Disconnect();
...@@ -202,7 +202,7 @@ protected: ...@@ -202,7 +202,7 @@ protected:
* *
* @note This method is not called out of the audio streaming context but out of the network context. * @note This method is not called out of the audio streaming context but out of the network context.
*/ */
int Transmit( const ITASampleFrame& sfNewSamples, int iNumSamples ); int Transmit( const ITASampleFrame& sfNewSamples, const int iNumSamples );
//! Returns samples that can be read from ring buffer //! Returns samples that can be read from ring buffer
/** /**
...@@ -217,7 +217,7 @@ protected: ...@@ -217,7 +217,7 @@ protected:
int GetRingBufferFreeSamples() const; int GetRingBufferFreeSamples() const;
//! Returns a string for the streaming status identifier //! Returns a string for the streaming status identifier
static std::string GetStreamingStatusString( int iStreamingStatus ); static std::string GetStreamingStatusString( const int iStreamingStatus );
private: private:
CITANetAudioStreamingClient* m_pNetAudioStreamingClient; //!< Audio streaming network client CITANetAudioStreamingClient* m_pNetAudioStreamingClient; //!< Audio streaming network client
......
...@@ -36,8 +36,7 @@ class CITANetAudioMessage; ...@@ -36,8 +36,7 @@ class CITANetAudioMessage;
class CITANetAudioProtocol; class CITANetAudioProtocol;
class CITANetAudioServer; class CITANetAudioServer;
class CITANetAudioMessage; class CITANetAudioMessage;
class VistaTCPSocket; class CITABufferedDataLoggerImplServer;
class ITABufferedDataLoggerImplServer;
class VistaConnectionIP; class VistaConnectionIP;
...@@ -98,7 +97,7 @@ private: ...@@ -98,7 +97,7 @@ private:
CITANetAudioMessage* m_pMessage; CITANetAudioMessage* m_pMessage;
ITABufferedDataLoggerImplServer* m_pServerLogger; CITABufferedDataLoggerImplServer* m_pServerLogger;
std::string m_sServerLogBaseName; std::string m_sServerLogBaseName;
ITAStopWatch m_swTryReadBlockStats, m_swTryReadAccessStats; ITAStopWatch m_swTryReadBlockStats, m_swTryReadAccessStats;
bool m_bDebuggingEnabled; bool m_bDebuggingEnabled;
......
...@@ -15,13 +15,14 @@ CITANetAudioClient::~CITANetAudioClient() ...@@ -15,13 +15,14 @@ CITANetAudioClient::~CITANetAudioClient()
delete m_pConnection; delete m_pConnection;
} }
bool CITANetAudioClient::Connect( const std::string& sAddress, int iPort ) bool CITANetAudioClient::Connect( const std::string& sAddress, const int iPort, const bool bUseUDP /* = false */ )
{ {
if( GetIsConnected() ) if( GetIsConnected() )
ITA_EXCEPT1( MODAL_EXCEPTION, "This net stream is already connected" ); ITA_EXCEPT1( MODAL_EXCEPTION, "This net stream is already connected" );
// Attempt to connect and check parameters // Attempt to connect and check parameters
m_pConnection = new VistaConnectionIP( VistaConnectionIP::CT_TCP, sAddress, iPort ); const VistaConnectionIP::VistaProtocol iCTProtocol = bUseUDP ? VistaConnectionIP::CT_UDP : VistaConnectionIP::CT_TCP;
m_pConnection = new VistaConnectionIP( iCTProtocol, sAddress, iPort );
if( !GetIsConnected() ) if( !GetIsConnected() )
{ {
......
...@@ -28,7 +28,7 @@ class VistaConnectionIP; ...@@ -28,7 +28,7 @@ class VistaConnectionIP;
//! A network audio client that connects to a network audio server //! A network audio client that connects to a network audio server
/** /**
* Use CITANetAudioStreamingClient to start an audio stream with the connection of this client. * Use CITANetAudioStreamingClient to start an audio stream with the connection of this client.
* This class is basically a helper around Vista TCP/IP network functionality. * This class is basically a helper around Vista TCP/IP or UDP network functionality.
* *
*/ */
class CITANetAudioClient class CITANetAudioClient
...@@ -42,7 +42,7 @@ public: ...@@ -42,7 +42,7 @@ public:
CITANetAudioClient(); CITANetAudioClient();
~CITANetAudioClient(); ~CITANetAudioClient();
bool Connect( const std::string& sAddress, int iPort ); bool Connect( const std::string& sAddress, const int iPort, const bool bUseUDP );
void Disconnect(); void Disconnect();
bool GetIsConnected() const; bool GetIsConnected() const;
......
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
#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 <VistaInterProcComm/IPNet/VistaSocketAddress.h>
#include <VistaInterProcComm/IPNet/VistaUDPSocket.h>
#include <VistaBase/VistaTimeUtils.h> #include <VistaBase/VistaTimeUtils.h>
#include <VistaInterProcComm/IPNet/VistaIPAddress.h> #include <VistaInterProcComm/IPNet/VistaIPAddress.h>
...@@ -21,8 +23,9 @@ ...@@ -21,8 +23,9 @@
#include <cassert> #include <cassert>
CITANetAudioServer::CITANetAudioServer() CITANetAudioServer::CITANetAudioServer()
: m_pServer( NULL ) : m_pTCPServer( NULL )
, m_pSocket( NULL ) , m_pTCPSocket( NULL )
, m_pUDPSocket( NULL )
, m_pConnection( NULL ) , m_pConnection( NULL )
, m_iServerPort( -1 ) , m_iServerPort( -1 )
{ {
...@@ -30,9 +33,13 @@ CITANetAudioServer::CITANetAudioServer() ...@@ -30,9 +33,13 @@ CITANetAudioServer::CITANetAudioServer()
CITANetAudioServer::~CITANetAudioServer() CITANetAudioServer::~CITANetAudioServer()
{ {
m_pSocket = NULL; m_pTCPSocket = NULL;
delete m_pUDPSocket;
m_pUDPSocket = NULL;
delete m_pConnection; delete m_pConnection;
delete m_pServer; delete m_pTCPServer;
} }
std::string CITANetAudioServer::GetServerAddress() const std::string CITANetAudioServer::GetServerAddress() const
...@@ -45,21 +52,37 @@ int CITANetAudioServer::GetNetworkPort() const ...@@ -45,21 +52,37 @@ int CITANetAudioServer::GetNetworkPort() const
return m_iServerPort; return m_iServerPort;
} }
bool CITANetAudioServer::Start(const std::string& sAddress, int iPort) bool CITANetAudioServer::Start( const std::string& sAddress, const int iPort, const bool bUseUDP /* = false */ )
{ {
if( m_pServer ) if( m_pTCPServer || m_pUDPSocket )
ITA_EXCEPT1( MODAL_EXCEPTION, "This net sample server is already started" ); ITA_EXCEPT1( MODAL_EXCEPTION, "This NetAudio server is already started" );
m_pServer = new VistaTCPServer( sAddress, iPort, 1 );
m_sServerAddress = sAddress; m_sServerAddress = sAddress;
m_iServerPort = iPort; m_iServerPort = iPort;
// blocking wait for connection if( bUseUDP )
m_pSocket = m_pServer->GetNextClient(); {
if( !m_pSocket ) VistaSocketAddress oAddress( sAddress, iPort );
return false; VistaUDPSocket* pUDPSocket = new VistaUDPSocket();
if( m_pSocket->GetIsConnected() )
m_pConnection = new VistaConnectionIP( m_pSocket ); // blocking wait for connection
pUDPSocket->ConnectToAddress( oAddress );
if( pUDPSocket->GetIsConnected() )
m_pConnection = new VistaConnectionIP( pUDPSocket );
}
else
{
m_pTCPServer = new VistaTCPServer( sAddress, iPort, 1 );
// blocking wait for connection
m_pTCPSocket = m_pTCPServer->GetNextClient();
if( !m_pTCPSocket )
return false;
if( m_pTCPSocket->GetIsConnected() )
m_pConnection = new VistaConnectionIP( m_pTCPSocket );
}
if( !m_pConnection ) if( !m_pConnection )
return false; return false;
...@@ -78,10 +101,13 @@ void CITANetAudioServer::Stop() ...@@ -78,10 +101,13 @@ void CITANetAudioServer::Stop()
delete m_pConnection; delete m_pConnection;
m_pConnection = NULL; m_pConnection = NULL;
m_pSocket = NULL; m_pTCPSocket = NULL;
delete m_pTCPServer;
m_pTCPServer = NULL;
delete m_pServer; delete m_pUDPSocket;
m_pServer = NULL; m_pUDPSocket = NULL;
} }
bool CITANetAudioServer::IsConnected() const bool CITANetAudioServer::IsConnected() const
......
...@@ -30,6 +30,7 @@ class CITANetAudioStreamingServer; ...@@ -30,6 +30,7 @@ class CITANetAudioStreamingServer;
class VistaConnectionIP; class VistaConnectionIP;
class VistaTCPServer; class VistaTCPServer;
class VistaTCPSocket; class VistaTCPSocket;
class VistaUDPSocket;
//! Realizes server functionality for network audio streaming //! Realizes server functionality for network audio streaming
/** /**
...@@ -47,7 +48,7 @@ public: ...@@ -47,7 +48,7 @@ public:
std::string GetServerAddress() const; std::string GetServerAddress() const;
int GetNetworkPort() const; int GetNetworkPort() const;
bool Start( const std::string& sAddress, int iPort ); bool Start( const std::string& sAddress, const int iPort, const bool bUseUDP = false );
void Stop(); void Stop();
VistaConnectionIP* GetConnection() const; VistaConnectionIP* GetConnection() const;
...@@ -55,8 +56,9 @@ public: ...@@ -55,8 +56,9 @@ public:
private: private:
VistaTCPServer* m_pServer; VistaTCPServer* m_pTCPServer;
VistaTCPSocket* m_pSocket; VistaTCPSocket* m_pTCPSocket;
VistaUDPSocket* m_pUDPSocket;
VistaConnectionIP* m_pConnection; VistaConnectionIP* m_pConnection;
int m_iServerPort; int m_iServerPort;
......
...@@ -126,9 +126,9 @@ CITANetAudioStream::~CITANetAudioStream() ...@@ -126,9 +126,9 @@ CITANetAudioStream::~CITANetAudioStream()
delete m_pNetAudioStreamingClient; delete m_pNetAudioStreamingClient;
} }
bool CITANetAudioStream::Connect( const std::string& sAddress, int iPort ) bool CITANetAudioStream::Connect( const std::string& sAddress, const int iPort, const bool bUseUDP )
{ {
return m_pNetAudioStreamingClient->Connect( sAddress, iPort ); return m_pNetAudioStreamingClient->Connect( sAddress, iPort, bUseUDP );
} }
void CITANetAudioStream::Disconnect() void CITANetAudioStream::Disconnect()
...@@ -255,7 +255,7 @@ void CITANetAudioStream::IncrementBlockPointer() ...@@ -255,7 +255,7 @@ void CITANetAudioStream::IncrementBlockPointer()
m_pAudioStreamLogger->log( oLog ); m_pAudioStreamLogger->log( oLog );
} }
int CITANetAudioStream::Transmit( const ITASampleFrame& sfNewSamples, int iNumSamples ) int CITANetAudioStream::Transmit( const ITASampleFrame& sfNewSamples, const int iNumSamples )
{ {
// Take local copies (concurrent access) // Take local copies (concurrent access)
int iCurrentReadCursor = m_iReadCursor; int iCurrentReadCursor = m_iReadCursor;
...@@ -357,7 +357,7 @@ double CITANetAudioStream::GetSampleRate() const ...@@ -357,7 +357,7 @@ double CITANetAudioStream::GetSampleRate() const
return m_dSampleRate; return m_dSampleRate;
} }
std::string CITANetAudioStream::GetStreamingStatusString( int iStreamingStatus ) std::string CITANetAudioStream::GetStreamingStatusString( const int iStreamingStatus )
{ {
if( iStreamingStatus == CITANetAudioStream::INVALID ) if( iStreamingStatus == CITANetAudioStream::INVALID )
return "INVALID"; return "INVALID";
......
...@@ -93,12 +93,12 @@ CITANetAudioStreamingClient::~CITANetAudioStreamingClient() ...@@ -93,12 +93,12 @@ CITANetAudioStreamingClient::~CITANetAudioStreamingClient()
} }
bool CITANetAudioStreamingClient::Connect( const std::string& sAddress, int iPort ) bool CITANetAudioStreamingClient::Connect( const std::string& sAddress, const int iPort, const bool bUseUDP )
{ {
if( GetIsConnected() ) if( GetIsConnected() )
return false; return false;
if( !m_pClient->Connect( sAddress, iPort ) ) if( !m_pClient->Connect( sAddress, iPort, bUseUDP ) )
ITA_EXCEPT1( INVALID_PARAMETER, "Could not connect to " + sAddress ); ITA_EXCEPT1( INVALID_PARAMETER, "Could not connect to " + sAddress );
if( !m_pClient->GetIsConnected() ) if( !m_pClient->GetIsConnected() )
......
...@@ -40,7 +40,7 @@ class VistaConnectionIP; ...@@ -40,7 +40,7 @@ class VistaConnectionIP;
//! Network audio streaming client //! Network audio streaming client
/** /**
* Audio streaming for a signal source that is connected via TCP/IP. * Audio streaming for a signal source that is connected via TCP/IP or UDP.
* Implements the ITA network protocol for audio streaming on client side. * Implements the ITA network protocol for audio streaming on client side.
* *
* @todo: move to src folder * @todo: move to src folder
...@@ -53,7 +53,7 @@ public: ...@@ -53,7 +53,7 @@ public:
CITANetAudioStreamingClient( CITANetAudioStream* pParent ); CITANetAudioStreamingClient( CITANetAudioStream* pParent );
virtual ~CITANetAudioStreamingClient(); virtual ~CITANetAudioStreamingClient();
bool Connect( const std::string& sAddress, int iPort ); bool Connect( const std::string& sAddress, const int iPort, const bool bUseUDP );
bool GetIsConnected() const; bool GetIsConnected() const;
void Disconnect(); void Disconnect();
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
// 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/VistaTCPSocket.h>
#include <VistaBase/VistaTimeUtils.h> #include <VistaBase/VistaTimeUtils.h>
#include <VistaInterProcComm/IPNet/VistaIPAddress.h> #include <VistaInterProcComm/IPNet/VistaIPAddress.h>
#include <VistaInterProcComm/Concurrency/VistaPriority.h> #include <VistaInterProcComm/Concurrency/VistaPriority.h>
...@@ -23,7 +22,7 @@ ...@@ -23,7 +22,7 @@
#include <cmath> #include <cmath>
#include <cassert> #include <cassert>
struct ITAServerLog : public ITALogDataBase struct CITAServerLog : public ITALogDataBase
{ {
inline static std::ostream& outputDesc( std::ostream& os ) inline static std::ostream& outputDesc( std::ostream& os )
{ {
...@@ -54,7 +53,7 @@ struct ITAServerLog : public ITALogDataBase ...@@ -54,7 +53,7 @@ struct ITAServerLog : public ITALogDataBase
int iTransmittedSamples; int iTransmittedSamples;
}; };
class ITABufferedDataLoggerImplServer : public ITABufferedDataLogger < ITAServerLog > {}; class CITABufferedDataLoggerImplServer : public ITABufferedDataLogger < CITAServerLog > {};
CITANetAudioStreamingServer::CITANetAudioStreamingServer() CITANetAudioStreamingServer::CITANetAudioStreamingServer()
: m_pInputStream( NULL ) : m_pInputStream( NULL )
...@@ -77,7 +76,7 @@ CITANetAudioStreamingServer::~CITANetAudioStreamingServer() ...@@ -77,7 +76,7 @@ CITANetAudioStreamingServer::~CITANetAudioStreamingServer()
{ {
delete m_pNetAudioServer; delete m_pNetAudioServer;
if( GetIsDebuggingEnabled() ) if( GetIsDebuggingEnabled() )
{ {
vstr::out() << "[ ITANetAudioStreamingServer ] Processing statistics: " << m_swTryReadBlockStats.ToString() << std::endl; vstr::out() << "[ ITANetAudioStreamingServer ] Processing statistics: " << m_swTryReadBlockStats.ToString() << std::endl;
...@@ -90,7 +89,7 @@ CITANetAudioStreamingServer::~CITANetAudioStreamingServer() ...@@ -90,7 +89,7 @@ CITANetAudioStreamingServer::~CITANetAudioStreamingServer()
} }
bool CITANetAudioStreamingServer::Start(const std::string& sAddress, int iPort, double dTimeIntervalCientSendStatus) bool CITANetAudioStreamingServer::Start( const std::string& sAddress, const int iPort, const double dTimeIntervalCientSendStatus )
{ {
if( !m_pInputStream ) if( !m_pInputStream )
ITA_EXCEPT1( MODAL_EXCEPTION, "Can not start server without a valid input stream" ); ITA_EXCEPT1( MODAL_EXCEPTION, "Can not start server without a valid input stream" );
...@@ -122,7 +121,7 @@ bool CITANetAudioStreamingServer::Start(const std::string& sAddress, int iPort, ...@@ -122,7 +121,7 @@ bool CITANetAudioStreamingServer::Start(const std::string& sAddress, int iPort,
m_sfTempTransmitBuffer.init( m_pInputStream->GetNumberOfChannels(), oServerParams.iRingBufferSize, true ); m_sfTempTransmitBuffer.init( m_pInputStream->GetNumberOfChannels(), oServerParams.iRingBufferSize, true );
m_pServerLogger = new ITABufferedDataLoggerImplServer(); m_pServerLogger = new CITABufferedDataLoggerImplServer();
m_pServerLogger->setOutputFile( m_sServerLogBaseName + "_Server.log" ); m_pServerLogger->setOutputFile( m_sServerLogBaseName + "_Server.log" );
m_dLastTimeStamp = ITAClock::getDefaultClock()->getTime(); m_dLastTimeStamp = ITAClock::getDefaultClock()->getTime();
...@@ -157,22 +156,22 @@ bool CITANetAudioStreamingServer::LoopBody() ...@@ -157,22 +156,22 @@ bool CITANetAudioStreamingServer::LoopBody()
{ {
const double dNow = ITAClock::getDefaultClock()->getTime(); const double dNow = ITAClock::getDefaultClock()->getTime();
ITAServerLog oLog; CITAServerLog oLog;
oLog.dWorldTimeStamp = dNow; oLog.dWorldTimeStamp = dNow;
oLog.uiBlockId = ++m_iServerBlockId; oLog.uiBlockId = ++m_iServerBlockId;
oLog.iTransmittedSamples = 0; oLog.iTransmittedSamples = 0;
// Sending Samples // Sending Samples
int iEstimatedClientRingBufferTargetLatencyFreeSamples = m_iEstimatedClientRingBufferFreeSamples - ( m_iClientRingBufferSize - m_iTargetLatencySamples ); int iEstimatedClientRingBufferTargetLatencyFreeSamples = m_iEstimatedClientRingBufferFreeSamples - ( m_iClientRingBufferSize - m_iTargetLatencySamples );
if (iEstimatedClientRingBufferTargetLatencyFreeSamples >= m_iSendingBlockLength) if( iEstimatedClientRingBufferTargetLatencyFreeSamples >= m_iSendingBlockLength )
{ {
// Send Samples // Send Samples
int iSendBlocks = iEstimatedClientRingBufferTargetLatencyFreeSamples / m_iSendingBlockLength; int iSendBlocks = iEstimatedClientRingBufferTargetLatencyFreeSamples / m_iSendingBlockLength;
// Besser wre vermutlich, gleich alle samples zu senden und nicht nur einen Block nach dem anderen // Besser wre vermutlich, gleich alle samples zu senden und nicht nur einen Block nach dem anderen
if (m_sfTempTransmitBuffer.GetLength() != m_iSendingBlockLength) if( m_sfTempTransmitBuffer.GetLength() != m_iSendingBlockLength )
m_sfTempTransmitBuffer.init(m_pInputStream->GetNumberOfChannels(), m_iSendingBlockLength, false); m_sfTempTransmitBuffer.init( m_pInputStream->GetNumberOfChannels(), m_iSendingBlockLength, false );
for( int j = 0; j < iSendBlocks; j++ ) for( int j = 0; j < iSendBlocks; j++ )
{ {
...@@ -183,7 +182,7 @@ bool CITANetAudioStreamingServer::LoopBody() ...@@ -183,7 +182,7 @@ bool CITANetAudioStreamingServer::LoopBody()
const float* pfData = m_pInputStream->GetBlockPointer( i, &oStreamInfo ); const float* pfData = m_pInputStream->GetBlockPointer( i, &oStreamInfo );
if( pfData != 0 ) if( pfData != 0 )
m_sfTempTransmitBuffer[i].write(pfData, m_iSendingBlockLength, 0); m_sfTempTransmitBuffer[ i ].write( pfData, m_iSendingBlockLength, 0 );
} }
m_pInputStream->IncrementBlockPointer(); m_pInputStream->IncrementBlockPointer();
...@@ -202,7 +201,7 @@ bool CITANetAudioStreamingServer::LoopBody() ...@@ -202,7 +201,7 @@ bool CITANetAudioStreamingServer::LoopBody()
oLog.iTransmittedSamples = iSendBlocks * m_pInputStream->GetBlocklength(); oLog.iTransmittedSamples = iSendBlocks * m_pInputStream->GetBlocklength();
} }
// Try-read incoming messages from client (e.g. regular status information) // Try-read incoming messages from client (e.g. regular status information)
m_pMessage->ResetMessage(); m_pMessage->ResetMessage();
m_swTryReadBlockStats.start(); m_swTryReadBlockStats.start();
...@@ -253,7 +252,7 @@ bool CITANetAudioStreamingServer::LoopBody() ...@@ -253,7 +252,7 @@ bool CITANetAudioStreamingServer::LoopBody()
} }
if( m_swTryReadBlockStats.started() ) // only stop if still running if( m_swTryReadBlockStats.started() ) // only stop if still running
m_swTryReadBlockStats.stop(); m_swTryReadBlockStats.stop();
oLog.iEstimatedFreeSamples = m_iEstimatedClientRingBufferFreeSamples; oLog.iEstimatedFreeSamples = m_iEstimatedClientRingBufferFreeSamples;
m_pServerLogger->log( oLog ); m_pServerLogger->log( oLog );
...@@ -283,7 +282,7 @@ int CITANetAudioStreamingServer::GetSendingBlockLength() const ...@@ -283,7 +282,7 @@ int CITANetAudioStreamingServer::GetSendingBlockLength() const
return m_iSendingBlockLength; return m_iSendingBlockLength;
} }
void CITANetAudioStreamingServer::SetSendingBlockLength(const int iSendingBlockLength) void CITANetAudioStreamingServer::SetSendingBlockLength( const int iSendingBlockLength )
{ {
m_iSendingBlockLength = iSendingBlockLength; m_iSendingBlockLength = iSendingBlockLength;
} }
...@@ -310,7 +309,7 @@ void CITANetAudioStreamingServer::SetTargetLatencySamples( const int iTargetLate ...@@ -310,7 +309,7 @@ void CITANetAudioStreamingServer::SetTargetLatencySamples( const int iTargetLate
ITA_EXCEPT1( MODAL_EXCEPTION, "Server not connected, client ring buffer unkown" ); ITA_EXCEPT1( MODAL_EXCEPTION, "Server not connected, client ring buffer unkown" );
if( m_pInputStream ) if( m_pInputStream )
if( m_iTargetLatencySamples < m_pInputStream->GetBlocklength() ) if( m_iTargetLatencySamples < int( m_pInputStream->GetBlocklength() ) )
ITA_EXCEPT1( INVALID_PARAMETER, "Target latency has to be at least the block size of the audio streaming at client side." ); ITA_EXCEPT1( INVALID_PARAMETER, "Target latency has to be at least the block size of the audio streaming at client side." );
m_iTargetLatencySamples = iTargetLatency; m_iTargetLatencySamples = iTargetLatency;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment