Index: webrtc/modules/audio_coding/codecs/isac/audio_encoder_isac_t_impl.h |
diff --git a/webrtc/modules/audio_coding/codecs/isac/audio_encoder_isac_t_impl.h b/webrtc/modules/audio_coding/codecs/isac/audio_encoder_isac_t_impl.h |
index befb3558beb85ff8eb304fae5317bbe6f19cde52..d2b20e3b941c932cf736489b17cf4455154a9d32 100644 |
--- a/webrtc/modules/audio_coding/codecs/isac/audio_encoder_isac_t_impl.h |
+++ b/webrtc/modules/audio_coding/codecs/isac/audio_encoder_isac_t_impl.h |
@@ -70,16 +70,18 @@ AudioEncoderDecoderIsacT<T>::AudioEncoderDecoderIsacT(const Config& config) |
state_lock_(CriticalSectionWrapper::CreateCriticalSection()), |
decoder_sample_rate_hz_(0), |
lock_(CriticalSectionWrapper::CreateCriticalSection()), |
- packet_in_progress_(false) { |
+ packet_in_progress_(false), |
+ target_bitrate_bps_(config.adaptive_mode ? -1 : (config.bit_rate == 0 |
+ ? kDefaultBitRate |
+ : config.bit_rate)) { |
CHECK(config.IsOk()); |
CHECK_EQ(0, T::Create(&isac_state_)); |
CHECK_EQ(0, T::EncoderInit(isac_state_, config.adaptive_mode ? 0 : 1)); |
CHECK_EQ(0, T::SetEncSampRate(isac_state_, config.sample_rate_hz)); |
const int bit_rate = config.bit_rate == 0 ? kDefaultBitRate : config.bit_rate; |
if (config.adaptive_mode) { |
- CHECK_EQ(0, T::ControlBwe(isac_state_, bit_rate, |
- config.frame_size_ms, config.enforce_frame_size)); |
- |
+ CHECK_EQ(0, T::ControlBwe(isac_state_, bit_rate, config.frame_size_ms, |
+ config.enforce_frame_size)); |
} else { |
CHECK_EQ(0, T::Control(isac_state_, bit_rate, config.frame_size_ms)); |
} |
@@ -130,6 +132,11 @@ int AudioEncoderDecoderIsacT<T>::Max10MsFramesInAPacket() const { |
} |
template <typename T> |
+int AudioEncoderDecoderIsacT<T>::GetTargetBitrate() const { |
+ return target_bitrate_bps_; |
+} |
+ |
+template <typename T> |
AudioEncoder::EncodedInfo AudioEncoderDecoderIsacT<T>::EncodeInternal( |
uint32_t rtp_timestamp, |
const int16_t* audio, |