rename SYSTEM_FRAME_SIZE_SAMPLES_SMALL to SYSTEM_FRAME_SIZE_SAMPLES

This commit is contained in:
Volker Fischer 2020-04-15 15:29:43 +02:00
parent f51dd662c4
commit b335321950
6 changed files with 93 additions and 93 deletions

View file

@ -166,7 +166,7 @@ void CChannel::SetAudioStreamProperties ( const EAudComprType eNewAudComprType,
} }
else else
{ {
iAudioFrameSizeSamples = SYSTEM_FRAME_SIZE_SAMPLES_SMALL; iAudioFrameSizeSamples = SYSTEM_FRAME_SIZE_SAMPLES;
} }
MutexSocketBuf.lock(); MutexSocketBuf.lock();
@ -387,7 +387,7 @@ void CChannel::OnNetTranspPropsReceived ( CNetworkTransportProps NetworkTranspor
else else
{ {
iFadeInCntMax = FADE_IN_NUM_FRAMES / iNetwFrameSizeFact; iFadeInCntMax = FADE_IN_NUM_FRAMES / iNetwFrameSizeFact;
iAudioFrameSizeSamples = SYSTEM_FRAME_SIZE_SAMPLES_SMALL; iAudioFrameSizeSamples = SYSTEM_FRAME_SIZE_SAMPLES;
} }
MutexSocketBuf.lock(); MutexSocketBuf.lock();

View file

@ -83,7 +83,7 @@ CClient::CClient ( const quint16 iPortNumber,
&iOpusError ); &iOpusError );
Opus64Mode = opus_custom_mode_create ( SYSTEM_SAMPLE_RATE_HZ, Opus64Mode = opus_custom_mode_create ( SYSTEM_SAMPLE_RATE_HZ,
SYSTEM_FRAME_SIZE_SAMPLES_SMALL, SYSTEM_FRAME_SIZE_SAMPLES,
&iOpusError ); &iOpusError );
// init audio encoders and decoders // init audio encoders and decoders
@ -669,16 +669,16 @@ void CClient::Stop()
void CClient::Init() void CClient::Init()
{ {
// check if possible frame size factors are supported // check if possible frame size factors are supported
const int iFraSizePreffered = SYSTEM_FRAME_SIZE_SAMPLES_SMALL * FRAME_SIZE_FACTOR_PREFERRED; const int iFraSizePreffered = SYSTEM_FRAME_SIZE_SAMPLES * FRAME_SIZE_FACTOR_PREFERRED;
const int iFraSizeDefault = SYSTEM_FRAME_SIZE_SAMPLES_SMALL * FRAME_SIZE_FACTOR_DEFAULT; const int iFraSizeDefault = SYSTEM_FRAME_SIZE_SAMPLES * FRAME_SIZE_FACTOR_DEFAULT;
const int iFraSizeSafe = SYSTEM_FRAME_SIZE_SAMPLES_SMALL * FRAME_SIZE_FACTOR_SAFE; const int iFraSizeSafe = SYSTEM_FRAME_SIZE_SAMPLES * FRAME_SIZE_FACTOR_SAFE;
bFraSiFactPrefSupported = ( Sound.Init ( iFraSizePreffered ) == iFraSizePreffered ); bFraSiFactPrefSupported = ( Sound.Init ( iFraSizePreffered ) == iFraSizePreffered );
bFraSiFactDefSupported = ( Sound.Init ( iFraSizeDefault ) == iFraSizeDefault ); bFraSiFactDefSupported = ( Sound.Init ( iFraSizeDefault ) == iFraSizeDefault );
bFraSiFactSafeSupported = ( Sound.Init ( iFraSizeSafe ) == iFraSizeSafe ); bFraSiFactSafeSupported = ( Sound.Init ( iFraSizeSafe ) == iFraSizeSafe );
// translate block size index in actual block size // translate block size index in actual block size
const int iPrefMonoFrameSize = iSndCrdPrefFrameSizeFactor * SYSTEM_FRAME_SIZE_SAMPLES_SMALL; const int iPrefMonoFrameSize = iSndCrdPrefFrameSizeFactor * SYSTEM_FRAME_SIZE_SAMPLES;
// get actual sound card buffer size using preferred size // get actual sound card buffer size using preferred size
iMonoBlockSizeSam = Sound.Init ( iPrefMonoFrameSize ); iMonoBlockSizeSam = Sound.Init ( iPrefMonoFrameSize );
@ -686,12 +686,12 @@ void CClient::Init()
// Calculate the current sound card frame size factor. In case // Calculate the current sound card frame size factor. In case
// the current mono block size is not a multiple of the system // the current mono block size is not a multiple of the system
// frame size, we have to use a sound card conversion buffer. // frame size, we have to use a sound card conversion buffer.
if ( ( iMonoBlockSizeSam == ( SYSTEM_FRAME_SIZE_SAMPLES_SMALL * FRAME_SIZE_FACTOR_PREFERRED ) ) || if ( ( iMonoBlockSizeSam == ( SYSTEM_FRAME_SIZE_SAMPLES * FRAME_SIZE_FACTOR_PREFERRED ) ) ||
( iMonoBlockSizeSam == ( SYSTEM_FRAME_SIZE_SAMPLES_SMALL * FRAME_SIZE_FACTOR_DEFAULT ) ) || ( iMonoBlockSizeSam == ( SYSTEM_FRAME_SIZE_SAMPLES * FRAME_SIZE_FACTOR_DEFAULT ) ) ||
( iMonoBlockSizeSam == ( SYSTEM_FRAME_SIZE_SAMPLES_SMALL * FRAME_SIZE_FACTOR_SAFE ) ) ) ( iMonoBlockSizeSam == ( SYSTEM_FRAME_SIZE_SAMPLES * FRAME_SIZE_FACTOR_SAFE ) ) )
{ {
// regular case: one of our predefined buffer sizes is available // regular case: one of our predefined buffer sizes is available
iSndCrdFrameSizeFactor = iMonoBlockSizeSam / SYSTEM_FRAME_SIZE_SAMPLES_SMALL; iSndCrdFrameSizeFactor = iMonoBlockSizeSam / SYSTEM_FRAME_SIZE_SAMPLES;
// no sound card conversion buffer required // no sound card conversion buffer required
bSndCrdConversionBufferRequired = false; bSndCrdConversionBufferRequired = false;
@ -715,7 +715,7 @@ void CClient::Init()
{ {
if ( iSndCardMonoBlockSizeSamConvBuff < DOUBLE_SYSTEM_FRAME_SIZE_SAMPLES ) if ( iSndCardMonoBlockSizeSamConvBuff < DOUBLE_SYSTEM_FRAME_SIZE_SAMPLES )
{ {
iMonoBlockSizeSam = SYSTEM_FRAME_SIZE_SAMPLES_SMALL; iMonoBlockSizeSam = SYSTEM_FRAME_SIZE_SAMPLES;
eAudioCompressionType = CT_OPUS64; eAudioCompressionType = CT_OPUS64;
} }
else else
@ -773,7 +773,7 @@ void CClient::Init()
} }
else /* CT_OPUS64 */ else /* CT_OPUS64 */
{ {
iOPUSFrameSizeSamples = SYSTEM_FRAME_SIZE_SAMPLES_SMALL; iOPUSFrameSizeSamples = SYSTEM_FRAME_SIZE_SAMPLES;
if ( eAudioChannelConf == CC_MONO ) if ( eAudioChannelConf == CC_MONO )
{ {

View file

@ -347,14 +347,14 @@ CClientSettingsDlg::CClientSettingsDlg ( CClient* pNCliP, QWidget* parent,
// set text for sound card buffer delay radio buttons // set text for sound card buffer delay radio buttons
rbtBufferDelayPreferred->setText ( GenSndCrdBufferDelayString ( rbtBufferDelayPreferred->setText ( GenSndCrdBufferDelayString (
FRAME_SIZE_FACTOR_PREFERRED * SYSTEM_FRAME_SIZE_SAMPLES_SMALL, FRAME_SIZE_FACTOR_PREFERRED * SYSTEM_FRAME_SIZE_SAMPLES,
", preferred" ) ); ", preferred" ) );
rbtBufferDelayDefault->setText ( GenSndCrdBufferDelayString ( rbtBufferDelayDefault->setText ( GenSndCrdBufferDelayString (
FRAME_SIZE_FACTOR_DEFAULT * SYSTEM_FRAME_SIZE_SAMPLES_SMALL ) ); FRAME_SIZE_FACTOR_DEFAULT * SYSTEM_FRAME_SIZE_SAMPLES ) );
rbtBufferDelaySafe->setText ( GenSndCrdBufferDelayString ( rbtBufferDelaySafe->setText ( GenSndCrdBufferDelayString (
FRAME_SIZE_FACTOR_SAFE * SYSTEM_FRAME_SIZE_SAMPLES_SMALL ) ); FRAME_SIZE_FACTOR_SAFE * SYSTEM_FRAME_SIZE_SAMPLES ) );
// sound card buffer delay inits // sound card buffer delay inits
SndCrdBufferDelayButtonGroup.addButton ( rbtBufferDelayPreferred ); SndCrdBufferDelayButtonGroup.addButton ( rbtBufferDelayPreferred );
@ -472,9 +472,9 @@ void CClientSettingsDlg::UpdateSoundCardFrame()
const int iCurActualBufSize = pClient->GetSndCrdActualMonoBlSize(); const int iCurActualBufSize = pClient->GetSndCrdActualMonoBlSize();
// check which predefined size is used (it is possible that none is used) // check which predefined size is used (it is possible that none is used)
const bool bPreferredChecked = ( iCurActualBufSize == SYSTEM_FRAME_SIZE_SAMPLES_SMALL * FRAME_SIZE_FACTOR_PREFERRED ); const bool bPreferredChecked = ( iCurActualBufSize == SYSTEM_FRAME_SIZE_SAMPLES * FRAME_SIZE_FACTOR_PREFERRED );
const bool bDefaultChecked = ( iCurActualBufSize == SYSTEM_FRAME_SIZE_SAMPLES_SMALL * FRAME_SIZE_FACTOR_DEFAULT ); const bool bDefaultChecked = ( iCurActualBufSize == SYSTEM_FRAME_SIZE_SAMPLES * FRAME_SIZE_FACTOR_DEFAULT );
const bool bSafeChecked = ( iCurActualBufSize == SYSTEM_FRAME_SIZE_SAMPLES_SMALL * FRAME_SIZE_FACTOR_SAFE ); const bool bSafeChecked = ( iCurActualBufSize == SYSTEM_FRAME_SIZE_SAMPLES * FRAME_SIZE_FACTOR_SAFE );
// Set radio buttons according to current value (To make it possible // Set radio buttons according to current value (To make it possible
// to have all radio buttons unchecked, we have to disable the // to have all radio buttons unchecked, we have to disable the

View file

@ -79,169 +79,169 @@ LED bar: lbr
// version and application name (use version from qt prject file) // version and application name (use version from qt prject file)
#undef VERSION #undef VERSION
#define VERSION APP_VERSION #define VERSION APP_VERSION
#define APP_NAME "Jamulus" #define APP_NAME "Jamulus"
// Windows registry key name of auto run entry for the server // Windows registry key name of auto run entry for the server
#define AUTORUN_SERVER_REG_NAME "Jamulus server" #define AUTORUN_SERVER_REG_NAME "Jamulus server"
// default names of the ini-file for client and server // default names of the ini-file for client and server
#define DEFAULT_INI_FILE_NAME "Jamulus.ini" #define DEFAULT_INI_FILE_NAME "Jamulus.ini"
#define DEFAULT_INI_FILE_NAME_SERVER "Jamulusserver.ini" #define DEFAULT_INI_FILE_NAME_SERVER "Jamulusserver.ini"
// file name for logging file // file name for logging file
#define DEFAULT_LOG_FILE_NAME "Jamulussrvlog.txt" #define DEFAULT_LOG_FILE_NAME "Jamulussrvlog.txt"
// default oldest item to draw in history graph (days ago) // default oldest item to draw in history graph (days ago)
#define DEFAULT_DAYS_HISTORY 60 #define DEFAULT_DAYS_HISTORY 60
// System block size, this is the block size on which the audio coder works. // System block size, this is the block size on which the audio coder works.
// All other block sizes must be a multiple of this size. // All other block sizes must be a multiple of this size.
// Note that the UpdateAutoSetting() function assumes a value of 128. // Note that the UpdateAutoSetting() function assumes a value of 128.
#define SYSTEM_FRAME_SIZE_SAMPLES_SMALL 64 // TODO this is temporary and shall be replaced by SYSTEM_FRAME_SIZE_SAMPLES later on #define SYSTEM_FRAME_SIZE_SAMPLES 64
#define DOUBLE_SYSTEM_FRAME_SIZE_SAMPLES ( 2 * SYSTEM_FRAME_SIZE_SAMPLES_SMALL ) #define DOUBLE_SYSTEM_FRAME_SIZE_SAMPLES ( 2 * SYSTEM_FRAME_SIZE_SAMPLES )
// default server address // default server address
#define DEFAULT_SERVER_ADDRESS "jamulus.fischvolk.de" #define DEFAULT_SERVER_ADDRESS "jamulus.fischvolk.de"
#define DEFAULT_SERVER_NAME "Central Server" #define DEFAULT_SERVER_NAME "Central Server"
// download URL // download URL
#define SOFTWARE_DOWNLOAD_URL "http://sourceforge.net/projects/llcon/files" #define SOFTWARE_DOWNLOAD_URL "http://sourceforge.net/projects/llcon/files"
// determining server internal address uses well-known host and port // determining server internal address uses well-known host and port
// (Google DNS, or something else reliable) // (Google DNS, or something else reliable)
#define WELL_KNOWN_HOST "8.8.8.8" // Google #define WELL_KNOWN_HOST "8.8.8.8" // Google
#define WELL_KNOWN_PORT 53 // DNS #define WELL_KNOWN_PORT 53 // DNS
#define IP_LOOKUP_TIMEOUT 500 // ms #define IP_LOOKUP_TIMEOUT 500 // ms
// defined port numbers for client and server // defined port numbers for client and server
#define LLCON_DEFAULT_PORT_NUMBER 22124 #define LLCON_DEFAULT_PORT_NUMBER 22124
#define LLCON_PORT_NUMBER_NORTHAMERICA 22224 #define LLCON_PORT_NUMBER_NORTHAMERICA 22224
// system sample rate (the sound card and audio coder works on this sample rate) // system sample rate (the sound card and audio coder works on this sample rate)
#define SYSTEM_SAMPLE_RATE_HZ 48000 // Hz #define SYSTEM_SAMPLE_RATE_HZ 48000 // Hz
// define the allowed audio frame size factors (since the // define the allowed audio frame size factors (since the
// "SYSTEM_FRAME_SIZE_SAMPLES" is quite small, it may be that on some // "SYSTEM_FRAME_SIZE_SAMPLES" is quite small, it may be that on some
// computers a larger value is required) // computers a larger value is required)
#define FRAME_SIZE_FACTOR_PREFERRED 1 // 64 samples accumulated frame size #define FRAME_SIZE_FACTOR_PREFERRED 1 // 64 samples accumulated frame size
#define FRAME_SIZE_FACTOR_DEFAULT 2 // 128 samples accumulated frame size #define FRAME_SIZE_FACTOR_DEFAULT 2 // 128 samples accumulated frame size
#define FRAME_SIZE_FACTOR_SAFE 4 // 256 samples accumulated frame size #define FRAME_SIZE_FACTOR_SAFE 4 // 256 samples accumulated frame size
// define the minimum allowed number of coded bytes for CELT (the encoder // define the minimum allowed number of coded bytes for CELT (the encoder
// gets in trouble if the value is too low) // gets in trouble if the value is too low)
#define CELT_MINIMUM_NUM_BYTES 10 #define CELT_MINIMUM_NUM_BYTES 10
// Maximum block size for network input buffer. It is defined by the longest // Maximum block size for network input buffer. It is defined by the longest
// protocol message which is PROTMESSID_CLM_SERVER_LIST: Worst case: // protocol message which is PROTMESSID_CLM_SERVER_LIST: Worst case:
// (2+2+1+2+2)+200*(4+2+2+1+1+2+20+2+32+2+20)=17609 // (2+2+1+2+2)+200*(4+2+2+1+1+2+20+2+32+2+20)=17609
// We add some headroom to that value. // We add some headroom to that value.
#define MAX_SIZE_BYTES_NETW_BUF 20000 #define MAX_SIZE_BYTES_NETW_BUF 20000
// minimum/maximum network buffer size (which can be chosen by slider) // minimum/maximum network buffer size (which can be chosen by slider)
#define MIN_NET_BUF_SIZE_NUM_BL 1 // number of blocks #define MIN_NET_BUF_SIZE_NUM_BL 1 // number of blocks
#define MAX_NET_BUF_SIZE_NUM_BL 20 // number of blocks #define MAX_NET_BUF_SIZE_NUM_BL 20 // number of blocks
#define AUTO_NET_BUF_SIZE_FOR_PROTOCOL ( MAX_NET_BUF_SIZE_NUM_BL + 1 ) // auto set parameter (only used for protocol) #define AUTO_NET_BUF_SIZE_FOR_PROTOCOL ( MAX_NET_BUF_SIZE_NUM_BL + 1 ) // auto set parameter (only used for protocol)
// default network buffer size // default network buffer size
#define DEF_NET_BUF_SIZE_NUM_BL 10 // number of blocks #define DEF_NET_BUF_SIZE_NUM_BL 10 // number of blocks
// audio mixer fader maximum value // audio mixer fader maximum value
#define AUD_MIX_FADER_MAX 100 #define AUD_MIX_FADER_MAX 100
// maximum number of recognized sound cards installed in the system, // maximum number of recognized sound cards installed in the system,
// definition for "no device" // definition for "no device"
#define MAX_NUMBER_SOUND_CARDS 129 // e.g. 16 inputs, 8 outputs + default entry (MacOS) #define MAX_NUMBER_SOUND_CARDS 129 // e.g. 16 inputs, 8 outputs + default entry (MacOS)
#define INVALID_SNC_CARD_DEVICE -1 #define INVALID_SNC_CARD_DEVICE -1
// define the maximum number of audio channel for input/output we can store // define the maximum number of audio channel for input/output we can store
// channel infos for (and therefore this is the maximum number of entries in // channel infos for (and therefore this is the maximum number of entries in
// the channel selection combo box regardless of the actual available number // the channel selection combo box regardless of the actual available number
// of channels by the audio device) // of channels by the audio device)
#define MAX_NUM_IN_OUT_CHANNELS 64 #define MAX_NUM_IN_OUT_CHANNELS 64
// maximum number of elemts in the server address combo box // maximum number of elemts in the server address combo box
#define MAX_NUM_SERVER_ADDR_ITEMS 6 #define MAX_NUM_SERVER_ADDR_ITEMS 6
// maximum number of fader settings to be stored (together with the fader tags) // maximum number of fader settings to be stored (together with the fader tags)
#define MAX_NUM_STORED_FADER_SETTINGS 200 #define MAX_NUM_STORED_FADER_SETTINGS 200
// defines for LED level meter CMultiColorLEDBar // defines for LED level meter CMultiColorLEDBar
#define NUM_STEPS_LED_BAR 8 #define NUM_STEPS_LED_BAR 8
#define RED_BOUND_LED_BAR 7 #define RED_BOUND_LED_BAR 7
#define YELLOW_BOUND_LED_BAR 5 #define YELLOW_BOUND_LED_BAR 5
// range for signal level meter // range for signal level meter
#define LOW_BOUND_SIG_METER ( -50.0 ) // dB #define LOW_BOUND_SIG_METER ( -50.0 ) // dB
#define UPPER_BOUND_SIG_METER ( 0.0 ) // dB #define UPPER_BOUND_SIG_METER ( 0.0 ) // dB
// Maximum number of connected clients at the server. If you want to change this // Maximum number of connected clients at the server. If you want to change this
// paramter you have to modify the code on some places, too! The code tag // paramter you have to modify the code on some places, too! The code tag
// "MAX_NUM_CHANNELS_TAG" shows these places (just search for the tag in the entire code) // "MAX_NUM_CHANNELS_TAG" shows these places (just search for the tag in the entire code)
#define MAX_NUM_CHANNELS 50 // max number channels for server #define MAX_NUM_CHANNELS 50 // max number channels for server
// actual number of used channels in the server // actual number of used channels in the server
// this parameter can safely be changed from 1 to MAX_NUM_CHANNELS // this parameter can safely be changed from 1 to MAX_NUM_CHANNELS
// without any other changes in the code // without any other changes in the code
#define DEFAULT_USED_NUM_CHANNELS 10 // default used number channels for server #define DEFAULT_USED_NUM_CHANNELS 10 // default used number channels for server
// Maximum number of servers registered in the server list. If you want to // Maximum number of servers registered in the server list. If you want to
// change this parameter, you most probably have to adjust MAX_SIZE_BYTES_NETW_BUF. // change this parameter, you most probably have to adjust MAX_SIZE_BYTES_NETW_BUF.
#define MAX_NUM_SERVERS_IN_SERVER_LIST 200 #define MAX_NUM_SERVERS_IN_SERVER_LIST 200
// defines the time interval at which the ping time is updated in the GUI // defines the time interval at which the ping time is updated in the GUI
#define PING_UPDATE_TIME_MS 500 // ms #define PING_UPDATE_TIME_MS 500 // ms
// defines the time interval at which the ping time is updated for the server // defines the time interval at which the ping time is updated for the server
// list // list
#define PING_UPDATE_TIME_SERVER_LIST_MS 2000 // ms #define PING_UPDATE_TIME_SERVER_LIST_MS 2000 // ms
// defines the interval between Channel Level updates from the server // defines the interval between Channel Level updates from the server
#define CHANNEL_LEVEL_UPDATE_INTERVAL 200 // number of frames at 64 samples frame size #define CHANNEL_LEVEL_UPDATE_INTERVAL 200 // number of frames at 64 samples frame size
// time-out until a registered server is deleted from the server list if no // time-out until a registered server is deleted from the server list if no
// new registering was made in minutes // new registering was made in minutes
#define SERVLIST_TIME_OUT_MINUTES 60 // minutes #define SERVLIST_TIME_OUT_MINUTES 60 // minutes
// poll time for server list (to check if entries are time-out) // poll time for server list (to check if entries are time-out)
#define SERVLIST_POLL_TIME_MINUTES 1 // minute #define SERVLIST_POLL_TIME_MINUTES 1 // minute
// time interval for sending ping messages to servers in the server list // time interval for sending ping messages to servers in the server list
#define SERVLIST_UPDATE_PING_SERVERS_MS 59000 // ms #define SERVLIST_UPDATE_PING_SERVERS_MS 59000 // ms
// time until a slave server registers in the server list // time until a slave server registers in the server list
#define SERVLIST_REGIST_INTERV_MINUTES 15 // minutes #define SERVLIST_REGIST_INTERV_MINUTES 15 // minutes
// defines the minimum time a server must run to be a permanent server // defines the minimum time a server must run to be a permanent server
#define SERVLIST_TIME_PERMSERV_MINUTES 1440 // minutes, 1440 = 60 min * 24 h #define SERVLIST_TIME_PERMSERV_MINUTES 1440 // minutes, 1440 = 60 min * 24 h
// length of the moving average buffer for response time measurement // length of the moving average buffer for response time measurement
#define TIME_MOV_AV_RESPONSE_SECONDS 30 // seconds #define TIME_MOV_AV_RESPONSE_SECONDS 30 // seconds
// Maximum length of fader tag and text message strings (Since for chat messages // Maximum length of fader tag and text message strings (Since for chat messages
// some HTML code is added, we also have to define a second length which includes // some HTML code is added, we also have to define a second length which includes
// this additionl HTML code. Right now the length of the HTML code is approx. 66 // this additionl HTML code. Right now the length of the HTML code is approx. 66
// character. Here, we add some headroom to this number) // character. Here, we add some headroom to this number)
#define MAX_LEN_FADER_TAG 16 #define MAX_LEN_FADER_TAG 16
#define MAX_LEN_CHAT_TEXT 1600 #define MAX_LEN_CHAT_TEXT 1600
#define MAX_LEN_CHAT_TEXT_PLUS_HTML 1800 #define MAX_LEN_CHAT_TEXT_PLUS_HTML 1800
#define MAX_LEN_SERVER_NAME 20 #define MAX_LEN_SERVER_NAME 20
#define MAX_LEN_IP_ADDRESS 15 #define MAX_LEN_IP_ADDRESS 15
#define MAX_LEN_SERVER_CITY 20 #define MAX_LEN_SERVER_CITY 20
#define MAX_LEN_VERSION_TEXT 20 #define MAX_LEN_VERSION_TEXT 20
// common tool tip bottom line text // common tool tip bottom line text
#define TOOLTIP_COM_END_TEXT tr ( \ #define TOOLTIP_COM_END_TEXT tr ( \
"<br><div align=right><font size=-1><i>" \ "<br><div align=right><font size=-1><i>" \
"For more information use the ""What's " \ "For more information use the ""What's " \
"This"" help (? menu, right mouse button or Shift+F1)" \ "This"" help (? menu, right mouse button or Shift+F1)" \
"</i></font></div>" ) "</i></font></div>" )
#define _MAXSHORT 32767 #define _MAXSHORT 32767
#define _MAXBYTE 255 // binary: 11111111 #define _MAXBYTE 255 // binary: 11111111
#define _MINSHORT ( -32768 ) #define _MINSHORT ( -32768 )
#if HAVE_STDINT_H #if HAVE_STDINT_H
# include <stdint.h> # include <stdint.h>
@ -268,7 +268,7 @@ typedef unsigned char uint8_t;
/* Pseudo enum definitions -------------------------------------------------- */ /* Pseudo enum definitions -------------------------------------------------- */
// definition for custom event // definition for custom event
#define MS_PACKET_RECEIVED 0 #define MS_PACKET_RECEIVED 0
/* Classes ********************************************************************/ /* Classes ********************************************************************/

View file

@ -118,7 +118,7 @@ int main ( int argc, char** argv )
"--fastupdate" ) ) "--fastupdate" ) )
{ {
bUseDoubleSystemFrameSize = false; // 64 samples frame size bUseDoubleSystemFrameSize = false; // 64 samples frame size
tsConsole << "- using " << SYSTEM_FRAME_SIZE_SAMPLES_SMALL << " samples frame size mode" << endl; tsConsole << "- using " << SYSTEM_FRAME_SIZE_SAMPLES << " samples frame size mode" << endl;
continue; continue;
} }

View file

@ -32,7 +32,7 @@ CHighPrecisionTimer::CHighPrecisionTimer ( const bool bNewUseDoubleSystemFrameSi
{ {
// add some error checking, the high precision timer implementation only // add some error checking, the high precision timer implementation only
// supports 64 and 128 samples frame size at 48 kHz sampling rate // supports 64 and 128 samples frame size at 48 kHz sampling rate
#if ( SYSTEM_FRAME_SIZE_SAMPLES_SMALL != 64 ) && ( DOUBLE_SYSTEM_FRAME_SIZE_SAMPLES != 128 ) #if ( SYSTEM_FRAME_SIZE_SAMPLES != 64 ) && ( DOUBLE_SYSTEM_FRAME_SIZE_SAMPLES != 128 )
# error "Only system frame size of 64 and 128 samples is supported by this module" # error "Only system frame size of 64 and 128 samples is supported by this module"
#endif #endif
#if ( SYSTEM_SAMPLE_RATE_HZ != 48000 ) #if ( SYSTEM_SAMPLE_RATE_HZ != 48000 )
@ -127,7 +127,7 @@ CHighPrecisionTimer::CHighPrecisionTimer ( const bool bUseDoubleSystemFrameSize
} }
else else
{ {
iNsDelay = ( (uint64_t) SYSTEM_FRAME_SIZE_SAMPLES_SMALL * 1000000000 ) / iNsDelay = ( (uint64_t) SYSTEM_FRAME_SIZE_SAMPLES * 1000000000 ) /
(uint64_t) SYSTEM_SAMPLE_RATE_HZ; // in ns (uint64_t) SYSTEM_SAMPLE_RATE_HZ; // in ns
} }
@ -267,7 +267,7 @@ CServer::CServer ( const int iNewMaxNumChan,
&iOpusError ); &iOpusError );
Opus64Mode[i] = opus_custom_mode_create ( SYSTEM_SAMPLE_RATE_HZ, Opus64Mode[i] = opus_custom_mode_create ( SYSTEM_SAMPLE_RATE_HZ,
SYSTEM_FRAME_SIZE_SAMPLES_SMALL, SYSTEM_FRAME_SIZE_SAMPLES,
&iOpusError ); &iOpusError );
// init audio encoders and decoders // init audio encoders and decoders
@ -320,7 +320,7 @@ CServer::CServer ( const int iNewMaxNumChan,
} }
else else
{ {
iServerFrameSizeSamples = SYSTEM_FRAME_SIZE_SAMPLES_SMALL; iServerFrameSizeSamples = SYSTEM_FRAME_SIZE_SAMPLES;
} }
@ -953,7 +953,7 @@ JitterMeas.Measure();
} }
else if ( vecAudioComprType[i] == CT_OPUS64 ) else if ( vecAudioComprType[i] == CT_OPUS64 )
{ {
iClientFrameSizeSamples = SYSTEM_FRAME_SIZE_SAMPLES_SMALL; iClientFrameSizeSamples = SYSTEM_FRAME_SIZE_SAMPLES;
if ( vecNumAudioChannels[i] == 1 ) if ( vecNumAudioChannels[i] == 1 )
{ {
@ -988,7 +988,7 @@ JitterMeas.Measure();
// 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 ( ( vecUseDoubleSysFraSizeConvBuf[i] == 0 ) || if ( ( vecUseDoubleSysFraSizeConvBuf[i] == 0 ) ||
!DoubleFrameSizeConvBufIn[iCurChanID].Get ( vecvecsData[i], SYSTEM_FRAME_SIZE_SAMPLES_SMALL * vecNumAudioChannels[i] ) ) !DoubleFrameSizeConvBufIn[iCurChanID].Get ( vecvecsData[i], SYSTEM_FRAME_SIZE_SAMPLES * vecNumAudioChannels[i] ) )
{ {
// get current number of OPUS coded bytes // get current number of OPUS coded bytes
const int iCeltNumCodedBytes = vecChannels[iCurChanID].GetNetwFrameSize(); const int iCeltNumCodedBytes = vecChannels[iCurChanID].GetNetwFrameSize();
@ -1028,7 +1028,7 @@ JitterMeas.Measure();
opus_custom_decode ( CurOpusDecoder, opus_custom_decode ( CurOpusDecoder,
pCurCodedData, pCurCodedData,
iCeltNumCodedBytes, iCeltNumCodedBytes,
&vecvecsData[i][iB * SYSTEM_FRAME_SIZE_SAMPLES_SMALL * vecNumAudioChannels[i]], &vecvecsData[i][iB * SYSTEM_FRAME_SIZE_SAMPLES * vecNumAudioChannels[i]],
iClientFrameSizeSamples ); iClientFrameSizeSamples );
} }
} }
@ -1038,7 +1038,7 @@ JitterMeas.Measure();
if ( vecUseDoubleSysFraSizeConvBuf[i] != 0 ) if ( vecUseDoubleSysFraSizeConvBuf[i] != 0 )
{ {
DoubleFrameSizeConvBufIn[iCurChanID].PutAll ( vecvecsData[i] ); DoubleFrameSizeConvBufIn[iCurChanID].PutAll ( vecvecsData[i] );
DoubleFrameSizeConvBufIn[iCurChanID].Get ( vecvecsData[i], SYSTEM_FRAME_SIZE_SAMPLES_SMALL * vecNumAudioChannels[i] ); DoubleFrameSizeConvBufIn[iCurChanID].Get ( vecvecsData[i], SYSTEM_FRAME_SIZE_SAMPLES * vecNumAudioChannels[i] );
} }
} }
} }
@ -1131,7 +1131,7 @@ JitterMeas.Measure();
} }
else if ( vecAudioComprType[i] == CT_OPUS64 ) else if ( vecAudioComprType[i] == CT_OPUS64 )
{ {
iClientFrameSizeSamples = SYSTEM_FRAME_SIZE_SAMPLES_SMALL; iClientFrameSizeSamples = SYSTEM_FRAME_SIZE_SAMPLES;
if ( vecNumAudioChannels[i] == 1 ) if ( vecNumAudioChannels[i] == 1 )
{ {
@ -1153,7 +1153,7 @@ JitterMeas.Measure();
// 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 ( ( vecUseDoubleSysFraSizeConvBuf[i] == 0 ) || if ( ( vecUseDoubleSysFraSizeConvBuf[i] == 0 ) ||
DoubleFrameSizeConvBufOut[iCurChanID].Put ( vecsSendData, SYSTEM_FRAME_SIZE_SAMPLES_SMALL * vecNumAudioChannels[i] ) ) DoubleFrameSizeConvBufOut[iCurChanID].Put ( vecsSendData, SYSTEM_FRAME_SIZE_SAMPLES * vecNumAudioChannels[i] ) )
{ {
if ( vecUseDoubleSysFraSizeConvBuf[i] != 0 ) if ( vecUseDoubleSysFraSizeConvBuf[i] != 0 )
{ {
@ -1173,7 +1173,7 @@ opus_custom_encoder_ctl ( CurOpusEncoder,
OPUS_SET_BITRATE ( CalcBitRateBitsPerSecFromCodedBytes ( iCeltNumCodedBytes, iClientFrameSizeSamples ) ) ); OPUS_SET_BITRATE ( CalcBitRateBitsPerSecFromCodedBytes ( iCeltNumCodedBytes, iClientFrameSizeSamples ) ) );
opus_custom_encode ( CurOpusEncoder, opus_custom_encode ( CurOpusEncoder,
&vecsSendData[iB * SYSTEM_FRAME_SIZE_SAMPLES_SMALL * vecNumAudioChannels[i]], &vecsSendData[iB * SYSTEM_FRAME_SIZE_SAMPLES * vecNumAudioChannels[i]],
iClientFrameSizeSamples, iClientFrameSizeSamples,
&vecbyCodedData[0], &vecbyCodedData[0],
iCeltNumCodedBytes ); iCeltNumCodedBytes );