Commit 7a53b1a7 authored by Anne Heimes's avatar Anne Heimes

Merge branch 'ba_2016_heimes' of https://git.rwth-aachen.de/ita/ITADataSources into ba_2016_heimes

parents 5c60efa2 960e909f
...@@ -110,23 +110,21 @@ endif( ) ...@@ -110,23 +110,21 @@ endif( )
if( ITA_DATA_SOURCES_WITH_NET_AUDIO ) if( ITA_DATA_SOURCES_WITH_NET_AUDIO )
list( APPEND ITADataSourcesHeader list( APPEND ITADataSourcesHeader
"include/ITANetAudioClient.h"
"include/ITANetAudioMessage.h"
"include/ITANetAudioProtocol.h"
"include/ITANetAudioServer.h"
"include/ITANetAudioStream.h" "include/ITANetAudioStream.h"
"include/ITANetAudioStreamingClient.h"
"include/ITANetAudioStreamingServer.h" "include/ITANetAudioStreamingServer.h"
"include/ITANetAudioStreamingClient.h"
) )
list( APPEND ITADataSourcesSources list( APPEND ITADataSourcesSources
"src/ITANetAudioClient.cpp" "src/ITANetAudioClient.cpp"
"src/ITANetAudioClient.h"
"src/ITANetAudioMessage.cpp" "src/ITANetAudioMessage.cpp"
"src/ITANetAudioProtocol.cpp" "src/ITANetAudioMessage.h"
"src/ITANetAudioProtocol.h"
"src/ITANetAudioServer.cpp"
"src/ITANetAudioServer.h"
"src/ITANetAudioStream.cpp" "src/ITANetAudioStream.cpp"
"src/ITANetAudioStreamingClient.cpp" "src/ITANetAudioStreamingClient.cpp"
"src/ITANetAudioStreamingClient.h"
"src/ITANetAudioStreamingServer.cpp" "src/ITANetAudioStreamingServer.cpp"
"src/ITANetAudioServer.cpp"
) )
endif( ) endif( )
......
...@@ -26,9 +26,6 @@ ...@@ -26,9 +26,6 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include <iostream>
#include <fstream>
using namespace std;
class CITANetAudioStreamingClient; class CITANetAudioStreamingClient;
...@@ -38,7 +35,7 @@ class ITABufferedDataLoggerImplAudio; ...@@ -38,7 +35,7 @@ class ITABufferedDataLoggerImplAudio;
//! Network audio stream //! Network audio stream
/** /**
* 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.
* The network audio stream behaves like a client and receives samples * The network audio stream behaves like a client and receives samples
* from a network audio stream server, CITANetAudioStreamingSearver. * from a network audio stream server, CITANetAudioStreamingSearver.
* *
...@@ -46,11 +43,13 @@ class ITABufferedDataLoggerImplAudio; ...@@ -46,11 +43,13 @@ class ITABufferedDataLoggerImplAudio;
* block the streaming processing, because it is decoupled from the * block the streaming processing, because it is decoupled from the
* network connection and forwards samples from an internal ring buffer. * network connection and forwards samples from an internal ring buffer.
* If the buffer runs out of samples, zeros will be return. If the buffer * If the buffer runs out of samples, zeros will be return. If the buffer
* overruns, the sample server will be suspendeb by blocking the network * overruns, the sample server will be suspended by blocking the network
* data flow. * data flow.
* *
* Latency can be managed by either providing a small ring buffer or * Latency can be managed by either providing a small ring buffer and
* oversizing the ring buffer and requesting a target latency. * constantly filling it uo, or by oversizing the internal ring buffer
* only pushing samples to meet a target latency. This has to be
* implemented by the server.
* *
* \note not thread-safe * \note not thread-safe
*/ */
...@@ -58,7 +57,21 @@ class ITA_DATA_SOURCES_API CITANetAudioStream : public ITADatasource ...@@ -58,7 +57,21 @@ class ITA_DATA_SOURCES_API CITANetAudioStream : public ITADatasource
{ {
public: public:
//! Constructor of a network audio stream //! Constructor of a network audio stream
/**
* @param[in] iChannels Number of channels
* @param[in] dSamplingRate Sampling rate
* @param[in] iBufferSize Size of audio streaming buffer
* @param[in] iRingBufferCapacity Internal ring buffer
*
* The ring buffer capacity should be roughly 6-10 buffer sizes long for short audio streaming buffers,
* and can go down to one block in case of higher audio buffer sizes.
*
* The streaming parameters have to match with the server settings (yes also buffer size, that of the audio streaming context)
*
* @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( int iChannels, double dSamplingRate, int iBufferSize, int iRingBufferCapacity = 2048 );
virtual ~CITANetAudioStream(); virtual ~CITANetAudioStream();
//! Network streaming status of client //! Network streaming status of client
...@@ -68,17 +81,19 @@ public: ...@@ -68,17 +81,19 @@ public:
STOPPED, //!< Client not connected to a server and streaming stopped, i.e. not receiving samples by choice STOPPED, //!< Client not connected to a server and streaming stopped, i.e. not receiving samples by choice
CONNECTED, //!< Client is connected to a sample server (and potentially receives samples) CONNECTED, //!< Client is connected to a sample server (and potentially receives samples)
STREAMING, //!< STREAMING, //!<
BUFFER_UNDERRUN, BUFFER_UNDERRUN, //!< Client internal audio buffer ran out of samples
BUFFER_OVERRUN, BUFFER_OVERRUN, //!< Client internal audio ring buffer is full
}; };
//! Connect a streaming server //! Connect a streaming server
/** /**
* @sAddress[in] Server address IP, i.e. 127.0.0.1 * @sAddress[in] Server address IP (127.0.0.1, localhost, etc.)
* @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
*/ */
bool Connect( const std::string& sAddress, int iPort = 12480 ); bool Connect( const std::string& sAddress, int iPort = 12480 );
//! Disconnct safely from server
void Disconnect(); void Disconnect();
//! Returns the connection status //! Returns the connection status
...@@ -87,27 +102,48 @@ public: ...@@ -87,27 +102,48 @@ public:
*/ */
bool GetIsConnected() const; bool GetIsConnected() const;
//! Sets the minimal latency possible //! Returns the minimal latency possible (single block)
/** /**
* Real-time network audio is considered to process at lowest latency possible. * @return Minimum latency in seconds
* However, this implementation requires at least one block. Hence latency is
* depending on sampling rate and block length.
*
* @sa GetMinimumLatencySamples()
* @sa GetMinimumLatencySamples()
*/ */
float GetMinimumLatencySeconds() const; float GetMinimumLatencySeconds() const;
//! Returns the maximum latency possible (entire ring buffer used)
/**
* @return Maximum latency in seconds
*/
float GetMaximumLatencySeconds() const; float GetMaximumLatencySeconds() const;
//! Returns the minimum latency possible (single block)
/**
* @return Minimum latency in samples
*/
int GetMinimumLatencySamples() const; int GetMinimumLatencySamples() const;
//! Returns the maximum latency possible (entire ring buffer used)
/**
* @return Maximum latency in samples
*/
int GetMaximumLatencySamples() const; int GetMaximumLatencySamples() const;
//! Returns the NetAudio streaming logger base name //! Returns the NetAudio streaming logger base name
std::string GetNetAudioStreamLoggerBaseName() const; std::string GetNetAudioStreamLoggerBaseName() const;
//! Sets the NetAudio streaming logger base name //! Sets the NetAudio streaming logger base name
/**
* If debugging is enabled, all debugging files will be named
* with this suffix.
* @param[in] sBaseName Base name string
*
*/
void SetNetAudioStreamingLoggerBaseName( const std::string& sBaseName ); void SetNetAudioStreamingLoggerBaseName( const std::string& sBaseName );
//! Enabled/disables export of loggers
void SetDebuggingEnabled( bool bEnabled );
//! Logging export flag getter
bool GetIsDebuggingEnabled() const;
//! Returns (static) size of ring buffer //! Returns (static) size of ring buffer
/** /**
* @return Number of maximum samples that can be hold by internal ring buffer * @return Number of maximum samples that can be hold by internal ring buffer
...@@ -200,6 +236,7 @@ private: ...@@ -200,6 +236,7 @@ private:
ITABufferedDataLoggerImplStream* m_pAudioStreamLogger; //!< Logging for the audio stream ITABufferedDataLoggerImplStream* m_pAudioStreamLogger; //!< Logging for the audio stream
ITABufferedDataLoggerImplNet* m_pNetworkStreamLogger; //!< Logging for the network stream ITABufferedDataLoggerImplNet* m_pNetworkStreamLogger; //!< Logging for the network stream
std::string m_sNetAudioStreamLoggerBaseName; std::string m_sNetAudioStreamLoggerBaseName;
bool m_bDebuggingEnabled;
int m_iAudioStreamingBlockID; //!< Audio streaming block id int m_iAudioStreamingBlockID; //!< Audio streaming block id
int m_iNetStreamingBlockID; //!< Network streaming block id int m_iNetStreamingBlockID; //!< Network streaming block id
......
...@@ -21,8 +21,6 @@ ...@@ -21,8 +21,6 @@
#include <ITADataSourcesDefinitions.h> #include <ITADataSourcesDefinitions.h>
#include <ITANetAudioProtocol.h>
#include <ITANetAudioProtocol.h>
#include <ITASampleFrame.h> #include <ITASampleFrame.h>
#include <ITAStopWatch.h> #include <ITAStopWatch.h>
...@@ -40,31 +38,25 @@ class CITANetAudioServer; ...@@ -40,31 +38,25 @@ class CITANetAudioServer;
class CITANetAudioMessage; class CITANetAudioMessage;
class VistaTCPSocket; class VistaTCPSocket;
class ITABufferedDataLoggerImplServer; class ITABufferedDataLoggerImplServer;
class VistaConnectionIP;
//! Network audio sample server (for connecting a net audio stream) //! Network audio streaming server (for connecting a net audio stream) with an ITADataSource connection
/** /**
* Audio sample transmitter for a networked signal source that can connect via TCP/IP. * Audio sample transmitter for a networked signal source that can connect via TCP/IP.
* *
* \sa CITANetAudioStream * @sa CITANetAudioStream, CITANetAudioSampleServer
* \note not thread-safe * @note not thread-safe
*/ */
class ITA_DATA_SOURCES_API CITANetAudioStreamingServer : public VistaThreadLoop class ITA_DATA_SOURCES_API CITANetAudioStreamingServer : public VistaThreadLoop
{ {
public: public:
enum UpdateStrategy
{
AUTO = 1, //!< Automatic update rate based on sample rate and block length of client (default)
ADAPTIVE, //!< Adaptive update rate, adjusts for drifting clocks
CONSTANT, //!< Set a user-defined update rate (may cause forced pausing of sample feeding or dropouts on client side)
};
CITANetAudioStreamingServer(); CITANetAudioStreamingServer();
~CITANetAudioStreamingServer(); ~CITANetAudioStreamingServer();
//! Start to listen on a socket (blocking) //! Start to listen on a socket (blocking)
bool Start(const std::string& sAddress, const int iPort, const double dTimeIntervalCientSendStatus); bool Start( const std::string& sAddress, const int iPort, const double dTimeIntervalCientSendStatus );
bool IsClientConnected() const; bool IsClientConnected() const;
std::string GetNetworkAddress() const; std::string GetNetworkAddress() const;
int GetNetworkPort() const; int GetNetworkPort() const;
...@@ -77,11 +69,16 @@ public: ...@@ -77,11 +69,16 @@ public:
int GetNetStreamNumberOfChannels() const; int GetNetStreamNumberOfChannels() const;
double GetNetStreamSampleRate() const; double GetNetStreamSampleRate() const;
//! Enabled/disables export of loggers
void SetDebuggingEnabled( bool bEnabled );
//! Logging export flag getter
bool GetIsDebuggingEnabled() const;
int GetSendingBlockLength() const; int GetSendingBlockLength() const;
void SetSendingBlockLength( const int iSendingBlockLength ); void SetSendingBlockLength( const int iSendingBlockLength );
void SetAutomaticUpdateRate();
void SetTargetLatencySamples( const int iTargetLatency ); void SetTargetLatencySamples( const int iTargetLatency );
int GetTargetLatencySamples() const; int GetTargetLatencySamples() const;
...@@ -99,20 +96,21 @@ private: ...@@ -99,20 +96,21 @@ private:
ITADatasource* m_pInputStream; ITADatasource* m_pInputStream;
VistaConnectionIP* m_pConnection; VistaConnectionIP* m_pConnection;
CITANetAudioProtocol::StreamingParameters m_oServerParams;
CITANetAudioMessage* m_pMessage; CITANetAudioMessage* m_pMessage;
int iServerBlockId;
ITABufferedDataLoggerImplServer* m_pServerLogger; ITABufferedDataLoggerImplServer* m_pServerLogger;
std::string m_sServerLogBaseName; std::string m_sServerLogBaseName;
ITAStopWatch m_swTryReadBlockStats, m_swTryReadAccessStats; ITAStopWatch m_swTryReadBlockStats, m_swTryReadAccessStats;
bool m_bDebuggingEnabled;
int m_iServerBlockId;
double m_dLastTimeStamp;
int m_iUpdateStrategy;
int m_iEstimatedClientRingBufferFreeSamples;
int m_iTargetLatencySamples; int m_iTargetLatencySamples;
int m_iMaxSendBlocks; int m_iEstimatedClientRingBufferFreeSamples;
int m_iClientRingBufferSize;
int m_iSendingBlockLength; int m_iSendingBlockLength;
double m_dLastTimeStamp; int m_iMaxSendBlocks;
friend class CITANetAudioServer; friend class CITANetAudioServer;
}; };
......
#include <ITANetAudioClient.h> #include "ITANetAudioClient.h"
#include <ITANetAudioMessage.h>
#include <ITANetAudioProtocol.h>
#include <ITANetAudioStream.h> #include <ITANetAudioStream.h>
#include <ITAException.h>
#include <VistaInterProcComm/Connections/VistaConnectionIP.h> #include <VistaInterProcComm/Connections/VistaConnectionIP.h>
......
#include <ITANetAudioMessage.h> #include "ITANetAudioMessage.h"
#include <ITAClock.h>
#include <ITADataLog.h>
#include <ITAStringUtils.h> #include <ITAStringUtils.h>
#include <VistaInterProcComm/Connections/VistaConnectionIP.h> #include <VistaInterProcComm/Connections/VistaConnectionIP.h>
#include <VistaBase/VistaExceptionBase.h> #include <VistaBase/VistaExceptionBase.h>
#include <VistaBase/VistaStreamUtils.h> #include <VistaBase/VistaStreamUtils.h>
#include <ITAClock.h>
#include <ITADataLog.h>
#include <cstring>
#include <algorithm> #include <algorithm>
#include <cstring>
#include <cassert> #include <cassert>
#include <iostream> #include <iostream>
#include <iomanip> #include <iomanip>
...@@ -58,6 +59,7 @@ CITANetAudioMessage::CITANetAudioMessage( VistaSerializingToolset::ByteOrderSwap ...@@ -58,6 +59,7 @@ CITANetAudioMessage::CITANetAudioMessage( VistaSerializingToolset::ByteOrderSwap
, m_pConnection( NULL ) , m_pConnection( NULL )
, m_iBytesReceivedTotal( 0 ) , m_iBytesReceivedTotal( 0 )
, m_sMessageLoggerBaseName( "ITANetAudioMessage" ) , m_sMessageLoggerBaseName( "ITANetAudioMessage" )
, m_bDebuggingEnabled( false )
{ {
m_pMessageLogger = new ITABufferedDataLoggerImplProtocol(); m_pMessageLogger = new ITABufferedDataLoggerImplProtocol();
m_pMessageLogger->setOutputFile( m_sMessageLoggerBaseName + ".log" ); m_pMessageLogger->setOutputFile( m_sMessageLoggerBaseName + ".log" );
...@@ -200,8 +202,8 @@ bool CITANetAudioMessage::ReadMessage( int timeout ) ...@@ -200,8 +202,8 @@ bool CITANetAudioMessage::ReadMessage( int timeout )
VistaType::sint32 nMessagePayloadSize; VistaType::sint32 nMessagePayloadSize;
int nBytesRead = m_pConnection->ReadInt32( nMessagePayloadSize ); int nBytesRead = m_pConnection->ReadInt32( nMessagePayloadSize );
oLog.nMessagePayloadSize = nMessagePayloadSize;
assert( nBytesRead == sizeof( VistaType::sint32 ) ); assert( nBytesRead == sizeof( VistaType::sint32 ) );
oLog.nMessagePayloadSize = nMessagePayloadSize;
#if NET_AUDIO_SHOW_TRAFFIC #if NET_AUDIO_SHOW_TRAFFIC
vstr::out() << "CITANetAudioMessage [ Reading ] Expecting " << nMessagePayloadSize << " bytes message payload" << std::endl; vstr::out() << "CITANetAudioMessage [ Reading ] Expecting " << nMessagePayloadSize << " bytes message payload" << std::endl;
#endif #endif
...@@ -368,6 +370,8 @@ VistaConnectionIP* CITANetAudioMessage::GetConnection() const ...@@ -368,6 +370,8 @@ VistaConnectionIP* CITANetAudioMessage::GetConnection() const
void CITANetAudioMessage::ClearConnection() void CITANetAudioMessage::ClearConnection()
{ {
m_pConnection = NULL; m_pConnection = NULL;
if( GetIsDebuggingEnabled() == false )
m_pMessageLogger->setOutputFile( "" ); // disable output
delete m_pMessageLogger; delete m_pMessageLogger;
} }
...@@ -462,3 +466,13 @@ std::string CITANetAudioMessage::GetMessageLoggerBaseName() const ...@@ -462,3 +466,13 @@ std::string CITANetAudioMessage::GetMessageLoggerBaseName() const
{ {
return m_sMessageLoggerBaseName; return m_sMessageLoggerBaseName;
} }
void CITANetAudioMessage::SetDebuggingEnabled( bool bEnabled )
{
m_bDebuggingEnabled = bEnabled;
}
bool CITANetAudioMessage::GetIsDebuggingEnabled() const
{
return m_bDebuggingEnabled;
}
...@@ -21,11 +21,12 @@ ...@@ -21,11 +21,12 @@
#include <ITADataSourcesDefinitions.h> #include <ITADataSourcesDefinitions.h>
#include "ITANetAudioProtocol.h"
// ITA includes // ITA includes
#include <ITAException.h> #include <ITAException.h>
#include <ITASampleBuffer.h> #include <ITASampleBuffer.h>
#include <ITASampleFrame.h> #include <ITASampleFrame.h>
#include <ITANetAudioProtocol.h>
// Vista includes // Vista includes
#include <VistaInterProcComm/Connections/VistaByteBufferSerializer.h> #include <VistaInterProcComm/Connections/VistaByteBufferSerializer.h>
...@@ -97,6 +98,8 @@ public: ...@@ -97,6 +98,8 @@ public:
void SetMessageLoggerBaseName( const std::string& ); void SetMessageLoggerBaseName( const std::string& );
std::string GetMessageLoggerBaseName() const; std::string GetMessageLoggerBaseName() const;
void SetDebuggingEnabled( bool bEnabled );
bool GetIsDebuggingEnabled() const;
private: private:
int m_nMessageType; int m_nMessageType;
...@@ -111,6 +114,7 @@ private: ...@@ -111,6 +114,7 @@ private:
ITABufferedDataLoggerImplProtocol* m_pMessageLogger; ITABufferedDataLoggerImplProtocol* m_pMessageLogger;
std::string m_sMessageLoggerBaseName; std::string m_sMessageLoggerBaseName;
bool m_bDebuggingEnabled;
}; };
#endif // INCLUDE_WATCHER_ITA_NET_AUDIO_MESSAGE #endif // INCLUDE_WATCHER_ITA_NET_AUDIO_MESSAGE
#include <ITANetAudioProtocol.h> #include "ITANetAudioProtocol.h"
// @todo remove (all inline implemented) // @todo remove (all inline implemented)
\ No newline at end of file
...@@ -54,6 +54,7 @@ public: ...@@ -54,6 +54,7 @@ public:
static const int NP_SERVER_OPEN = 200; static const int NP_SERVER_OPEN = 200;
static const int NP_SERVER_CLOSE = 201; static const int NP_SERVER_CLOSE = 201;
static const int NP_SERVER_REFUSED_INVALID_PARAMETERS = 202;
static const int NP_SERVER_GET_RINGBUFFER_FREE_SAMPLES = 211; static const int NP_SERVER_GET_RINGBUFFER_FREE_SAMPLES = 211;
static const int NP_SERVER_SENDING_SAMPLES = 222; static const int NP_SERVER_SENDING_SAMPLES = 222;
...@@ -69,6 +70,7 @@ public: ...@@ -69,6 +70,7 @@ public:
case NP_CLIENT_CLOSE: return "CLIENT_CLOSE"; case NP_CLIENT_CLOSE: return "CLIENT_CLOSE";
case NP_CLIENT_SENDING_RINGBUFFER_FREE_SAMPLES: return "CLIENT_SENDING_RINGBUFFER_FREE_SAMPLES"; case NP_CLIENT_SENDING_RINGBUFFER_FREE_SAMPLES: return "CLIENT_SENDING_RINGBUFFER_FREE_SAMPLES";
case NP_SERVER_OPEN: return "SERVER_OPEN"; case NP_SERVER_OPEN: return "SERVER_OPEN";
case NP_SERVER_REFUSED_INVALID_PARAMETERS: return "NP_SERVER_REFUSED_INVALID_PARAMETERS";
case NP_SERVER_CLOSE: return "SERVER_CLOSE"; case NP_SERVER_CLOSE: return "SERVER_CLOSE";
case NP_SERVER_GET_RINGBUFFER_FREE_SAMPLES: return "SERVER_GET_RINGBUFFER_FREE_SAMPLES"; case NP_SERVER_GET_RINGBUFFER_FREE_SAMPLES: return "SERVER_GET_RINGBUFFER_FREE_SAMPLES";
case NP_SERVER_SENDING_SAMPLES: return "SERVER_SENDING_SAMPLES"; case NP_SERVER_SENDING_SAMPLES: return "SERVER_SENDING_SAMPLES";
......
#include <ITANetAudioServer.h> #include "ITANetAudioServer.h"
#include "ITANetAudioProtocol.h"
#include <ITANetAudioStreamingServer.h> #include <ITANetAudioStreamingServer.h>
#include <ITANetAudioProtocol.h>
// ITA includes // ITA includes
#include <ITADataSource.h> #include <ITADataSource.h>
...@@ -29,9 +30,9 @@ CITANetAudioServer::CITANetAudioServer() ...@@ -29,9 +30,9 @@ CITANetAudioServer::CITANetAudioServer()
CITANetAudioServer::~CITANetAudioServer() CITANetAudioServer::~CITANetAudioServer()
{ {
m_pSocket = NULL;
delete m_pConnection; delete m_pConnection;
delete m_pServer; delete m_pServer;
delete m_pSocket;
} }
std::string CITANetAudioServer::GetServerAddress() const std::string CITANetAudioServer::GetServerAddress() const
......
...@@ -21,8 +21,6 @@ ...@@ -21,8 +21,6 @@
#include <ITADataSourcesDefinitions.h> #include <ITADataSourcesDefinitions.h>
#include <ITANetAudioProtocol.h>
#include <ITASampleFrame.h> #include <ITASampleFrame.h>
#include <string> #include <string>
...@@ -65,4 +63,5 @@ private: ...@@ -65,4 +63,5 @@ private:
std::string m_sServerAddress; std::string m_sServerAddress;
}; };
#endif // INCLUDE_WATCHER_ITA_NET_AUDIO_SERVER #endif // INCLUDE_WATCHER_ITA_NET_AUDIO_SERVER
#include <ITANetAudioStream.h> #include <ITANetAudioStream.h>
#include <ITANetAudioStreamingClient.h> #include "ITANetAudioStreamingClient.h"
// ITA includes // ITA includes
#include <ITAException.h> #include <ITAException.h>
#include <ITADataLog.h> #include <ITADataLog.h>
#include <ITAStreamInfo.h> #include <ITAStreamInfo.h>
#include <ITAClock.h> #include <ITAClock.h>
#include <iomanip>
// Vista includes // Vista includes
#include <VistaBase/VistaStreamUtils.h> #include <VistaBase/VistaStreamUtils.h>
// STL includes // STL includes
#include <cmath> #include <cmath>
#include <iomanip>
#include <iostream> #include <iostream>
...@@ -97,6 +97,7 @@ CITANetAudioStream::CITANetAudioStream(int iChannels, double dSamplingRate, int ...@@ -97,6 +97,7 @@ CITANetAudioStream::CITANetAudioStream(int iChannels, double dSamplingRate, int
, m_iWriteCursor( 0 ) // always ahead, i.e. iWriteCursor >= iReadCursor if unwrapped , m_iWriteCursor( 0 ) // always ahead, i.e. iWriteCursor >= iReadCursor if unwrapped
, m_iAudioStreamingBlockID( 0 ) , m_iAudioStreamingBlockID( 0 )
, m_iNetStreamingBlockID( 0 ) , m_iNetStreamingBlockID( 0 )
, m_bDebuggingEnabled( false )
{ {
if( iBufferSize > iRingBufferCapacity ) if( iBufferSize > iRingBufferCapacity )
ITA_EXCEPT1( INVALID_PARAMETER, "Ring buffer capacity can not be smaller than Target Sample Latency." ); ITA_EXCEPT1( INVALID_PARAMETER, "Ring buffer capacity can not be smaller than Target Sample Latency." );
...@@ -114,6 +115,12 @@ CITANetAudioStream::CITANetAudioStream(int iChannels, double dSamplingRate, int ...@@ -114,6 +115,12 @@ CITANetAudioStream::CITANetAudioStream(int iChannels, double dSamplingRate, int
CITANetAudioStream::~CITANetAudioStream() CITANetAudioStream::~CITANetAudioStream()
{ {
if( GetIsDebuggingEnabled() == false )
{