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

Unified Diff: webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.cc

Issue 2772773002: Adding cbr support for Opus (Closed)
Patch Set: Created 3 years, 9 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/opus/audio_encoder_opus.cc
diff --git a/webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.cc b/webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.cc
index bac963f4e8e2de9ff047ac78d889e9b187c6469e..05ba589d94f6dacc0d74206268764d8aa45cb07a 100644
--- a/webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.cc
+++ b/webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.cc
@@ -260,6 +260,20 @@ bool AudioEncoderOpus::GetDtx() const {
return config_.dtx_enabled;
}
+bool AudioEncoderOpus::SetCbr(bool enable) {
+ if (enable) {
+ RTC_CHECK_EQ(0, WebRtcOpus_EnableCbr(inst_));
+ } else {
+ RTC_CHECK_EQ(0, WebRtcOpus_DisableCbr(inst_));
+ }
+ config_.cbr_enabled = enable;
+ return true;
+}
+
+bool AudioEncoderOpus::GetCbr() const {
+ return config_.cbr_enabled;
+}
+
bool AudioEncoderOpus::SetApplication(Application application) {
auto conf = config_;
switch (application) {

Powered by Google App Engine
This is Rietveld 408576698