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

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

Issue 2352713005: Posting Opus's set-force-channels functionality to WebRTC. (Closed)
Patch Set: reformat 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.h
diff --git a/webrtc/modules/audio_coding/codecs/opus/opus_interface.h b/webrtc/modules/audio_coding/codecs/opus/opus_interface.h
index 754b49c80827c40d61082e5cbc0be05364a3f7d1..5446ca499eaebdacab11e97e054674e2d0d5b3ce 100644
--- a/webrtc/modules/audio_coding/codecs/opus/opus_interface.h
+++ b/webrtc/modules/audio_coding/codecs/opus/opus_interface.h
@@ -195,6 +195,28 @@ int16_t WebRtcOpus_DisableDtx(OpusEncInst* inst);
*/
int16_t WebRtcOpus_SetComplexity(OpusEncInst* inst, int32_t complexity);
+/*
+ * WebRtcOpus_SetForceChannels(...)
tlegrand-webrtc 2016/09/22 12:15:42 I don't think this function need to be as general
minyue-webrtc 2016/09/22 15:02:19 This function is very much doing the same as Opus
tlegrand-webrtc 2016/09/23 11:37:41 Acknowledged.
+ *
+ * If the encoder is initialized as a stereo encoder, Opus will by default
+ * decide whether to encode in mono or stereo based on the bitrate. This
+ * function overrules this decision and forces the encoder to encode in
tlegrand-webrtc 2016/09/22 12:15:42 this -> that
minyue-webrtc 2016/09/22 15:02:19 sure
tlegrand-webrtc 2016/09/23 11:37:41 Or maybe change the comment to "This function ove
minyue-webrtc 2016/09/26 08:21:23 Done.
+ * auto/mono/stereo.
+ *
+ * If the Encoder is initialized as a mono encoder, and one tries to force
+ * stereo, the function will return a error.
+ *
+ * Input:
+ * - inst : Encoder context
+ * - num_channels : 0 - Not forced
tlegrand-webrtc 2016/09/22 12:15:42 Why would you call a SetForce-function with the in
minyue-webrtc 2016/09/22 15:02:19 I do not like that name either, but it resembles t
+ * 1 - Mono
+ * 2 - Stereo
+ *
+ * Return value : 0 - Success
+ * -1 - Error
tlegrand-webrtc 2016/09/22 12:15:42 Maybe we shouldn't return -1, but instead return m
minyue-webrtc 2016/09/22 15:02:19 A problem can be: if the encoder is in stereo mode
tlegrand-webrtc 2016/09/23 11:37:41 Right! Because this is a C-file, so we can't add a
kwiberg-webrtc 2016/09/23 11:40:52 Yes, you can! I made variants of the [D]CHECK macr
minyue-webrtc 2016/09/26 08:21:23 That is good news. We may consider doing a refacto
+ */
+int16_t WebRtcOpus_SetForceChannels(OpusEncInst* inst, int32_t num_channels);
+
int16_t WebRtcOpus_DecoderCreate(OpusDecInst** inst, size_t channels);
int16_t WebRtcOpus_DecoderFree(OpusDecInst* inst);

Powered by Google App Engine
This is Rietveld 408576698