-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0aabf99
commit 47134e1
Showing
8 changed files
with
62 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
app/src/main/java/org/thoughtcrime/securesms/service/webrtc/AudioProcessingMethodSelector.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters