Fixing compile and linking problems with net stream server user interface

parent fc6ae220
......@@ -72,7 +72,7 @@ include( "src/_SourceFiles.cmake" )
if( ITA_VANET_WITH_NETAUDIO_STREAM_SERVER_EXTENSION )
vista_use_package( ITADataSources REQUIRED FIND_DEPENDENCIES )
list( APPEND ProjectSources "src/VANetAudioStreamServer.cpp src/VANetAudioStreamServerImpl.cpp src/VANetAudioStreamServerImpl.h" )
list( APPEND ProjectSources "src/VANetAudioStreamServer.cpp;src/VANetAudioStreamServerImpl.cpp;src/VANetAudioStreamServerImpl.h" )
endif( )
include_directories( "include" )
......
......@@ -19,6 +19,8 @@
#include <VABaseDefinitions.h>
#include <VASamples.h>
#include <string>
class CVANetAudioStreamServerImpl;
//! Stream server framework for providing samples for a network stream
......@@ -33,11 +35,11 @@ class CVANetAudioStreamServerImpl;
* transmission deviates stream process call timings.
*
*/
public VANET_API CVANetAudioStreamServer
class VANET_API CVANetAudioStreamServer
{
public:
//! Create a network audio stream
CVANetAudioStreamServer();
CVANetAudioStreamServer( const double dSampleRate, const int iBlockLength );
virtual ~CVANetAudioStreamServer();
//! Initialize server and start listening on network port
......@@ -48,6 +50,6 @@ public:
private:
CVANetAudioStreamServerImpl* m_pImpl;
}
};
#endif // IW_VANET_AUDIO_STREAM_SERVER
#include <VANetAudioStreamServer.h>
#include "CVANetAudioStreamServerImpl.h"
CVANetAudioStreamServer::CVANetAudioStreamServer()
#include "VANetAudioStreamServerImpl.h"
CVANetAudioStreamServer::CVANetAudioStreamServer( const double dSampleRate, const int iBlockLength )
{
m_pImpl = new CVANetAudioStreamServerImpl();
m_pImpl = new CVANetAudioStreamServerImpl( this, dSampleRate, iBlockLength );
}
CVANetAudioStreamServer::~CVANetAudioStreamServer()
......@@ -13,5 +14,6 @@ CVANetAudioStreamServer::~CVANetAudioStreamServer()
bool CVANetAudioStreamServer::Initialize( const std::string& sBindInterface, const int iBindPort )
{
return m_pImpl->Initialize( sBindInterface, iBindPort );
}
\ No newline at end of file
return m_pImpl->InitializeInternal( sBindInterface, iBindPort );
}
#include "VANetAudioStreamServerImpl.h"
#include <VANetAudioStreamServer.h>
#include <ITAStreamInfo.h>
CVANetAudioStreamServerImpl::CVANetAudioStreamServerImpl( CVANetAudioStreamServer* pParent, const double dSampleRate, const int iBlockLength )
: m_pParent( pParent )
, m_pSampleServer( NULL )
, CITASampleProcessor( 1, dSampleRate, iBlockLength )
{
}
CVANetAudioStreamServerImpl::~CVANetAudioStreamServerImpl()
{
delete m_pSampleServer;
}
void CVANetAudioStreamServerImpl::Process( const ITAStreamInfo* pStreamInfo )
{
m_oStreamInfo.bSyncMod = false;
m_oStreamInfo.bTimeReset = false;
m_oStreamInfo.dCoreTime = pStreamInfo->dTimecode;
m_oStreamInfo.dSysTime = pStreamInfo->dTimecode;
m_oStreamInfo.i64Sample = pStreamInfo->nSamples;
m_pParent->Process( m_sfStreamTransmitBuffer, m_oStreamInfo );
}
bool CVANetAudioStreamServerImpl::InitializeInternal( const std::string& sBindInterface, const int iBindPort )
{
m_pSampleServer = new CITANetAudioSampleServer( this );
const double dSyncTimeInterval = 0.001f; // 1 ms
return m_pSampleServer->Start( sBindInterface, iBindPort, dSyncTimeInterval );
}
\ No newline at end of file
#ifndef IW_VANET_AUDIO_STREAM_SERVER_IMPL
#define IW_VANET_AUDIO_STREAM_SERVER_IMPL
#include <VABaseDefinitions.h>
#include <VASamples.h>
#include <ITANetAudioSampleServer.h>
#include <string>
class CVANetAudioStreamServer;
class ITAStreamInfo;
class CVANetAudioStreamServerImpl : CITASampleProcessor
{
public:
CVANetAudioStreamServerImpl( CVANetAudioStreamServer* pParent, const double, const int );
~CVANetAudioStreamServerImpl();
bool InitializeInternal( const std::string& sBindInterface, const int iBindPort );
void Process( const ITAStreamInfo* pStreamInfo );
private:
CVASampleBuffer m_sfStreamTransmitBuffer;
CVANetAudioStreamServer* m_pParent;
CITANetAudioSampleServer* m_pSampleServer;
CVAAudiostreamState m_oStreamInfo;
};
#endif // IW_VANET_AUDIO_STREAM_SERVER_IMPL
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