diff --git a/webrtc/modules/audio_coding/main/source/acm_amr.h b/webrtc/modules/audio_coding/main/source/acm_amr.h index 9c8743460..e077ad6c2 100644 --- a/webrtc/modules/audio_coding/main/source/acm_amr.h +++ b/webrtc/modules/audio_coding/main/source/acm_amr.h @@ -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_; diff --git a/webrtc/modules/audio_coding/main/source/acm_amrwb.h b/webrtc/modules/audio_coding/main/source/acm_amrwb.h index 2cd301aff..e209bce38 100644 --- a/webrtc/modules/audio_coding/main/source/acm_amrwb.h +++ b/webrtc/modules/audio_coding/main/source/acm_amrwb.h @@ -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_; diff --git a/webrtc/modules/audio_coding/main/source/acm_celt.h b/webrtc/modules/audio_coding/main/source/acm_celt.h index ee6804453..a24338de4 100644 --- a/webrtc/modules/audio_coding/main/source/acm_celt.h +++ b/webrtc/modules/audio_coding/main/source/acm_celt.h @@ -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_; diff --git a/webrtc/modules/audio_coding/main/source/acm_cng.cc b/webrtc/modules/audio_coding/main/source/acm_cng.cc index 35491225f..0c44aa0ab 100644 --- a/webrtc/modules/audio_coding/main/source/acm_cng.cc +++ b/webrtc/modules/audio_coding/main/source/acm_cng.cc @@ -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 diff --git a/webrtc/modules/audio_coding/main/source/acm_cng.h b/webrtc/modules/audio_coding/main/source/acm_cng.h index 7221fbe54..37391745c 100644 --- a/webrtc/modules/audio_coding/main/source/acm_cng.h +++ b/webrtc/modules/audio_coding/main/source/acm_cng.h @@ -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_; diff --git a/webrtc/modules/audio_coding/main/source/acm_dtmf_playout.h b/webrtc/modules/audio_coding/main/source/acm_dtmf_playout.h index d07da4775..2f8a28b9d 100644 --- a/webrtc/modules/audio_coding/main/source/acm_dtmf_playout.h +++ b/webrtc/modules/audio_coding/main/source/acm_dtmf_playout.h @@ -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 diff --git a/webrtc/modules/audio_coding/main/source/acm_g722.h b/webrtc/modules/audio_coding/main/source/acm_g722.h index d4273ab13..70014229e 100644 --- a/webrtc/modules/audio_coding/main/source/acm_g722.h +++ b/webrtc/modules/audio_coding/main/source/acm_g722.h @@ -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_; diff --git a/webrtc/modules/audio_coding/main/source/acm_generic_codec.cc b/webrtc/modules/audio_coding/main/source/acm_generic_codec.cc index 8b6c9c55a..dea8cda51 100644 --- a/webrtc/modules/audio_coding/main/source/acm_generic_codec.cc +++ b/webrtc/modules/audio_coding/main/source/acm_generic_codec.cc @@ -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 diff --git a/webrtc/modules/audio_coding/main/source/acm_generic_codec.h b/webrtc/modules/audio_coding/main/source/acm_generic_codec.h index 945967e13..4bff67119 100644 --- a/webrtc/modules/audio_coding/main/source/acm_generic_codec.h +++ b/webrtc/modules/audio_coding/main/source/acm_generic_codec.h @@ -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); diff --git a/webrtc/modules/audio_coding/main/source/acm_ilbc.h b/webrtc/modules/audio_coding/main/source/acm_ilbc.h index eb619f09c..1f0a48dff 100644 --- a/webrtc/modules/audio_coding/main/source/acm_ilbc.h +++ b/webrtc/modules/audio_coding/main/source/acm_ilbc.h @@ -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_; diff --git a/webrtc/modules/audio_coding/main/source/acm_isac.h b/webrtc/modules/audio_coding/main/source/acm_isac.h index 625547706..8f5596921 100644 --- a/webrtc/modules/audio_coding/main/source/acm_isac.h +++ b/webrtc/modules/audio_coding/main/source/acm_isac.h @@ -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_; diff --git a/webrtc/modules/audio_coding/main/source/acm_opus.h b/webrtc/modules/audio_coding/main/source/acm_opus.h index 92096e3a5..68685d44d 100644 --- a/webrtc/modules/audio_coding/main/source/acm_opus.h +++ b/webrtc/modules/audio_coding/main/source/acm_opus.h @@ -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_; diff --git a/webrtc/modules/audio_coding/main/source/acm_pcm16b.h b/webrtc/modules/audio_coding/main/source/acm_pcm16b.h index 5368fe74e..3c4654b9d 100644 --- a/webrtc/modules/audio_coding/main/source/acm_pcm16b.h +++ b/webrtc/modules/audio_coding/main/source/acm_pcm16b.h @@ -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_; }; diff --git a/webrtc/modules/audio_coding/main/source/acm_pcma.h b/webrtc/modules/audio_coding/main/source/acm_pcma.h index 59c338920..2fc4ea4fe 100644 --- a/webrtc/modules/audio_coding/main/source/acm_pcma.h +++ b/webrtc/modules/audio_coding/main/source/acm_pcma.h @@ -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 diff --git a/webrtc/modules/audio_coding/main/source/acm_pcmu.h b/webrtc/modules/audio_coding/main/source/acm_pcmu.h index 5169f13f9..309d31870 100644 --- a/webrtc/modules/audio_coding/main/source/acm_pcmu.h +++ b/webrtc/modules/audio_coding/main/source/acm_pcmu.h @@ -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 diff --git a/webrtc/modules/audio_coding/main/source/acm_red.h b/webrtc/modules/audio_coding/main/source/acm_red.h index e19e335c6..7034f6eec 100644 --- a/webrtc/modules/audio_coding/main/source/acm_red.h +++ b/webrtc/modules/audio_coding/main/source/acm_red.h @@ -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 diff --git a/webrtc/modules/audio_coding/neteq/test/NETEQTEST_CodecClass.h b/webrtc/modules/audio_coding/neteq/test/NETEQTEST_CodecClass.h index a58bf0d05..90f24ee6d 100644 --- a/webrtc/modules/audio_coding/neteq/test/NETEQTEST_CodecClass.h +++ b/webrtc/modules/audio_coding/neteq/test/NETEQTEST_CodecClass.h @@ -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 diff --git a/webrtc/modules/audio_coding/neteq/test/NETEQTEST_DummyRTPpacket.h b/webrtc/modules/audio_coding/neteq/test/NETEQTEST_DummyRTPpacket.h index ef7442199..9dcece780 100644 --- a/webrtc/modules/audio_coding/neteq/test/NETEQTEST_DummyRTPpacket.h +++ b/webrtc/modules/audio_coding/neteq/test/NETEQTEST_DummyRTPpacket.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 diff --git a/webrtc/modules/audio_coding/neteq4/accelerate.h b/webrtc/modules/audio_coding/neteq4/accelerate.h index 856a01f80..d0cde4660 100644 --- a/webrtc/modules/audio_coding/neteq4/accelerate.h +++ b/webrtc/modules/audio_coding/neteq4/accelerate.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* output) const; + AudioMultiVector* output) const OVERRIDE; private: DISALLOW_COPY_AND_ASSIGN(Accelerate); diff --git a/webrtc/modules/audio_coding/neteq4/audio_decoder.cc b/webrtc/modules/audio_coding/neteq4/audio_decoder.cc index 8af5f11a8..77111ebf9 100644 --- a/webrtc/modules/audio_coding/neteq4/audio_decoder.cc +++ b/webrtc/modules/audio_coding/neteq4/audio_decoder.cc @@ -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: diff --git a/webrtc/modules/audio_coding/neteq4/background_noise.cc b/webrtc/modules/audio_coding/neteq4/background_noise.cc index 7b0e828a7..7ab5eade3 100644 --- a/webrtc/modules/audio_coding/neteq4/background_noise.cc +++ b/webrtc/modules/audio_coding/neteq4/background_noise.cc @@ -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) { diff --git a/webrtc/modules/audio_coding/neteq4/background_noise.h b/webrtc/modules/audio_coding/neteq4/background_noise.h index 0ee95e03b..6aa643b48 100644 --- a/webrtc/modules/audio_coding/neteq4/background_noise.h +++ b/webrtc/modules/audio_coding/neteq4/background_noise.h @@ -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(); diff --git a/webrtc/modules/audio_coding/neteq4/decision_logic_fax.h b/webrtc/modules/audio_coding/neteq4/decision_logic_fax.h index 91f6def4a..1ccd35244 100644 --- a/webrtc/modules/audio_coding/neteq4/decision_logic_fax.h +++ b/webrtc/modules/audio_coding/neteq4/decision_logic_fax.h @@ -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); diff --git a/webrtc/modules/audio_coding/neteq4/decoder_database.cc b/webrtc/modules/audio_coding/neteq4/decoder_database.cc index e62097e2c..bb4575f39 100644 --- a/webrtc/modules/audio_coding/neteq4/decoder_database.cc +++ b/webrtc/modules/audio_coding/neteq4/decoder_database.cc @@ -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; diff --git a/webrtc/modules/audio_coding/neteq4/decoder_database.h b/webrtc/modules/audio_coding/neteq4/decoder_database.h index 203e50254..9effd525d 100644 --- a/webrtc/modules/audio_coding/neteq4/decoder_database.h +++ b/webrtc/modules/audio_coding/neteq4/decoder_database.h @@ -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 diff --git a/webrtc/modules/audio_coding/neteq4/delay_manager.cc b/webrtc/modules/audio_coding/neteq4/delay_manager.cc index 58ca132c5..736f60c04 100644 --- a/webrtc/modules/audio_coding/neteq4/delay_manager.cc +++ b/webrtc/modules/audio_coding/neteq4/delay_manager.cc @@ -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 diff --git a/webrtc/modules/audio_coding/neteq4/delay_manager.h b/webrtc/modules/audio_coding/neteq4/delay_manager.h index 7fa389741..9d385e726 100644 --- a/webrtc/modules/audio_coding/neteq4/delay_manager.h +++ b/webrtc/modules/audio_coding/neteq4/delay_manager.h @@ -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. diff --git a/webrtc/modules/audio_coding/neteq4/interface/audio_decoder.h b/webrtc/modules/audio_coding/neteq4/interface/audio_decoder.h index 7668f3371..6e6b8e85e 100644 --- a/webrtc/modules/audio_coding/neteq4/interface/audio_decoder.h +++ b/webrtc/modules/audio_coding/neteq4/interface/audio_decoder.h @@ -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_; } diff --git a/webrtc/modules/audio_coding/neteq4/post_decode_vad.cc b/webrtc/modules/audio_coding/neteq4/post_decode_vad.cc index 38917cbdf..553dbec3c 100644 --- a/webrtc/modules/audio_coding/neteq4/post_decode_vad.cc +++ b/webrtc/modules/audio_coding/neteq4/post_decode_vad.cc @@ -12,6 +12,11 @@ namespace webrtc { +PostDecodeVad::~PostDecodeVad() { + if (vad_instance_) + WebRtcVad_Free(vad_instance_); +} + void PostDecodeVad::Enable() { if (!vad_instance_) { // Create the instance. diff --git a/webrtc/modules/audio_coding/neteq4/post_decode_vad.h b/webrtc/modules/audio_coding/neteq4/post_decode_vad.h index 363838bf9..fabd32fef 100644 --- a/webrtc/modules/audio_coding/neteq4/post_decode_vad.h +++ b/webrtc/modules/audio_coding/neteq4/post_decode_vad.h @@ -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(); diff --git a/webrtc/modules/audio_coding/neteq4/test/NETEQTEST_DummyRTPpacket.h b/webrtc/modules/audio_coding/neteq4/test/NETEQTEST_DummyRTPpacket.h index ef7442199..9dcece780 100644 --- a/webrtc/modules/audio_coding/neteq4/test/NETEQTEST_DummyRTPpacket.h +++ b/webrtc/modules/audio_coding/neteq4/test/NETEQTEST_DummyRTPpacket.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 diff --git a/webrtc/modules/audio_coding/neteq4/tools/input_audio_file.cc b/webrtc/modules/audio_coding/neteq4/tools/input_audio_file.cc index 40b3f9259..b61399210 100644 --- a/webrtc/modules/audio_coding/neteq4/tools/input_audio_file.cc +++ b/webrtc/modules/audio_coding/neteq4/tools/input_audio_file.cc @@ -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; diff --git a/webrtc/modules/audio_coding/neteq4/tools/input_audio_file.h b/webrtc/modules/audio_coding/neteq4/tools/input_audio_file.h index 35d0d1f40..b296cd32e 100644 --- a/webrtc/modules/audio_coding/neteq4/tools/input_audio_file.h +++ b/webrtc/modules/audio_coding/neteq4/tools/input_audio_file.h @@ -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,