backup checking, compiles but not tested -> quick hack test

This commit is contained in:
Volker Fischer 2020-08-03 22:36:47 +02:00
parent e72d1508ee
commit 0d5ce4b62b
4 changed files with 45 additions and 18 deletions

View file

@ -20,6 +20,7 @@
- bug fix: --showallservers ping column sort is alphabetic (#201) - bug fix: --showallservers ping column sort is alphabetic (#201)
TODO QT += concurrent added -> Windows deployment must be adjusted!

View file

@ -11,6 +11,7 @@ CONFIG += qt \
release release
QT += network \ QT += network \
concurrent \
xml xml
contains(CONFIG, "headless") { contains(CONFIG, "headless") {

View file

@ -1055,8 +1055,18 @@ static CTimingMeas JitterMeas ( 1000, "test2.dat" ); JitterMeas.Measure(); // TE
} }
} }
// TEST
QFuture<void> future = QtConcurrent::run ( this, &CServer::MixEncodeTransmitData,
i,
iCurChanID,
pCurOpusEncoder,
iClientFrameSizeSamples,
iNumClients );
// generate a separate mix for each channel, OPUS encode the // generate a separate mix for each channel, OPUS encode the
// audio data and transmit the network packet // audio data and transmit the network packet
/*
MixEncodeTransmitData ( vecvecsData, MixEncodeTransmitData ( vecvecsData,
vecvecdGains[i], vecvecdGains[i],
vecvecdPannings[i], vecvecdPannings[i],
@ -1073,6 +1083,7 @@ static CTimingMeas JitterMeas ( 1000, "test2.dat" ); JitterMeas.Measure(); // TE
iClientFrameSizeSamples, iClientFrameSizeSamples,
iCurNumAudChan, iCurNumAudChan,
iNumClients ); iNumClients );
*/
} }
} }
else else
@ -1086,23 +1097,26 @@ static CTimingMeas JitterMeas ( 1000, "test2.dat" ); JitterMeas.Measure(); // TE
} }
/// @brief Mix all audio data from all clients together, encode and transmit /// @brief Mix all audio data from all clients together, encode and transmit
void CServer::MixEncodeTransmitData ( const CVector<CVector<int16_t> >& vecvecsData, void CServer::MixEncodeTransmitData ( const int iIdx,
const CVector<double>& vecdGains, const int iCurChanID,
const CVector<double>& vecdPannings,
const CVector<int>& vecNumAudioChannels,
CVector<double>& vecdIntermProcBuf,
CVector<int16_t>& vecsSendData,
CVector<uint8_t>& vecbyCodedData,
CChannel& Channel,
CConvBuf<int16_t>& DoubleFrameSizeConvBufOut,
const int iUseDoubleSysFraSizeConvBuf,
const int iNumFrameSizeConvBlocks,
OpusCustomEncoder* pCurOpusEncoder, OpusCustomEncoder* pCurOpusEncoder,
const int iCeltNumCodedBytes,
const int iClientFrameSizeSamples, const int iClientFrameSizeSamples,
const int iCurNumAudChan,
const int iNumClients ) const int iNumClients )
{ {
// TEST
const CVector<double>& vecdGains = vecvecdGains[iIdx];
const CVector<double>& vecdPannings = vecvecdPannings[iIdx];
CVector<double>& vecdIntermProcBuf = vecvecsIntermediateProcBuf[iIdx];
CVector<int16_t>& vecsSendData = vecvecsSendData[iIdx];
CVector<uint8_t>& vecbyCodedData = vecvecbyCodedData[iIdx];
CChannel& Channel = vecChannels[iCurChanID];
CConvBuf<int16_t>* pDoubleFrameSizeConvBufOut = &DoubleFrameSizeConvBufOut[iCurChanID];
const int iUseDoubleSysFraSizeConvBuf = vecUseDoubleSysFraSizeConvBuf[iIdx];
const int iNumFrameSizeConvBlocks = vecNumFrameSizeConvBlocks[iIdx];
const int iCurNumAudChan = vecNumAudioChannels[iIdx];
const int iCeltNumCodedBytes = vecChannels[iCurChanID].GetNetwFrameSize();
int i, j, k, iUnused; int i, j, k, iUnused;
// init intermediate processing vector with zeros since we mix all channels on that vector // init intermediate processing vector with zeros since we mix all channels on that vector
@ -1242,12 +1256,12 @@ void CServer::MixEncodeTransmitData ( const CVector<CVector<int16_t> >& vecvecsD
// is false and the Get() function is not called at all. Therefore if the buffer is not needed // is false and the Get() function is not called at all. Therefore if the buffer is not needed
// we do not spend any time in the function but go directly inside the if condition. // we do not spend any time in the function but go directly inside the if condition.
if ( ( iUseDoubleSysFraSizeConvBuf == 0 ) || if ( ( iUseDoubleSysFraSizeConvBuf == 0 ) ||
DoubleFrameSizeConvBufOut.Put ( vecsSendData, SYSTEM_FRAME_SIZE_SAMPLES * iCurNumAudChan ) ) pDoubleFrameSizeConvBufOut->Put ( vecsSendData, SYSTEM_FRAME_SIZE_SAMPLES * iCurNumAudChan ) )
{ {
if ( iUseDoubleSysFraSizeConvBuf != 0 ) if ( iUseDoubleSysFraSizeConvBuf != 0 )
{ {
// get the large frame from the conversion buffer // get the large frame from the conversion buffer
DoubleFrameSizeConvBufOut.GetAll ( vecsSendData, DOUBLE_SYSTEM_FRAME_SIZE_SAMPLES * iCurNumAudChan ); pDoubleFrameSizeConvBufOut->GetAll ( vecsSendData, DOUBLE_SYSTEM_FRAME_SIZE_SAMPLES * iCurNumAudChan );
} }
for ( int iB = 0; iB < iNumFrameSizeConvBlocks; iB++ ) for ( int iB = 0; iB < iNumFrameSizeConvBlocks; iB++ )

View file

@ -29,6 +29,7 @@
#include <QDateTime> #include <QDateTime>
#include <QHostAddress> #include <QHostAddress>
#include <QFileInfo> #include <QFileInfo>
#include <QtConcurrent>
#include <algorithm> #include <algorithm>
#ifdef USE_OPUS_SHARED_LIB #ifdef USE_OPUS_SHARED_LIB
# include "opus/opus_custom.h" # include "opus/opus_custom.h"
@ -301,6 +302,7 @@ protected:
void WriteHTMLChannelList(); void WriteHTMLChannelList();
/*
void MixEncodeTransmitData ( const CVector<CVector<int16_t> >& vecvecsData, void MixEncodeTransmitData ( const CVector<CVector<int16_t> >& vecvecsData,
const CVector<double>& vecdGains, const CVector<double>& vecdGains,
const CVector<double>& vecdPannings, const CVector<double>& vecdPannings,
@ -317,6 +319,15 @@ protected:
const int iClientFrameSizeSamples, const int iClientFrameSizeSamples,
const int iCurNumAudChan, const int iCurNumAudChan,
const int iNumClients ); const int iNumClients );
*/
// TEST
void MixEncodeTransmitData ( const int iIdx,
const int iCurChanID,
OpusCustomEncoder* pCurOpusEncoder,
const int iClientFrameSizeSamples,
const int iNumClients );
virtual void customEvent ( QEvent* pEvent ); virtual void customEvent ( QEvent* pEvent );