From c5cf24f58e7579e3d9b24d30ddbf1aa1e46fe129 Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Sat, 16 Sep 2006 11:26:15 +0000 Subject: [PATCH] bug fix for exchanging initial jitter buffer size value on new connect, show block size in server GUI, always show version number in GUI which is set in global.h --- src/channel.cpp | 42 ++++++++++++++++++++++-------------------- src/channel.h | 12 ++++++++---- src/global.h | 7 +++---- src/llconserverdlg.cpp | 25 ++++++++++++++++++++----- src/server.h | 8 +++++--- 5 files changed, 58 insertions(+), 36 deletions(-) diff --git a/src/channel.cpp b/src/channel.cpp index 8b7df30a..2a85dd6d 100755 --- a/src/channel.cpp +++ b/src/channel.cpp @@ -37,11 +37,11 @@ CChannelSet::CChannelSet() QObject::connect(&vecChannels[2],SIGNAL(MessReadyForSending(CVector)),this,SLOT(OnSendProtMessCh2(CVector))); QObject::connect(&vecChannels[3],SIGNAL(MessReadyForSending(CVector)),this,SLOT(OnSendProtMessCh3(CVector))); QObject::connect(&vecChannels[4],SIGNAL(MessReadyForSending(CVector)),this,SLOT(OnSendProtMessCh4(CVector))); - QObject::connect(&vecChannels[5],SIGNAL(MessReadyForSending(CVector)),this,SLOT(OnSendProtMessCh5(CVector))); - QObject::connect(&vecChannels[6],SIGNAL(MessReadyForSending(CVector)),this,SLOT(OnSendProtMessCh6(CVector))); - QObject::connect(&vecChannels[7],SIGNAL(MessReadyForSending(CVector)),this,SLOT(OnSendProtMessCh7(CVector))); - QObject::connect(&vecChannels[8],SIGNAL(MessReadyForSending(CVector)),this,SLOT(OnSendProtMessCh8(CVector))); - QObject::connect(&vecChannels[9],SIGNAL(MessReadyForSending(CVector)),this,SLOT(OnSendProtMessCh9(CVector))); +// QObject::connect(&vecChannels[5],SIGNAL(MessReadyForSending(CVector)),this,SLOT(OnSendProtMessCh5(CVector))); +// QObject::connect(&vecChannels[6],SIGNAL(MessReadyForSending(CVector)),this,SLOT(OnSendProtMessCh6(CVector))); +// QObject::connect(&vecChannels[7],SIGNAL(MessReadyForSending(CVector)),this,SLOT(OnSendProtMessCh7(CVector))); +// QObject::connect(&vecChannels[8],SIGNAL(MessReadyForSending(CVector)),this,SLOT(OnSendProtMessCh8(CVector))); +// QObject::connect(&vecChannels[9],SIGNAL(MessReadyForSending(CVector)),this,SLOT(OnSendProtMessCh9(CVector))); // request jitter buffer size QObject::connect(&vecChannels[0],SIGNAL(NewConnection()),this,SLOT(OnNewConnectionCh0())); @@ -49,11 +49,11 @@ CChannelSet::CChannelSet() QObject::connect(&vecChannels[2],SIGNAL(NewConnection()),this,SLOT(OnNewConnectionCh2())); QObject::connect(&vecChannels[3],SIGNAL(NewConnection()),this,SLOT(OnNewConnectionCh3())); QObject::connect(&vecChannels[4],SIGNAL(NewConnection()),this,SLOT(OnNewConnectionCh4())); - QObject::connect(&vecChannels[5],SIGNAL(NewConnection()),this,SLOT(OnNewConnectionCh5())); - QObject::connect(&vecChannels[6],SIGNAL(NewConnection()),this,SLOT(OnNewConnectionCh6())); - QObject::connect(&vecChannels[7],SIGNAL(NewConnection()),this,SLOT(OnNewConnectionCh7())); - QObject::connect(&vecChannels[8],SIGNAL(NewConnection()),this,SLOT(OnNewConnectionCh8())); - QObject::connect(&vecChannels[9],SIGNAL(NewConnection()),this,SLOT(OnNewConnectionCh9())); +// QObject::connect(&vecChannels[5],SIGNAL(NewConnection()),this,SLOT(OnNewConnectionCh5())); +// QObject::connect(&vecChannels[6],SIGNAL(NewConnection()),this,SLOT(OnNewConnectionCh6())); +// QObject::connect(&vecChannels[7],SIGNAL(NewConnection()),this,SLOT(OnNewConnectionCh7())); +// QObject::connect(&vecChannels[8],SIGNAL(NewConnection()),this,SLOT(OnNewConnectionCh8())); +// QObject::connect(&vecChannels[9],SIGNAL(NewConnection()),this,SLOT(OnNewConnectionCh9())); } int CChannelSet::GetFreeChan() @@ -196,22 +196,28 @@ void CChannelSet::GetBlockAllConC ( CVector& vecChanID, } void CChannelSet::GetConCliParam ( CVector& vecHostAddresses, - CVector& veciJitBufSize ) + CVector& veciJitBufSize, + CVector& veciNetwOutBlSiFact, + CVector& veciNetwInBlSiFact ) { CHostAddress InetAddr; /* init return values */ vecHostAddresses.Init ( MAX_NUM_CHANNELS ); - veciJitBufSize.Init ( MAX_NUM_CHANNELS ); + veciJitBufSize.Init ( MAX_NUM_CHANNELS ); + veciNetwOutBlSiFact.Init ( MAX_NUM_CHANNELS ); + veciNetwInBlSiFact.Init ( MAX_NUM_CHANNELS ); /* Check all possible channels */ for ( int i = 0; i < MAX_NUM_CHANNELS; i++ ) { if ( vecChannels[i].GetAddress ( InetAddr ) ) { - /* add new address and sample rate offset to vectors */ + /* get requested data */ vecHostAddresses[i] = InetAddr; - veciJitBufSize[i] = vecChannels[i].GetSockBufSize (); + veciJitBufSize[i] = vecChannels[i].GetSockBufSize (); + veciNetwOutBlSiFact[i] = vecChannels[i].GetNetwBufSizeFactOut (); + veciNetwInBlSiFact[i] = vecChannels[i].GetNetwBufSizeFactIn (); } } } @@ -347,7 +353,7 @@ void CChannel::OnJittBufSizeChange ( int iNewJitBufSize ) bool CChannel::GetAddress(CHostAddress& RetAddr) { - if (IsConnected()) + if ( IsConnected() ) { RetAddr = InetAddr; return true; @@ -426,11 +432,7 @@ for ( int i = 0; i < iCurNetwInBlSiFact * MIN_BLOCK_SIZE_SAMPLES; i++ ) { else { // only use protocol data if channel is connected - -// must be disabled to be able to receive network buffer size factor changes -// FIXME check, if this condition must be checked somewhere else! -// if ( IsConnected() ) - + if ( IsConnected() ) { // this seems not to be an audio block, parse the message if ( Protocol.ParseMessage ( vecbyData, iNumBytes ) ) diff --git a/src/channel.h b/src/channel.h index 9bd8977c..83f78280 100755 --- a/src/channel.h +++ b/src/channel.h @@ -43,7 +43,7 @@ /* maximum number of internet connections (channels) */ // if you want to change this paramter, change the connections in this class, too! -#define MAX_NUM_CHANNELS 10 /* max number channels for server */ +#define MAX_NUM_CHANNELS 5//10 /* max number channels for server */ /* no valid channel number */ #define INVALID_CHANNEL_ID (MAX_NUM_CHANNELS + 1) @@ -86,6 +86,8 @@ public: void SetNetwBufSizeFactOut ( const int iNewNetwBlSiFactOut ); int GetNetwBufSizeFactOut() { return iCurNetwOutBlSiFact; } + int GetNetwBufSizeFactIn() { return iCurNetwInBlSiFact; } + // network protocol interface void CreateJitBufMes ( const int iJitBufSize ) { @@ -177,9 +179,11 @@ public: void GetBlockAllConC ( CVector& vecChanID, CVector >& vecvecdData ); - - void GetConCliParam( CVector& vecHostAddresses, - CVector& veciJitBufSize ); + + void GetConCliParam ( CVector& vecHostAddresses, + CVector& veciJitBufSize, + CVector& veciNetwOutBlSiFact, + CVector& veciNetwInBlSiFact ); /* access functions for actual channels */ bool IsConnected ( const int iChanNum ) diff --git a/src/global.h b/src/global.h index 20fd7a72..93a0d613 100755 --- a/src/global.h +++ b/src/global.h @@ -40,10 +40,9 @@ #define _DEBUG_ #undef _DEBUG_ -/* version and application name */ -#ifndef VERSION -# define VERSION "0.9.5cvs" -#endif +/* version and application name (always use this version) */ +#undef VERSION +#define VERSION "0.9.6cvs" #define APP_NAME "llcon" diff --git a/src/llconserverdlg.cpp b/src/llconserverdlg.cpp index 8495c726..a0425f95 100755 --- a/src/llconserverdlg.cpp +++ b/src/llconserverdlg.cpp @@ -55,6 +55,10 @@ 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("Block Size In")); + ListViewClients->setColumnAlignment(4, Qt::AlignRight); + ListViewClients->addColumn(tr("Block Size Out")); + ListViewClients->setColumnAlignment(5, Qt::AlignRight); ListViewClients->clear(); /* insert items in reverse order because in Windows all of them are @@ -96,11 +100,14 @@ void CLlconServerDlg::OnTimer() { CVector vecHostAddresses; CVector veciJitBufSize; + CVector veciNetwOutBlSiFact; + CVector veciNetwInBlSiFact; double dCurTiStdDev; ListViewMutex.lock(); - - pServer->GetConCliParam(vecHostAddresses, veciJitBufSize); + + pServer->GetConCliParam ( vecHostAddresses, veciJitBufSize, + veciNetwOutBlSiFact, veciNetwInBlSiFact ); /* fill list with connected clients */ for (int i = 0; i < MAX_NUM_CHANNELS; i++) @@ -115,6 +122,14 @@ void CLlconServerDlg::OnTimer() /* jitter buffer size (polling for updates) */ vecpListViewItems[i]->setText(3, QString().setNum(veciJitBufSize[i])); + + /* in / out network block sizes */ + vecpListViewItems[i]->setText(4, + QString().setNum( + double(veciNetwInBlSiFact[i] * MIN_BLOCK_DURATION_MS), 'f', 2)); + vecpListViewItems[i]->setText(5, + QString().setNum( + double(veciNetwOutBlSiFact[i] * MIN_BLOCK_DURATION_MS), 'f', 2)); #ifndef _WIN32 vecpListViewItems[i]->setVisible ( true ); @@ -124,9 +139,9 @@ void CLlconServerDlg::OnTimer() { #ifdef _WIN32 /* remove text for Windows version */ - vecpListViewItems[i]->setText(0,""); - vecpListViewItems[i]->setText(3,""); - vecpListViewItems[i]->setText(4,""); + vecpListViewItems[i]->setText(0, ""); + vecpListViewItems[i]->setText(3, ""); + vecpListViewItems[i]->setText(4, ""); #else vecpListViewItems[i]->setVisible ( false ); #endif diff --git a/src/server.h b/src/server.h index b36eeddc..4f12662e 100755 --- a/src/server.h +++ b/src/server.h @@ -48,11 +48,13 @@ public: void Start (); void Stop (); bool IsRunning() { return Timer.isActive (); } - void GetConCliParam ( CVector& vecHostAddresses, - CVector& veciJitBufSize ) + + void GetConCliParam ( CVector& vecHostAddresses, + CVector& veciJitBufSize, CVector& veciNetwOutBlSiFact, + CVector& veciNetwInBlSiFact) { ChannelSet.GetConCliParam ( vecHostAddresses, - veciJitBufSize ); + veciJitBufSize, veciNetwOutBlSiFact, veciNetwInBlSiFact ); } bool GetTimingStdDev ( double& dCurTiStdDev );