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

Unified Diff: webrtc/modules/audio_device/ios/voice_processing_audio_unit.mm

Issue 3004053002: Experimental patch for delaying mic permission dialog in AppRTCMobile
Patch Set: Created 3 years, 4 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/audio_device_ios.mm ('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/voice_processing_audio_unit.mm
diff --git a/webrtc/modules/audio_device/ios/voice_processing_audio_unit.mm b/webrtc/modules/audio_device/ios/voice_processing_audio_unit.mm
index 3701f3fee367d383be690fdad1c6effad6a20b0c..3427fbf636e2bca0397bb5c73ca2bb5bf56dee47 100644
--- a/webrtc/modules/audio_device/ios/voice_processing_audio_unit.mm
+++ b/webrtc/modules/audio_device/ios/voice_processing_audio_unit.mm
@@ -84,6 +84,7 @@ const UInt32 VoiceProcessingAudioUnit::kBytesPerSample = 2;
bool VoiceProcessingAudioUnit::Init() {
RTC_DCHECK_EQ(state_, kInitRequired);
+ RTCLog(@"Init");
// Create an audio component description to identify the Voice Processing
// I/O audio unit.
@@ -107,19 +108,6 @@ bool VoiceProcessingAudioUnit::Init() {
return false;
}
- // Enable input on the input scope of the input element.
- UInt32 enable_input = 1;
- result = AudioUnitSetProperty(vpio_unit_, kAudioOutputUnitProperty_EnableIO,
- kAudioUnitScope_Input, kInputBus, &enable_input,
- sizeof(enable_input));
- if (result != noErr) {
- DisposeAudioUnit();
- RTCLogError(@"Failed to enable input on input scope of input element. "
- "Error=%ld.",
- (long)result);
- return false;
- }
-
// Enable output on the output scope of the output element.
UInt32 enable_output = 1;
result = AudioUnitSetProperty(vpio_unit_, kAudioOutputUnitProperty_EnableIO,
@@ -194,6 +182,20 @@ bool VoiceProcessingAudioUnit::Initialize(Float64 sample_rate) {
RTCLog(@"Initializing audio unit with sample rate: %f", sample_rate);
OSStatus result = noErr;
+
+ // Enable input on the input scope of the input element.
+ UInt32 enable_input = 1;
+ result = AudioUnitSetProperty(vpio_unit_, kAudioOutputUnitProperty_EnableIO,
+ kAudioUnitScope_Input, kInputBus, &enable_input,
+ sizeof(enable_input));
+ if (result != noErr) {
+ DisposeAudioUnit();
+ RTCLogError(@"Failed to enable input on input scope of input element. "
+ "Error=%ld.",
+ (long)result);
+ return false;
+ }
+
AudioStreamBasicDescription format = GetFormat(sample_rate);
UInt32 size = sizeof(format);
#if !defined(NDEBUG)
« no previous file with comments | « webrtc/modules/audio_device/ios/audio_device_ios.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698