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

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

Issue 2402883003: Removes usage of hardware AGC and any related APIs on Android (Closed)
Patch Set: Created 4 years, 2 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/android/java/src/org/webrtc/voiceengine/WebRtcAudioRecord.java ('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/android/java/src/org/webrtc/voiceengine/WebRtcAudioUtils.java
diff --git a/webrtc/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioUtils.java b/webrtc/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioUtils.java
index 420633d422fd3e7937c601f5c81e43751a941e00..677569c6945a372bdb618fa306595c31ae5f0eae 100644
--- a/webrtc/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioUtils.java
+++ b/webrtc/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioUtils.java
@@ -39,9 +39,6 @@ public final class WebRtcAudioUtils {
"ONE A2005", // OnePlus 2
"MotoG3", // Moto G (3rd Generation)
};
- private static final String[] BLACKLISTED_AGC_MODELS = new String[] {
- "Nexus 10", "Nexus 9",
- };
private static final String[] BLACKLISTED_NS_MODELS = new String[] {
"Nexus 10", "Nexus 9",
"ONE A2005", // OnePlus 2
@@ -54,9 +51,9 @@ public final class WebRtcAudioUtils {
// Set to true if setDefaultSampleRateHz() has been called.
private static boolean isDefaultSampleRateOverridden = false;
- // By default, utilize hardware based audio effects when available.
+ // By default, utilize hardware based audio effects for AEC and NS when
+ // available.
private static boolean useWebRtcBasedAcousticEchoCanceler = false;
- private static boolean useWebRtcBasedAutomaticGainControl = false;
private static boolean useWebRtcBasedNoiseSuppressor = false;
// Call these methods if any hardware based effect shall be replaced by a
@@ -64,12 +61,13 @@ public final class WebRtcAudioUtils {
public static synchronized void setWebRtcBasedAcousticEchoCanceler(boolean enable) {
useWebRtcBasedAcousticEchoCanceler = enable;
}
- public static synchronized void setWebRtcBasedAutomaticGainControl(boolean enable) {
- useWebRtcBasedAutomaticGainControl = enable;
- }
public static synchronized void setWebRtcBasedNoiseSuppressor(boolean enable) {
useWebRtcBasedNoiseSuppressor = enable;
}
+ public static synchronized void setWebRtcBasedAutomaticGainControl(boolean enable) {
+ // TODO(henrika): deprecated; remove when no longer used by any client.
+ Logging.w(TAG, "setWebRtcBasedAutomaticGainControl() is deprecated");
+ }
public static synchronized boolean useWebRtcBasedAcousticEchoCanceler() {
if (useWebRtcBasedAcousticEchoCanceler) {
@@ -77,20 +75,19 @@ public final class WebRtcAudioUtils {
}
return useWebRtcBasedAcousticEchoCanceler;
}
- public static synchronized boolean useWebRtcBasedAutomaticGainControl() {
- if (useWebRtcBasedAutomaticGainControl) {
- Logging.w(TAG, "Overriding default behavior; now using WebRTC AGC!");
- }
- return useWebRtcBasedAutomaticGainControl;
- }
public static synchronized boolean useWebRtcBasedNoiseSuppressor() {
if (useWebRtcBasedNoiseSuppressor) {
Logging.w(TAG, "Overriding default behavior; now using WebRTC NS!");
}
return useWebRtcBasedNoiseSuppressor;
}
+ // TODO(henrika): deprecated; remove when no longer used by any client.
+ public static synchronized boolean useWebRtcBasedAutomaticGainControl() {
+ // Always return true here to avoid trying to use any built-in AGC.
+ return true;
+ }
- // Returns true if the device supports an audio effect (AEC, AGC or NS).
+ // Returns true if the device supports an audio effect (AEC or NS).
// Four conditions must be fulfilled if functions are to return true:
// 1) the platform must support the built-in (HW) effect,
// 2) explicit use (override) of a WebRTC based version must not be set,
@@ -99,12 +96,14 @@ public final class WebRtcAudioUtils {
public static boolean isAcousticEchoCancelerSupported() {
return WebRtcAudioEffects.canUseAcousticEchoCanceler();
}
- public static boolean isAutomaticGainControlSupported() {
- return WebRtcAudioEffects.canUseAutomaticGainControl();
- }
public static boolean isNoiseSuppressorSupported() {
return WebRtcAudioEffects.canUseNoiseSuppressor();
}
+ // TODO(henrika): deprecated; remove when no longer used by any client.
+ public static boolean isAutomaticGainControlSupported() {
+ // Always return false here to avoid trying to use any built-in AGC.
+ return false;
+ }
// Call this method if the default handling of querying the native sample
// rate shall be overridden. Can be useful on some devices where the
@@ -126,10 +125,6 @@ public final class WebRtcAudioUtils {
return Arrays.asList(WebRtcAudioUtils.BLACKLISTED_AEC_MODELS);
}
- public static List<String> getBlackListedModelsForAgcUsage() {
- return Arrays.asList(WebRtcAudioUtils.BLACKLISTED_AGC_MODELS);
- }
-
public static List<String> getBlackListedModelsForNsUsage() {
return Arrays.asList(WebRtcAudioUtils.BLACKLISTED_NS_MODELS);
}
« no previous file with comments | « webrtc/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioRecord.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698