Prepare to compile ACM1 and ACM2.
ACM1 code is wrapped in namespace acm1. Inculde paths and define guards of ACM2 source codes are corrected. gypi file of ACM2 is changed so that ACM1 will later on depends on ACM2. BUG= R=andrew@webrtc.org Review URL: https://webrtc-codereview.appspot.com/2206004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@4743 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -49,6 +49,8 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
#ifndef WEBRTC_CODEC_AMR
|
||||
ACMAMR::ACMAMR(int16_t /* codec_id */)
|
||||
: encoder_inst_ptr_(NULL),
|
||||
@ -421,4 +423,8 @@ ACMAMRPackingFormat ACMAMR::AMRDecoderPackingFormat() const {
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@ struct AMR_decinst_t_;
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
enum ACMAMRPackingFormat;
|
||||
namespace acm1 {
|
||||
|
||||
class ACMAMR : public ACMGenericCodec {
|
||||
public:
|
||||
@ -80,6 +80,8 @@ class ACMAMR : public ACMGenericCodec {
|
||||
ACMAMRPackingFormat decoder_packing_format_;
|
||||
};
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_SOURCE_ACM_AMR_H_
|
||||
|
||||
@ -46,6 +46,8 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
#ifndef WEBRTC_CODEC_AMRWB
|
||||
ACMAMRwb::ACMAMRwb(int16_t /* codec_id */)
|
||||
: encoder_inst_ptr_(NULL),
|
||||
@ -429,4 +431,6 @@ ACMAMRPackingFormat ACMAMRwb::AMRwbDecoderPackingFormat() const {
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -19,6 +19,8 @@ struct AMRWB_decinst_t_;
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
class ACMAMRwb : public ACMGenericCodec {
|
||||
public:
|
||||
explicit ACMAMRwb(int16_t codec_id);
|
||||
@ -81,6 +83,8 @@ class ACMAMRwb : public ACMGenericCodec {
|
||||
ACMAMRPackingFormat decoder_packing_format_;
|
||||
};
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_SOURCE_ACM_AMRWB_H_
|
||||
|
||||
@ -24,6 +24,8 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
#ifndef WEBRTC_CODEC_CELT
|
||||
|
||||
ACMCELT::ACMCELT(int16_t /* codec_id */)
|
||||
@ -332,4 +334,6 @@ void ACMCELT::SplitStereoPacket(uint8_t* payload, int32_t* payload_length) {
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -19,6 +19,8 @@ struct CELT_decinst_t_;
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
class ACMCELT : public ACMGenericCodec {
|
||||
public:
|
||||
explicit ACMCELT(int16_t codec_id);
|
||||
@ -70,6 +72,8 @@ class ACMCELT : public ACMGenericCodec {
|
||||
uint16_t dec_channels_;
|
||||
};
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_SOURCE_ACM_CELT_H_
|
||||
|
||||
@ -20,6 +20,8 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
ACMCNG::ACMCNG(int16_t codec_id) {
|
||||
encoder_inst_ptr_ = NULL;
|
||||
decoder_inst_ptr_ = NULL;
|
||||
@ -143,4 +145,6 @@ void ACMCNG::InternalDestructEncoderInst(void* ptr_inst) {
|
||||
int16_t ACMCNG::EnableDTX() { return -1; }
|
||||
int16_t ACMCNG::DisableDTX() { return -1; }
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -19,6 +19,8 @@ struct WebRtcCngDecInst;
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
class ACMCNG: public ACMGenericCodec {
|
||||
public:
|
||||
explicit ACMCNG(int16_t codec_id);
|
||||
@ -64,6 +66,8 @@ class ACMCNG: public ACMGenericCodec {
|
||||
uint16_t samp_freq_hz_;
|
||||
};
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_SOURCE_ACM_CNG_H_
|
||||
|
||||
@ -101,6 +101,8 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
// Not yet used payload-types.
|
||||
// 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68,
|
||||
// 67, 66, 65
|
||||
@ -949,4 +951,6 @@ bool ACMCodecDB::ValidPayloadType(int payload_type) {
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -22,6 +22,8 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
// TODO(tlegrand): replace class ACMCodecDB with a namespace.
|
||||
class ACMCodecDB {
|
||||
public:
|
||||
@ -327,6 +329,8 @@ class ACMCodecDB {
|
||||
static const WebRtcNetEQDecoder neteq_decoders_[kMaxNumCodecs];
|
||||
};
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_SOURCE_ACM_CODEC_DATABASE_H_
|
||||
|
||||
@ -26,6 +26,8 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
// 60 ms is the maximum block size we support. An extra 20 ms is considered
|
||||
// for safety if process() method is not called when it should be, i.e. we
|
||||
// accept 20 ms of jitter. 80 ms @ 48 kHz (full-band) stereo is 7680 samples.
|
||||
@ -104,6 +106,8 @@ struct WebRtcACMAudioBuff {
|
||||
uint32_t last_in_timestamp;
|
||||
};
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_SOURCE_ACM_COMMON_DEFS_H_
|
||||
|
||||
@ -14,6 +14,8 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
ACMDTMFDetection::ACMDTMFDetection() {}
|
||||
|
||||
ACMDTMFDetection::~ACMDTMFDetection() {}
|
||||
@ -35,4 +37,6 @@ int16_t ACMDTMFDetection::Detect(
|
||||
return -1;
|
||||
}
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -17,6 +17,8 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
class ACMDTMFDetection {
|
||||
public:
|
||||
ACMDTMFDetection();
|
||||
@ -33,6 +35,8 @@ class ACMDTMFDetection {
|
||||
ACMResampler resampler_;
|
||||
};
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_SOURCE_ACM_DTMF_DETECTION_H_
|
||||
|
||||
@ -18,6 +18,8 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
#ifndef WEBRTC_CODEC_AVT
|
||||
|
||||
ACMDTMFPlayout::ACMDTMFPlayout(
|
||||
@ -164,4 +166,6 @@ void ACMDTMFPlayout::DestructDecoderSafe() {
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -15,6 +15,8 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
class ACMDTMFPlayout: public ACMGenericCodec {
|
||||
public:
|
||||
explicit ACMDTMFPlayout(int16_t codec_id);
|
||||
@ -53,6 +55,8 @@ class ACMDTMFPlayout: public ACMGenericCodec {
|
||||
virtual void InternalDestructEncoderInst(void* ptr_inst) OVERRIDE;
|
||||
};
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_SOURCE_ACM_DTMF_PLAYOUT_H_
|
||||
|
||||
@ -20,6 +20,8 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
#ifndef WEBRTC_CODEC_G722
|
||||
|
||||
ACMG722::ACMG722(int16_t /* codec_id */)
|
||||
@ -351,4 +353,6 @@ void ACMG722::SplitStereoPacket(uint8_t* payload, int32_t* payload_length) {
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -18,6 +18,8 @@ typedef struct WebRtcG722DecInst G722DecInst;
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
// forward declaration
|
||||
struct ACMG722EncStr;
|
||||
struct ACMG722DecStr;
|
||||
@ -75,6 +77,8 @@ class ACMG722 : public ACMGenericCodec {
|
||||
G722DecInst* decoder_inst_ptr_;
|
||||
};
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_SOURCE_ACM_G722_H_
|
||||
|
||||
@ -86,6 +86,8 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
#ifndef WEBRTC_CODEC_G722_1
|
||||
|
||||
ACMG722_1::ACMG722_1(int16_t /* codec_id */)
|
||||
@ -493,4 +495,6 @@ void ACMG722_1::InternalDestructEncoderInst(void* ptr_inst) {
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -24,6 +24,8 @@ struct G722_1_Inst_t_;
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
class ACMG722_1: public ACMGenericCodec {
|
||||
public:
|
||||
explicit ACMG722_1(int16_t codec_id);
|
||||
@ -77,6 +79,8 @@ class ACMG722_1: public ACMGenericCodec {
|
||||
G722_1_32_decinst_t_* decoder_inst32_ptr_;
|
||||
};
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_SOURCE_ACM_G7221_H_
|
||||
|
||||
@ -87,6 +87,8 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
#ifndef WEBRTC_CODEC_G722_1C
|
||||
|
||||
ACMG722_1C::ACMG722_1C(int16_t /* codec_id */)
|
||||
@ -503,4 +505,6 @@ void ACMG722_1C::InternalDestructEncoderInst(void* ptr_inst) {
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -24,6 +24,8 @@ struct G722_1_Inst_t_;
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
class ACMG722_1C : public ACMGenericCodec {
|
||||
public:
|
||||
explicit ACMG722_1C(int16_t codec_id);
|
||||
@ -85,6 +87,8 @@ class ACMG722_1C : public ACMGenericCodec {
|
||||
G722_1C_48_decinst_t_* decoder_inst48_ptr_;
|
||||
};
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc;
|
||||
|
||||
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_SOURCE_ACM_G7221C_H_
|
||||
|
||||
@ -25,6 +25,8 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
#ifndef WEBRTC_CODEC_G729
|
||||
|
||||
ACMG729::ACMG729(int16_t /* codec_id */)
|
||||
@ -359,4 +361,6 @@ void ACMG729::InternalDestructEncoderInst(void* ptr_inst) {
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -19,6 +19,8 @@ struct G729_decinst_t_;
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
class ACMG729 : public ACMGenericCodec {
|
||||
public:
|
||||
explicit ACMG729(int16_t codec_id);
|
||||
@ -67,6 +69,8 @@ class ACMG729 : public ACMGenericCodec {
|
||||
|
||||
};
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_SOURCE_ACM_G729_H_
|
||||
|
||||
@ -24,6 +24,8 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
#ifndef WEBRTC_CODEC_G729_1
|
||||
|
||||
ACMG729_1::ACMG729_1(int16_t /* codec_id */)
|
||||
@ -342,4 +344,6 @@ int16_t ACMG729_1::SetBitRateSafe(const int32_t rate) {
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -19,6 +19,8 @@ struct G729_1_inst_t_;
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
class ACMG729_1 : public ACMGenericCodec {
|
||||
public:
|
||||
explicit ACMG729_1(int16_t codec_id);
|
||||
@ -63,6 +65,8 @@ class ACMG729_1 : public ACMGenericCodec {
|
||||
int16_t flag_g729_mode_;
|
||||
};
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_SOURCE_ACM_G7291_H_
|
||||
|
||||
@ -22,6 +22,8 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
// Enum for CNG
|
||||
enum {
|
||||
kMaxPLCParamsCNG = WEBRTC_CNG_MAX_LPC_ORDER,
|
||||
@ -1251,4 +1253,6 @@ int16_t ACMGenericCodec::REDPayloadISAC(const int32_t /* isac_rate */,
|
||||
|
||||
bool ACMGenericCodec::IsTrueStereoCodec() { return false; }
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -27,6 +27,9 @@ namespace webrtc {
|
||||
|
||||
// forward declaration
|
||||
struct CodecInst;
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
class ACMNetEQ;
|
||||
|
||||
class ACMGenericCodec {
|
||||
@ -1213,6 +1216,8 @@ class ACMGenericCodec {
|
||||
uint32_t unique_id_;
|
||||
};
|
||||
|
||||
} // namespace webrt
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_SOURCE_ACM_GENERIC_CODEC_H_
|
||||
|
||||
@ -24,6 +24,8 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
#ifndef WEBRTC_CODEC_GSMFR
|
||||
|
||||
ACMGSMFR::ACMGSMFR(int16_t /* codec_id */)
|
||||
@ -260,4 +262,6 @@ void ACMGSMFR::InternalDestructEncoderInst(void* ptr_inst) {
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -19,6 +19,8 @@ struct GSMFR_decinst_t_;
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
class ACMGSMFR : public ACMGenericCodec {
|
||||
public:
|
||||
explicit ACMGSMFR(int16_t codec_id);
|
||||
@ -62,6 +64,8 @@ class ACMGSMFR : public ACMGenericCodec {
|
||||
GSMFR_decinst_t_* decoder_inst_ptr_;
|
||||
};
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_SOURCE_ACM_GSMFR_H_
|
||||
|
||||
@ -21,6 +21,8 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
#ifndef WEBRTC_CODEC_ILBC
|
||||
|
||||
ACMILBC::ACMILBC(int16_t /* codec_id */)
|
||||
@ -252,4 +254,6 @@ int16_t ACMILBC::SetBitRateSafe(const int32_t rate) {
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -19,6 +19,8 @@ struct iLBC_decinst_t_;
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
class ACMILBC : public ACMGenericCodec {
|
||||
public:
|
||||
explicit ACMILBC(int16_t codec_id);
|
||||
@ -62,6 +64,8 @@ class ACMILBC : public ACMGenericCodec {
|
||||
iLBC_decinst_t_* decoder_inst_ptr_;
|
||||
};
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_SOURCE_ACM_ILBC_H_
|
||||
|
||||
@ -28,6 +28,8 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
// we need this otherwise we cannot use forward declaration
|
||||
// in the header file
|
||||
#if (defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX))
|
||||
@ -896,4 +898,6 @@ int16_t ACMISAC::REDPayloadISAC(const int32_t isac_rate,
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -15,6 +15,8 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
struct ACMISACInst;
|
||||
|
||||
enum IsacCodingMode {
|
||||
@ -129,6 +131,8 @@ class ACMISAC : public ACMGenericCodec {
|
||||
WebRtcACMCodecParams decoder_params_32khz_;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_SOURCE_ACM_ISAC_H_
|
||||
|
||||
@ -15,6 +15,8 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
#ifdef WEBRTC_CODEC_ISAC
|
||||
#define ACM_ISAC_CREATE WebRtcIsac_Create
|
||||
#define ACM_ISAC_FREE WebRtcIsac_Free
|
||||
@ -67,7 +69,9 @@ namespace webrtc {
|
||||
#define ACM_ISAC_GETDECSAMPRATE ACMISACFixGetDecSampRate // local Impl
|
||||
#endif
|
||||
|
||||
} // namespace
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_SOURCE_ACM_ISAC_MACROS_H_
|
||||
|
||||
|
||||
@ -26,6 +26,8 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
#define RTP_HEADER_SIZE 12
|
||||
#define NETEQ_INIT_FREQ 8000
|
||||
#define NETEQ_INIT_FREQ_KHZ (NETEQ_INIT_FREQ/1000)
|
||||
@ -1140,4 +1142,6 @@ bool ACMNetEQ::DecodedRtpInfo(int* sequence_number, uint32_t* timestamp) const {
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -12,8 +12,6 @@
|
||||
#define WEBRTC_MODULES_AUDIO_CODING_MAIN_SOURCE_ACM_NETEQ_H_
|
||||
|
||||
#include "webrtc/common_audio/vad/include/webrtc_vad.h"
|
||||
#include "webrtc/engine_configurations.h"
|
||||
#include "webrtc/modules/audio_coding/main/interface/audio_coding_module.h"
|
||||
#include "webrtc/modules/audio_coding/main/interface/audio_coding_module_typedefs.h"
|
||||
#include "webrtc/modules/audio_coding/neteq/interface/webrtc_neteq.h"
|
||||
#include "webrtc/modules/interface/module_common_types.h"
|
||||
@ -25,6 +23,8 @@ class CriticalSectionWrapper;
|
||||
class RWLockWrapper;
|
||||
struct CodecInst;
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
#define MAX_NUM_SLAVE_NETEQ 1
|
||||
|
||||
class ACMNetEQ {
|
||||
@ -392,6 +392,8 @@ class ACMNetEQ {
|
||||
int maximum_delay_ms_;
|
||||
};
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_SOURCE_ACM_NETEQ_H_
|
||||
|
||||
@ -24,6 +24,8 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
class AcmNetEqTest : public ::testing::Test {
|
||||
protected:
|
||||
static const size_t kMaxPayloadLen = 5760; // 60 ms, 48 kHz, 16 bit samples.
|
||||
@ -146,4 +148,6 @@ TEST_F(AcmNetEqTest, TestZeroLengthWaitingTimesVector) {
|
||||
EXPECT_EQ(-1, stats.medianWaitingTimeMs);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -23,6 +23,8 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
#ifndef WEBRTC_CODEC_OPUS
|
||||
|
||||
ACMOpus::ACMOpus(int16_t /* codec_id */)
|
||||
@ -312,4 +314,6 @@ void ACMOpus::SplitStereoPacket(uint8_t* payload, int32_t* payload_length) {
|
||||
|
||||
#endif // WEBRTC_CODEC_OPUS
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -19,6 +19,8 @@ struct WebRtcOpusDecInst;
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
class ACMOpus : public ACMGenericCodec {
|
||||
public:
|
||||
explicit ACMOpus(int16_t codec_id);
|
||||
@ -69,6 +71,8 @@ class ACMOpus : public ACMGenericCodec {
|
||||
int channels_;
|
||||
};
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_SOURCE_ACM_OPUS_H_
|
||||
|
||||
@ -23,6 +23,8 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
#ifndef WEBRTC_CODEC_PCM16
|
||||
|
||||
ACMPCM16B::ACMPCM16B(int16_t /* codec_id */) {
|
||||
@ -244,4 +246,6 @@ void ACMPCM16B::SplitStereoPacket(uint8_t* payload, int32_t* payload_length) {
|
||||
}
|
||||
#endif
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -15,6 +15,8 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
class ACMPCM16B : public ACMGenericCodec {
|
||||
public:
|
||||
explicit ACMPCM16B(int16_t codec_id);
|
||||
@ -58,6 +60,8 @@ class ACMPCM16B : public ACMGenericCodec {
|
||||
int32_t sampling_freq_hz_;
|
||||
};
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_SOURCE_ACM_PCM16B_H_
|
||||
|
||||
@ -21,6 +21,8 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
ACMPCMA::ACMPCMA(int16_t codec_id) {
|
||||
codec_id_ = codec_id;
|
||||
}
|
||||
@ -127,4 +129,6 @@ void ACMPCMA::SplitStereoPacket(uint8_t* payload, int32_t* payload_length) {
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -15,6 +15,8 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
class ACMPCMA : public ACMGenericCodec {
|
||||
public:
|
||||
explicit ACMPCMA(int16_t codec_id);
|
||||
@ -56,6 +58,8 @@ class ACMPCMA : public ACMGenericCodec {
|
||||
int32_t* payload_length) OVERRIDE;
|
||||
};
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_SOURCE_ACM_PCMA_H_
|
||||
|
||||
@ -21,6 +21,8 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
ACMPCMU::ACMPCMU(int16_t codec_id) {
|
||||
codec_id_ = codec_id;
|
||||
}
|
||||
@ -129,4 +131,6 @@ void ACMPCMU::SplitStereoPacket(uint8_t* payload, int32_t* payload_length) {
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -15,6 +15,8 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
class ACMPCMU : public ACMGenericCodec {
|
||||
public:
|
||||
explicit ACMPCMU(int16_t codec_id);
|
||||
@ -56,6 +58,8 @@ class ACMPCMU : public ACMGenericCodec {
|
||||
int32_t* payload_length) OVERRIDE;
|
||||
};
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_SOURCE_ACM_PCMU_H_
|
||||
|
||||
@ -18,6 +18,8 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
ACMRED::ACMRED(int16_t codec_id) {
|
||||
codec_id_ = codec_id;
|
||||
}
|
||||
@ -101,4 +103,6 @@ void ACMRED::DestructDecoderSafe() {
|
||||
return;
|
||||
}
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -15,6 +15,8 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
class ACMRED : public ACMGenericCodec {
|
||||
public:
|
||||
explicit ACMRED(int16_t codec_id);
|
||||
@ -53,6 +55,8 @@ class ACMRED : public ACMGenericCodec {
|
||||
virtual void InternalDestructEncoderInst(void* ptr_inst) OVERRIDE;
|
||||
};
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_SOURCE_ACM_RED_H_
|
||||
|
||||
@ -17,6 +17,8 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
ACMResampler::ACMResampler() {
|
||||
}
|
||||
|
||||
@ -56,4 +58,6 @@ int16_t ACMResampler::Resample10Msec(const int16_t* in_audio,
|
||||
return out_length / num_audio_channels;
|
||||
}
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -16,6 +16,8 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
class ACMResampler {
|
||||
public:
|
||||
ACMResampler();
|
||||
@ -31,6 +33,8 @@ class ACMResampler {
|
||||
PushResampler resampler_;
|
||||
};
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_SOURCE_ACM_RESAMPLER_H_
|
||||
|
||||
@ -25,6 +25,8 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
#ifndef WEBRTC_CODEC_SPEEX
|
||||
ACMSPEEX::ACMSPEEX(int16_t /* codec_id */)
|
||||
: encoder_inst_ptr_(NULL),
|
||||
@ -464,4 +466,6 @@ int16_t ACMSPEEX::SetComplMode(int16_t mode) {
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -19,6 +19,8 @@ struct SPEEX_decinst_t_;
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
class ACMSPEEX : public ACMGenericCodec {
|
||||
public:
|
||||
explicit ACMSPEEX(int16_t codec_id);
|
||||
@ -77,6 +79,8 @@ class ACMSPEEX : public ACMGenericCodec {
|
||||
uint16_t samples_in_20ms_audio_;
|
||||
};
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_SOURCE_ACM_SPEEX_H_
|
||||
|
||||
@ -21,31 +21,31 @@ namespace webrtc {
|
||||
|
||||
// Create module
|
||||
AudioCodingModule* AudioCodingModule::Create(const int32_t id) {
|
||||
return new AudioCodingModuleImpl(id, Clock::GetRealTimeClock());
|
||||
return new acm1::AudioCodingModuleImpl(id, Clock::GetRealTimeClock());
|
||||
}
|
||||
|
||||
// Used for testing by inserting a simulated clock. ACM will not destroy the
|
||||
// injected |clock| the client has to take care of that.
|
||||
AudioCodingModule* AudioCodingModule::Create(const int32_t id,
|
||||
Clock* clock) {
|
||||
return new AudioCodingModuleImpl(id, clock);
|
||||
return new acm1::AudioCodingModuleImpl(id, clock);
|
||||
}
|
||||
|
||||
// Destroy module
|
||||
void AudioCodingModule::Destroy(AudioCodingModule* module) {
|
||||
delete static_cast<AudioCodingModuleImpl*>(module);
|
||||
delete static_cast<acm1::AudioCodingModuleImpl*>(module);
|
||||
}
|
||||
|
||||
// Get number of supported codecs
|
||||
uint8_t AudioCodingModule::NumberOfCodecs() {
|
||||
return static_cast<uint8_t>(ACMCodecDB::kNumCodecs);
|
||||
return static_cast<uint8_t>(acm1::ACMCodecDB::kNumCodecs);
|
||||
}
|
||||
|
||||
// Get supported codec param with id
|
||||
int32_t AudioCodingModule::Codec(uint8_t list_id,
|
||||
CodecInst* codec) {
|
||||
// Get the codec settings for the codec with the given list ID
|
||||
return ACMCodecDB::Codec(list_id, codec);
|
||||
return acm1::ACMCodecDB::Codec(list_id, codec);
|
||||
}
|
||||
|
||||
// Get supported codec Param with name, frequency and number of channels.
|
||||
@ -55,7 +55,8 @@ int32_t AudioCodingModule::Codec(const char* payload_name,
|
||||
int codec_id;
|
||||
|
||||
// Get the id of the codec from the database.
|
||||
codec_id = ACMCodecDB::CodecId(payload_name, sampling_freq_hz, channels);
|
||||
codec_id = acm1::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.
|
||||
@ -68,7 +69,7 @@ int32_t AudioCodingModule::Codec(const char* payload_name,
|
||||
}
|
||||
|
||||
// Get default codec settings.
|
||||
ACMCodecDB::Codec(codec_id, codec);
|
||||
acm1::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.
|
||||
@ -80,14 +81,14 @@ int32_t AudioCodingModule::Codec(const char* payload_name,
|
||||
// Get supported codec Index with name, frequency and number of channels.
|
||||
int32_t AudioCodingModule::Codec(const char* payload_name,
|
||||
int sampling_freq_hz, int channels) {
|
||||
return ACMCodecDB::CodecId(payload_name, sampling_freq_hz, channels);
|
||||
return acm1::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 = acm1::ACMCodecDB::CodecNumber(&codec, &mirror_id);
|
||||
|
||||
if (codec_number < 0) {
|
||||
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, -1,
|
||||
@ -99,8 +100,8 @@ bool AudioCodingModule::IsCodecValid(const CodecInst& codec) {
|
||||
}
|
||||
|
||||
AudioCodingModule* AudioCodingModuleFactory::Create(int id) const {
|
||||
return new AudioCodingModuleImpl(static_cast<int32_t>(id),
|
||||
Clock::GetRealTimeClock());
|
||||
return new acm1::AudioCodingModuleImpl(static_cast<int32_t>(id),
|
||||
Clock::GetRealTimeClock());
|
||||
}
|
||||
|
||||
AudioCodingModule* NewAudioCodingModuleFactory::Create(int id) const {
|
||||
|
||||
@ -32,6 +32,8 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
enum {
|
||||
kACMToneEnd = 999
|
||||
};
|
||||
@ -3115,4 +3117,6 @@ void AudioCodingModuleImpl::DisableNack() {
|
||||
nack_enabled_ = false;
|
||||
}
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -15,6 +15,7 @@
|
||||
|
||||
#include "webrtc/common_types.h"
|
||||
#include "webrtc/engine_configurations.h"
|
||||
#include "webrtc/modules/audio_coding/main/interface/audio_coding_module.h"
|
||||
#include "webrtc/modules/audio_coding/main/source/acm_codec_database.h"
|
||||
#include "webrtc/modules/audio_coding/main/source/acm_neteq.h"
|
||||
#include "webrtc/modules/audio_coding/main/source/acm_resampler.h"
|
||||
@ -22,11 +23,16 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
class ACMDTMFDetection;
|
||||
class ACMGenericCodec;
|
||||
class CriticalSectionWrapper;
|
||||
class RWLockWrapper;
|
||||
class Clock;
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
struct WebRtcACMAudioBuff;
|
||||
struct WebRtcACMCodecParams;
|
||||
class ACMDTMFDetection;
|
||||
class ACMGenericCodec;
|
||||
class Nack;
|
||||
|
||||
class AudioCodingModuleImpl : public AudioCodingModule {
|
||||
@ -88,8 +94,7 @@ class AudioCodingModuleImpl : public AudioCodingModule {
|
||||
|
||||
// Register a transport callback which will be
|
||||
// called to deliver the encoded buffers.
|
||||
int32_t RegisterTransportCallback(
|
||||
AudioPacketizationCallback* transport);
|
||||
int32_t RegisterTransportCallback(AudioPacketizationCallback* transport);
|
||||
|
||||
// Used by the module to deliver messages to the codec module/application
|
||||
// AVT(DTMF).
|
||||
@ -125,8 +130,7 @@ class AudioCodingModuleImpl : public AudioCodingModule {
|
||||
bool enable_vad = false,
|
||||
ACMVADMode mode = VADNormal);
|
||||
|
||||
int32_t VAD(bool* dtx_enabled, bool* vad_enabled,
|
||||
ACMVADMode* mode) const;
|
||||
int32_t VAD(bool* dtx_enabled, bool* vad_enabled, ACMVADMode* mode) const;
|
||||
|
||||
int32_t RegisterVADCallback(ACMVADCallback* vad_callback);
|
||||
|
||||
@ -454,6 +458,8 @@ class AudioCodingModuleImpl : public AudioCodingModule {
|
||||
bool nack_enabled_;
|
||||
};
|
||||
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_SOURCE_AUDIO_CODING_MODULE_IMPL_H_
|
||||
|
||||
@ -19,6 +19,8 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
namespace {
|
||||
|
||||
const int kDefaultSampleRateKhz = 48;
|
||||
@ -222,4 +224,6 @@ std::vector<uint16_t> Nack::GetNackList(int round_trip_time_ms) const {
|
||||
return sequence_numbers;
|
||||
}
|
||||
|
||||
} // webrtc
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -49,6 +49,8 @@
|
||||
//
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
class Nack {
|
||||
public:
|
||||
// A limit for the size of the NACK list.
|
||||
@ -204,6 +206,8 @@ class Nack {
|
||||
size_t max_nack_list_size_;
|
||||
};
|
||||
|
||||
} // webrtc
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_SOURCE_NACK_H_
|
||||
|
||||
@ -13,6 +13,7 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "webrtc/typedefs.h"
|
||||
@ -21,6 +22,8 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace acm1 {
|
||||
|
||||
namespace {
|
||||
|
||||
const int kNackThreshold = 3;
|
||||
@ -479,4 +482,6 @@ TEST(NackTest, RoudTripTimeIsApplied) {
|
||||
EXPECT_EQ(5, nack_list[1]);
|
||||
}
|
||||
|
||||
} // webrtc
|
||||
} // namespace acm1
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
Reference in New Issue
Block a user