Adding build switch for Opus that supports 120ms ptime.

BUG=webrtc:7097

TEST=Set "ptime=120", try WebRTC calls over custom build Chromium with and without Opus 120ms. Try both Chromium w <-> Chromium w and Chromium w <-> Chromium w/o

Review-Url: https://codereview.webrtc.org/2668633004
Cr-Commit-Position: refs/heads/master@{#16408}
This commit is contained in:
minyue
2017-02-01 17:31:11 -08:00
committed by Commit bot
parent d3d3ba5159
commit 2e03c66119
7 changed files with 31 additions and 0 deletions

View File

@ -872,6 +872,8 @@ rtc_source_set("webrtc_opus_c") {
"codecs/opus/opus_interface.h",
]
defines = audio_coding_defines
if (rtc_build_opus) {
public_deps = [
rtc_opus_dir,

View File

@ -151,7 +151,11 @@ const ACMCodecDB::CodecSettings ACMCodecDB::codec_settings_[] = {
// Opus supports frames shorter than 10ms,
// but it doesn't help us to use them.
// Mono and stereo.
#if WEBRTC_OPUS_SUPPORT_120MS_PTIME
{5, {480, 960, 1920, 2880, 5760}, 0, 2},
#else
{4, {480, 960, 1920, 2880}, 0, 2},
#endif
#endif
// Comfort noise for three different sampling frequencies.
{1, {240}, 240, 1},

View File

@ -15,6 +15,11 @@ if (rtc_include_ilbc) {
if (rtc_include_opus) {
audio_codec_defines += [ "WEBRTC_CODEC_OPUS" ]
}
if (rtc_opus_support_120ms_ptime) {
audio_codec_defines += [ "WEBRTC_OPUS_SUPPORT_120MS_PTIME=1" ]
} else {
audio_codec_defines += [ "WEBRTC_OPUS_SUPPORT_120MS_PTIME=0" ]
}
if (!build_with_mozilla) {
if (current_cpu == "arm") {
audio_codec_defines += [ "WEBRTC_CODEC_ISACFX" ]

View File

@ -17,8 +17,13 @@
#include <string.h>
enum {
#if WEBRTC_OPUS_SUPPORT_120MS_PTIME
/* Maximum supported frame size in WebRTC is 120 ms. */
kWebRtcOpusMaxEncodeFrameSizeMs = 120,
#else
/* Maximum supported frame size in WebRTC is 60 ms. */
kWebRtcOpusMaxEncodeFrameSizeMs = 60,
#endif
/* The format allows up to 120 ms frames. Since we don't control the other
* side, we must allow for packets of that size. NetEq is currently limited