Issue 1647. Avoid unsequenced modification.

issue=1647
test=trybots,manual

Review URL: https://webrtc-codereview.appspot.com/1327004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3858 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
turaj@webrtc.org 2013-04-16 17:01:35 +00:00
parent 6e788df19e
commit f1a3b4bc0c
2 changed files with 22 additions and 51 deletions

View File

@ -101,26 +101,9 @@
namespace webrtc { namespace webrtc {
// We dynamically allocate some of the dynamic payload types to the defined // Not yet used payload-types.
// codecs. Note! There are a limited number of payload types. If more codecs // 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68,
// are defined they will receive reserved fixed payload types (values 69-95). // 67, 66, 65
const int kDynamicPayloadtypes[ACMCodecDB::kMaxNumCodecs] = {
107, 108, 109, 111, 112, 113, 114, 115, 116, 117, 92,
91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80,
79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68,
67, 66, 65
};
// Creates database with all supported codecs at compile time.
// Each entry needs the following parameters in the given order:
// payload type, name, sampling frequency, packet size in samples,
// number of channels, and default rate.
#if (defined(WEBRTC_CODEC_AMR) || defined(WEBRTC_CODEC_AMRWB) || \
defined(WEBRTC_CODEC_CELT) || defined(WEBRTC_CODEC_G722_1) || \
defined(WEBRTC_CODEC_G722_1C) || defined(WEBRTC_CODEC_G729_1) || \
defined(WEBRTC_CODEC_PCM16) || defined(WEBRTC_CODEC_SPEEX))
static int count_database = 0;
#endif
const CodecInst ACMCodecDB::database_[] = { const CodecInst ACMCodecDB::database_[] = {
#if (defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX)) #if (defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX))
@ -132,13 +115,13 @@ const CodecInst ACMCodecDB::database_[] = {
#endif #endif
#ifdef WEBRTC_CODEC_PCM16 #ifdef WEBRTC_CODEC_PCM16
// Mono // Mono
{kDynamicPayloadtypes[count_database++], "L16", 8000, 80, 1, 128000}, {107, "L16", 8000, 80, 1, 128000},
{kDynamicPayloadtypes[count_database++], "L16", 16000, 160, 1, 256000}, {108, "L16", 16000, 160, 1, 256000},
{kDynamicPayloadtypes[count_database++], "L16", 32000, 320, 1, 512000}, {109, "L16", 32000, 320, 1, 512000},
// Stereo // Stereo
{kDynamicPayloadtypes[count_database++], "L16", 8000, 80, 2, 128000}, {111, "L16", 8000, 80, 2, 128000},
{kDynamicPayloadtypes[count_database++], "L16", 16000, 160, 2, 256000}, {112, "L16", 16000, 160, 2, 256000},
{kDynamicPayloadtypes[count_database++], "L16", 32000, 320, 2, 512000}, {113, "L16", 32000, 320, 2, 512000},
#endif #endif
// G.711, PCM mu-law and A-law. // G.711, PCM mu-law and A-law.
// Mono // Mono
@ -151,16 +134,16 @@ const CodecInst ACMCodecDB::database_[] = {
{102, "ILBC", 8000, 240, 1, 13300}, {102, "ILBC", 8000, 240, 1, 13300},
#endif #endif
#ifdef WEBRTC_CODEC_AMR #ifdef WEBRTC_CODEC_AMR
{kDynamicPayloadtypes[count_database++], "AMR", 8000, 160, 1, 12200}, {114, "AMR", 8000, 160, 1, 12200},
#endif #endif
#ifdef WEBRTC_CODEC_AMRWB #ifdef WEBRTC_CODEC_AMRWB
{kDynamicPayloadtypes[count_database++], "AMR-WB", 16000, 320, 1, 20000}, {115, "AMR-WB", 16000, 320, 1, 20000},
#endif #endif
#ifdef WEBRTC_CODEC_CELT #ifdef WEBRTC_CODEC_CELT
// Mono // Mono
{kDynamicPayloadtypes[count_database++], "CELT", 32000, 640, 1, 64000}, {116, "CELT", 32000, 640, 1, 64000},
// Stereo // Stereo
{kDynamicPayloadtypes[count_database++], "CELT", 32000, 640, 2, 64000}, {117, "CELT", 32000, 640, 2, 64000},
#endif #endif
#ifdef WEBRTC_CODEC_G722 #ifdef WEBRTC_CODEC_G722
// Mono // Mono
@ -169,20 +152,20 @@ const CodecInst ACMCodecDB::database_[] = {
{119, "G722", 16000, 320, 2, 64000}, {119, "G722", 16000, 320, 2, 64000},
#endif #endif
#ifdef WEBRTC_CODEC_G722_1 #ifdef WEBRTC_CODEC_G722_1
{kDynamicPayloadtypes[count_database++], "G7221", 16000, 320, 1, 32000}, {92, "G7221", 16000, 320, 1, 32000},
{kDynamicPayloadtypes[count_database++], "G7221", 16000, 320, 1, 24000}, {91, "G7221", 16000, 320, 1, 24000},
{kDynamicPayloadtypes[count_database++], "G7221", 16000, 320, 1, 16000}, {90, "G7221", 16000, 320, 1, 16000},
#endif #endif
#ifdef WEBRTC_CODEC_G722_1C #ifdef WEBRTC_CODEC_G722_1C
{kDynamicPayloadtypes[count_database++], "G7221", 32000, 640, 1, 48000}, {89, "G7221", 32000, 640, 1, 48000},
{kDynamicPayloadtypes[count_database++], "G7221", 32000, 640, 1, 32000}, {88, "G7221", 32000, 640, 1, 32000},
{kDynamicPayloadtypes[count_database++], "G7221", 32000, 640, 1, 24000}, {87, "G7221", 32000, 640, 1, 24000},
#endif #endif
#ifdef WEBRTC_CODEC_G729 #ifdef WEBRTC_CODEC_G729
{18, "G729", 8000, 240, 1, 8000}, {18, "G729", 8000, 240, 1, 8000},
#endif #endif
#ifdef WEBRTC_CODEC_G729_1 #ifdef WEBRTC_CODEC_G729_1
{kDynamicPayloadtypes[count_database++], "G7291", 16000, 320, 1, 32000}, {86, "G7291", 16000, 320, 1, 32000},
#endif #endif
#ifdef WEBRTC_CODEC_GSMFR #ifdef WEBRTC_CODEC_GSMFR
{3, "GSM", 8000, 160, 1, 13200}, {3, "GSM", 8000, 160, 1, 13200},
@ -193,8 +176,8 @@ const CodecInst ACMCodecDB::database_[] = {
{120, "opus", 48000, 960, 2, 64000}, {120, "opus", 48000, 960, 2, 64000},
#endif #endif
#ifdef WEBRTC_CODEC_SPEEX #ifdef WEBRTC_CODEC_SPEEX
{kDynamicPayloadtypes[count_database++], "speex", 8000, 160, 1, 11000}, {85, "speex", 8000, 160, 1, 11000},
{kDynamicPayloadtypes[count_database++], "speex", 16000, 320, 1, 22000}, {84, "speex", 16000, 320, 1, 22000},
#endif #endif
// Comfort noise for four different sampling frequencies. // Comfort noise for four different sampling frequencies.
{13, "CN", 8000, 240, 1, 0}, {13, "CN", 8000, 240, 1, 0},

View File

@ -106,18 +106,6 @@
'audio_coding_module_impl.cc', 'audio_coding_module_impl.cc',
'audio_coding_module_impl.h', 'audio_coding_module_impl.h',
], ],
'conditions': [
['clang==1', {
'cflags': [
'-Wno-unsequenced',
],
'xcode_settings': {
'WARNING_CFLAGS': [
'-Wno-unsequenced',
],
},
}],
],
}, },
], ],
'conditions': [ 'conditions': [