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

Side by Side Diff: talk/examples/android/src/org/appspot/apprtc/AppRTCAudioManager.java

Issue 1165923002: Removes automatic setting of COMM mode in WebRTC (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Removed CHECK Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/modules/audio_device/android/audio_device_template.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2014 Google Inc. 3 * Copyright 2014 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 144
145 // Store current audio state so we can restore it when close() is called. 145 // Store current audio state so we can restore it when close() is called.
146 savedAudioMode = audioManager.getMode(); 146 savedAudioMode = audioManager.getMode();
147 savedIsSpeakerPhoneOn = audioManager.isSpeakerphoneOn(); 147 savedIsSpeakerPhoneOn = audioManager.isSpeakerphoneOn();
148 savedIsMicrophoneMute = audioManager.isMicrophoneMute(); 148 savedIsMicrophoneMute = audioManager.isMicrophoneMute();
149 149
150 // Request audio focus before making any device switch. 150 // Request audio focus before making any device switch.
151 audioManager.requestAudioFocus(null, AudioManager.STREAM_VOICE_CALL, 151 audioManager.requestAudioFocus(null, AudioManager.STREAM_VOICE_CALL,
152 AudioManager.AUDIOFOCUS_GAIN_TRANSIENT); 152 AudioManager.AUDIOFOCUS_GAIN_TRANSIENT);
153 153
154 // Start by setting RINGTONE as default audio mode. The native WebRTC 154 // Start by setting MODE_IN_COMMUNICATION as default audio mode. It is
155 // audio layer will switch to COMMUNICATION mode when the first streaming 155 // required to be in this mode when playout and/or recording starts for
156 // session starts and return to RINGTONE mode when all streaming stops. 156 // best possible VoIP performance.
157 audioManager.setMode(AudioManager.MODE_RINGTONE); 157 // TODO(henrika): we migh want to start with RINGTONE mode here instead.
158 audioManager.setMode(AudioManager.MODE_IN_COMMUNICATION);
158 159
159 // Always disable microphone mute during a WebRTC call. 160 // Always disable microphone mute during a WebRTC call.
160 setMicrophoneMute(false); 161 setMicrophoneMute(false);
161 162
162 // Do initial selection of audio device. This setting can later be changed 163 // Do initial selection of audio device. This setting can later be changed
163 // either by adding/removing a wired headset or by covering/uncovering the 164 // either by adding/removing a wired headset or by covering/uncovering the
164 // proximity sensor. 165 // proximity sensor.
165 updateAudioDeviceState(hasWiredHeadset()); 166 updateAudioDeviceState(hasWiredHeadset());
166 167
167 // Register receiver for broadcast intents related to adding/removing a 168 // Register receiver for broadcast intents related to adding/removing a
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 Log.e(TAG, "Invalid device list"); 364 Log.e(TAG, "Invalid device list");
364 } 365 }
365 366
366 if (onStateChangeListener != null) { 367 if (onStateChangeListener != null) {
367 // Run callback to notify a listening client. The client can then 368 // Run callback to notify a listening client. The client can then
368 // use public getters to query the new state. 369 // use public getters to query the new state.
369 onStateChangeListener.run(); 370 onStateChangeListener.run();
370 } 371 }
371 } 372 }
372 } 373 }
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/audio_device/android/audio_device_template.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698