mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-11 19:03:39 +00:00
Update to webrtc M64
This commit is contained in:
parent
b17451b867
commit
a798f97aa3
@ -73,7 +73,7 @@ dependencies {
|
||||
compile 'org.whispersystems:jobmanager:1.0.2'
|
||||
compile 'org.whispersystems:libpastelog:1.0.7'
|
||||
compile 'org.whispersystems:signal-service-android:2.6.12'
|
||||
compile 'org.whispersystems:webrtc-android:M63'
|
||||
compile 'org.whispersystems:webrtc-android:M64'
|
||||
|
||||
compile "me.leolin:ShortcutBadger:1.1.16"
|
||||
compile 'se.emilsjolander:stickylistheaders:2.7.0'
|
||||
@ -161,7 +161,7 @@ dependencyVerification {
|
||||
'org.whispersystems:jobmanager:506f679fc2fcf7bb6d10f00f41d6f6ea0abf75c70dc95b913398661ad538a181',
|
||||
'org.whispersystems:libpastelog:bb331d9a98240fc139101128ba836c1edec3c40e000597cdbb29ebf4cbf34d88',
|
||||
'org.whispersystems:signal-service-android:6d29df68961b7fabb119b50afec3c599b66d2cb85cc6e92b40eb27861bb7e4b9',
|
||||
'org.whispersystems:webrtc-android:3f5c39b710797fbda9fe6015cb6a8667ab2fc14ef2c1eb9be832a53b368aa110',
|
||||
'org.whispersystems:webrtc-android:ed297e8b795dad9658cf306c2aa0f7d296c65f0997a2ac4353fd0157910acc12',
|
||||
'me.leolin:ShortcutBadger:e3cb3e7625892129b0c92dd5e4bc649faffdd526d5af26d9c45ee31ff8851774',
|
||||
'se.emilsjolander:stickylistheaders:a08ca948aa6b220f09d82f16bbbac395f6b78897e9eeac6a9f0b0ba755928eeb',
|
||||
'com.jpardogo.materialtabstrip:library:c6ef812fba4f74be7dc4a905faa4c2908cba261a94c13d4f96d5e67e4aad4aaa',
|
||||
@ -224,7 +224,6 @@ dependencyVerification {
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
android {
|
||||
flavorDimensions "none"
|
||||
compileSdkVersion 27
|
||||
|
@ -16,6 +16,7 @@
|
||||
*/
|
||||
package org.thoughtcrime.securesms;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
@ -40,6 +41,7 @@ import org.thoughtcrime.securesms.service.RotateSignedPreKeyListener;
|
||||
import org.thoughtcrime.securesms.service.UpdateApkRefreshListener;
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
import org.webrtc.PeerConnectionFactory;
|
||||
import org.webrtc.PeerConnectionFactory.InitializationOptions;
|
||||
import org.webrtc.voiceengine.WebRtcAudioManager;
|
||||
import org.webrtc.voiceengine.WebRtcAudioUtils;
|
||||
import org.whispersystems.jobqueue.JobManager;
|
||||
@ -171,22 +173,23 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc
|
||||
add("Pixel XL");
|
||||
}};
|
||||
|
||||
if (Build.VERSION.SDK_INT >= 11) {
|
||||
if (HARDWARE_AEC_BLACKLIST.contains(Build.MODEL)) {
|
||||
WebRtcAudioUtils.setWebRtcBasedAcousticEchoCanceler(true);
|
||||
}
|
||||
|
||||
if (!OPEN_SL_ES_WHITELIST.contains(Build.MODEL)) {
|
||||
WebRtcAudioManager.setBlacklistDeviceForOpenSLESUsage(true);
|
||||
}
|
||||
|
||||
PeerConnectionFactory.initializeAndroidGlobals(this, true, true, true);
|
||||
if (HARDWARE_AEC_BLACKLIST.contains(Build.MODEL)) {
|
||||
WebRtcAudioUtils.setWebRtcBasedAcousticEchoCanceler(true);
|
||||
}
|
||||
|
||||
if (!OPEN_SL_ES_WHITELIST.contains(Build.MODEL)) {
|
||||
WebRtcAudioManager.setBlacklistDeviceForOpenSLESUsage(true);
|
||||
}
|
||||
|
||||
PeerConnectionFactory.initialize(InitializationOptions.builder(this)
|
||||
.setEnableVideoHwAcceleration(true)
|
||||
.createInitializationOptions());
|
||||
} catch (UnsatisfiedLinkError e) {
|
||||
Log.w(TAG, e);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
private void initializeCircumvention() {
|
||||
AsyncTask<Void, Void, Void> task = new AsyncTask<Void, Void, Void>() {
|
||||
@Override
|
||||
|
@ -584,6 +584,7 @@ public class WebRtcCallService extends Service implements InjectableType, PeerCo
|
||||
|
||||
setCallInProgressNotification(TYPE_ESTABLISHED, recipient);
|
||||
|
||||
this.peerConnection.setCommunicationMode();
|
||||
this.peerConnection.setAudioEnabled(microphoneEnabled);
|
||||
this.peerConnection.setVideoEnabled(localVideoEnabled);
|
||||
|
||||
@ -1044,7 +1045,7 @@ public class WebRtcCallService extends Service implements InjectableType, PeerCo
|
||||
}
|
||||
|
||||
if (stream.videoTracks != null && stream.videoTracks.size() == 1) {
|
||||
VideoTrack videoTrack = stream.videoTracks.getFirst();
|
||||
VideoTrack videoTrack = stream.videoTracks.get(0);
|
||||
videoTrack.setEnabled(true);
|
||||
videoTrack.addRenderer(new VideoRenderer(remoteRenderer));
|
||||
}
|
||||
|
@ -69,6 +69,9 @@ public class PeerConnectionWrapper {
|
||||
audioConstraints.optional.add(new MediaConstraints.KeyValuePair("DtlsSrtpKeyAgreement", "true"));
|
||||
|
||||
this.peerConnection = factory.createPeerConnection(configuration, constraints, observer);
|
||||
this.peerConnection.setAudioPlayout(false);
|
||||
this.peerConnection.setAudioRecording(false);
|
||||
|
||||
this.videoCapturer = createVideoCapturer(context);
|
||||
|
||||
MediaStream mediaStream = factory.createLocalMediaStream("ARDAMS");
|
||||
@ -107,6 +110,11 @@ public class PeerConnectionWrapper {
|
||||
}
|
||||
}
|
||||
|
||||
public void setCommunicationMode() {
|
||||
this.peerConnection.setAudioPlayout(true);
|
||||
this.peerConnection.setAudioRecording(true);
|
||||
}
|
||||
|
||||
public void setAudioEnabled(boolean enabled) {
|
||||
this.audioTrack.setEnabled(enabled);
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ import org.thoughtcrime.securesms.util.ServiceUtil;
|
||||
|
||||
public class SignalAudioManager {
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private static final String TAG = SignalAudioManager.class.getSimpleName();
|
||||
|
||||
private final Context context;
|
||||
@ -61,11 +62,7 @@ public class SignalAudioManager {
|
||||
audioManager.setSpeakerphoneOn(false);
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
|
||||
audioManager.setMode(AudioManager.MODE_IN_COMMUNICATION);
|
||||
} else {
|
||||
audioManager.setMode(AudioManager.MODE_IN_CALL);
|
||||
}
|
||||
audioManager.setMode(AudioManager.MODE_IN_COMMUNICATION);
|
||||
|
||||
outgoingRinger.start(type);
|
||||
}
|
||||
@ -80,11 +77,7 @@ public class SignalAudioManager {
|
||||
incomingRinger.stop();
|
||||
outgoingRinger.stop();
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
|
||||
audioManager.setMode(AudioManager.MODE_IN_COMMUNICATION);
|
||||
} else {
|
||||
audioManager.setMode(AudioManager.MODE_IN_CALL);
|
||||
}
|
||||
audioManager.setMode(AudioManager.MODE_IN_COMMUNICATION);
|
||||
|
||||
if (!preserveSpeakerphone) {
|
||||
audioManager.setSpeakerphoneOn(false);
|
||||
|
Loading…
x
Reference in New Issue
Block a user