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

Unified Diff: webrtc/modules/audio_coding/codecs/opus/opus_interface.c

Issue 2352713005: Posting Opus's set-force-channels functionality to WebRTC. (Closed)
Patch Set: clarify comment Created 4 years, 3 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/opus_interface.c
diff --git a/webrtc/modules/audio_coding/codecs/opus/opus_interface.c b/webrtc/modules/audio_coding/codecs/opus/opus_interface.c
index d79a9ad290842db28ab62a14867bfe0a21684c8b..aff089f0923eea8cd8d6f70ba66cf9f987a3566f 100644
--- a/webrtc/modules/audio_coding/codecs/opus/opus_interface.c
+++ b/webrtc/modules/audio_coding/codecs/opus/opus_interface.c
@@ -208,6 +208,20 @@ int16_t WebRtcOpus_SetComplexity(OpusEncInst* inst, int32_t complexity) {
}
}
+int16_t WebRtcOpus_SetForceChannels(OpusEncInst* inst, int32_t num_channels) {
+ if (!inst)
+ return -1;
+ if (num_channels == 0) {
+ return opus_encoder_ctl(inst->encoder,
+ OPUS_SET_FORCE_CHANNELS(OPUS_AUTO));
+ } else if (num_channels == 1 || num_channels == 2) {
+ return opus_encoder_ctl(inst->encoder,
+ OPUS_SET_FORCE_CHANNELS(num_channels));
+ } else {
+ return -1;
+ }
+}
+
int16_t WebRtcOpus_DecoderCreate(OpusDecInst** inst, size_t channels) {
int error;
OpusDecInst* state;
« no previous file with comments | « webrtc/modules/audio_coding/codecs/opus/opus_interface.h ('k') | webrtc/modules/audio_coding/codecs/opus/opus_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698