removed sample rate offset estimation for now

This commit is contained in:
Volker Fischer 2006-02-26 13:27:19 +00:00
parent c19794c7ce
commit 2d3c5d54ca
10 changed files with 14 additions and 134 deletions

View file

@ -157,14 +157,12 @@ void CChannelSet::GetBlockAllConC ( CVector<int>& vecChanID,
}
void CChannelSet::GetConCliParam ( CVector<CHostAddress>& vecHostAddresses,
CVector<double>& vecdSamOffs,
CVector<int>& veciJitBufSize )
{
CHostAddress InetAddr;
/* init return values */
vecHostAddresses.Init ( MAX_NUM_CHANNELS );
vecdSamOffs.Init ( MAX_NUM_CHANNELS );
veciJitBufSize.Init ( MAX_NUM_CHANNELS );
/* Check all possible channels */
@ -174,7 +172,6 @@ void CChannelSet::GetConCliParam ( CVector<CHostAddress>& vecHostAddresses,
{
/* add new address and sample rate offset to vectors */
vecHostAddresses[i] = InetAddr;
vecdSamOffs[i] = vecChannels[i].GetResampleOffset ();
veciJitBufSize[i] = vecChannels[i].GetSockBufSize ();
}
}
@ -200,9 +197,6 @@ for ( int i = 0; i < MAX_NUM_CHANNELS; i++ )
\******************************************************************************/
CChannel::CChannel ()
{
/* init time stamp activation counter */
iTimeStampActCnt = NUM_BL_TIME_STAMPS;
/* init time stamp index counter */
byTimeStampIdxCnt = 0;
@ -218,9 +212,6 @@ CChannel::CChannel ()
/* init time-out for the buffer with zero -> no connection */
iConTimeOut = 0;
/* init sample rate offset estimation object */
SampleOffsetEst.Init();
/* connections ---------------------------------------------------------- */
@ -287,11 +278,6 @@ for (int i = 0; i < BLOCK_SIZE_SAMPLES; i++)
/* reset time-out counter */
iConTimeOut = CON_TIME_OUT_CNT_MAX;
}
else if ( iNumBytes == 1 )
{
/* time stamp packet */
SampleOffsetEst.AddTimeStampIdx ( vecbyData[0] );
}
else
{
@ -322,13 +308,6 @@ bool CChannel::GetData ( CVector<double>& vecdData )
if ( iConTimeOut > 0 )
{
iConTimeOut--;
/* if time out is reached, re-init resample offset estimation
module */
if ( iConTimeOut == 0 )
{
SampleOffsetEst.Init ();
}
}
}
@ -355,25 +334,6 @@ CVector<unsigned char> CChannel::PrepSendPacket(const CVector<short>& vecsNPacke
return vecbySendBuf;
}
int CChannel::GetTimeStampIdx ()
{
/* only send time stamp index after a pre-defined number of packets */
if ( iTimeStampActCnt > 0 )
{
iTimeStampActCnt--;
return INVALID_TIME_STAMP_IDX;
}
else
{
/* reset time stamp activation counter */
iTimeStampActCnt = NUM_BL_TIME_STAMPS - 1;
/* wraps around automatically */
byTimeStampIdxCnt++;
return byTimeStampIdxCnt;
}
}
/******************************************************************************\
* CSampleOffsetEst *

View file

@ -48,9 +48,6 @@
/* no valid channel number */
#define INVALID_CHANNEL_ID (MAX_NUM_CHANNELS + 1)
/* no valid time stamp index */
#define INVALID_TIME_STAMP_IDX -1
/* Classes ********************************************************************/
class CSampleOffsetEst
@ -91,9 +88,7 @@ public:
bool IsConnected () const { return iConTimeOut > 0; }
int GetTimeStampIdx ();
int GetComprAudSize () { return iAudComprSize; }
double GetResampleOffset () { return SampleOffsetEst.GetSamRate (); }
void SetAddress ( const CHostAddress NAddr ) { InetAddr = NAddr; }
bool GetAddress ( CHostAddress& RetAddr );
@ -119,8 +114,6 @@ protected:
CVector<double> vecdResInData;
CVector<double> vecdResOutData;
CSampleOffsetEst SampleOffsetEst;
/* connection parameters */
CHostAddress InetAddr;
@ -162,7 +155,6 @@ public:
void GetBlockAllConC(CVector<int>& vecChanID,
CVector<CVector<double> >& vecvecdData);
void GetConCliParam(CVector<CHostAddress>& vecHostAddresses,
CVector<double>& vecdSamOffs,
CVector<int>& veciJitBufSize);
/* access functions for actual channels */
@ -173,8 +165,6 @@ public:
{return vecChannels[iChanNum].PrepSendPacket(vecsNPacket);}
CHostAddress GetAddress(const int iChanNum)
{return vecChannels[iChanNum].GetAddress();}
int GetTimeStampIdx(const int iChanNum)
{return vecChannels[iChanNum].GetTimeStampIdx();}
void SetSockBufSize ( const int iNewBlockSize, const int iNumBlocks);
int GetSockBufSize() {return vecChannels[0].GetSockBufSize();}

View file

@ -31,23 +31,18 @@ CClient::CClient () : bRun ( false ), Socket ( &Channel ),
iReverbLevel ( AUD_REVERB_MAX / 6 ),
bReverbOnLeftChan ( false )
{
QObject::connect(&Channel, SIGNAL(MessReadyForSending()),
this, SLOT(OnSendProtMessage()));
// connection for protocol
QObject::connect ( &Channel, SIGNAL ( MessReadyForSending () ),
this, SLOT ( OnSendProtMessage () ) );
}
void CClient::OnSendProtMessage ()
{
// the protocol queries me to call the function to send the message
// send it through the network
Socket.SendPacket ( Channel.GetSendMessage (),
Channel.GetAddress(), Channel.GetTimeStampIdx() );
Channel.GetAddress () );
}
bool CClient::SetServerAddr(QString strNAddr)
{
@ -204,8 +199,8 @@ void CClient::run()
}
/* send it through the network */
Socket.SendPacket(Channel.PrepSendPacket(vecsNetwork),
Channel.GetAddress(), Channel.GetTimeStampIdx());
Socket.SendPacket ( Channel.PrepSendPacket ( vecsNetwork ),
Channel.GetAddress () );
/* receive a new block */
if (Channel.GetData(vecdNetwData))

View file

@ -67,9 +67,6 @@ CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP, QWidget* parent,
/* init status label */
OnTimerStatus ();
/* init sample rate offset label */
TextSamRateOffsValue->setText ( "0 Hz" );
/* init connection button text */
PushButtonConnect->setText ( CON_BUT_CONNECTTEXT );
@ -288,11 +285,6 @@ void CLlconClientDlg::OnTimerStatus ()
{
TextLabelStatus->setText ( tr ( "disconnected" ) );
}
/* update sample rate offset label */
QString strSamRaOffs;
strSamRaOffs.setNum(pClient->GetChannel()->GetResampleOffset(), 'f', 2);
TextSamRateOffsValue->setText(strSamRaOffs + " Hz");
/* response time */
TextLabelStdDevTimer->setText(QString().

View file

@ -1049,45 +1049,6 @@
</widget>
</hbox>
</widget>
<widget>
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
<cstring>Layout18</cstring>
</property>
<hbox>
<property stdset="1">
<name>margin</name>
<number>0</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
<widget>
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>TextLabelSamOffset</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>Fs Offs:</string>
</property>
</widget>
<widget>
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>TextSamRateOffsValue</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>24000.00 Hz</string>
</property>
</widget>
</hbox>
</widget>
</vbox>
</widget>
</hbox>

View file

@ -56,8 +56,6 @@ CLlconServerDlg::CLlconServerDlg ( CServer* pNServP, QWidget* parent,
ListViewClients->setColumnAlignment(2, Qt::AlignCenter);
ListViewClients->addColumn(tr("Jitter buffer size"));
ListViewClients->setColumnAlignment(3, Qt::AlignRight);
ListViewClients->addColumn(tr("Sample-rate offset [Hz]"));
ListViewClients->setColumnAlignment(4, Qt::AlignRight);
ListViewClients->clear();
/* insert items in reverse order because in Windows all of them are
@ -108,13 +106,12 @@ CLlconServerDlg::CLlconServerDlg ( CServer* pNServP, QWidget* parent,
void CLlconServerDlg::OnTimer()
{
CVector<CHostAddress> vecHostAddresses;
CVector<double> vecdSamOffs;
CVector<int> veciJitBufSize;
double dCurTiStdDev;
ListViewMutex.lock();
pServer->GetConCliParam(vecHostAddresses, vecdSamOffs, veciJitBufSize);
pServer->GetConCliParam(vecHostAddresses, veciJitBufSize);
/* fill list with connected clients */
for (int i = 0; i < MAX_NUM_CHANNELS; i++)
@ -130,11 +127,6 @@ void CLlconServerDlg::OnTimer()
vecpListViewItems[i]->setText(3,
QString().setNum(veciJitBufSize[i]));
/* sample rate offset */
// FIXME disable sample rate estimation result label since estimation does not work
// vecpListViewItems[i]->setText(4,
// QString().sprintf("%5.2f", vecdSamOffs[i]));
#ifndef _WIN32
vecpListViewItems[i]->setVisible ( true );
#endif

View file

@ -87,8 +87,7 @@ void CServer::OnTimer ()
{
Socket.SendPacket (
ChannelSet.PrepSendPacket ( vecChanID[i], vecsSendData ),
ChannelSet.GetAddress ( vecChanID[i] ),
ChannelSet.GetTimeStampIdx ( vecChanID[i] ) );
ChannelSet.GetAddress ( vecChanID[i] ) );
}

View file

@ -49,9 +49,9 @@ public:
void Stop ();
bool IsRunning() { return Timer.isActive (); }
void GetConCliParam ( CVector<CHostAddress>& vecHostAddresses,
CVector<double>& vecdSamOffs, CVector<int>& veciJitBufSize )
CVector<int>& veciJitBufSize )
{
ChannelSet.GetConCliParam ( vecHostAddresses, vecdSamOffs,
ChannelSet.GetConCliParam ( vecHostAddresses,
veciJitBufSize );
}

View file

@ -66,9 +66,8 @@ void CSocket::Init ()
this, SLOT ( OnDataReceived () ) );
}
void CSocket::SendPacket( const CVector<unsigned char>& vecbySendBuf,
const CHostAddress& HostAddr,
const int iTimeStampIdx )
void CSocket::SendPacket ( const CVector<unsigned char>& vecbySendBuf,
const CHostAddress& HostAddr )
{
const int iVecSizeOut = vecbySendBuf.Size ();
@ -79,14 +78,6 @@ void CSocket::SendPacket( const CVector<unsigned char>& vecbySendBuf,
(const char*) &( (CVector<unsigned char>) vecbySendBuf )[0],
iVecSizeOut, HostAddr.InetAddr, HostAddr.iPort );
}
/* sent time stamp if required */
if ( iTimeStampIdx != INVALID_TIME_STAMP_IDX )
{
/* Always one byte long */
SocketDevice.writeBlock ( (const char*) &iTimeStampIdx, 1,
HostAddr.InetAddr, HostAddr.iPort );
}
}
void CSocket::OnDataReceived ()

View file

@ -56,8 +56,8 @@ public:
{Init();}
virtual ~CSocket() {}
void SendPacket(const CVector<unsigned char>& vecbySendBuf,
const CHostAddress& HostAddr, const int iTimeStampIdx);
void SendPacket ( const CVector<unsigned char>& vecbySendBuf,
const CHostAddress& HostAddr );
protected:
void Init();