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

Unified Diff: webrtc/modules/audio_device/ios/objc/RTCAudioSessionConfiguration.mm

Issue 2066993005: (OBSOLETE) Increasing audio buffer on Iphone 4S. Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Addressing comments in PS 1 Created 4 years, 6 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
« no previous file with comments | « webrtc/modules/audio_device/ios/objc/RTCAudioSessionConfiguration.m ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_device/ios/objc/RTCAudioSessionConfiguration.mm
diff --git a/webrtc/modules/audio_device/ios/objc/RTCAudioSessionConfiguration.m b/webrtc/modules/audio_device/ios/objc/RTCAudioSessionConfiguration.mm
similarity index 91%
rename from webrtc/modules/audio_device/ios/objc/RTCAudioSessionConfiguration.m
rename to webrtc/modules/audio_device/ios/objc/RTCAudioSessionConfiguration.mm
index d2d04835499fe9ee990f546ddda01cc787d5cf39..ea6200270ce0dc56387b6f1b0f6115c4a63568f6 100644
--- a/webrtc/modules/audio_device/ios/objc/RTCAudioSessionConfiguration.m
+++ b/webrtc/modules/audio_device/ios/objc/RTCAudioSessionConfiguration.mm
@@ -13,6 +13,7 @@
#import "WebRTC/RTCDispatcher.h"
#import "webrtc/modules/audio_device/ios/objc/RTCAudioSession.h"
+#include "webrtc/modules/utility/include/helpers_ios.h"
tkchin_webrtc 2016/06/24 00:30:48 Let's avoid using this file. I want to move helper
// Try to use mono to save resources. Also avoids channel format conversion
// in the I/O audio unit. Initial tests have shown that it is possible to use
@@ -44,6 +45,10 @@ const double kRTCAudioSessionLowComplexitySampleRate = 16000.0;
// sequence without bursts of callbacks back to back.
const double kRTCAudioSessionHighPerformanceIOBufferDuration = 0.01;
+// Use a larger buffer size on iphone 4S to allow it running complex tasks
+// e.g., encoding large frames with Opus codec.
+const double kRTCAudioSessionHighPerformanceIOBufferDurationIphone4s = 0.02;
+
// Use a larger buffer size on devices with only one core (e.g. iPhone 4).
// It will result in a lower CPU consumption at the cost of a larger latency.
// The size of 60ms is based on instrumentation that shows a significant
@@ -84,7 +89,12 @@ static RTCAudioSessionConfiguration *gWebRTCConfiguration = nil;
// core.
if (processorCount > 1) {
_sampleRate = kRTCAudioSessionHighPerformanceSampleRate;
- _ioBufferDuration = kRTCAudioSessionHighPerformanceIOBufferDuration;
+ if (webrtc::ios::GetDeviceName() == "iPhone 4S") {
tkchin_webrtc 2016/06/24 00:30:48 Wouldn't use strings like this. We should enumerat
+ _ioBufferDuration =
+ kRTCAudioSessionHighPerformanceIOBufferDurationIphone4s;
+ } else {
+ _ioBufferDuration = kRTCAudioSessionHighPerformanceIOBufferDuration;
+ }
} else {
_sampleRate = kRTCAudioSessionLowComplexitySampleRate;
_ioBufferDuration = kRTCAudioSessionLowComplexityIOBufferDuration;
« no previous file with comments | « webrtc/modules/audio_device/ios/objc/RTCAudioSessionConfiguration.m ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698