bug fix in sound interface, prepared for new protocol message for connected client information
This commit is contained in:
parent
f280ad4b3b
commit
3e71e83110
4 changed files with 30 additions and 11 deletions
|
@ -50,7 +50,7 @@ public:
|
|||
iCurPeriodSizeOut(NUM_PERIOD_BLOCKS_OUT), bChangParamIn(true),
|
||||
bChangParamOut(true)
|
||||
#endif
|
||||
{snd_pcm_status_alloca(&status);}
|
||||
{}
|
||||
virtual ~CSound() {Close();}
|
||||
|
||||
/* Not implemented yet, always return one device and default string */
|
||||
|
|
|
@ -226,7 +226,7 @@ void CChannelSet::GetConCliParam ( CVector<CHostAddress>& vecHostAddresses,
|
|||
/******************************************************************************\
|
||||
* CChannel *
|
||||
\******************************************************************************/
|
||||
CChannel::CChannel()
|
||||
CChannel::CChannel() : sName ( "" )
|
||||
{
|
||||
// query all possible network in buffer sizes for determining if an
|
||||
// audio packet was received
|
||||
|
|
|
@ -79,6 +79,9 @@ public:
|
|||
void SetAddress ( const CHostAddress NAddr ) { InetAddr = NAddr; }
|
||||
bool GetAddress ( CHostAddress& RetAddr );
|
||||
CHostAddress GetAddress () { return InetAddr; }
|
||||
|
||||
void SetName ( const std::string sNNa ) { sName = sNNa; }
|
||||
std::string GetName() { return sName; }
|
||||
|
||||
void SetSockBufSize ( const int iNumBlocks );
|
||||
int GetSockBufSize() { return iCurSockBufSize; }
|
||||
|
@ -110,32 +113,35 @@ public:
|
|||
protected:
|
||||
void SetNetwInBlSiFact ( const int iNewBlockSizeFactor );
|
||||
|
||||
/* audio compression */
|
||||
// audio compression
|
||||
CAudioCompression AudioCompressionIn;
|
||||
int iAudComprSizeIn;
|
||||
CAudioCompression AudioCompressionOut;
|
||||
int iAudComprSizeOut;
|
||||
|
||||
/* resampling */
|
||||
// resampling
|
||||
CResample ResampleObj;
|
||||
double dSamRateOffset;
|
||||
CVector<double> vecdResInData;
|
||||
CVector<double> vecdResOutData;
|
||||
|
||||
/* connection parameters */
|
||||
CHostAddress InetAddr;
|
||||
// connection parameters
|
||||
CHostAddress InetAddr;
|
||||
|
||||
// channel name
|
||||
std::string sName;
|
||||
|
||||
/* network jitter-buffer */
|
||||
// network jitter-buffer
|
||||
CNetBuf SockBuf;
|
||||
int iCurSockBufSize;
|
||||
|
||||
/* network output conversion buffer */
|
||||
// network output conversion buffer
|
||||
CConvBuf ConvBuf;
|
||||
|
||||
// network protocol
|
||||
CProtocol Protocol;
|
||||
|
||||
/* time stamp index counter */
|
||||
// time stamp index counter
|
||||
Q_UINT8 byTimeStampIdxCnt;
|
||||
int iTimeStampActCnt;
|
||||
|
||||
|
@ -147,7 +153,7 @@ protected:
|
|||
int iCurNetwInBlSiFact;
|
||||
int iCurNetwOutBlSiFact;
|
||||
|
||||
QMutex Mutex;
|
||||
QMutex Mutex;
|
||||
|
||||
public slots:
|
||||
void OnSendProtMessage ( CVector<uint8_t> vecMessage );
|
||||
|
|
|
@ -57,8 +57,13 @@ MESSAGES
|
|||
| 2 bytes factor |
|
||||
+----------------+
|
||||
|
||||
- IP number and name of connected clients PROTMESSID_CONN_CLIENTS_LIST
|
||||
|
||||
for each connected client append following data:
|
||||
|
||||
+--------------------+------------------+----------------------+
|
||||
| 4 bytes IP address | 2 bytes number n | n bytes UTF-8 string |
|
||||
+--------------------+------------------+----------------------+
|
||||
|
||||
*
|
||||
******************************************************************************
|
||||
|
@ -365,6 +370,14 @@ void CProtocol::CreateNetwBlSiFactMes ( const int iNetwBlSiFact )
|
|||
CreateAndSendMessage ( PROTMESSID_NET_BLSI_FACTOR, vecData );
|
||||
}
|
||||
|
||||
//void CProtocol::CreateConClientListMes ( const )
|
||||
//{
|
||||
// TODO
|
||||
//PROTMESSID_CONN_CLIENTS_LIST
|
||||
|
||||
|
||||
//}
|
||||
|
||||
|
||||
/******************************************************************************\
|
||||
* Message generation (parsing) *
|
||||
|
@ -403,7 +416,7 @@ bool CProtocol::ParseMessageFrame ( const CVector<uint8_t>& vecIn,
|
|||
iLenBy = static_cast<int> ( GetValFromStream ( vecIn, iCurPos, 2 ) );
|
||||
|
||||
// make sure the length is correct
|
||||
if ( iLenBy != iVecInLenByte - MESS_LEN_WITHOUT_DATA_BYTE )
|
||||
if ( iLenBy != iVecInLenByte - MESS_LEN_WITHOUT_DATA_BYTE )
|
||||
{
|
||||
return false; // return error code
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue