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:
pbos@webrtc.org
2013-07-31 15:54:00 +00:00
parent e72428442d
commit 2d1a55caed
33 changed files with 443 additions and 351 deletions

View File

@ -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_;

View File

@ -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_;

View File

@ -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_;

View File

@ -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

View File

@ -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_;

View File

@ -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

View File

@ -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_;

View File

@ -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

View File

@ -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);

View File

@ -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_;

View File

@ -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_;

View File

@ -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_;

View File

@ -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_;
};

View File

@ -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

View File

@ -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

View File

@ -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