Wrap ACM2 code inside acm2 namespace. This gurantees that one ACM would not use components of others by accident.
BUG=
R=minyue@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/2344004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@4933 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_amr.cc b/webrtc/modules/audio_coding/main/acm2/acm_amr.cc
index ab4003a..64e323c 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_amr.cc
+++ b/webrtc/modules/audio_coding/main/acm2/acm_amr.cc
@@ -43,6 +43,8 @@
namespace webrtc {
+namespace acm2 {
+
#ifndef WEBRTC_CODEC_AMR
ACMAMR::ACMAMR(int16_t /* codec_id */)
: encoder_inst_ptr_(NULL),
@@ -307,4 +309,6 @@
}
#endif
+} // namespace acm2
+
} // namespace webrtc
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_amr.h b/webrtc/modules/audio_coding/main/acm2/acm_amr.h
index 4471e6b..efa5687 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_amr.h
+++ b/webrtc/modules/audio_coding/main/acm2/acm_amr.h
@@ -21,6 +21,8 @@
enum ACMAMRPackingFormat;
+namespace acm2 {
+
class ACMAMR : public ACMGenericCodec {
public:
explicit ACMAMR(int16_t codec_id);
@@ -60,6 +62,8 @@
ACMAMRPackingFormat encoder_packing_format_;
};
+} // namespace acm2
+
} // namespace webrtc
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_AMR_H_
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_amrwb.cc b/webrtc/modules/audio_coding/main/acm2/acm_amrwb.cc
index 849353a..4dd4e97 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_amrwb.cc
+++ b/webrtc/modules/audio_coding/main/acm2/acm_amrwb.cc
@@ -40,6 +40,8 @@
namespace webrtc {
+namespace acm2 {
+
#ifndef WEBRTC_CODEC_AMRWB
ACMAMRwb::ACMAMRwb(int16_t /* codec_id */)
: encoder_inst_ptr_(NULL),
@@ -313,4 +315,6 @@
#endif
+} // namespace acm2
+
} // namespace webrtc
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_amrwb.h b/webrtc/modules/audio_coding/main/acm2/acm_amrwb.h
index e5bd99d..c8db659 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_amrwb.h
+++ b/webrtc/modules/audio_coding/main/acm2/acm_amrwb.h
@@ -19,6 +19,8 @@
namespace webrtc {
+namespace acm2 {
+
class ACMAMRwb : public ACMGenericCodec {
public:
explicit ACMAMRwb(int16_t codec_id);
@@ -61,6 +63,8 @@
ACMAMRPackingFormat encoder_packing_format_;
};
+} // namespace acm2
+
} // namespace webrtc
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_AMRWB_H_
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_celt.cc b/webrtc/modules/audio_coding/main/acm2/acm_celt.cc
index 21fa3a9..3cd6e84 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_celt.cc
+++ b/webrtc/modules/audio_coding/main/acm2/acm_celt.cc
@@ -20,6 +20,8 @@
namespace webrtc {
+namespace acm2 {
+
#ifndef WEBRTC_CODEC_CELT
ACMCELT::ACMCELT(int16_t /* codec_id */)
@@ -188,4 +190,6 @@
#endif
+} // namespace acm2
+
} // namespace webrtc
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_celt.h b/webrtc/modules/audio_coding/main/acm2/acm_celt.h
index 4b40f79..dc8d3ee 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_celt.h
+++ b/webrtc/modules/audio_coding/main/acm2/acm_celt.h
@@ -19,6 +19,8 @@
namespace webrtc {
+namespace acm2 {
+
class ACMCELT : public ACMGenericCodec {
public:
explicit ACMCELT(int16_t codec_id);
@@ -45,6 +47,8 @@
uint16_t channels_;
};
+} // namespace acm2
+
} // namespace webrtc
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_CELT_H_
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_cng.cc b/webrtc/modules/audio_coding/main/acm2/acm_cng.cc
index 9e658bd..7f0adf8 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_cng.cc
+++ b/webrtc/modules/audio_coding/main/acm2/acm_cng.cc
@@ -17,6 +17,8 @@
namespace webrtc {
+namespace acm2 {
+
ACMCNG::ACMCNG(int16_t codec_id) {
encoder_inst_ptr_ = NULL;
codec_id_ = codec_id;
@@ -76,4 +78,6 @@
return;
}
+} // namespace acm2
+
} // namespace webrtc
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_cng.h b/webrtc/modules/audio_coding/main/acm2/acm_cng.h
index 3816fa2..a0c1c55 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_cng.h
+++ b/webrtc/modules/audio_coding/main/acm2/acm_cng.h
@@ -19,6 +19,8 @@
namespace webrtc {
+namespace acm2 {
+
class ACMCNG: public ACMGenericCodec {
public:
explicit ACMCNG(int16_t codec_id);
@@ -51,6 +53,8 @@
uint16_t samp_freq_hz_;
};
+} // namespace acm2
+
} // namespace webrtc
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_CNG_H_
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_codec_database.cc b/webrtc/modules/audio_coding/main/acm2/acm_codec_database.cc
index 225098a..fd30a13 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_codec_database.cc
+++ b/webrtc/modules/audio_coding/main/acm2/acm_codec_database.cc
@@ -102,6 +102,8 @@
namespace webrtc {
+namespace acm2 {
+
// Not yet used payload-types.
// 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68,
// 67, 66, 65
@@ -954,4 +956,6 @@
return ACMCodecDB::codec_settings_[codec_id].owns_decoder;
}
+} // namespace acm2
+
} // namespace webrtc
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_codec_database.h b/webrtc/modules/audio_coding/main/acm2/acm_codec_database.h
index b992b7d..98869ef 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_codec_database.h
+++ b/webrtc/modules/audio_coding/main/acm2/acm_codec_database.h
@@ -22,6 +22,8 @@
namespace webrtc {
+namespace acm2 {
+
// TODO(tlegrand): replace class ACMCodecDB with a namespace.
class ACMCodecDB {
public:
@@ -350,6 +352,8 @@
static const NetEqDecoder neteq_decoders_[kMaxNumCodecs];
};
+} // namespace acm2
+
} // namespace webrtc
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_CODEC_DATABASE_H_
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_dtmf_playout.cc b/webrtc/modules/audio_coding/main/acm2/acm_dtmf_playout.cc
index ca7e86f..07bab65 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_dtmf_playout.cc
+++ b/webrtc/modules/audio_coding/main/acm2/acm_dtmf_playout.cc
@@ -18,6 +18,8 @@
namespace webrtc {
+namespace acm2 {
+
#ifndef WEBRTC_CODEC_AVT
ACMDTMFPlayout::ACMDTMFPlayout(int16_t /* codec_id */) { return; }
@@ -83,4 +85,6 @@
#endif
+} // namespace acm2
+
} // namespace webrtc
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_dtmf_playout.h b/webrtc/modules/audio_coding/main/acm2/acm_dtmf_playout.h
index 4c3154c..5adb0dd 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_dtmf_playout.h
+++ b/webrtc/modules/audio_coding/main/acm2/acm_dtmf_playout.h
@@ -15,6 +15,8 @@
namespace webrtc {
+namespace acm2 {
+
class ACMDTMFPlayout : public ACMGenericCodec {
public:
explicit ACMDTMFPlayout(int16_t codec_id);
@@ -35,6 +37,8 @@
void InternalDestructEncoderInst(void* ptr_inst);
};
+} // namespace acm2
+
} // namespace webrtc
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_DTMF_PLAYOUT_H_
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_g722.cc b/webrtc/modules/audio_coding/main/acm2/acm_g722.cc
index fe2bd6c..8d45772 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_g722.cc
+++ b/webrtc/modules/audio_coding/main/acm2/acm_g722.cc
@@ -19,6 +19,8 @@
namespace webrtc {
+namespace acm2 {
+
#ifndef WEBRTC_CODEC_G722
ACMG722::ACMG722(int16_t /* codec_id */)
@@ -194,4 +196,6 @@
#endif
+} // namespace acm2
+
} // namespace webrtc
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_g722.h b/webrtc/modules/audio_coding/main/acm2/acm_g722.h
index 34b6c85..7216a57 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_g722.h
+++ b/webrtc/modules/audio_coding/main/acm2/acm_g722.h
@@ -18,6 +18,8 @@
namespace webrtc {
+namespace acm2 {
+
// Forward declaration.
struct ACMG722EncStr;
struct ACMG722DecStr;
@@ -52,6 +54,8 @@
G722EncInst* encoder_inst_ptr_right_; // Prepared for stereo
};
+} // namespace acm2
+
} // namespace webrtc
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_G722_H_
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_g7221.cc b/webrtc/modules/audio_coding/main/acm2/acm_g7221.cc
index 0cba710..3609f07 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_g7221.cc
+++ b/webrtc/modules/audio_coding/main/acm2/acm_g7221.cc
@@ -80,6 +80,8 @@
namespace webrtc {
+namespace acm2 {
+
#ifndef WEBRTC_CODEC_G722_1
ACMG722_1::ACMG722_1(int16_t /* codec_id */)
@@ -323,4 +325,6 @@
#endif
+} // namespace acm2
+
} // namespace webrtc
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_g7221.h b/webrtc/modules/audio_coding/main/acm2/acm_g7221.h
index 4a0bd48..74d9b27 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_g7221.h
+++ b/webrtc/modules/audio_coding/main/acm2/acm_g7221.h
@@ -24,6 +24,8 @@
namespace webrtc {
+namespace acm2 {
+
class ACMG722_1 : public ACMGenericCodec {
public:
explicit ACMG722_1(int16_t codec_id);
@@ -57,6 +59,8 @@
G722_1_32_encinst_t_* encoder_inst32_ptr_right_;
};
+} // namespace acm2
+
} // namespace webrtc
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_G7221_H_
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_g7221c.cc b/webrtc/modules/audio_coding/main/acm2/acm_g7221c.cc
index 531008a..f6555f5 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_g7221c.cc
+++ b/webrtc/modules/audio_coding/main/acm2/acm_g7221c.cc
@@ -80,6 +80,8 @@
namespace webrtc {
+namespace acm2 {
+
#ifndef WEBRTC_CODEC_G722_1C
ACMG722_1C::ACMG722_1C(int16_t /* codec_id */)
@@ -329,4 +331,6 @@
#endif
+} // namespace acm2
+
} // namespace webrtc
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_g7221c.h b/webrtc/modules/audio_coding/main/acm2/acm_g7221c.h
index 961ed4e..66b0f54 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_g7221c.h
+++ b/webrtc/modules/audio_coding/main/acm2/acm_g7221c.h
@@ -24,6 +24,8 @@
namespace webrtc {
+namespace acm2 {
+
class ACMG722_1C : public ACMGenericCodec {
public:
explicit ACMG722_1C(int16_t codec_id);
@@ -57,6 +59,8 @@
G722_1C_48_encinst_t_* encoder_inst48_ptr_right_;
};
+} // namespace acm2
+
} // namespace webrtc
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_G7221C_H_
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_g729.cc b/webrtc/modules/audio_coding/main/acm2/acm_g729.cc
index 91dbb43..6f95f36 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_g729.cc
+++ b/webrtc/modules/audio_coding/main/acm2/acm_g729.cc
@@ -22,6 +22,8 @@
namespace webrtc {
+namespace acm2 {
+
#ifndef WEBRTC_CODEC_G729
ACMG729::ACMG729(int16_t /* codec_id */) : encoder_inst_ptr_(NULL) {}
@@ -252,4 +254,6 @@
#endif
+} // namespace acm2
+
} // namespace webrtc
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_g729.h b/webrtc/modules/audio_coding/main/acm2/acm_g729.h
index f7e762c..88b1bf7 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_g729.h
+++ b/webrtc/modules/audio_coding/main/acm2/acm_g729.h
@@ -19,6 +19,8 @@
namespace webrtc {
+namespace acm2 {
+
class ACMG729 : public ACMGenericCodec {
public:
explicit ACMG729(int16_t codec_id);
@@ -49,6 +51,8 @@
G729_encinst_t_* encoder_inst_ptr_;
};
+} // namespace acm2
+
} // namespace webrtc
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_G729_H_
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_g7291.cc b/webrtc/modules/audio_coding/main/acm2/acm_g7291.cc
index f16eec8..3cf9f22 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_g7291.cc
+++ b/webrtc/modules/audio_coding/main/acm2/acm_g7291.cc
@@ -21,6 +21,8 @@
namespace webrtc {
+namespace acm2 {
+
#ifndef WEBRTC_CODEC_G729_1
ACMG729_1::ACMG729_1(int16_t /* codec_id */)
@@ -237,4 +239,6 @@
#endif
+} // namespace acm2
+
} // namespace webrtc
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_g7291.h b/webrtc/modules/audio_coding/main/acm2/acm_g7291.h
index 5a38e59..38c8fe1 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_g7291.h
+++ b/webrtc/modules/audio_coding/main/acm2/acm_g7291.h
@@ -19,6 +19,8 @@
namespace webrtc {
+namespace acm2 {
+
class ACMG729_1 : public ACMGenericCodec {
public:
explicit ACMG729_1(int16_t codec_id);
@@ -47,6 +49,8 @@
int16_t flag_g729_mode_;
};
+} // namespace acm2
+
} // namespace webrtc
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_G7291_H_
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_generic_codec.cc b/webrtc/modules/audio_coding/main/acm2/acm_generic_codec.cc
index 9754251..aa8e8be 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_generic_codec.cc
+++ b/webrtc/modules/audio_coding/main/acm2/acm_generic_codec.cc
@@ -21,6 +21,8 @@
namespace webrtc {
+namespace acm2 {
+
// Enum for CNG
enum {
kMaxPLCParamsCNG = WEBRTC_CNG_MAX_LPC_ORDER,
@@ -1002,4 +1004,6 @@
return -1;
}
+} // namespace acm2
+
} // namespace webrtc
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_generic_codec.h b/webrtc/modules/audio_coding/main/acm2/acm_generic_codec.h
index 78feb99..d41580f 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_generic_codec.h
+++ b/webrtc/modules/audio_coding/main/acm2/acm_generic_codec.h
@@ -26,8 +26,12 @@
namespace webrtc {
-// forward declaration
+struct WebRtcACMCodecParams;
struct CodecInst;
+
+namespace acm2 {
+
+// forward declaration
class AcmReceiver;
class ACMGenericCodec {
@@ -909,6 +913,8 @@
uint32_t unique_id_;
};
+} // namespace acm2
+
} // namespace webrtc
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_GENERIC_CODEC_H_
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_gsmfr.cc b/webrtc/modules/audio_coding/main/acm2/acm_gsmfr.cc
index 44e6e3d..90f9fce 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_gsmfr.cc
+++ b/webrtc/modules/audio_coding/main/acm2/acm_gsmfr.cc
@@ -21,6 +21,8 @@
namespace webrtc {
+namespace acm2 {
+
#ifndef WEBRTC_CODEC_GSMFR
ACMGSMFR::ACMGSMFR(int16_t /* codec_id */) : encoder_inst_ptr_(NULL) {}
@@ -154,4 +156,6 @@
#endif
+} // namespace acm2
+
} // namespace webrtc
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_gsmfr.h b/webrtc/modules/audio_coding/main/acm2/acm_gsmfr.h
index 51c29ee..79c3a18 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_gsmfr.h
+++ b/webrtc/modules/audio_coding/main/acm2/acm_gsmfr.h
@@ -19,6 +19,8 @@
namespace webrtc {
+namespace acm2 {
+
class ACMGSMFR : public ACMGenericCodec {
public:
explicit ACMGSMFR(int16_t codec_id);
@@ -45,6 +47,8 @@
GSMFR_encinst_t_* encoder_inst_ptr_;
};
+} // namespace acm2
+
} // namespace webrtc
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_GSMFR_H_
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_ilbc.cc b/webrtc/modules/audio_coding/main/acm2/acm_ilbc.cc
index 14fbbd4..eaa079c 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_ilbc.cc
+++ b/webrtc/modules/audio_coding/main/acm2/acm_ilbc.cc
@@ -17,6 +17,8 @@
namespace webrtc {
+namespace acm2 {
+
#ifndef WEBRTC_CODEC_ILBC
ACMILBC::ACMILBC(int16_t /* codec_id */) : encoder_inst_ptr_(NULL) {}
@@ -138,4 +140,6 @@
#endif
+} // namespace acm2
+
} // namespace webrtc
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_ilbc.h b/webrtc/modules/audio_coding/main/acm2/acm_ilbc.h
index e02c789..fd6e853 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_ilbc.h
+++ b/webrtc/modules/audio_coding/main/acm2/acm_ilbc.h
@@ -19,6 +19,8 @@
namespace webrtc {
+namespace acm2 {
+
class ACMILBC : public ACMGenericCodec {
public:
explicit ACMILBC(int16_t codec_id);
@@ -43,6 +45,8 @@
iLBC_encinst_t_* encoder_inst_ptr_;
};
+} // namespace acm2
+
} // namespace webrtc
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_ILBC_H_
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_isac.cc b/webrtc/modules/audio_coding/main/acm2/acm_isac.cc
index 7957fd3..e272842 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_isac.cc
+++ b/webrtc/modules/audio_coding/main/acm2/acm_isac.cc
@@ -31,6 +31,8 @@
namespace webrtc {
+namespace acm2 {
+
// we need this otherwise we cannot use forward declaration
// in the header file
#if (defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX))
@@ -826,4 +828,6 @@
#endif
+} // namespace acm2
+
} // namespace webrtc
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_isac.h b/webrtc/modules/audio_coding/main/acm2/acm_isac.h
index 2e6657f..a3227d5 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_isac.h
+++ b/webrtc/modules/audio_coding/main/acm2/acm_isac.h
@@ -15,6 +15,8 @@
namespace webrtc {
+namespace acm2 {
+
struct ACMISACInst;
class AcmAudioDecoderIsac;
@@ -93,6 +95,8 @@
bool decoder_initialized_;
};
+} // namespace acm2
+
} // namespace webrtc
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_ISAC_H_
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_isac_macros.h b/webrtc/modules/audio_coding/main/acm2/acm_isac_macros.h
index c2a7820..df03097 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_isac_macros.h
+++ b/webrtc/modules/audio_coding/main/acm2/acm_isac_macros.h
@@ -15,6 +15,8 @@
namespace webrtc {
+namespace acm2 {
+
#ifdef WEBRTC_CODEC_ISAC
#define ACM_ISAC_CREATE WebRtcIsac_Create
#define ACM_ISAC_FREE WebRtcIsac_Free
@@ -70,6 +72,8 @@
// decoder
#endif
+} // namespace acm2
+
} // namespace webrtc
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_ISAC_MACROS_H_
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_neteq_unittest.cc b/webrtc/modules/audio_coding/main/acm2/acm_neteq_unittest.cc
index 3f5a200..607b933 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_neteq_unittest.cc
+++ b/webrtc/modules/audio_coding/main/acm2/acm_neteq_unittest.cc
@@ -10,4 +10,6 @@
// This file contains unit tests for ACM's NetEQ wrapper (class ACMNetEQ).
-namespace webrtc {} // namespace
+namespace webrtc {
+
+namespace acm2 {} // namespace
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_opus.cc b/webrtc/modules/audio_coding/main/acm2/acm_opus.cc
index d627fad..c00a920 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_opus.cc
+++ b/webrtc/modules/audio_coding/main/acm2/acm_opus.cc
@@ -19,6 +19,8 @@
namespace webrtc {
+namespace acm2 {
+
#ifndef WEBRTC_CODEC_OPUS
ACMOpus::ACMOpus(int16_t /* codec_id */)
@@ -184,4 +186,6 @@
#endif // WEBRTC_CODEC_OPUS
+} // namespace acm2
+
} // namespace webrtc
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_opus.h b/webrtc/modules/audio_coding/main/acm2/acm_opus.h
index caac010..a346e3c 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_opus.h
+++ b/webrtc/modules/audio_coding/main/acm2/acm_opus.h
@@ -19,6 +19,8 @@
namespace webrtc {
+namespace acm2 {
+
class ACMOpus : public ACMGenericCodec {
public:
explicit ACMOpus(int16_t codec_id);
@@ -45,6 +47,8 @@
int channels_;
};
+} // namespace acm2
+
} // namespace webrtc
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_OPUS_H_
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_pcm16b.cc b/webrtc/modules/audio_coding/main/acm2/acm_pcm16b.cc
index 7c5b0bd..89688a8 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_pcm16b.cc
+++ b/webrtc/modules/audio_coding/main/acm2/acm_pcm16b.cc
@@ -19,6 +19,8 @@
namespace webrtc {
+namespace acm2 {
+
#ifndef WEBRTC_CODEC_PCM16
ACMPCM16B::ACMPCM16B(int16_t /* codec_id */) { return; }
@@ -89,4 +91,6 @@
#endif
+} // namespace acm2
+
} // namespace webrtc
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_pcm16b.h b/webrtc/modules/audio_coding/main/acm2/acm_pcm16b.h
index 3249020..23b8c12 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_pcm16b.h
+++ b/webrtc/modules/audio_coding/main/acm2/acm_pcm16b.h
@@ -15,6 +15,8 @@
namespace webrtc {
+namespace acm2 {
+
class ACMPCM16B : public ACMGenericCodec {
public:
explicit ACMPCM16B(int16_t codec_id);
@@ -37,6 +39,8 @@
int32_t sampling_freq_hz_;
};
+} // namespace acm2
+
} // namespace webrtc
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_PCM16B_H_
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_pcma.cc b/webrtc/modules/audio_coding/main/acm2/acm_pcma.cc
index cb5ebcc..1dd6e48 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_pcma.cc
+++ b/webrtc/modules/audio_coding/main/acm2/acm_pcma.cc
@@ -18,6 +18,8 @@
namespace webrtc {
+namespace acm2 {
+
ACMPCMA::ACMPCMA(int16_t codec_id) { codec_id_ = codec_id; }
ACMPCMA::~ACMPCMA() { return; }
@@ -55,4 +57,6 @@
return;
}
+} // namespace acm2
+
} // namespace webrtc
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_pcma.h b/webrtc/modules/audio_coding/main/acm2/acm_pcma.h
index 4102e17..2da873c 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_pcma.h
+++ b/webrtc/modules/audio_coding/main/acm2/acm_pcma.h
@@ -15,6 +15,8 @@
namespace webrtc {
+namespace acm2 {
+
class ACMPCMA : public ACMGenericCodec {
public:
explicit ACMPCMA(int16_t codec_id);
@@ -35,6 +37,8 @@
void InternalDestructEncoderInst(void* ptr_inst);
};
+} // namespace acm2
+
} // namespace webrtc
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_PCMA_H_
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_pcmu.cc b/webrtc/modules/audio_coding/main/acm2/acm_pcmu.cc
index 6f479ed..7d2536f 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_pcmu.cc
+++ b/webrtc/modules/audio_coding/main/acm2/acm_pcmu.cc
@@ -18,6 +18,8 @@
namespace webrtc {
+namespace acm2 {
+
ACMPCMU::ACMPCMU(int16_t codec_id) { codec_id_ = codec_id; }
ACMPCMU::~ACMPCMU() {}
@@ -56,4 +58,6 @@
encoder_initialized_ = false;
}
+} // namespace acm2
+
} // namespace webrtc
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_pcmu.h b/webrtc/modules/audio_coding/main/acm2/acm_pcmu.h
index 2898df6..18d8279 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_pcmu.h
+++ b/webrtc/modules/audio_coding/main/acm2/acm_pcmu.h
@@ -15,6 +15,8 @@
namespace webrtc {
+namespace acm2 {
+
class ACMPCMU : public ACMGenericCodec {
public:
explicit ACMPCMU(int16_t codec_id);
@@ -35,6 +37,8 @@
void InternalDestructEncoderInst(void* ptr_inst);
};
+} // namespace acm2
+
} // namespace webrtc
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_PCMU_H_
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_receiver.cc b/webrtc/modules/audio_coding/main/acm2/acm_receiver.cc
index 9c9f05d..6d4a8df 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_receiver.cc
+++ b/webrtc/modules/audio_coding/main/acm2/acm_receiver.cc
@@ -30,6 +30,8 @@
namespace webrtc {
+namespace acm2 {
+
namespace {
const int kNeteqInitSampleRateHz = 16000;
@@ -829,4 +831,6 @@
}
}
+} // namespace acm2
+
} // namespace webrtc
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_receiver.h b/webrtc/modules/audio_coding/main/acm2/acm_receiver.h
index 5f6d684..9267c1e 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_receiver.h
+++ b/webrtc/modules/audio_coding/main/acm2/acm_receiver.h
@@ -26,11 +26,14 @@
namespace webrtc {
+struct CodecInst;
class CriticalSectionWrapper;
class RWLockWrapper;
class NetEq;
+
+namespace acm2 {
+
class Nack;
-struct CodecInst;
class AcmReceiver {
public:
@@ -360,6 +363,8 @@
scoped_ptr<InitialDelayManager::SyncStream> late_packets_sync_stream_;
};
+} // namespace acm2
+
} // namespace webrtc
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_RECEIVER_H_
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_receiver_unittest.cc b/webrtc/modules/audio_coding/main/acm2/acm_receiver_unittest.cc
index a00db92..7d85d15 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_receiver_unittest.cc
+++ b/webrtc/modules/audio_coding/main/acm2/acm_receiver_unittest.cc
@@ -23,6 +23,8 @@
#include "webrtc/test/testsupport/gtest_disable.h"
namespace webrtc {
+
+namespace acm2 {
namespace {
bool CodecsEqual(const CodecInst& codec_a, const CodecInst& codec_b) {
@@ -418,4 +420,6 @@
}
}
+} // namespace acm2
+
} // namespace webrtc
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_red.cc b/webrtc/modules/audio_coding/main/acm2/acm_red.cc
index f4a1f6f..4f2c70c 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_red.cc
+++ b/webrtc/modules/audio_coding/main/acm2/acm_red.cc
@@ -15,6 +15,8 @@
namespace webrtc {
+namespace acm2 {
+
ACMRED::ACMRED(int16_t codec_id) { codec_id_ = codec_id; }
ACMRED::~ACMRED() {}
@@ -47,4 +49,6 @@
// RED has no instance
}
+} // namespace acm2
+
} // namespace webrtc
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_red.h b/webrtc/modules/audio_coding/main/acm2/acm_red.h
index ab8d913..ac38170 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_red.h
+++ b/webrtc/modules/audio_coding/main/acm2/acm_red.h
@@ -15,6 +15,8 @@
namespace webrtc {
+namespace acm2 {
+
class ACMRED : public ACMGenericCodec {
public:
explicit ACMRED(int16_t codec_id);
@@ -35,6 +37,8 @@
void InternalDestructEncoderInst(void* ptr_inst);
};
+} // namespace acm2
+
} // namespace webrtc
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_RED_H_
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_resampler.cc b/webrtc/modules/audio_coding/main/acm2/acm_resampler.cc
index 13eed0b..3abe4f1 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_resampler.cc
+++ b/webrtc/modules/audio_coding/main/acm2/acm_resampler.cc
@@ -19,6 +19,8 @@
namespace webrtc {
+namespace acm2 {
+
ACMResampler::ACMResampler()
: resampler_crit_sect_(CriticalSectionWrapper::CreateCriticalSection()) {
}
@@ -63,4 +65,6 @@
return out_len / num_audio_channels;
}
+} // namespace acm2
+
} // namespace webrtc
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_resampler.h b/webrtc/modules/audio_coding/main/acm2/acm_resampler.h
index 8abb2f4..e992955 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_resampler.h
+++ b/webrtc/modules/audio_coding/main/acm2/acm_resampler.h
@@ -18,6 +18,8 @@
class CriticalSectionWrapper;
+namespace acm2 {
+
class ACMResampler {
public:
ACMResampler();
@@ -35,6 +37,8 @@
CriticalSectionWrapper* resampler_crit_sect_;
};
+} // namespace acm2
+
} // namespace webrtc
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_RESAMPLER_H_
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_speex.cc b/webrtc/modules/audio_coding/main/acm2/acm_speex.cc
index 8290265..84a0592 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_speex.cc
+++ b/webrtc/modules/audio_coding/main/acm2/acm_speex.cc
@@ -21,6 +21,8 @@
namespace webrtc {
+namespace acm2 {
+
#ifndef WEBRTC_CODEC_SPEEX
ACMSPEEX::ACMSPEEX(int16_t /* codec_id */)
: encoder_inst_ptr_(NULL),
@@ -326,4 +328,6 @@
#endif
+} // namespace acm2
+
} // namespace webrtc
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_speex.h b/webrtc/modules/audio_coding/main/acm2/acm_speex.h
index 2fac8fd..f9cf787 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_speex.h
+++ b/webrtc/modules/audio_coding/main/acm2/acm_speex.h
@@ -19,6 +19,8 @@
namespace webrtc {
+namespace acm2 {
+
class ACMSPEEX : public ACMGenericCodec {
public:
explicit ACMSPEEX(int16_t codec_id);
@@ -60,6 +62,8 @@
uint16_t samples_in_20ms_audio_;
};
+} // namespace acm2
+
} // namespace webrtc
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_SPEEX_H_
diff --git a/webrtc/modules/audio_coding/main/acm2/audio_coding_module.cc b/webrtc/modules/audio_coding/main/acm2/audio_coding_module.cc
index 7acd49b..c7fe9fa 100644
--- a/webrtc/modules/audio_coding/main/acm2/audio_coding_module.cc
+++ b/webrtc/modules/audio_coding/main/acm2/audio_coding_module.cc
@@ -30,13 +30,13 @@
// Get number of supported codecs
int AudioCodingModule::NumberOfCodecs() {
- return ACMCodecDB::kNumCodecs;
+ return acm2::ACMCodecDB::kNumCodecs;
}
// Get supported codec parameters with id
int AudioCodingModule::Codec(int list_id, CodecInst* codec) {
// Get the codec settings for the codec with the given list ID
- return ACMCodecDB::Codec(list_id, codec);
+ return acm2::ACMCodecDB::Codec(list_id, codec);
}
// Get supported codec parameters with name, frequency and number of channels.
@@ -47,7 +47,8 @@
int codec_id;
// Get the id of the codec from the database.
- codec_id = ACMCodecDB::CodecId(payload_name, sampling_freq_hz, channels);
+ codec_id = acm2::ACMCodecDB::CodecId(
+ payload_name, sampling_freq_hz, channels);
if (codec_id < 0) {
// We couldn't find a matching codec, set the parameters to unacceptable
// values and return.
@@ -60,7 +61,7 @@
}
// Get default codec settings.
- ACMCodecDB::Codec(codec_id, codec);
+ acm2::ACMCodecDB::Codec(codec_id, codec);
// Keep the number of channels from the function call. For most codecs it
// will be the same value as in default codec settings, but not for all.
@@ -73,14 +74,14 @@
int AudioCodingModule::Codec(const char* payload_name,
int sampling_freq_hz,
int channels) {
- return ACMCodecDB::CodecId(payload_name, sampling_freq_hz, channels);
+ return acm2::ACMCodecDB::CodecId(payload_name, sampling_freq_hz, channels);
}
// Checks the validity of the parameters of the given codec
bool AudioCodingModule::IsCodecValid(const CodecInst& codec) {
int mirror_id;
- int codec_number = ACMCodecDB::CodecNumber(codec, &mirror_id);
+ int codec_number = acm2::ACMCodecDB::CodecNumber(codec, &mirror_id);
if (codec_number < 0) {
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, -1,
@@ -97,7 +98,7 @@
}
AudioCodingModule* NewAudioCodingModuleFactory::Create(int id) const {
- return new AudioCodingModuleImpl(id);
+ return new acm2::AudioCodingModuleImpl(id);
}
} // namespace webrtc
diff --git a/webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.cc b/webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.cc
index fb6fe39..911605e 100644
--- a/webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.cc
+++ b/webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.cc
@@ -27,6 +27,8 @@
namespace webrtc {
+namespace acm2 {
+
enum {
kACMToneEnd = 999
};
@@ -1974,4 +1976,6 @@
return receiver_.LeastRequiredDelayMs();
}
+} // namespace acm2
+
} // namespace webrtc
diff --git a/webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.h b/webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.h
index 435c7ae..6bf90cf 100644
--- a/webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.h
+++ b/webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.h
@@ -22,11 +22,14 @@
namespace webrtc {
-class ACMDTMFDetection;
-class ACMGenericCodec;
class CriticalSectionWrapper;
class RWLockWrapper;
+namespace acm2 {
+
+class ACMDTMFDetection;
+class ACMGenericCodec;
+
class AudioCodingModuleImpl : public AudioCodingModule {
public:
// Constructor
@@ -349,6 +352,8 @@
bool first_10ms_data_;
};
+} // namespace acm2
+
} // namespace webrtc
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_AUDIO_CODING_MODULE_IMPL_H_
diff --git a/webrtc/modules/audio_coding/main/acm2/initial_delay_manager.cc b/webrtc/modules/audio_coding/main/acm2/initial_delay_manager.cc
index 0dccb11..c2b218c 100644
--- a/webrtc/modules/audio_coding/main/acm2/initial_delay_manager.cc
+++ b/webrtc/modules/audio_coding/main/acm2/initial_delay_manager.cc
@@ -12,6 +12,8 @@
namespace webrtc {
+namespace acm2 {
+
InitialDelayManager::InitialDelayManager(int initial_delay_ms,
int late_packet_threshold)
: last_packet_type_(kUndefinedPacket),
@@ -227,4 +229,6 @@
initial_delay_ms_ * sample_rate_hz / 1000);
}
+} // namespace acm2
+
} // namespace webrtc
diff --git a/webrtc/modules/audio_coding/main/acm2/initial_delay_manager.h b/webrtc/modules/audio_coding/main/acm2/initial_delay_manager.h
index da08f8b..3c5ba3c 100644
--- a/webrtc/modules/audio_coding/main/acm2/initial_delay_manager.h
+++ b/webrtc/modules/audio_coding/main/acm2/initial_delay_manager.h
@@ -16,6 +16,8 @@
namespace webrtc {
+namespace acm2 {
+
class InitialDelayManager {
public:
enum PacketType {
@@ -110,6 +112,8 @@
const int late_packet_threshold_;
};
+} // namespace acm2
+
} // namespace webrtc
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_INITIAL_DELAY_MANAGER_H_
diff --git a/webrtc/modules/audio_coding/main/acm2/initial_delay_manager_unittest.cc b/webrtc/modules/audio_coding/main/acm2/initial_delay_manager_unittest.cc
index 7e3bda5..1e129f3 100644
--- a/webrtc/modules/audio_coding/main/acm2/initial_delay_manager_unittest.cc
+++ b/webrtc/modules/audio_coding/main/acm2/initial_delay_manager_unittest.cc
@@ -15,6 +15,8 @@
namespace webrtc {
+namespace acm2 {
+
namespace {
const uint8_t kAudioPayloadType = 0;
@@ -368,4 +370,6 @@
EXPECT_FALSE(manager_->buffering());
}
+} // namespace acm2
+
} // namespace webrtc
diff --git a/webrtc/modules/audio_coding/main/acm2/nack.cc b/webrtc/modules/audio_coding/main/acm2/nack.cc
index e26ad61..7265fe6 100644
--- a/webrtc/modules/audio_coding/main/acm2/nack.cc
+++ b/webrtc/modules/audio_coding/main/acm2/nack.cc
@@ -19,6 +19,8 @@
namespace webrtc {
+namespace acm2 {
+
namespace {
const int kDefaultSampleRateKhz = 48;
@@ -222,4 +224,6 @@
return sequence_numbers;
}
+} // namespace acm2
+
} // namespace webrtc
diff --git a/webrtc/modules/audio_coding/main/acm2/nack.h b/webrtc/modules/audio_coding/main/acm2/nack.h
index 490c038..3809327 100644
--- a/webrtc/modules/audio_coding/main/acm2/nack.h
+++ b/webrtc/modules/audio_coding/main/acm2/nack.h
@@ -49,6 +49,8 @@
//
namespace webrtc {
+namespace acm2 {
+
class Nack {
public:
// A limit for the size of the NACK list.
@@ -204,6 +206,8 @@
size_t max_nack_list_size_;
};
+} // namespace acm2
+
} // namespace webrtc
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_NACK_H_
diff --git a/webrtc/modules/audio_coding/main/acm2/nack_unittest.cc b/webrtc/modules/audio_coding/main/acm2/nack_unittest.cc
index b047fd6..8011d88 100644
--- a/webrtc/modules/audio_coding/main/acm2/nack_unittest.cc
+++ b/webrtc/modules/audio_coding/main/acm2/nack_unittest.cc
@@ -21,6 +21,8 @@
namespace webrtc {
+namespace acm2 {
+
namespace {
const int kNackThreshold = 3;
@@ -479,4 +481,6 @@
EXPECT_EQ(5, nack_list[1]);
}
+} // namespace acm2
+
} // namespace webrtc