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

Unified Diff: webrtc/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioManager.java

Issue 1440623002: OpenSL ES stability improvements (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: nit Created 5 years, 1 month 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 | « no previous file | webrtc/modules/audio_device/android/opensles_player.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioManager.java
diff --git a/webrtc/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioManager.java b/webrtc/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioManager.java
index 10fe8ca33fcc06f5d57315bae6ea681337b38283..7359486a3f78a3e66abe7c02b8fd8013e32fd435 100644
--- a/webrtc/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioManager.java
+++ b/webrtc/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioManager.java
@@ -33,11 +33,24 @@ import java.lang.Math;
// recommended to always use AudioManager.MODE_IN_COMMUNICATION.
// This class also adds support for output volume control of the
// STREAM_VOICE_CALL-type stream.
-class WebRtcAudioManager {
+public class WebRtcAudioManager {
private static final boolean DEBUG = false;
private static final String TAG = "WebRtcAudioManager";
+ private static boolean blacklistDeviceForOpenSLESUsage = false;
+ private static boolean blacklistDeviceForOpenSLESUsageIsOverridden = false;
+
+ // Call this method to override the deault list of blacklisted devices
+ // specified in WebRtcAudioUtils.BLACKLISTED_OPEN_SL_ES_MODELS.
+ // Allows an app to take control over which devices to exlude from using
+ // the OpenSL ES audio output path
+ public static synchronized void setBlacklistDeviceForOpenSLESUsage(
+ boolean enable) {
+ blacklistDeviceForOpenSLESUsageIsOverridden = true;
+ blacklistDeviceForOpenSLESUsage = enable;
+ }
+
// Default audio data format is PCM 16 bit per sample.
// Guaranteed to be supported by all devices.
private static final int BITS_PER_SAMPLE = 16;
@@ -110,7 +123,8 @@ class WebRtcAudioManager {
}
private boolean isDeviceBlacklistedForOpenSLESUsage() {
- boolean blacklisted =
+ boolean blacklisted = blacklistDeviceForOpenSLESUsageIsOverridden ?
+ blacklistDeviceForOpenSLESUsage :
WebRtcAudioUtils.deviceIsBlacklistedForOpenSLESUsage();
if (blacklisted) {
Logging.e(TAG, Build.MODEL + " is blacklisted for OpenSL ES usage!");
« no previous file with comments | « no previous file | webrtc/modules/audio_device/android/opensles_player.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698