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

This commit is contained in:
Volker Fischer 2006-09-16 11:26:15 +00:00
parent 06f36372e3
commit c5cf24f58e
5 changed files with 58 additions and 36 deletions

View File

@ -37,11 +37,11 @@ CChannelSet::CChannelSet()
QObject::connect(&vecChannels[2],SIGNAL(MessReadyForSending(CVector<uint8_t>)),this,SLOT(OnSendProtMessCh2(CVector<uint8_t>))); QObject::connect(&vecChannels[2],SIGNAL(MessReadyForSending(CVector<uint8_t>)),this,SLOT(OnSendProtMessCh2(CVector<uint8_t>)));
QObject::connect(&vecChannels[3],SIGNAL(MessReadyForSending(CVector<uint8_t>)),this,SLOT(OnSendProtMessCh3(CVector<uint8_t>))); QObject::connect(&vecChannels[3],SIGNAL(MessReadyForSending(CVector<uint8_t>)),this,SLOT(OnSendProtMessCh3(CVector<uint8_t>)));
QObject::connect(&vecChannels[4],SIGNAL(MessReadyForSending(CVector<uint8_t>)),this,SLOT(OnSendProtMessCh4(CVector<uint8_t>))); QObject::connect(&vecChannels[4],SIGNAL(MessReadyForSending(CVector<uint8_t>)),this,SLOT(OnSendProtMessCh4(CVector<uint8_t>)));
QObject::connect(&vecChannels[5],SIGNAL(MessReadyForSending(CVector<uint8_t>)),this,SLOT(OnSendProtMessCh5(CVector<uint8_t>))); // QObject::connect(&vecChannels[5],SIGNAL(MessReadyForSending(CVector<uint8_t>)),this,SLOT(OnSendProtMessCh5(CVector<uint8_t>)));
QObject::connect(&vecChannels[6],SIGNAL(MessReadyForSending(CVector<uint8_t>)),this,SLOT(OnSendProtMessCh6(CVector<uint8_t>))); // QObject::connect(&vecChannels[6],SIGNAL(MessReadyForSending(CVector<uint8_t>)),this,SLOT(OnSendProtMessCh6(CVector<uint8_t>)));
QObject::connect(&vecChannels[7],SIGNAL(MessReadyForSending(CVector<uint8_t>)),this,SLOT(OnSendProtMessCh7(CVector<uint8_t>))); // QObject::connect(&vecChannels[7],SIGNAL(MessReadyForSending(CVector<uint8_t>)),this,SLOT(OnSendProtMessCh7(CVector<uint8_t>)));
QObject::connect(&vecChannels[8],SIGNAL(MessReadyForSending(CVector<uint8_t>)),this,SLOT(OnSendProtMessCh8(CVector<uint8_t>))); // QObject::connect(&vecChannels[8],SIGNAL(MessReadyForSending(CVector<uint8_t>)),this,SLOT(OnSendProtMessCh8(CVector<uint8_t>)));
QObject::connect(&vecChannels[9],SIGNAL(MessReadyForSending(CVector<uint8_t>)),this,SLOT(OnSendProtMessCh9(CVector<uint8_t>))); // QObject::connect(&vecChannels[9],SIGNAL(MessReadyForSending(CVector<uint8_t>)),this,SLOT(OnSendProtMessCh9(CVector<uint8_t>)));
// request jitter buffer size // request jitter buffer size
QObject::connect(&vecChannels[0],SIGNAL(NewConnection()),this,SLOT(OnNewConnectionCh0())); 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[2],SIGNAL(NewConnection()),this,SLOT(OnNewConnectionCh2()));
QObject::connect(&vecChannels[3],SIGNAL(NewConnection()),this,SLOT(OnNewConnectionCh3())); QObject::connect(&vecChannels[3],SIGNAL(NewConnection()),this,SLOT(OnNewConnectionCh3()));
QObject::connect(&vecChannels[4],SIGNAL(NewConnection()),this,SLOT(OnNewConnectionCh4())); QObject::connect(&vecChannels[4],SIGNAL(NewConnection()),this,SLOT(OnNewConnectionCh4()));
QObject::connect(&vecChannels[5],SIGNAL(NewConnection()),this,SLOT(OnNewConnectionCh5())); // QObject::connect(&vecChannels[5],SIGNAL(NewConnection()),this,SLOT(OnNewConnectionCh5()));
QObject::connect(&vecChannels[6],SIGNAL(NewConnection()),this,SLOT(OnNewConnectionCh6())); // QObject::connect(&vecChannels[6],SIGNAL(NewConnection()),this,SLOT(OnNewConnectionCh6()));
QObject::connect(&vecChannels[7],SIGNAL(NewConnection()),this,SLOT(OnNewConnectionCh7())); // QObject::connect(&vecChannels[7],SIGNAL(NewConnection()),this,SLOT(OnNewConnectionCh7()));
QObject::connect(&vecChannels[8],SIGNAL(NewConnection()),this,SLOT(OnNewConnectionCh8())); // QObject::connect(&vecChannels[8],SIGNAL(NewConnection()),this,SLOT(OnNewConnectionCh8()));
QObject::connect(&vecChannels[9],SIGNAL(NewConnection()),this,SLOT(OnNewConnectionCh9())); // QObject::connect(&vecChannels[9],SIGNAL(NewConnection()),this,SLOT(OnNewConnectionCh9()));
} }
int CChannelSet::GetFreeChan() int CChannelSet::GetFreeChan()
@ -196,22 +196,28 @@ void CChannelSet::GetBlockAllConC ( CVector<int>& vecChanID,
} }
void CChannelSet::GetConCliParam ( CVector<CHostAddress>& vecHostAddresses, void CChannelSet::GetConCliParam ( CVector<CHostAddress>& vecHostAddresses,
CVector<int>& veciJitBufSize ) CVector<int>& veciJitBufSize,
CVector<int>& veciNetwOutBlSiFact,
CVector<int>& veciNetwInBlSiFact )
{ {
CHostAddress InetAddr; CHostAddress InetAddr;
/* init return values */ /* init return values */
vecHostAddresses.Init ( MAX_NUM_CHANNELS ); 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 */ /* Check all possible channels */
for ( int i = 0; i < MAX_NUM_CHANNELS; i++ ) for ( int i = 0; i < MAX_NUM_CHANNELS; i++ )
{ {
if ( vecChannels[i].GetAddress ( InetAddr ) ) if ( vecChannels[i].GetAddress ( InetAddr ) )
{ {
/* add new address and sample rate offset to vectors */ /* get requested data */
vecHostAddresses[i] = InetAddr; 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) bool CChannel::GetAddress(CHostAddress& RetAddr)
{ {
if (IsConnected()) if ( IsConnected() )
{ {
RetAddr = InetAddr; RetAddr = InetAddr;
return true; return true;
@ -426,11 +432,7 @@ for ( int i = 0; i < iCurNetwInBlSiFact * MIN_BLOCK_SIZE_SAMPLES; i++ ) {
else else
{ {
// only use protocol data if channel is connected // only use protocol data if channel is connected
if ( IsConnected() )
// 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() )
{ {
// this seems not to be an audio block, parse the message // this seems not to be an audio block, parse the message
if ( Protocol.ParseMessage ( vecbyData, iNumBytes ) ) if ( Protocol.ParseMessage ( vecbyData, iNumBytes ) )

View File

@ -43,7 +43,7 @@
/* maximum number of internet connections (channels) */ /* maximum number of internet connections (channels) */
// if you want to change this paramter, change the connections in this class, too! // 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 */ /* no valid channel number */
#define INVALID_CHANNEL_ID (MAX_NUM_CHANNELS + 1) #define INVALID_CHANNEL_ID (MAX_NUM_CHANNELS + 1)
@ -86,6 +86,8 @@ public:
void SetNetwBufSizeFactOut ( const int iNewNetwBlSiFactOut ); void SetNetwBufSizeFactOut ( const int iNewNetwBlSiFactOut );
int GetNetwBufSizeFactOut() { return iCurNetwOutBlSiFact; } int GetNetwBufSizeFactOut() { return iCurNetwOutBlSiFact; }
int GetNetwBufSizeFactIn() { return iCurNetwInBlSiFact; }
// network protocol interface // network protocol interface
void CreateJitBufMes ( const int iJitBufSize ) void CreateJitBufMes ( const int iJitBufSize )
{ {
@ -177,9 +179,11 @@ public:
void GetBlockAllConC ( CVector<int>& vecChanID, void GetBlockAllConC ( CVector<int>& vecChanID,
CVector<CVector<double> >& vecvecdData ); CVector<CVector<double> >& vecvecdData );
void GetConCliParam( CVector<CHostAddress>& vecHostAddresses, void GetConCliParam ( CVector<CHostAddress>& vecHostAddresses,
CVector<int>& veciJitBufSize ); CVector<int>& veciJitBufSize,
CVector<int>& veciNetwOutBlSiFact,
CVector<int>& veciNetwInBlSiFact );
/* access functions for actual channels */ /* access functions for actual channels */
bool IsConnected ( const int iChanNum ) bool IsConnected ( const int iChanNum )

View File

@ -40,10 +40,9 @@
#define _DEBUG_ #define _DEBUG_
#undef _DEBUG_ #undef _DEBUG_
/* version and application name */ /* version and application name (always use this version) */
#ifndef VERSION #undef VERSION
# define VERSION "0.9.5cvs" #define VERSION "0.9.6cvs"
#endif
#define APP_NAME "llcon" #define APP_NAME "llcon"

View File

@ -55,6 +55,10 @@ CLlconServerDlg::CLlconServerDlg ( CServer* pNServP, QWidget* parent,
ListViewClients->setColumnAlignment(2, Qt::AlignCenter); ListViewClients->setColumnAlignment(2, Qt::AlignCenter);
ListViewClients->addColumn(tr("Jitter buffer size")); ListViewClients->addColumn(tr("Jitter buffer size"));
ListViewClients->setColumnAlignment(3, Qt::AlignRight); 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(); ListViewClients->clear();
/* insert items in reverse order because in Windows all of them are /* insert items in reverse order because in Windows all of them are
@ -96,11 +100,14 @@ void CLlconServerDlg::OnTimer()
{ {
CVector<CHostAddress> vecHostAddresses; CVector<CHostAddress> vecHostAddresses;
CVector<int> veciJitBufSize; CVector<int> veciJitBufSize;
CVector<int> veciNetwOutBlSiFact;
CVector<int> veciNetwInBlSiFact;
double dCurTiStdDev; double dCurTiStdDev;
ListViewMutex.lock(); ListViewMutex.lock();
pServer->GetConCliParam(vecHostAddresses, veciJitBufSize); pServer->GetConCliParam ( vecHostAddresses, veciJitBufSize,
veciNetwOutBlSiFact, veciNetwInBlSiFact );
/* fill list with connected clients */ /* fill list with connected clients */
for (int i = 0; i < MAX_NUM_CHANNELS; i++) for (int i = 0; i < MAX_NUM_CHANNELS; i++)
@ -115,6 +122,14 @@ void CLlconServerDlg::OnTimer()
/* jitter buffer size (polling for updates) */ /* jitter buffer size (polling for updates) */
vecpListViewItems[i]->setText(3, vecpListViewItems[i]->setText(3,
QString().setNum(veciJitBufSize[i])); 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 #ifndef _WIN32
vecpListViewItems[i]->setVisible ( true ); vecpListViewItems[i]->setVisible ( true );
@ -124,9 +139,9 @@ void CLlconServerDlg::OnTimer()
{ {
#ifdef _WIN32 #ifdef _WIN32
/* remove text for Windows version */ /* remove text for Windows version */
vecpListViewItems[i]->setText(0,""); vecpListViewItems[i]->setText(0, "");
vecpListViewItems[i]->setText(3,""); vecpListViewItems[i]->setText(3, "");
vecpListViewItems[i]->setText(4,""); vecpListViewItems[i]->setText(4, "");
#else #else
vecpListViewItems[i]->setVisible ( false ); vecpListViewItems[i]->setVisible ( false );
#endif #endif

View File

@ -48,11 +48,13 @@ public:
void Start (); void Start ();
void Stop (); void Stop ();
bool IsRunning() { return Timer.isActive (); } bool IsRunning() { return Timer.isActive (); }
void GetConCliParam ( CVector<CHostAddress>& vecHostAddresses,
CVector<int>& veciJitBufSize ) void GetConCliParam ( CVector<CHostAddress>& vecHostAddresses,
CVector<int>& veciJitBufSize, CVector<int>& veciNetwOutBlSiFact,
CVector<int>& veciNetwInBlSiFact)
{ {
ChannelSet.GetConCliParam ( vecHostAddresses, ChannelSet.GetConCliParam ( vecHostAddresses,
veciJitBufSize ); veciJitBufSize, veciNetwOutBlSiFact, veciNetwInBlSiFact );
} }
bool GetTimingStdDev ( double& dCurTiStdDev ); bool GetTimingStdDev ( double& dCurTiStdDev );