Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Unified Diff: webrtc/modules/audio_coding/codecs/isac/audio_encoder_isac_t_impl.h

Issue 1184313002: Add AudioEncoder::GetTargetBitrate (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Reverting to SetTargetBitrate returning void Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..e88720dde7f9b7b246002728313702ea40a69b32 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
@@ -77,10 +77,12 @@ AudioEncoderDecoderIsacT<T>::AudioEncoderDecoderIsacT(const Config& config)
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) {
+ target_bitrate_bps_ = -1;
CHECK_EQ(0, T::ControlBwe(isac_state_, bit_rate,
config.frame_size_ms, config.enforce_frame_size));
} else {
+ target_bitrate_bps_ = bit_rate;
CHECK_EQ(0, T::Control(isac_state_, bit_rate, config.frame_size_ms));
}
// When config.sample_rate_hz is set to 48000 Hz (iSAC-fb), the decoder is
@@ -130,6 +132,12 @@ int AudioEncoderDecoderIsacT<T>::Max10MsFramesInAPacket() const {
}
template <typename T>
+int AudioEncoderDecoderIsacT<T>::GetTargetBitrate() const {
+ CriticalSectionScoped cs_lock(lock_.get());
+ return target_bitrate_bps_;
+}
+
+template <typename T>
AudioEncoder::EncodedInfo AudioEncoderDecoderIsacT<T>::EncodeInternal(
uint32_t rtp_timestamp,
const int16_t* audio,

Powered by Google App Engine
This is Rietveld 408576698