Chromium Code Reviews

Unified Diff: webrtc/modules/audio_coding/codecs/opus/interface/audio_encoder_opus.h

Issue 1184313002: Add AudioEncoder::GetTargetBitrate (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Getting rid of erroneous code Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: webrtc/modules/audio_coding/codecs/opus/interface/audio_encoder_opus.h
diff --git a/webrtc/modules/audio_coding/codecs/opus/interface/audio_encoder_opus.h b/webrtc/modules/audio_coding/codecs/opus/interface/audio_encoder_opus.h
index 4de4e26273f98d3fa077c286eb008d185711f6cb..babed8ad95501201811300445c9cbf4899ec605a 100644
--- a/webrtc/modules/audio_coding/codecs/opus/interface/audio_encoder_opus.h
+++ b/webrtc/modules/audio_coding/codecs/opus/interface/audio_encoder_opus.h
@@ -52,12 +52,14 @@ class AudioEncoderOpus final : public AudioEncoder {
size_t MaxEncodedBytes() const override;
int Num10MsFramesInNextPacket() const override;
int Max10MsFramesInAPacket() const override;
- void SetTargetBitrate(int bits_per_second) override;
+ int SetTargetBitrate(int bits_per_second) override;
void SetProjectedPacketLossRate(double fraction) override;
double packet_loss_rate() const { return packet_loss_rate_; }
ApplicationMode application() const { return application_; }
bool dtx_enabled() const { return dtx_enabled_; }
+ int bitrate_bps() const { return bitrate_bps_; }
+
EncodedInfo EncodeInternal(uint32_t rtp_timestamp,
const int16_t* audio,
size_t max_encoded_bytes,
@@ -104,6 +106,10 @@ class AudioEncoderMutableOpus
CriticalSectionScoped cs(encoder_lock_.get());
return encoder()->dtx_enabled();
}
+ int bitrate_bps() const {
+ CriticalSectionScoped cs(encoder_lock_.get());
+ return encoder()->bitrate_bps();
+ }
};
} // namespace webrtc

Powered by Google App Engine