Add some virtual and OVERRIDEs in webrtc/modules/audio_coding/
BUG=163 TBR=turaj@webrtc.org Review URL: https://webrtc-codereview.appspot.com/1900004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@4447 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
e72428442d
commit
2d1a55caed
@ -24,17 +24,19 @@ enum ACMAMRPackingFormat;
|
||||
class ACMAMR: public ACMGenericCodec {
|
||||
public:
|
||||
explicit ACMAMR(int16_t codec_id);
|
||||
~ACMAMR();
|
||||
virtual ~ACMAMR();
|
||||
|
||||
// for FEC
|
||||
ACMGenericCodec* CreateInstance(void);
|
||||
virtual ACMGenericCodec* CreateInstance(void) OVERRIDE;
|
||||
|
||||
int16_t InternalEncode(uint8_t* bitstream,
|
||||
int16_t* bitstream_len_byte);
|
||||
virtual int16_t InternalEncode(uint8_t* bitstream,
|
||||
int16_t* bitstream_len_byte) OVERRIDE;
|
||||
|
||||
int16_t InternalInitEncoder(WebRtcACMCodecParams *codec_params);
|
||||
virtual int16_t InternalInitEncoder(
|
||||
WebRtcACMCodecParams* codec_params) OVERRIDE;
|
||||
|
||||
int16_t InternalInitDecoder(WebRtcACMCodecParams *codec_params);
|
||||
virtual int16_t InternalInitDecoder(
|
||||
WebRtcACMCodecParams* codec_params) OVERRIDE;
|
||||
|
||||
int16_t SetAMREncoderPackingFormat(
|
||||
const ACMAMRPackingFormat packing_format);
|
||||
@ -47,29 +49,29 @@ class ACMAMR: public ACMGenericCodec {
|
||||
ACMAMRPackingFormat AMRDecoderPackingFormat() const;
|
||||
|
||||
protected:
|
||||
int16_t DecodeSafe(uint8_t* bitstream,
|
||||
virtual int16_t DecodeSafe(uint8_t* bitstream,
|
||||
int16_t bitstream_len_byte,
|
||||
int16_t* audio, int16_t* audio_samples,
|
||||
int8_t* speech_type);
|
||||
int8_t* speech_type) OVERRIDE;
|
||||
|
||||
int32_t CodecDef(WebRtcNetEQ_CodecDef& codec_def,
|
||||
const CodecInst& codec_inst);
|
||||
virtual int32_t CodecDef(WebRtcNetEQ_CodecDef& codec_def,
|
||||
const CodecInst& codec_inst) OVERRIDE;
|
||||
|
||||
void DestructEncoderSafe();
|
||||
virtual void DestructEncoderSafe() OVERRIDE;
|
||||
|
||||
void DestructDecoderSafe();
|
||||
virtual void DestructDecoderSafe() OVERRIDE;
|
||||
|
||||
int16_t InternalCreateEncoder();
|
||||
virtual int16_t InternalCreateEncoder() OVERRIDE;
|
||||
|
||||
int16_t InternalCreateDecoder();
|
||||
virtual int16_t InternalCreateDecoder() OVERRIDE;
|
||||
|
||||
void InternalDestructEncoderInst(void* ptr_inst);
|
||||
virtual void InternalDestructEncoderInst(void* ptr_inst) OVERRIDE;
|
||||
|
||||
int16_t SetBitRateSafe(const int32_t rate);
|
||||
virtual int16_t SetBitRateSafe(const int32_t rate) OVERRIDE;
|
||||
|
||||
int16_t EnableDTX();
|
||||
virtual int16_t EnableDTX() OVERRIDE;
|
||||
|
||||
int16_t DisableDTX();
|
||||
virtual int16_t DisableDTX() OVERRIDE;
|
||||
|
||||
AMR_encinst_t_* encoder_inst_ptr_;
|
||||
AMR_decinst_t_* decoder_inst_ptr_;
|
||||
|
@ -22,52 +22,54 @@ namespace webrtc {
|
||||
class ACMAMRwb: public ACMGenericCodec {
|
||||
public:
|
||||
explicit ACMAMRwb(int16_t codec_id);
|
||||
~ACMAMRwb();
|
||||
virtual ~ACMAMRwb();
|
||||
|
||||
// for FEC
|
||||
ACMGenericCodec* CreateInstance(void);
|
||||
virtual ACMGenericCodec* CreateInstance(void) OVERRIDE;
|
||||
|
||||
int16_t InternalEncode(uint8_t* bitstream,
|
||||
int16_t* bitstream_len_byte);
|
||||
virtual int16_t InternalEncode(uint8_t* bitstream,
|
||||
int16_t* bitstream_len_byte) OVERRIDE;
|
||||
|
||||
int16_t InternalInitEncoder(WebRtcACMCodecParams* codec_params);
|
||||
virtual int16_t InternalInitEncoder(
|
||||
WebRtcACMCodecParams* codec_params) OVERRIDE;
|
||||
|
||||
int16_t InternalInitDecoder(WebRtcACMCodecParams* codec_params);
|
||||
virtual int16_t InternalInitDecoder(
|
||||
WebRtcACMCodecParams* codec_params) OVERRIDE;
|
||||
|
||||
int16_t SetAMRwbEncoderPackingFormat(
|
||||
virtual int16_t SetAMRwbEncoderPackingFormat(
|
||||
const ACMAMRPackingFormat packing_format);
|
||||
|
||||
ACMAMRPackingFormat AMRwbEncoderPackingFormat() const;
|
||||
virtual ACMAMRPackingFormat AMRwbEncoderPackingFormat() const;
|
||||
|
||||
int16_t SetAMRwbDecoderPackingFormat(
|
||||
virtual int16_t SetAMRwbDecoderPackingFormat(
|
||||
const ACMAMRPackingFormat packing_format);
|
||||
|
||||
ACMAMRPackingFormat AMRwbDecoderPackingFormat() const;
|
||||
virtual ACMAMRPackingFormat AMRwbDecoderPackingFormat() const;
|
||||
|
||||
protected:
|
||||
int16_t DecodeSafe(uint8_t* bitstream,
|
||||
virtual int16_t DecodeSafe(uint8_t* bitstream,
|
||||
int16_t bitstream_len_byte,
|
||||
int16_t* audio, int16_t* audio_samples,
|
||||
int8_t* speech_type);
|
||||
int8_t* speech_type) OVERRIDE;
|
||||
|
||||
int32_t CodecDef(WebRtcNetEQ_CodecDef& codec_def,
|
||||
const CodecInst& codec_inst);
|
||||
virtual int32_t CodecDef(WebRtcNetEQ_CodecDef& codec_def,
|
||||
const CodecInst& codec_inst) OVERRIDE;
|
||||
|
||||
void DestructEncoderSafe();
|
||||
virtual void DestructEncoderSafe() OVERRIDE;
|
||||
|
||||
void DestructDecoderSafe();
|
||||
virtual void DestructDecoderSafe() OVERRIDE;
|
||||
|
||||
int16_t InternalCreateEncoder();
|
||||
virtual int16_t InternalCreateEncoder() OVERRIDE;
|
||||
|
||||
int16_t InternalCreateDecoder();
|
||||
virtual int16_t InternalCreateDecoder() OVERRIDE;
|
||||
|
||||
void InternalDestructEncoderInst(void* ptr_inst);
|
||||
virtual void InternalDestructEncoderInst(void* ptr_inst) OVERRIDE;
|
||||
|
||||
int16_t SetBitRateSafe(const int32_t rate);
|
||||
virtual int16_t SetBitRateSafe(const int32_t rate) OVERRIDE;
|
||||
|
||||
int16_t EnableDTX();
|
||||
virtual int16_t EnableDTX() OVERRIDE;
|
||||
|
||||
int16_t DisableDTX();
|
||||
virtual int16_t DisableDTX() OVERRIDE;
|
||||
|
||||
AMRWB_encinst_t_* encoder_inst_ptr_;
|
||||
AMRWB_decinst_t_* decoder_inst_ptr_;
|
||||
|
@ -22,42 +22,46 @@ namespace webrtc {
|
||||
class ACMCELT : public ACMGenericCodec {
|
||||
public:
|
||||
explicit ACMCELT(int16_t codec_id);
|
||||
~ACMCELT();
|
||||
virtual ~ACMCELT();
|
||||
|
||||
ACMGenericCodec* CreateInstance(void);
|
||||
virtual ACMGenericCodec* CreateInstance(void) OVERRIDE;
|
||||
|
||||
int16_t InternalEncode(uint8_t* bitstream, int16_t* bitstream_len_byte);
|
||||
virtual int16_t InternalEncode(uint8_t* bitstream,
|
||||
int16_t* bitstream_len_byte) OVERRIDE;
|
||||
|
||||
int16_t InternalInitEncoder(WebRtcACMCodecParams *codec_params);
|
||||
virtual int16_t InternalInitEncoder(
|
||||
WebRtcACMCodecParams* codec_params) OVERRIDE;
|
||||
|
||||
int16_t InternalInitDecoder(WebRtcACMCodecParams *codec_params);
|
||||
virtual int16_t InternalInitDecoder(
|
||||
WebRtcACMCodecParams* codec_params) OVERRIDE;
|
||||
|
||||
protected:
|
||||
int16_t DecodeSafe(
|
||||
virtual int16_t DecodeSafe(
|
||||
uint8_t* /* bitstream */,
|
||||
int16_t /* bitstream_len_byte */,
|
||||
int16_t* /* audio */,
|
||||
int16_t* /* audio_samples */,
|
||||
int8_t* /* speech_type */);
|
||||
int8_t* /* speech_type */) OVERRIDE;
|
||||
|
||||
int32_t CodecDef(WebRtcNetEQ_CodecDef& codec_def,
|
||||
const CodecInst& codec_inst);
|
||||
virtual int32_t CodecDef(WebRtcNetEQ_CodecDef& codec_def,
|
||||
const CodecInst& codec_inst) OVERRIDE;
|
||||
|
||||
void DestructEncoderSafe();
|
||||
virtual void DestructEncoderSafe() OVERRIDE;
|
||||
|
||||
void DestructDecoderSafe();
|
||||
virtual void DestructDecoderSafe() OVERRIDE;
|
||||
|
||||
int16_t InternalCreateEncoder();
|
||||
virtual int16_t InternalCreateEncoder() OVERRIDE;
|
||||
|
||||
int16_t InternalCreateDecoder();
|
||||
virtual int16_t InternalCreateDecoder() OVERRIDE;
|
||||
|
||||
void InternalDestructEncoderInst(void* ptr_inst);
|
||||
virtual void InternalDestructEncoderInst(void* ptr_inst) OVERRIDE;
|
||||
|
||||
bool IsTrueStereoCodec();
|
||||
virtual bool IsTrueStereoCodec() OVERRIDE;
|
||||
|
||||
int16_t SetBitRateSafe(const int32_t rate);
|
||||
virtual int16_t SetBitRateSafe(const int32_t rate) OVERRIDE;
|
||||
|
||||
void SplitStereoPacket(uint8_t* payload, int32_t* payload_length);
|
||||
virtual void SplitStereoPacket(uint8_t* payload,
|
||||
int32_t* payload_length) OVERRIDE;
|
||||
|
||||
CELT_encinst_t_* enc_inst_ptr_;
|
||||
CELT_decinst_t_* dec_inst_ptr_;
|
||||
|
@ -140,4 +140,7 @@ void ACMCNG::InternalDestructEncoderInst(void* ptr_inst) {
|
||||
return;
|
||||
}
|
||||
|
||||
int16_t ACMCNG::EnableDTX() { return -1; }
|
||||
int16_t ACMCNG::DisableDTX() { return -1; }
|
||||
|
||||
} // namespace webrtc
|
||||
|
@ -22,44 +22,41 @@ namespace webrtc {
|
||||
class ACMCNG: public ACMGenericCodec {
|
||||
public:
|
||||
explicit ACMCNG(int16_t codec_id);
|
||||
~ACMCNG();
|
||||
virtual ~ACMCNG();
|
||||
|
||||
// for FEC
|
||||
ACMGenericCodec* CreateInstance(void);
|
||||
virtual ACMGenericCodec* CreateInstance(void) OVERRIDE;
|
||||
|
||||
int16_t InternalEncode(uint8_t* bitstream,
|
||||
int16_t* bitstream_len_byte);
|
||||
virtual int16_t InternalEncode(uint8_t* bitstream,
|
||||
int16_t* bitstream_len_byte) OVERRIDE;
|
||||
|
||||
int16_t InternalInitEncoder(WebRtcACMCodecParams *codec_params);
|
||||
virtual int16_t InternalInitEncoder(
|
||||
WebRtcACMCodecParams* codec_params) OVERRIDE;
|
||||
|
||||
int16_t InternalInitDecoder(WebRtcACMCodecParams *codec_params);
|
||||
virtual int16_t InternalInitDecoder(
|
||||
WebRtcACMCodecParams* codec_params) OVERRIDE;
|
||||
|
||||
protected:
|
||||
int16_t DecodeSafe(uint8_t* bitstream,
|
||||
virtual int16_t DecodeSafe(uint8_t* bitstream,
|
||||
int16_t bitstream_len_byte,
|
||||
int16_t* audio, int16_t* audio_samples,
|
||||
int8_t* speech_type);
|
||||
int8_t* speech_type) OVERRIDE;
|
||||
|
||||
int32_t CodecDef(WebRtcNetEQ_CodecDef& codec_def,
|
||||
const CodecInst& codec_inst);
|
||||
virtual int32_t CodecDef(WebRtcNetEQ_CodecDef& codec_def,
|
||||
const CodecInst& codec_inst) OVERRIDE;
|
||||
|
||||
void DestructEncoderSafe();
|
||||
virtual void DestructEncoderSafe() OVERRIDE;
|
||||
|
||||
void DestructDecoderSafe();
|
||||
virtual void DestructDecoderSafe() OVERRIDE;
|
||||
|
||||
int16_t InternalCreateEncoder();
|
||||
virtual int16_t InternalCreateEncoder() OVERRIDE;
|
||||
|
||||
int16_t InternalCreateDecoder();
|
||||
virtual int16_t InternalCreateDecoder() OVERRIDE;
|
||||
|
||||
void InternalDestructEncoderInst(void* ptr_inst);
|
||||
virtual void InternalDestructEncoderInst(void* ptr_inst) OVERRIDE;
|
||||
|
||||
int16_t EnableDTX() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
int16_t DisableDTX() {
|
||||
return -1;
|
||||
}
|
||||
virtual int16_t EnableDTX() OVERRIDE;
|
||||
virtual int16_t DisableDTX() OVERRIDE;
|
||||
|
||||
WebRtcCngEncInst* encoder_inst_ptr_;
|
||||
WebRtcCngDecInst* decoder_inst_ptr_;
|
||||
|
@ -18,35 +18,38 @@ namespace webrtc {
|
||||
class ACMDTMFPlayout: public ACMGenericCodec {
|
||||
public:
|
||||
explicit ACMDTMFPlayout(int16_t codec_id);
|
||||
~ACMDTMFPlayout();
|
||||
virtual ~ACMDTMFPlayout();
|
||||
|
||||
// for FEC
|
||||
ACMGenericCodec* CreateInstance(void);
|
||||
virtual ACMGenericCodec* CreateInstance(void) OVERRIDE;
|
||||
|
||||
int16_t InternalEncode(uint8_t* bitstream, int16_t* bitstream_len_byte);
|
||||
virtual int16_t InternalEncode(uint8_t* bitstream,
|
||||
int16_t* bitstream_len_byte) OVERRIDE;
|
||||
|
||||
int16_t InternalInitEncoder(WebRtcACMCodecParams *codec_params);
|
||||
virtual int16_t InternalInitEncoder(
|
||||
WebRtcACMCodecParams* codec_params) OVERRIDE;
|
||||
|
||||
int16_t InternalInitDecoder(WebRtcACMCodecParams *codec_params);
|
||||
virtual int16_t InternalInitDecoder(
|
||||
WebRtcACMCodecParams* codec_params) OVERRIDE;
|
||||
|
||||
protected:
|
||||
int16_t DecodeSafe(uint8_t* bitstream,
|
||||
virtual int16_t DecodeSafe(uint8_t* bitstream,
|
||||
int16_t bitstream_len_byte,
|
||||
int16_t* audio, int16_t* audio_samples,
|
||||
int8_t* speech_type);
|
||||
int8_t* speech_type) OVERRIDE;
|
||||
|
||||
int32_t CodecDef(WebRtcNetEQ_CodecDef& codec_def,
|
||||
const CodecInst& codec_inst);
|
||||
virtual int32_t CodecDef(WebRtcNetEQ_CodecDef& codec_def,
|
||||
const CodecInst& codec_inst) OVERRIDE;
|
||||
|
||||
void DestructEncoderSafe();
|
||||
virtual void DestructEncoderSafe() OVERRIDE;
|
||||
|
||||
void DestructDecoderSafe();
|
||||
virtual void DestructDecoderSafe() OVERRIDE;
|
||||
|
||||
int16_t InternalCreateEncoder();
|
||||
virtual int16_t InternalCreateEncoder() OVERRIDE;
|
||||
|
||||
int16_t InternalCreateDecoder();
|
||||
virtual int16_t InternalCreateDecoder() OVERRIDE;
|
||||
|
||||
void InternalDestructEncoderInst(void* ptr_inst);
|
||||
virtual void InternalDestructEncoderInst(void* ptr_inst) OVERRIDE;
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
@ -25,42 +25,46 @@ struct ACMG722DecStr;
|
||||
class ACMG722: public ACMGenericCodec {
|
||||
public:
|
||||
explicit ACMG722(int16_t codec_id);
|
||||
~ACMG722();
|
||||
virtual ~ACMG722();
|
||||
|
||||
// for FEC
|
||||
ACMGenericCodec* CreateInstance(void);
|
||||
virtual ACMGenericCodec* CreateInstance(void) OVERRIDE;
|
||||
|
||||
int16_t InternalEncode(uint8_t* bitstream, int16_t* bitstream_len_byte);
|
||||
virtual int16_t InternalEncode(uint8_t* bitstream,
|
||||
int16_t* bitstream_len_byte) OVERRIDE;
|
||||
|
||||
int16_t InternalInitEncoder(WebRtcACMCodecParams *codec_params);
|
||||
virtual int16_t InternalInitEncoder(
|
||||
WebRtcACMCodecParams* codec_params) OVERRIDE;
|
||||
|
||||
int16_t InternalInitDecoder(WebRtcACMCodecParams *codec_params);
|
||||
virtual int16_t InternalInitDecoder(
|
||||
WebRtcACMCodecParams* codec_params) OVERRIDE;
|
||||
|
||||
protected:
|
||||
int16_t DecodeSafe(uint8_t* bitstream,
|
||||
virtual int16_t DecodeSafe(uint8_t* bitstream,
|
||||
int16_t bitstream_len_byte,
|
||||
int16_t* audio, int16_t* audio_samples,
|
||||
int8_t* speech_type);
|
||||
int8_t* speech_type) OVERRIDE;
|
||||
|
||||
int32_t CodecDef(WebRtcNetEQ_CodecDef& codec_def,
|
||||
const CodecInst& codec_inst);
|
||||
virtual int32_t CodecDef(WebRtcNetEQ_CodecDef& codec_def,
|
||||
const CodecInst& codec_inst) OVERRIDE;
|
||||
|
||||
int32_t Add10MsDataSafe(const uint32_t timestamp,
|
||||
virtual int32_t Add10MsDataSafe(const uint32_t timestamp,
|
||||
const int16_t* data,
|
||||
const uint16_t length_smpl,
|
||||
const uint8_t audio_channel);
|
||||
const uint8_t audio_channel) OVERRIDE;
|
||||
|
||||
void DestructEncoderSafe();
|
||||
virtual void DestructEncoderSafe() OVERRIDE;
|
||||
|
||||
void DestructDecoderSafe();
|
||||
virtual void DestructDecoderSafe() OVERRIDE;
|
||||
|
||||
int16_t InternalCreateEncoder();
|
||||
virtual int16_t InternalCreateEncoder() OVERRIDE;
|
||||
|
||||
int16_t InternalCreateDecoder();
|
||||
virtual int16_t InternalCreateDecoder() OVERRIDE;
|
||||
|
||||
void InternalDestructEncoderInst(void* ptr_inst);
|
||||
virtual void InternalDestructEncoderInst(void* ptr_inst) OVERRIDE;
|
||||
|
||||
void SplitStereoPacket(uint8_t* payload, int32_t* payload_length);
|
||||
virtual void SplitStereoPacket(uint8_t* payload,
|
||||
int32_t* payload_length) OVERRIDE;
|
||||
|
||||
ACMG722EncStr* ptr_enc_str_;
|
||||
ACMG722DecStr* ptr_dec_str_;
|
||||
|
@ -591,6 +591,10 @@ bool ACMGenericCodec::CanChangeEncodingParam(CodecInst& /*codec_inst*/) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void ACMGenericCodec::CurrentRate(int32_t& /* rate_bps */) {
|
||||
return;
|
||||
}
|
||||
|
||||
int16_t ACMGenericCodec::InitDecoder(WebRtcACMCodecParams* codec_params,
|
||||
bool force_initialization) {
|
||||
WriteLockScoped lockCodc(codec_wrapper_lock_);
|
||||
@ -1159,6 +1163,10 @@ bool ACMGenericCodec::IsAudioBufferFresh() const {
|
||||
return is_audio_buff_fresh_;
|
||||
}
|
||||
|
||||
int16_t ACMGenericCodec::UpdateDecoderSampFreq(int16_t /* codec_id */) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// This function is replaced by codec specific functions for some codecs.
|
||||
int16_t ACMGenericCodec::EncoderSampFreq(uint16_t& samp_freq_hz) {
|
||||
int32_t f;
|
||||
@ -1231,4 +1239,6 @@ int16_t ACMGenericCodec::REDPayloadISAC(const int32_t /* isac_rate */,
|
||||
return -1;
|
||||
}
|
||||
|
||||
bool ACMGenericCodec::IsTrueStereoCodec() { return false; }
|
||||
|
||||
} // namespace webrtc
|
||||
|
@ -594,9 +594,7 @@ class ACMGenericCodec {
|
||||
// 0 if succeeded in updating the decoder.
|
||||
// -1 if failed to update.
|
||||
//
|
||||
virtual int16_t UpdateDecoderSampFreq(int16_t /* codec_id */) {
|
||||
return 0;
|
||||
}
|
||||
virtual int16_t UpdateDecoderSampFreq(int16_t /* codec_id */);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// UpdateEncoderSampFreq()
|
||||
@ -747,9 +745,7 @@ class ACMGenericCodec {
|
||||
// -true if stereo codec
|
||||
// -false if not stereo codec.
|
||||
//
|
||||
virtual bool IsTrueStereoCodec() {
|
||||
return false;
|
||||
}
|
||||
virtual bool IsTrueStereoCodec();
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// HasFrameToEncode()
|
||||
@ -1148,9 +1144,7 @@ class ACMGenericCodec {
|
||||
// Output:
|
||||
// -rate_bps : the current target rate of the codec.
|
||||
//
|
||||
virtual void CurrentRate(int32_t& /* rate_bps */) {
|
||||
return;
|
||||
}
|
||||
virtual void CurrentRate(int32_t& /* rate_bps */);
|
||||
|
||||
virtual void SaveDecoderParamSafe(const WebRtcACMCodecParams* codec_params);
|
||||
|
||||
|
@ -22,39 +22,41 @@ namespace webrtc {
|
||||
class ACMILBC : public ACMGenericCodec {
|
||||
public:
|
||||
explicit ACMILBC(int16_t codec_id);
|
||||
~ACMILBC();
|
||||
virtual ~ACMILBC();
|
||||
|
||||
// for FEC
|
||||
ACMGenericCodec* CreateInstance(void);
|
||||
virtual ACMGenericCodec* CreateInstance(void) OVERRIDE;
|
||||
|
||||
int16_t InternalEncode(uint8_t* bitstream,
|
||||
int16_t* bitstream_len_byte);
|
||||
virtual int16_t InternalEncode(uint8_t* bitstream,
|
||||
int16_t* bitstream_len_byte) OVERRIDE;
|
||||
|
||||
int16_t InternalInitEncoder(WebRtcACMCodecParams *codec_params);
|
||||
virtual int16_t InternalInitEncoder(
|
||||
WebRtcACMCodecParams* codec_params) OVERRIDE;
|
||||
|
||||
int16_t InternalInitDecoder(WebRtcACMCodecParams *codec_params);
|
||||
virtual int16_t InternalInitDecoder(
|
||||
WebRtcACMCodecParams* codec_params) OVERRIDE;
|
||||
|
||||
protected:
|
||||
int16_t DecodeSafe(uint8_t* bitstream,
|
||||
virtual int16_t DecodeSafe(uint8_t* bitstream,
|
||||
int16_t bitstream_len_byte,
|
||||
int16_t* audio,
|
||||
int16_t* audio_samples,
|
||||
int8_t* speech_type);
|
||||
int8_t* speech_type) OVERRIDE;
|
||||
|
||||
int32_t CodecDef(WebRtcNetEQ_CodecDef& codec_def,
|
||||
const CodecInst& codec_inst);
|
||||
virtual int32_t CodecDef(WebRtcNetEQ_CodecDef& codec_def,
|
||||
const CodecInst& codec_inst) OVERRIDE;
|
||||
|
||||
int16_t SetBitRateSafe(const int32_t rate);
|
||||
virtual int16_t SetBitRateSafe(const int32_t rate) OVERRIDE;
|
||||
|
||||
void DestructEncoderSafe();
|
||||
virtual void DestructEncoderSafe() OVERRIDE;
|
||||
|
||||
void DestructDecoderSafe();
|
||||
virtual void DestructDecoderSafe() OVERRIDE;
|
||||
|
||||
int16_t InternalCreateEncoder();
|
||||
virtual int16_t InternalCreateEncoder() OVERRIDE;
|
||||
|
||||
int16_t InternalCreateDecoder();
|
||||
virtual int16_t InternalCreateDecoder() OVERRIDE;
|
||||
|
||||
void InternalDestructEncoderInst(void* ptr_inst);
|
||||
virtual void InternalDestructEncoderInst(void* ptr_inst) OVERRIDE;
|
||||
|
||||
iLBC_encinst_t_* encoder_inst_ptr_;
|
||||
iLBC_decinst_t_* decoder_inst_ptr_;
|
||||
|
@ -25,17 +25,19 @@ enum IsacCodingMode {
|
||||
class ACMISAC : public ACMGenericCodec {
|
||||
public:
|
||||
explicit ACMISAC(int16_t codec_id);
|
||||
~ACMISAC();
|
||||
virtual ~ACMISAC();
|
||||
|
||||
// for FEC
|
||||
ACMGenericCodec* CreateInstance(void);
|
||||
virtual ACMGenericCodec* CreateInstance(void) OVERRIDE;
|
||||
|
||||
int16_t InternalEncode(uint8_t* bitstream,
|
||||
int16_t* bitstream_len_byte);
|
||||
virtual int16_t InternalEncode(uint8_t* bitstream,
|
||||
int16_t* bitstream_len_byte) OVERRIDE;
|
||||
|
||||
int16_t InternalInitEncoder(WebRtcACMCodecParams *codec_params);
|
||||
virtual int16_t InternalInitEncoder(
|
||||
WebRtcACMCodecParams* codec_params) OVERRIDE;
|
||||
|
||||
int16_t InternalInitDecoder(WebRtcACMCodecParams *codec_params);
|
||||
virtual int16_t InternalInitDecoder(
|
||||
WebRtcACMCodecParams* codec_params) OVERRIDE;
|
||||
|
||||
int16_t DeliverCachedIsacData(uint8_t* bitstream,
|
||||
int16_t* bitstream_len_byte,
|
||||
@ -51,55 +53,56 @@ class ACMISAC : public ACMGenericCodec {
|
||||
return -1;
|
||||
}
|
||||
|
||||
int16_t UpdateDecoderSampFreq(int16_t codec_id);
|
||||
virtual int16_t UpdateDecoderSampFreq(int16_t codec_id) OVERRIDE;
|
||||
|
||||
int16_t UpdateEncoderSampFreq(uint16_t samp_freq_hz);
|
||||
virtual int16_t UpdateEncoderSampFreq(uint16_t samp_freq_hz) OVERRIDE;
|
||||
|
||||
int16_t EncoderSampFreq(uint16_t& samp_freq_hz);
|
||||
virtual int16_t EncoderSampFreq(uint16_t& samp_freq_hz) OVERRIDE;
|
||||
|
||||
int32_t ConfigISACBandwidthEstimator(
|
||||
virtual int32_t ConfigISACBandwidthEstimator(
|
||||
const uint8_t init_frame_size_msec,
|
||||
const uint16_t init_rate_bit_per_sec,
|
||||
const bool enforce_frame_size);
|
||||
const bool enforce_frame_size) OVERRIDE;
|
||||
|
||||
int32_t SetISACMaxPayloadSize(
|
||||
const uint16_t max_payload_len_bytes);
|
||||
virtual int32_t SetISACMaxPayloadSize(
|
||||
const uint16_t max_payload_len_bytes) OVERRIDE;
|
||||
|
||||
int32_t SetISACMaxRate(const uint32_t max_rate_bit_per_sec);
|
||||
virtual int32_t SetISACMaxRate(const uint32_t max_rate_bit_per_sec) OVERRIDE;
|
||||
|
||||
int16_t REDPayloadISAC(const int32_t isac_rate,
|
||||
virtual int16_t REDPayloadISAC(const int32_t isac_rate,
|
||||
const int16_t isac_bw_estimate,
|
||||
uint8_t* payload,
|
||||
int16_t* payload_len_bytes);
|
||||
int16_t* payload_len_bytes) OVERRIDE;
|
||||
|
||||
protected:
|
||||
int16_t DecodeSafe(uint8_t* bitstream,
|
||||
virtual int16_t DecodeSafe(uint8_t* bitstream,
|
||||
int16_t bitstream_len_byte,
|
||||
int16_t* audio,
|
||||
int16_t* audio_samples,
|
||||
int8_t* speech_type);
|
||||
int8_t* speech_type) OVERRIDE;
|
||||
|
||||
int32_t CodecDef(WebRtcNetEQ_CodecDef& codec_def,
|
||||
const CodecInst& codec_inst);
|
||||
virtual int32_t CodecDef(WebRtcNetEQ_CodecDef& codec_def,
|
||||
const CodecInst& codec_inst) OVERRIDE;
|
||||
|
||||
void DestructEncoderSafe();
|
||||
virtual void DestructEncoderSafe() OVERRIDE;
|
||||
|
||||
void DestructDecoderSafe();
|
||||
virtual void DestructDecoderSafe() OVERRIDE;
|
||||
|
||||
int16_t SetBitRateSafe(const int32_t bit_rate);
|
||||
virtual int16_t SetBitRateSafe(const int32_t bit_rate) OVERRIDE;
|
||||
|
||||
int32_t GetEstimatedBandwidthSafe();
|
||||
virtual int32_t GetEstimatedBandwidthSafe() OVERRIDE;
|
||||
|
||||
int32_t SetEstimatedBandwidthSafe(int32_t estimated_bandwidth);
|
||||
virtual int32_t SetEstimatedBandwidthSafe(
|
||||
int32_t estimated_bandwidth) OVERRIDE;
|
||||
|
||||
int32_t GetRedPayloadSafe(uint8_t* red_payload,
|
||||
int16_t* payload_bytes);
|
||||
virtual int32_t GetRedPayloadSafe(uint8_t* red_payload,
|
||||
int16_t* payload_bytes) OVERRIDE;
|
||||
|
||||
int16_t InternalCreateEncoder();
|
||||
virtual int16_t InternalCreateEncoder() OVERRIDE;
|
||||
|
||||
int16_t InternalCreateDecoder();
|
||||
virtual int16_t InternalCreateDecoder() OVERRIDE;
|
||||
|
||||
void InternalDestructEncoderInst(void* ptr_inst);
|
||||
virtual void InternalDestructEncoderInst(void* ptr_inst) OVERRIDE;
|
||||
|
||||
int16_t Transcode(uint8_t* bitstream,
|
||||
int16_t* bitstream_len_byte,
|
||||
@ -107,14 +110,15 @@ class ACMISAC : public ACMGenericCodec {
|
||||
int32_t rate,
|
||||
bool is_red);
|
||||
|
||||
void CurrentRate(int32_t& rate_bit_per_sec);
|
||||
virtual void CurrentRate(int32_t& rate_bit_per_sec) OVERRIDE;
|
||||
|
||||
void UpdateFrameLen();
|
||||
|
||||
bool DecoderParamsSafe(WebRtcACMCodecParams *dec_params,
|
||||
const uint8_t payload_type);
|
||||
virtual bool DecoderParamsSafe(WebRtcACMCodecParams *dec_params,
|
||||
const uint8_t payload_type) OVERRIDE;
|
||||
|
||||
void SaveDecoderParamSafe(const WebRtcACMCodecParams* codec_params);
|
||||
virtual void SaveDecoderParamSafe(
|
||||
const WebRtcACMCodecParams* codec_params) OVERRIDE;
|
||||
|
||||
ACMISACInst* codec_inst_ptr_;
|
||||
bool is_enc_initialized_;
|
||||
|
@ -22,41 +22,45 @@ namespace webrtc {
|
||||
class ACMOpus : public ACMGenericCodec {
|
||||
public:
|
||||
explicit ACMOpus(int16_t codec_id);
|
||||
~ACMOpus();
|
||||
virtual ~ACMOpus();
|
||||
|
||||
ACMGenericCodec* CreateInstance(void);
|
||||
virtual ACMGenericCodec* CreateInstance(void) OVERRIDE;
|
||||
|
||||
int16_t InternalEncode(uint8_t* bitstream, int16_t* bitstream_len_byte);
|
||||
virtual int16_t InternalEncode(uint8_t* bitstream,
|
||||
int16_t* bitstream_len_byte) OVERRIDE;
|
||||
|
||||
int16_t InternalInitEncoder(WebRtcACMCodecParams *codec_params);
|
||||
virtual int16_t InternalInitEncoder(
|
||||
WebRtcACMCodecParams* codec_params) OVERRIDE;
|
||||
|
||||
int16_t InternalInitDecoder(WebRtcACMCodecParams *codec_params);
|
||||
virtual int16_t InternalInitDecoder(
|
||||
WebRtcACMCodecParams* codec_params) OVERRIDE;
|
||||
|
||||
protected:
|
||||
int16_t DecodeSafe(uint8_t* bitstream,
|
||||
virtual int16_t DecodeSafe(uint8_t* bitstream,
|
||||
int16_t bitstream_len_byte,
|
||||
int16_t* audio,
|
||||
int16_t* audio_samples,
|
||||
int8_t* speech_type);
|
||||
int8_t* speech_type) OVERRIDE;
|
||||
|
||||
int32_t CodecDef(WebRtcNetEQ_CodecDef& codec_def,
|
||||
const CodecInst& codec_inst);
|
||||
virtual int32_t CodecDef(WebRtcNetEQ_CodecDef& codec_def,
|
||||
const CodecInst& codec_inst) OVERRIDE;
|
||||
|
||||
void DestructEncoderSafe();
|
||||
virtual void DestructEncoderSafe() OVERRIDE;
|
||||
|
||||
void DestructDecoderSafe();
|
||||
virtual void DestructDecoderSafe() OVERRIDE;
|
||||
|
||||
int16_t InternalCreateEncoder();
|
||||
virtual int16_t InternalCreateEncoder() OVERRIDE;
|
||||
|
||||
int16_t InternalCreateDecoder();
|
||||
virtual int16_t InternalCreateDecoder() OVERRIDE;
|
||||
|
||||
void InternalDestructEncoderInst(void* ptr_inst);
|
||||
virtual void InternalDestructEncoderInst(void* ptr_inst) OVERRIDE;
|
||||
|
||||
int16_t SetBitRateSafe(const int32_t rate);
|
||||
virtual int16_t SetBitRateSafe(const int32_t rate) OVERRIDE;
|
||||
|
||||
bool IsTrueStereoCodec();
|
||||
virtual bool IsTrueStereoCodec() OVERRIDE;
|
||||
|
||||
void SplitStereoPacket(uint8_t* payload, int32_t* payload_length);
|
||||
virtual void SplitStereoPacket(uint8_t* payload,
|
||||
int32_t* payload_length) OVERRIDE;
|
||||
|
||||
WebRtcOpusEncInst* encoder_inst_ptr_;
|
||||
WebRtcOpusDecInst* decoder_inst_ptr_;
|
||||
|
@ -18,39 +18,42 @@ namespace webrtc {
|
||||
class ACMPCM16B : public ACMGenericCodec {
|
||||
public:
|
||||
explicit ACMPCM16B(int16_t codec_id);
|
||||
~ACMPCM16B();
|
||||
virtual ~ACMPCM16B();
|
||||
|
||||
// for FEC
|
||||
ACMGenericCodec* CreateInstance(void);
|
||||
virtual ACMGenericCodec* CreateInstance(void) OVERRIDE;
|
||||
|
||||
int16_t InternalEncode(uint8_t* bitstream,
|
||||
int16_t* bitstream_len_byte);
|
||||
virtual int16_t InternalEncode(uint8_t* bitstream,
|
||||
int16_t* bitstream_len_byte) OVERRIDE;
|
||||
|
||||
int16_t InternalInitEncoder(WebRtcACMCodecParams *codec_params);
|
||||
virtual int16_t InternalInitEncoder(
|
||||
WebRtcACMCodecParams* codec_params) OVERRIDE;
|
||||
|
||||
int16_t InternalInitDecoder(WebRtcACMCodecParams *codec_params);
|
||||
virtual int16_t InternalInitDecoder(
|
||||
WebRtcACMCodecParams* codec_params) OVERRIDE;
|
||||
|
||||
protected:
|
||||
int16_t DecodeSafe(uint8_t* bitstream,
|
||||
virtual int16_t DecodeSafe(uint8_t* bitstream,
|
||||
int16_t bitstream_len_byte,
|
||||
int16_t* audio,
|
||||
int16_t* audio_samples,
|
||||
int8_t* speech_type);
|
||||
int8_t* speech_type) OVERRIDE;
|
||||
|
||||
int32_t CodecDef(WebRtcNetEQ_CodecDef& codec_def,
|
||||
const CodecInst& codec_inst);
|
||||
virtual int32_t CodecDef(WebRtcNetEQ_CodecDef& codec_def,
|
||||
const CodecInst& codec_inst) OVERRIDE;
|
||||
|
||||
void DestructEncoderSafe();
|
||||
virtual void DestructEncoderSafe() OVERRIDE;
|
||||
|
||||
void DestructDecoderSafe();
|
||||
virtual void DestructDecoderSafe() OVERRIDE;
|
||||
|
||||
int16_t InternalCreateEncoder();
|
||||
virtual int16_t InternalCreateEncoder() OVERRIDE;
|
||||
|
||||
int16_t InternalCreateDecoder();
|
||||
virtual int16_t InternalCreateDecoder() OVERRIDE;
|
||||
|
||||
void InternalDestructEncoderInst(void* ptr_inst);
|
||||
virtual void InternalDestructEncoderInst(void* ptr_inst) OVERRIDE;
|
||||
|
||||
void SplitStereoPacket(uint8_t* payload, int32_t* payload_length);
|
||||
virtual void SplitStereoPacket(uint8_t* payload,
|
||||
int32_t* payload_length) OVERRIDE;
|
||||
|
||||
int32_t sampling_freq_hz_;
|
||||
};
|
||||
|
@ -18,39 +18,42 @@ namespace webrtc {
|
||||
class ACMPCMA : public ACMGenericCodec {
|
||||
public:
|
||||
explicit ACMPCMA(int16_t codec_id);
|
||||
~ACMPCMA();
|
||||
virtual ~ACMPCMA();
|
||||
|
||||
// for FEC
|
||||
ACMGenericCodec* CreateInstance(void);
|
||||
virtual ACMGenericCodec* CreateInstance(void) OVERRIDE;
|
||||
|
||||
int16_t InternalEncode(uint8_t* bitstream,
|
||||
int16_t* bitstream_len_byte);
|
||||
virtual int16_t InternalEncode(uint8_t* bitstream,
|
||||
int16_t* bitstream_len_byte) OVERRIDE;
|
||||
|
||||
int16_t InternalInitEncoder(WebRtcACMCodecParams *codec_params);
|
||||
virtual int16_t InternalInitEncoder(
|
||||
WebRtcACMCodecParams* codec_params) OVERRIDE;
|
||||
|
||||
int16_t InternalInitDecoder(WebRtcACMCodecParams *codec_params);
|
||||
virtual int16_t InternalInitDecoder(
|
||||
WebRtcACMCodecParams* codec_params) OVERRIDE;
|
||||
|
||||
protected:
|
||||
int16_t DecodeSafe(uint8_t* bitstream,
|
||||
int16_t bitstream_len_byte,
|
||||
int16_t* audio,
|
||||
int16_t* audio_samples,
|
||||
int8_t* speech_type);
|
||||
virtual int16_t DecodeSafe(uint8_t* bitstream,
|
||||
int16_t bitstream_len_byte,
|
||||
int16_t* audio,
|
||||
int16_t* audio_samples,
|
||||
int8_t* speech_type) OVERRIDE;
|
||||
|
||||
int32_t CodecDef(WebRtcNetEQ_CodecDef& codec_def,
|
||||
const CodecInst& codec_inst);
|
||||
virtual int32_t CodecDef(WebRtcNetEQ_CodecDef& codec_def,
|
||||
const CodecInst& codec_inst) OVERRIDE;
|
||||
|
||||
void DestructEncoderSafe();
|
||||
virtual void DestructEncoderSafe() OVERRIDE;
|
||||
|
||||
void DestructDecoderSafe();
|
||||
virtual void DestructDecoderSafe() OVERRIDE;
|
||||
|
||||
int16_t InternalCreateEncoder();
|
||||
virtual int16_t InternalCreateEncoder() OVERRIDE;
|
||||
|
||||
int16_t InternalCreateDecoder();
|
||||
virtual int16_t InternalCreateDecoder() OVERRIDE;
|
||||
|
||||
void InternalDestructEncoderInst(void* ptr_inst);
|
||||
virtual void InternalDestructEncoderInst(void* ptr_inst) OVERRIDE;
|
||||
|
||||
void SplitStereoPacket(uint8_t* payload, int32_t* payload_length);
|
||||
virtual void SplitStereoPacket(uint8_t* payload,
|
||||
int32_t* payload_length) OVERRIDE;
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
@ -18,39 +18,42 @@ namespace webrtc {
|
||||
class ACMPCMU : public ACMGenericCodec {
|
||||
public:
|
||||
explicit ACMPCMU(int16_t codec_id);
|
||||
~ACMPCMU();
|
||||
virtual ~ACMPCMU();
|
||||
|
||||
// for FEC
|
||||
ACMGenericCodec* CreateInstance(void);
|
||||
virtual ACMGenericCodec* CreateInstance(void) OVERRIDE;
|
||||
|
||||
int16_t InternalEncode(uint8_t* bitstream,
|
||||
int16_t* bitstream_len_byte);
|
||||
virtual int16_t InternalEncode(uint8_t* bitstream,
|
||||
int16_t* bitstream_len_byte) OVERRIDE;
|
||||
|
||||
int16_t InternalInitEncoder(WebRtcACMCodecParams *codec_params);
|
||||
virtual int16_t InternalInitEncoder(
|
||||
WebRtcACMCodecParams* codec_params) OVERRIDE;
|
||||
|
||||
int16_t InternalInitDecoder(WebRtcACMCodecParams *codec_params);
|
||||
virtual int16_t InternalInitDecoder(
|
||||
WebRtcACMCodecParams* codec_params) OVERRIDE;
|
||||
|
||||
protected:
|
||||
int16_t DecodeSafe(uint8_t* bitstream,
|
||||
int16_t bitstream_len_byte,
|
||||
int16_t* audio,
|
||||
int16_t* audio_samples,
|
||||
int8_t* speech_type);
|
||||
virtual int16_t DecodeSafe(uint8_t* bitstream,
|
||||
int16_t bitstream_len_byte,
|
||||
int16_t* audio,
|
||||
int16_t* audio_samples,
|
||||
int8_t* speech_type) OVERRIDE;
|
||||
|
||||
int32_t CodecDef(WebRtcNetEQ_CodecDef& codec_def,
|
||||
const CodecInst& codec_inst);
|
||||
virtual int32_t CodecDef(WebRtcNetEQ_CodecDef& codec_def,
|
||||
const CodecInst& codec_inst) OVERRIDE;
|
||||
|
||||
void DestructEncoderSafe();
|
||||
virtual void DestructEncoderSafe() OVERRIDE;
|
||||
|
||||
void DestructDecoderSafe();
|
||||
virtual void DestructDecoderSafe() OVERRIDE;
|
||||
|
||||
int16_t InternalCreateEncoder();
|
||||
virtual int16_t InternalCreateEncoder() OVERRIDE;
|
||||
|
||||
int16_t InternalCreateDecoder();
|
||||
virtual int16_t InternalCreateDecoder() OVERRIDE;
|
||||
|
||||
void InternalDestructEncoderInst(void* ptr_inst);
|
||||
virtual void InternalDestructEncoderInst(void* ptr_inst) OVERRIDE;
|
||||
|
||||
void SplitStereoPacket(uint8_t* payload, int32_t* payload_length);
|
||||
virtual void SplitStereoPacket(uint8_t* payload,
|
||||
int32_t* payload_length) OVERRIDE;
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
@ -18,37 +18,39 @@ namespace webrtc {
|
||||
class ACMRED : public ACMGenericCodec {
|
||||
public:
|
||||
explicit ACMRED(int16_t codec_id);
|
||||
~ACMRED();
|
||||
virtual ~ACMRED();
|
||||
|
||||
// for FEC
|
||||
ACMGenericCodec* CreateInstance(void);
|
||||
virtual ACMGenericCodec* CreateInstance(void) OVERRIDE;
|
||||
|
||||
int16_t InternalEncode(uint8_t* bitstream,
|
||||
int16_t* bitstream_len_byte);
|
||||
virtual int16_t InternalEncode(uint8_t* bitstream,
|
||||
int16_t* bitstream_len_byte) OVERRIDE;
|
||||
|
||||
int16_t InternalInitEncoder(WebRtcACMCodecParams *codec_params);
|
||||
virtual int16_t InternalInitEncoder(
|
||||
WebRtcACMCodecParams* codec_params) OVERRIDE;
|
||||
|
||||
int16_t InternalInitDecoder(WebRtcACMCodecParams *codec_params);
|
||||
virtual int16_t InternalInitDecoder(
|
||||
WebRtcACMCodecParams* codec_params) OVERRIDE;
|
||||
|
||||
protected:
|
||||
int16_t DecodeSafe(uint8_t* bitstream,
|
||||
virtual int16_t DecodeSafe(uint8_t* bitstream,
|
||||
int16_t bitstream_len_byte,
|
||||
int16_t* audio,
|
||||
int16_t* audio_samples,
|
||||
int8_t* speech_type);
|
||||
int8_t* speech_type) OVERRIDE;
|
||||
|
||||
int32_t CodecDef(WebRtcNetEQ_CodecDef& codec_def,
|
||||
const CodecInst& codec_inst);
|
||||
virtual int32_t CodecDef(WebRtcNetEQ_CodecDef& codec_def,
|
||||
const CodecInst& codec_inst) OVERRIDE;
|
||||
|
||||
void DestructEncoderSafe();
|
||||
virtual void DestructEncoderSafe() OVERRIDE;
|
||||
|
||||
void DestructDecoderSafe();
|
||||
virtual void DestructDecoderSafe() OVERRIDE;
|
||||
|
||||
int16_t InternalCreateEncoder();
|
||||
virtual int16_t InternalCreateEncoder() OVERRIDE;
|
||||
|
||||
int16_t InternalCreateDecoder();
|
||||
virtual int16_t InternalCreateDecoder() OVERRIDE;
|
||||
|
||||
void InternalDestructEncoderInst(void* ptr_inst);
|
||||
virtual void InternalDestructEncoderInst(void* ptr_inst) OVERRIDE;
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
@ -51,7 +51,7 @@ class decoder_iSAC : public NETEQTEST_Decoder
|
||||
public:
|
||||
decoder_iSAC(uint8_t pt = 0);
|
||||
virtual ~decoder_iSAC();
|
||||
int loadToNetEQ(NETEQTEST_NetEQClass & neteq);
|
||||
virtual int loadToNetEQ(NETEQTEST_NetEQClass & neteq) OVERRIDE;
|
||||
};
|
||||
|
||||
|
||||
@ -60,7 +60,7 @@ class decoder_iSACSWB : public NETEQTEST_Decoder
|
||||
public:
|
||||
decoder_iSACSWB(uint8_t pt = 0);
|
||||
virtual ~decoder_iSACSWB();
|
||||
int loadToNetEQ(NETEQTEST_NetEQClass & neteq);
|
||||
virtual int loadToNetEQ(NETEQTEST_NetEQClass & neteq) OVERRIDE;
|
||||
};
|
||||
|
||||
|
||||
@ -68,7 +68,7 @@ class decoder_iSACFB : public NETEQTEST_Decoder {
|
||||
public:
|
||||
decoder_iSACFB(uint8_t pt = 0);
|
||||
virtual ~decoder_iSACFB();
|
||||
int loadToNetEQ(NETEQTEST_NetEQClass & neteq);
|
||||
virtual int loadToNetEQ(NETEQTEST_NetEQClass & neteq) OVERRIDE;
|
||||
};
|
||||
|
||||
|
||||
@ -77,7 +77,7 @@ class decoder_PCMU : public NETEQTEST_Decoder
|
||||
public:
|
||||
decoder_PCMU(uint8_t pt = 0);
|
||||
virtual ~decoder_PCMU() {};
|
||||
int loadToNetEQ(NETEQTEST_NetEQClass & neteq);
|
||||
virtual int loadToNetEQ(NETEQTEST_NetEQClass & neteq) OVERRIDE;
|
||||
};
|
||||
|
||||
|
||||
@ -86,7 +86,7 @@ class decoder_PCMA : public NETEQTEST_Decoder
|
||||
public:
|
||||
decoder_PCMA(uint8_t pt = 0);
|
||||
virtual ~decoder_PCMA() {};
|
||||
int loadToNetEQ(NETEQTEST_NetEQClass & neteq);
|
||||
virtual int loadToNetEQ(NETEQTEST_NetEQClass & neteq) OVERRIDE;
|
||||
};
|
||||
|
||||
class decoder_PCM16B_NB : public NETEQTEST_Decoder
|
||||
@ -94,37 +94,37 @@ class decoder_PCM16B_NB : public NETEQTEST_Decoder
|
||||
public:
|
||||
decoder_PCM16B_NB(uint8_t pt = 0) : NETEQTEST_Decoder(kDecoderPCM16B, 8000, "PCM16 nb", pt) {};
|
||||
virtual ~decoder_PCM16B_NB() {};
|
||||
virtual int loadToNetEQ(NETEQTEST_NetEQClass & neteq);
|
||||
virtual int loadToNetEQ(NETEQTEST_NetEQClass & neteq) OVERRIDE;
|
||||
};
|
||||
class decoder_PCM16B_WB : public NETEQTEST_Decoder
|
||||
{
|
||||
public:
|
||||
decoder_PCM16B_WB(uint8_t pt = 0) : NETEQTEST_Decoder(kDecoderPCM16Bwb, 16000, "PCM16 wb", pt) {};
|
||||
virtual ~decoder_PCM16B_WB() {};
|
||||
virtual int loadToNetEQ(NETEQTEST_NetEQClass & neteq);
|
||||
virtual int loadToNetEQ(NETEQTEST_NetEQClass & neteq) OVERRIDE;
|
||||
};
|
||||
class decoder_PCM16B_SWB32 : public NETEQTEST_Decoder
|
||||
{
|
||||
public:
|
||||
decoder_PCM16B_SWB32(uint8_t pt = 0) : NETEQTEST_Decoder(kDecoderPCM16Bswb32kHz, 32000, "PCM16 swb32", pt) {};
|
||||
virtual ~decoder_PCM16B_SWB32() {};
|
||||
virtual int loadToNetEQ(NETEQTEST_NetEQClass & neteq);
|
||||
virtual int loadToNetEQ(NETEQTEST_NetEQClass & neteq) OVERRIDE;
|
||||
};
|
||||
|
||||
class decoder_PCM16B_SWB48 : public NETEQTEST_Decoder
|
||||
{
|
||||
public:
|
||||
decoder_PCM16B_SWB48(uint8_t pt = 0) : NETEQTEST_Decoder(kDecoderPCM16Bswb48kHz, 48000, "PCM16 swb48", pt) {};
|
||||
virtual ~decoder_PCM16B_SWB48() {};
|
||||
virtual int loadToNetEQ(NETEQTEST_NetEQClass & neteq);
|
||||
virtual int loadToNetEQ(NETEQTEST_NetEQClass & neteq) OVERRIDE;
|
||||
};
|
||||
|
||||
|
||||
class decoder_ILBC : public NETEQTEST_Decoder
|
||||
{
|
||||
public:
|
||||
decoder_ILBC(uint8_t pt = 0);
|
||||
virtual ~decoder_ILBC();
|
||||
int loadToNetEQ(NETEQTEST_NetEQClass & neteq);
|
||||
virtual int loadToNetEQ(NETEQTEST_NetEQClass & neteq) OVERRIDE;
|
||||
};
|
||||
|
||||
|
||||
@ -133,7 +133,7 @@ class decoder_G729 : public NETEQTEST_Decoder
|
||||
public:
|
||||
decoder_G729(uint8_t pt = 0);
|
||||
virtual ~decoder_G729();
|
||||
int loadToNetEQ(NETEQTEST_NetEQClass & neteq);
|
||||
virtual int loadToNetEQ(NETEQTEST_NetEQClass & neteq) OVERRIDE;
|
||||
};
|
||||
|
||||
class decoder_G729_1 : public NETEQTEST_Decoder
|
||||
@ -141,7 +141,7 @@ class decoder_G729_1 : public NETEQTEST_Decoder
|
||||
public:
|
||||
decoder_G729_1(uint8_t pt = 0);
|
||||
virtual ~decoder_G729_1();
|
||||
int loadToNetEQ(NETEQTEST_NetEQClass & neteq);
|
||||
virtual int loadToNetEQ(NETEQTEST_NetEQClass & neteq) OVERRIDE;
|
||||
};
|
||||
|
||||
|
||||
@ -150,7 +150,7 @@ class decoder_G722 : public NETEQTEST_Decoder
|
||||
public:
|
||||
decoder_G722(uint8_t pt = 0);
|
||||
virtual ~decoder_G722();
|
||||
int loadToNetEQ(NETEQTEST_NetEQClass & neteq);
|
||||
virtual int loadToNetEQ(NETEQTEST_NetEQClass & neteq) OVERRIDE;
|
||||
};
|
||||
|
||||
|
||||
@ -159,7 +159,7 @@ class decoder_G722_1_16 : public NETEQTEST_Decoder
|
||||
public:
|
||||
decoder_G722_1_16(uint8_t pt = 0);
|
||||
virtual ~decoder_G722_1_16();
|
||||
int loadToNetEQ(NETEQTEST_NetEQClass & neteq);
|
||||
virtual int loadToNetEQ(NETEQTEST_NetEQClass & neteq) OVERRIDE;
|
||||
};
|
||||
|
||||
class decoder_G722_1_24 : public NETEQTEST_Decoder
|
||||
@ -167,7 +167,7 @@ class decoder_G722_1_24 : public NETEQTEST_Decoder
|
||||
public:
|
||||
decoder_G722_1_24(uint8_t pt = 0);
|
||||
virtual ~decoder_G722_1_24();
|
||||
int loadToNetEQ(NETEQTEST_NetEQClass & neteq);
|
||||
virtual int loadToNetEQ(NETEQTEST_NetEQClass & neteq) OVERRIDE;
|
||||
};
|
||||
|
||||
class decoder_G722_1_32 : public NETEQTEST_Decoder
|
||||
@ -175,7 +175,7 @@ class decoder_G722_1_32 : public NETEQTEST_Decoder
|
||||
public:
|
||||
decoder_G722_1_32(uint8_t pt = 0);
|
||||
virtual ~decoder_G722_1_32();
|
||||
int loadToNetEQ(NETEQTEST_NetEQClass & neteq);
|
||||
virtual int loadToNetEQ(NETEQTEST_NetEQClass & neteq) OVERRIDE;
|
||||
};
|
||||
|
||||
|
||||
@ -184,7 +184,7 @@ class decoder_G722_1C_24 : public NETEQTEST_Decoder
|
||||
public:
|
||||
decoder_G722_1C_24(uint8_t pt = 0);
|
||||
virtual ~decoder_G722_1C_24();
|
||||
int loadToNetEQ(NETEQTEST_NetEQClass & neteq);
|
||||
virtual int loadToNetEQ(NETEQTEST_NetEQClass & neteq) OVERRIDE;
|
||||
};
|
||||
|
||||
class decoder_G722_1C_32 : public NETEQTEST_Decoder
|
||||
@ -192,7 +192,7 @@ class decoder_G722_1C_32 : public NETEQTEST_Decoder
|
||||
public:
|
||||
decoder_G722_1C_32(uint8_t pt = 0);
|
||||
virtual ~decoder_G722_1C_32();
|
||||
int loadToNetEQ(NETEQTEST_NetEQClass & neteq);
|
||||
virtual int loadToNetEQ(NETEQTEST_NetEQClass & neteq) OVERRIDE;
|
||||
};
|
||||
|
||||
class decoder_G722_1C_48 : public NETEQTEST_Decoder
|
||||
@ -200,7 +200,7 @@ class decoder_G722_1C_48 : public NETEQTEST_Decoder
|
||||
public:
|
||||
decoder_G722_1C_48(uint8_t pt = 0);
|
||||
virtual ~decoder_G722_1C_48();
|
||||
int loadToNetEQ(NETEQTEST_NetEQClass & neteq);
|
||||
virtual int loadToNetEQ(NETEQTEST_NetEQClass & neteq) OVERRIDE;
|
||||
};
|
||||
|
||||
|
||||
@ -209,7 +209,7 @@ class decoder_AMR : public NETEQTEST_Decoder
|
||||
public:
|
||||
decoder_AMR(uint8_t pt = 0);
|
||||
virtual ~decoder_AMR();
|
||||
int loadToNetEQ(NETEQTEST_NetEQClass & neteq);
|
||||
virtual int loadToNetEQ(NETEQTEST_NetEQClass & neteq) OVERRIDE;
|
||||
};
|
||||
|
||||
class decoder_AMRWB : public NETEQTEST_Decoder
|
||||
@ -217,7 +217,7 @@ class decoder_AMRWB : public NETEQTEST_Decoder
|
||||
public:
|
||||
decoder_AMRWB(uint8_t pt = 0);
|
||||
virtual ~decoder_AMRWB();
|
||||
int loadToNetEQ(NETEQTEST_NetEQClass & neteq);
|
||||
virtual int loadToNetEQ(NETEQTEST_NetEQClass & neteq) OVERRIDE;
|
||||
};
|
||||
|
||||
class decoder_GSMFR : public NETEQTEST_Decoder
|
||||
@ -225,7 +225,7 @@ class decoder_GSMFR : public NETEQTEST_Decoder
|
||||
public:
|
||||
decoder_GSMFR(uint8_t pt = 0);
|
||||
virtual ~decoder_GSMFR();
|
||||
int loadToNetEQ(NETEQTEST_NetEQClass & neteq);
|
||||
virtual int loadToNetEQ(NETEQTEST_NetEQClass & neteq) OVERRIDE;
|
||||
};
|
||||
|
||||
class decoder_G726 : public NETEQTEST_Decoder
|
||||
@ -241,28 +241,28 @@ class decoder_G726_16 : public decoder_G726
|
||||
{
|
||||
public:
|
||||
decoder_G726_16(uint8_t pt = 0) : decoder_G726(kDecoderG726_16, "G.726 (16 kbps)", pt) {};
|
||||
int loadToNetEQ(NETEQTEST_NetEQClass & neteq);
|
||||
virtual int loadToNetEQ(NETEQTEST_NetEQClass & neteq) OVERRIDE;
|
||||
};
|
||||
|
||||
class decoder_G726_24 : public decoder_G726
|
||||
{
|
||||
public:
|
||||
decoder_G726_24(uint8_t pt = 0) : decoder_G726(kDecoderG726_24, "G.726 (24 kbps)", pt) {};
|
||||
int loadToNetEQ(NETEQTEST_NetEQClass & neteq);
|
||||
virtual int loadToNetEQ(NETEQTEST_NetEQClass & neteq) OVERRIDE;
|
||||
};
|
||||
|
||||
class decoder_G726_32 : public decoder_G726
|
||||
{
|
||||
public:
|
||||
decoder_G726_32(uint8_t pt = 0) : decoder_G726(kDecoderG726_32, "G.726 (32 kbps)", pt) {};
|
||||
int loadToNetEQ(NETEQTEST_NetEQClass & neteq);
|
||||
virtual int loadToNetEQ(NETEQTEST_NetEQClass & neteq) OVERRIDE;
|
||||
};
|
||||
|
||||
class decoder_G726_40 : public decoder_G726
|
||||
{
|
||||
public:
|
||||
decoder_G726_40(uint8_t pt = 0) : decoder_G726(kDecoderG726_40, "G.726 (40 kbps)", pt) {};
|
||||
int loadToNetEQ(NETEQTEST_NetEQClass & neteq);
|
||||
virtual int loadToNetEQ(NETEQTEST_NetEQClass & neteq) OVERRIDE;
|
||||
};
|
||||
|
||||
class decoder_SPEEX : public NETEQTEST_Decoder
|
||||
@ -270,7 +270,7 @@ class decoder_SPEEX : public NETEQTEST_Decoder
|
||||
public:
|
||||
decoder_SPEEX(uint8_t pt = 0, uint16_t fs = 8000);
|
||||
virtual ~decoder_SPEEX();
|
||||
int loadToNetEQ(NETEQTEST_NetEQClass & neteq);
|
||||
virtual int loadToNetEQ(NETEQTEST_NetEQClass & neteq) OVERRIDE;
|
||||
};
|
||||
|
||||
class decoder_CELT : public NETEQTEST_Decoder
|
||||
@ -278,14 +278,14 @@ class decoder_CELT : public NETEQTEST_Decoder
|
||||
public:
|
||||
decoder_CELT(uint8_t pt = 0, uint16_t fs = 32000);
|
||||
virtual ~decoder_CELT();
|
||||
int loadToNetEQ(NETEQTEST_NetEQClass & neteq);
|
||||
virtual int loadToNetEQ(NETEQTEST_NetEQClass & neteq) OVERRIDE;
|
||||
};
|
||||
class decoder_CELTslave : public NETEQTEST_Decoder
|
||||
{
|
||||
public:
|
||||
decoder_CELTslave(uint8_t pt = 0, uint16_t fs = 32000);
|
||||
virtual ~decoder_CELTslave();
|
||||
int loadToNetEQ(NETEQTEST_NetEQClass & neteq);
|
||||
virtual int loadToNetEQ(NETEQTEST_NetEQClass & neteq) OVERRIDE;
|
||||
};
|
||||
|
||||
class decoder_RED : public NETEQTEST_Decoder
|
||||
@ -293,7 +293,7 @@ class decoder_RED : public NETEQTEST_Decoder
|
||||
public:
|
||||
decoder_RED(uint8_t pt = 0) : NETEQTEST_Decoder(kDecoderRED, 8000, "RED", pt) {};
|
||||
virtual ~decoder_RED() {};
|
||||
int loadToNetEQ(NETEQTEST_NetEQClass & neteq);
|
||||
virtual int loadToNetEQ(NETEQTEST_NetEQClass & neteq) OVERRIDE;
|
||||
};
|
||||
|
||||
class decoder_AVT : public NETEQTEST_Decoder
|
||||
@ -301,7 +301,7 @@ class decoder_AVT : public NETEQTEST_Decoder
|
||||
public:
|
||||
decoder_AVT(uint8_t pt = 0) : NETEQTEST_Decoder(kDecoderAVT, 8000, "AVT", pt) {};
|
||||
virtual ~decoder_AVT() {};
|
||||
int loadToNetEQ(NETEQTEST_NetEQClass & neteq);
|
||||
virtual int loadToNetEQ(NETEQTEST_NetEQClass & neteq) OVERRIDE;
|
||||
};
|
||||
|
||||
|
||||
@ -310,7 +310,7 @@ class decoder_CNG : public NETEQTEST_Decoder
|
||||
public:
|
||||
decoder_CNG(uint8_t pt = 0, uint16_t fs = 8000);
|
||||
virtual ~decoder_CNG();
|
||||
int loadToNetEQ(NETEQTEST_NetEQClass & neteq);
|
||||
virtual int loadToNetEQ(NETEQTEST_NetEQClass & neteq) OVERRIDE;
|
||||
};
|
||||
|
||||
#endif //NETEQTEST_CODECCLASS_H
|
||||
|
@ -13,11 +13,10 @@
|
||||
|
||||
#include "NETEQTEST_RTPpacket.h"
|
||||
|
||||
class NETEQTEST_DummyRTPpacket : public NETEQTEST_RTPpacket
|
||||
{
|
||||
public:
|
||||
virtual int readFromFile(FILE *fp);
|
||||
virtual int writeToFile(FILE *fp);
|
||||
class NETEQTEST_DummyRTPpacket : public NETEQTEST_RTPpacket {
|
||||
public:
|
||||
virtual int readFromFile(FILE* fp) OVERRIDE;
|
||||
virtual int writeToFile(FILE* fp) OVERRIDE;
|
||||
};
|
||||
|
||||
#endif //NETEQTEST_DUMMYRTPPACKET_H
|
||||
#endif // NETEQTEST_DUMMYRTPPACKET_H
|
||||
|
@ -51,14 +51,14 @@ class Accelerate : public TimeStretch {
|
||||
// values when the signal contains no active speech.
|
||||
virtual void SetParametersForPassiveSpeech(int len,
|
||||
int16_t* best_correlation,
|
||||
int* peak_index) const;
|
||||
int* peak_index) const OVERRIDE;
|
||||
|
||||
// Checks the criteria for performing the time-stretching operation and,
|
||||
// if possible, performs the time-stretching.
|
||||
virtual ReturnCodes CheckCriteriaAndStretch(
|
||||
const int16_t* input, int input_length, size_t peak_index,
|
||||
int16_t best_correlation, bool active_speech,
|
||||
AudioMultiVector<int16_t>* output) const;
|
||||
AudioMultiVector<int16_t>* output) const OVERRIDE;
|
||||
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(Accelerate);
|
||||
|
@ -16,6 +16,33 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
int AudioDecoder::DecodeRedundant(const uint8_t* encoded,
|
||||
size_t encoded_len,
|
||||
int16_t* decoded,
|
||||
SpeechType* speech_type) {
|
||||
return Decode(encoded, encoded_len, decoded, speech_type);
|
||||
}
|
||||
|
||||
bool AudioDecoder::HasDecodePlc() const { return false; }
|
||||
|
||||
int AudioDecoder::DecodePlc(int num_frames, int16_t* decoded) { return -1; }
|
||||
|
||||
int AudioDecoder::IncomingPacket(const uint8_t* payload,
|
||||
size_t payload_len,
|
||||
uint16_t rtp_sequence_number,
|
||||
uint32_t rtp_timestamp,
|
||||
uint32_t arrival_timestamp) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int AudioDecoder::ErrorCode() { return 0; }
|
||||
|
||||
int AudioDecoder::PacketDuration(const uint8_t* encoded, size_t encoded_len) {
|
||||
return kNotImplemented;
|
||||
}
|
||||
|
||||
NetEqDecoder AudioDecoder::codec_type() const { return codec_type_; }
|
||||
|
||||
bool AudioDecoder::CodecSupported(NetEqDecoder codec_type) {
|
||||
switch (codec_type) {
|
||||
case kDecoderPCMu:
|
||||
|
@ -21,6 +21,15 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
BackgroundNoise::BackgroundNoise(size_t num_channels)
|
||||
: num_channels_(num_channels),
|
||||
channel_parameters_(new ChannelParameters[num_channels_]),
|
||||
mode_(kBgnOn) {
|
||||
Reset();
|
||||
}
|
||||
|
||||
BackgroundNoise::~BackgroundNoise() {}
|
||||
|
||||
void BackgroundNoise::Reset() {
|
||||
initialized_ = false;
|
||||
for (size_t channel = 0; channel < num_channels_; ++channel) {
|
||||
|
@ -36,15 +36,8 @@ class BackgroundNoise {
|
||||
// Will work anyway, but probably sound a little worse.
|
||||
static const int kMaxLpcOrder = 8; // 32000 / 8000 + 4.
|
||||
|
||||
explicit BackgroundNoise(size_t num_channels)
|
||||
: num_channels_(num_channels),
|
||||
channel_parameters_(new ChannelParameters[num_channels_]),
|
||||
mode_(kBgnOn) {
|
||||
Reset();
|
||||
}
|
||||
|
||||
virtual ~BackgroundNoise() {
|
||||
}
|
||||
explicit BackgroundNoise(size_t num_channels);
|
||||
virtual ~BackgroundNoise();
|
||||
|
||||
void Reset();
|
||||
|
||||
|
@ -53,7 +53,7 @@ class DecisionLogicFax : public DecisionLogic {
|
||||
const RTPHeader* packet_header,
|
||||
Modes prev_mode,
|
||||
bool play_dtmf,
|
||||
bool* reset_decoder);
|
||||
bool* reset_decoder) OVERRIDE;
|
||||
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(DecisionLogicFax);
|
||||
|
@ -17,10 +17,19 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
DecoderDatabase::DecoderDatabase()
|
||||
: active_decoder_(-1), active_cng_decoder_(-1) {}
|
||||
|
||||
DecoderDatabase::~DecoderDatabase() {}
|
||||
|
||||
DecoderDatabase::DecoderInfo::~DecoderInfo() {
|
||||
if (!external) delete decoder;
|
||||
}
|
||||
|
||||
bool DecoderDatabase::Empty() const { return decoders_.empty(); }
|
||||
|
||||
int DecoderDatabase::Size() const { return decoders_.size(); }
|
||||
|
||||
void DecoderDatabase::Reset() {
|
||||
decoders_.clear();
|
||||
active_decoder_ = -1;
|
||||
|
@ -65,18 +65,15 @@ class DecoderDatabase {
|
||||
// only 7 bits).
|
||||
static const uint8_t kRtpPayloadTypeError = 0xFF;
|
||||
|
||||
DecoderDatabase()
|
||||
: active_decoder_(-1),
|
||||
active_cng_decoder_(-1) {
|
||||
}
|
||||
DecoderDatabase();
|
||||
|
||||
virtual ~DecoderDatabase() {}
|
||||
virtual ~DecoderDatabase();
|
||||
|
||||
// Returns true if the database is empty.
|
||||
virtual bool Empty() const { return decoders_.empty(); }
|
||||
virtual bool Empty() const;
|
||||
|
||||
// Returns the number of decoders registered in the database.
|
||||
virtual int Size() const { return decoders_.size(); }
|
||||
virtual int Size() const;
|
||||
|
||||
// Resets the database, erasing all registered payload types, and deleting
|
||||
// any AudioDecoder objects that were not externally created and inserted
|
||||
|
@ -44,6 +44,12 @@ DelayManager::DelayManager(int max_packets_in_buffer,
|
||||
Reset();
|
||||
}
|
||||
|
||||
DelayManager::~DelayManager() {}
|
||||
|
||||
const DelayManager::IATVector& DelayManager::iat_vector() const {
|
||||
return iat_vector_;
|
||||
}
|
||||
|
||||
// Set the histogram vector to an exponentially decaying distribution
|
||||
// iat_vector_[i] = 0.5^(i+1), i = 0, 1, 2, ...
|
||||
// iat_vector_ is in Q30.
|
||||
@ -323,6 +329,8 @@ void DelayManager::UpdateCounters(int elapsed_time_ms) {
|
||||
max_timer_ms_ += elapsed_time_ms;
|
||||
}
|
||||
|
||||
void DelayManager::ResetPacketIatCount() { packet_iat_count_ms_ = 0; }
|
||||
|
||||
void DelayManager::BufferLimits(int* lower_limit, int* higher_limit) const {
|
||||
if (!lower_limit || !higher_limit) {
|
||||
LOG_F(LS_ERROR) << "NULL pointers supplied as input";
|
||||
@ -366,4 +374,18 @@ void DelayManager::LastDecoderType(NetEqDecoder decoder_type) {
|
||||
last_pack_cng_or_dtmf_ = -1;
|
||||
}
|
||||
}
|
||||
|
||||
void DelayManager::set_extra_delay_ms(int16_t delay) {
|
||||
extra_delay_ms_ = delay;
|
||||
}
|
||||
|
||||
int DelayManager::base_target_level() const { return base_target_level_; }
|
||||
void DelayManager::set_streaming_mode(bool value) { streaming_mode_ = value; }
|
||||
int DelayManager::last_pack_cng_or_dtmf() const {
|
||||
return last_pack_cng_or_dtmf_;
|
||||
}
|
||||
|
||||
void DelayManager::set_last_pack_cng_or_dtmf(int value) {
|
||||
last_pack_cng_or_dtmf_ = value;
|
||||
}
|
||||
} // namespace webrtc
|
||||
|
@ -33,10 +33,10 @@ class DelayManager {
|
||||
// object to the DelayManager.
|
||||
DelayManager(int max_packets_in_buffer, DelayPeakDetector* peak_detector);
|
||||
|
||||
virtual ~DelayManager() {}
|
||||
virtual ~DelayManager();
|
||||
|
||||
// Read the inter-arrival time histogram. Mainly for testing purposes.
|
||||
virtual const IATVector& iat_vector() const { return iat_vector_; }
|
||||
virtual const IATVector& iat_vector() const;
|
||||
|
||||
// Updates the delay manager with a new incoming packet, with
|
||||
// |sequence_number| and |timestamp| from the RTP header. This updates the
|
||||
@ -79,7 +79,7 @@ class DelayManager {
|
||||
virtual void UpdateCounters(int elapsed_time_ms);
|
||||
|
||||
// Reset the inter-arrival time counter to 0.
|
||||
virtual void ResetPacketIatCount() { packet_iat_count_ms_ = 0; }
|
||||
virtual void ResetPacketIatCount();
|
||||
|
||||
// Writes the lower and higher limits which the buffer level should stay
|
||||
// within to the corresponding pointers. The values are in (fractions of)
|
||||
@ -93,13 +93,11 @@ class DelayManager {
|
||||
virtual void LastDecoderType(NetEqDecoder decoder_type);
|
||||
|
||||
// Accessors and mutators.
|
||||
virtual void set_extra_delay_ms(int16_t delay) { extra_delay_ms_ = delay; }
|
||||
virtual int base_target_level() const { return base_target_level_; }
|
||||
virtual void set_streaming_mode(bool value) { streaming_mode_ = value; }
|
||||
virtual int last_pack_cng_or_dtmf() const { return last_pack_cng_or_dtmf_; }
|
||||
virtual void set_last_pack_cng_or_dtmf(int value) {
|
||||
last_pack_cng_or_dtmf_ = value;
|
||||
}
|
||||
virtual void set_extra_delay_ms(int16_t delay);
|
||||
virtual int base_target_level() const;
|
||||
virtual void set_streaming_mode(bool value);
|
||||
virtual int last_pack_cng_or_dtmf() const;
|
||||
virtual void set_last_pack_cng_or_dtmf(int value);
|
||||
|
||||
private:
|
||||
static const int kLimitProbability = 53687091; // 1/20 in Q30.
|
||||
|
@ -81,16 +81,14 @@ class AudioDecoder {
|
||||
// Same as Decode(), but interfaces to the decoders redundant decode function.
|
||||
// The default implementation simply calls the regular Decode() method.
|
||||
virtual int DecodeRedundant(const uint8_t* encoded, size_t encoded_len,
|
||||
int16_t* decoded, SpeechType* speech_type) {
|
||||
return Decode(encoded, encoded_len, decoded, speech_type);
|
||||
}
|
||||
int16_t* decoded, SpeechType* speech_type);
|
||||
|
||||
// Indicates if the decoder implements the DecodePlc method.
|
||||
virtual bool HasDecodePlc() const { return false; }
|
||||
virtual bool HasDecodePlc() const;
|
||||
|
||||
// Calls the packet-loss concealment of the decoder to update the state after
|
||||
// one or several lost packets.
|
||||
virtual int DecodePlc(int num_frames, int16_t* decoded) { return -1; }
|
||||
virtual int DecodePlc(int num_frames, int16_t* decoded);
|
||||
|
||||
// Initializes the decoder.
|
||||
virtual int Init() = 0;
|
||||
@ -100,19 +98,17 @@ class AudioDecoder {
|
||||
size_t payload_len,
|
||||
uint16_t rtp_sequence_number,
|
||||
uint32_t rtp_timestamp,
|
||||
uint32_t arrival_timestamp) { return 0; }
|
||||
uint32_t arrival_timestamp);
|
||||
|
||||
// Returns the last error code from the decoder.
|
||||
virtual int ErrorCode() { return 0; }
|
||||
virtual int ErrorCode();
|
||||
|
||||
// Returns the duration in samples of the payload in |encoded| which is
|
||||
// |encoded_len| bytes long. Returns kNotImplemented if no duration estimate
|
||||
// is available, or -1 in case of an error.
|
||||
virtual int PacketDuration(const uint8_t* encoded, size_t encoded_len) {
|
||||
return kNotImplemented;
|
||||
}
|
||||
virtual int PacketDuration(const uint8_t* encoded, size_t encoded_len);
|
||||
|
||||
virtual NetEqDecoder codec_type() const { return codec_type_; }
|
||||
virtual NetEqDecoder codec_type() const;
|
||||
|
||||
// Returns the underlying decoder state.
|
||||
void* state() { return state_; }
|
||||
|
@ -12,6 +12,11 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
PostDecodeVad::~PostDecodeVad() {
|
||||
if (vad_instance_)
|
||||
WebRtcVad_Free(vad_instance_);
|
||||
}
|
||||
|
||||
void PostDecodeVad::Enable() {
|
||||
if (!vad_instance_) {
|
||||
// Create the instance.
|
||||
|
@ -33,11 +33,7 @@ class PostDecodeVad {
|
||||
vad_instance_(NULL) {
|
||||
}
|
||||
|
||||
virtual ~PostDecodeVad() {
|
||||
if (vad_instance_) {
|
||||
WebRtcVad_Free(vad_instance_);
|
||||
}
|
||||
}
|
||||
virtual ~PostDecodeVad();
|
||||
|
||||
// Enables post-decode VAD.
|
||||
void Enable();
|
||||
|
@ -13,11 +13,10 @@
|
||||
|
||||
#include "NETEQTEST_RTPpacket.h"
|
||||
|
||||
class NETEQTEST_DummyRTPpacket : public NETEQTEST_RTPpacket
|
||||
{
|
||||
public:
|
||||
virtual int readFromFile(FILE *fp);
|
||||
virtual int writeToFile(FILE *fp);
|
||||
class NETEQTEST_DummyRTPpacket : public NETEQTEST_RTPpacket {
|
||||
public:
|
||||
virtual int readFromFile(FILE* fp) OVERRIDE;
|
||||
virtual int writeToFile(FILE* fp) OVERRIDE;
|
||||
};
|
||||
|
||||
#endif //NETEQTEST_DUMMYRTPPACKET_H
|
||||
#endif // NETEQTEST_DUMMYRTPPACKET_H
|
||||
|
@ -13,6 +13,12 @@
|
||||
namespace webrtc {
|
||||
namespace test {
|
||||
|
||||
InputAudioFile::InputAudioFile(const std::string file_name) {
|
||||
fp_ = fopen(file_name.c_str(), "rb");
|
||||
}
|
||||
|
||||
InputAudioFile::~InputAudioFile() { fclose(fp_); }
|
||||
|
||||
bool InputAudioFile::Read(size_t samples, int16_t* destination) {
|
||||
if (!fp_) {
|
||||
return false;
|
||||
|
@ -23,13 +23,9 @@ namespace test {
|
||||
// Class for handling a looping input audio file.
|
||||
class InputAudioFile {
|
||||
public:
|
||||
explicit InputAudioFile(const std::string file_name) {
|
||||
fp_ = fopen(file_name.c_str(), "rb");
|
||||
}
|
||||
explicit InputAudioFile(const std::string file_name);
|
||||
|
||||
virtual ~InputAudioFile() {
|
||||
fclose(fp_);
|
||||
}
|
||||
virtual ~InputAudioFile();
|
||||
|
||||
// Reads |samples| elements from source file to |destination|. Returns true
|
||||
// if the read was successful, otherwise false. If the file end is reached,
|
||||
|
Loading…
x
Reference in New Issue
Block a user