| Index: webrtc/modules/audio_coding/codecs/isac/fix/source/audio_encoder_isacfix.cc
|
| diff --git a/webrtc/modules/audio_coding/codecs/isac/fix/source/audio_encoder_isacfix.cc b/webrtc/modules/audio_coding/codecs/isac/fix/source/audio_encoder_isacfix.cc
|
| index c7999b56be36deb1f6e54f09dd77ecd8c75da3c5..2f8d4b6e5d411f661f9b7be4fefedc42ee2cd961 100644
|
| --- a/webrtc/modules/audio_coding/codecs/isac/fix/source/audio_encoder_isacfix.cc
|
| +++ b/webrtc/modules/audio_coding/codecs/isac/fix/source/audio_encoder_isacfix.cc
|
| @@ -17,13 +17,15 @@ namespace webrtc {
|
|
|
| const uint16_t IsacFix::kFixSampleRate;
|
|
|
| -// Explicit instantiation of AudioEncoderDecoderIsacT<IsacFix>, a.k.a.
|
| -// AudioEncoderDecoderIsacFix.
|
| -template class AudioEncoderDecoderIsacT<IsacFix>;
|
| +// Explicit instantiation:
|
| +template class AudioEncoderIsacT<IsacFix>;
|
| +template class AudioDecoderIsacT<IsacFix>;
|
|
|
| namespace {
|
| -AudioEncoderDecoderIsacFix::Config CreateConfig(const CodecInst& codec_inst) {
|
| - AudioEncoderDecoderIsacFix::Config config;
|
| +AudioEncoderIsacFix::Config CreateConfig(const CodecInst& codec_inst,
|
| + LockedIsacBandwidthInfo* bwinfo) {
|
| + AudioEncoderIsacFix::Config config;
|
| + config.bwinfo = bwinfo;
|
| config.payload_type = codec_inst.pltype;
|
| config.sample_rate_hz = codec_inst.plfreq;
|
| config.frame_size_ms =
|
| @@ -35,110 +37,22 @@ AudioEncoderDecoderIsacFix::Config CreateConfig(const CodecInst& codec_inst) {
|
| }
|
| } // namespace
|
|
|
| -AudioEncoderDecoderMutableIsacFix::AudioEncoderDecoderMutableIsacFix(
|
| - const CodecInst& codec_inst)
|
| - : AudioEncoderMutableImpl<AudioEncoderDecoderIsacFix,
|
| - AudioEncoderDecoderMutableIsac>(
|
| - CreateConfig(codec_inst)) {
|
| -}
|
| -
|
| -void AudioEncoderDecoderMutableIsacFix::UpdateSettings(
|
| - const CodecInst& codec_inst) {
|
| - bool success = Reconstruct(CreateConfig(codec_inst));
|
| - DCHECK(success);
|
| -}
|
| +AudioEncoderMutableIsacFix::AudioEncoderMutableIsacFix(
|
| + const CodecInst& codec_inst,
|
| + LockedIsacBandwidthInfo* bwinfo)
|
| + : AudioEncoderMutableImpl<AudioEncoderIsacFix>(
|
| + CreateConfig(codec_inst, bwinfo)) {}
|
|
|
| -void AudioEncoderDecoderMutableIsacFix::SetMaxPayloadSize(
|
| - int max_payload_size_bytes) {
|
| +void AudioEncoderMutableIsacFix::SetMaxPayloadSize(int max_payload_size_bytes) {
|
| auto conf = config();
|
| conf.max_payload_size_bytes = max_payload_size_bytes;
|
| Reconstruct(conf);
|
| }
|
|
|
| -void AudioEncoderDecoderMutableIsacFix::SetMaxRate(int max_rate_bps) {
|
| +void AudioEncoderMutableIsacFix::SetMaxRate(int max_rate_bps) {
|
| auto conf = config();
|
| conf.max_bit_rate = max_rate_bps;
|
| Reconstruct(conf);
|
| }
|
|
|
| -int AudioEncoderDecoderMutableIsacFix::Decode(const uint8_t* encoded,
|
| - size_t encoded_len,
|
| - int sample_rate_hz,
|
| - size_t max_decoded_bytes,
|
| - int16_t* decoded,
|
| - SpeechType* speech_type) {
|
| - CriticalSectionScoped cs(encoder_lock_.get());
|
| - return encoder()->Decode(encoded, encoded_len, sample_rate_hz,
|
| - max_decoded_bytes, decoded, speech_type);
|
| -}
|
| -
|
| -int AudioEncoderDecoderMutableIsacFix::DecodeRedundant(
|
| - const uint8_t* encoded,
|
| - size_t encoded_len,
|
| - int sample_rate_hz,
|
| - size_t max_decoded_bytes,
|
| - int16_t* decoded,
|
| - SpeechType* speech_type) {
|
| - CriticalSectionScoped cs(encoder_lock_.get());
|
| - return encoder()->DecodeRedundant(encoded, encoded_len, sample_rate_hz,
|
| - max_decoded_bytes, decoded, speech_type);
|
| -}
|
| -
|
| -bool AudioEncoderDecoderMutableIsacFix::HasDecodePlc() const {
|
| - CriticalSectionScoped cs(encoder_lock_.get());
|
| - return encoder()->HasDecodePlc();
|
| -}
|
| -
|
| -int AudioEncoderDecoderMutableIsacFix::DecodePlc(int num_frames,
|
| - int16_t* decoded) {
|
| - CriticalSectionScoped cs(encoder_lock_.get());
|
| - return encoder()->DecodePlc(num_frames, decoded);
|
| -}
|
| -
|
| -int AudioEncoderDecoderMutableIsacFix::Init() {
|
| - CriticalSectionScoped cs(encoder_lock_.get());
|
| - return encoder()->Init();
|
| -}
|
| -
|
| -int AudioEncoderDecoderMutableIsacFix::IncomingPacket(
|
| - const uint8_t* payload,
|
| - size_t payload_len,
|
| - uint16_t rtp_sequence_number,
|
| - uint32_t rtp_timestamp,
|
| - uint32_t arrival_timestamp) {
|
| - CriticalSectionScoped cs(encoder_lock_.get());
|
| - return encoder()->IncomingPacket(payload, payload_len, rtp_sequence_number,
|
| - rtp_timestamp, arrival_timestamp);
|
| -}
|
| -
|
| -int AudioEncoderDecoderMutableIsacFix::ErrorCode() {
|
| - CriticalSectionScoped cs(encoder_lock_.get());
|
| - return encoder()->ErrorCode();
|
| -}
|
| -
|
| -int AudioEncoderDecoderMutableIsacFix::PacketDuration(
|
| - const uint8_t* encoded,
|
| - size_t encoded_len) const {
|
| - CriticalSectionScoped cs(encoder_lock_.get());
|
| - return encoder()->PacketDuration(encoded, encoded_len);
|
| -}
|
| -
|
| -int AudioEncoderDecoderMutableIsacFix::PacketDurationRedundant(
|
| - const uint8_t* encoded,
|
| - size_t encoded_len) const {
|
| - CriticalSectionScoped cs(encoder_lock_.get());
|
| - return encoder()->PacketDurationRedundant(encoded, encoded_len);
|
| -}
|
| -
|
| -bool AudioEncoderDecoderMutableIsacFix::PacketHasFec(const uint8_t* encoded,
|
| - size_t encoded_len) const {
|
| - CriticalSectionScoped cs(encoder_lock_.get());
|
| - return encoder()->PacketHasFec(encoded, encoded_len);
|
| -}
|
| -
|
| -size_t AudioEncoderDecoderMutableIsacFix::Channels() const {
|
| - CriticalSectionScoped cs(encoder_lock_.get());
|
| - return encoder()->Channels();
|
| -}
|
| -
|
| } // namespace webrtc
|
|
|