mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-20 00:29:11 +01:00
Default to sofware AEC.
This commit is contained in:
committed by
Alex Hart
parent
0aabf9945f
commit
47134e19f1
@@ -0,0 +1,33 @@
|
||||
package org.thoughtcrime.securesms.service.webrtc
|
||||
|
||||
import android.os.Build
|
||||
import org.signal.ringrtc.CallManager.AudioProcessingMethod
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore
|
||||
import org.thoughtcrime.securesms.util.FeatureFlags
|
||||
|
||||
/**
|
||||
* Utility class to determine which AEC method RingRTC should use.
|
||||
*/
|
||||
object AudioProcessingMethodSelector {
|
||||
|
||||
private val hardwareModels: Set<String> by lazy {
|
||||
FeatureFlags.hardwareAecModels()
|
||||
.split(",")
|
||||
.map { it.trim() }
|
||||
.filter { it.isNotEmpty() }
|
||||
.toSet()
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun get(): AudioProcessingMethod {
|
||||
if (SignalStore.internalValues().audioProcessingMethod() != AudioProcessingMethod.Default) {
|
||||
return SignalStore.internalValues().audioProcessingMethod()
|
||||
}
|
||||
|
||||
return when {
|
||||
FeatureFlags.forceDefaultAec() -> AudioProcessingMethod.Default
|
||||
hardwareModels.contains(Build.MODEL) -> AudioProcessingMethod.ForceHardware
|
||||
else -> AudioProcessingMethod.ForceSoftware
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -46,7 +46,7 @@ class GroupNetworkUnavailableActionProcessor extends WebRtcActionProcessor {
|
||||
GroupCall groupCall = webRtcInteractor.getCallManager().createGroupCall(groupId,
|
||||
SignalStore.internalValues().groupCallingServer(),
|
||||
new byte[0],
|
||||
SignalStore.internalValues().audioProcessingMethod(),
|
||||
AudioProcessingMethodSelector.get(),
|
||||
webRtcInteractor.getGroupCallObserver());
|
||||
|
||||
return currentState.builder()
|
||||
|
||||
@@ -45,7 +45,7 @@ public class GroupPreJoinActionProcessor extends GroupActionProcessor {
|
||||
GroupCall groupCall = webRtcInteractor.getCallManager().createGroupCall(groupId,
|
||||
SignalStore.internalValues().groupCallingServer(),
|
||||
new byte[0],
|
||||
SignalStore.internalValues().audioProcessingMethod(),
|
||||
AudioProcessingMethodSelector.get(),
|
||||
webRtcInteractor.getGroupCallObserver());
|
||||
|
||||
try {
|
||||
|
||||
@@ -68,7 +68,7 @@ public class IncomingCallActionProcessor extends DeviceAwareActionProcessor {
|
||||
webRtcInteractor.getCallManager().proceed(activePeer.getCallId(),
|
||||
context,
|
||||
videoState.getLockableEglBase().require(),
|
||||
SignalStore.internalValues().audioProcessingMethod(),
|
||||
AudioProcessingMethodSelector.get(),
|
||||
videoState.requireLocalSink(),
|
||||
callParticipant.getVideoSink(),
|
||||
videoState.requireCamera(),
|
||||
|
||||
@@ -170,7 +170,7 @@ public final class IncomingGroupCallActionProcessor extends DeviceAwareActionPro
|
||||
GroupCall groupCall = webRtcInteractor.getCallManager().createGroupCall(groupId,
|
||||
SignalStore.internalValues().groupCallingServer(),
|
||||
new byte[0],
|
||||
SignalStore.internalValues().audioProcessingMethod(),
|
||||
AudioProcessingMethodSelector.get(),
|
||||
webRtcInteractor.getGroupCallObserver());
|
||||
|
||||
try {
|
||||
|
||||
@@ -14,7 +14,6 @@ import org.thoughtcrime.securesms.crypto.IdentityKeyUtil;
|
||||
import org.thoughtcrime.securesms.database.SignalDatabase;
|
||||
import org.thoughtcrime.securesms.events.CallParticipant;
|
||||
import org.thoughtcrime.securesms.events.WebRtcViewModel;
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientUtil;
|
||||
import org.thoughtcrime.securesms.ringrtc.RemotePeer;
|
||||
@@ -106,7 +105,7 @@ public class OutgoingCallActionProcessor extends DeviceAwareActionProcessor {
|
||||
webRtcInteractor.getCallManager().proceed(activePeer.getCallId(),
|
||||
context,
|
||||
videoState.getLockableEglBase().require(),
|
||||
SignalStore.internalValues().audioProcessingMethod(),
|
||||
AudioProcessingMethodSelector.get(),
|
||||
videoState.requireLocalSink(),
|
||||
callParticipant.getVideoSink(),
|
||||
videoState.requireCamera(),
|
||||
|
||||
Reference in New Issue
Block a user