From fbd3f3db3f6eb60f1aa9f7747e6deb127278257e Mon Sep 17 00:00:00 2001 From: Moxie Marlinspike Date: Tue, 24 Jul 2018 17:04:55 -0700 Subject: [PATCH] Update webrtc to M68 --- build.gradle | 4 ++-- .../thoughtcrime/securesms/service/WebRtcCallService.java | 5 +++-- .../thoughtcrime/securesms/webrtc/PeerConnectionWrapper.java | 5 +++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index dfea2726e9..71a3605764 100644 --- a/build.gradle +++ b/build.gradle @@ -80,7 +80,7 @@ dependencies { exclude group: 'com.squareup.okhttp3', module: 'okhttp' } compile 'org.whispersystems:signal-service-android:2.7.6' - compile 'org.whispersystems:webrtc-android:M67' + compile 'org.whispersystems:webrtc-android:M68' compile "me.leolin:ShortcutBadger:1.1.16" compile 'se.emilsjolander:stickylistheaders:2.7.0' @@ -174,7 +174,7 @@ dependencyVerification { 'com.google.android.exoplayer:exoplayer:955085aa611a8f7cf6c61b88ae03d1a392f4ad94c9bfbc153f3dedb9ffb14718', 'org.whispersystems:libpastelog:fe56b4db9ec743c8b565e3e4caa9228fafe132dc0bf82000d6e359b97a81177c', 'org.whispersystems:signal-service-android:823eed29e64fb0aa30d2078cb5ec0245e2a0713a4028121329c5c28788ef27f8', - 'org.whispersystems:webrtc-android:235b3b79f0ea917e4cda447a9919cb8e17a74ae59da6fb8252503b787fe0828f', + 'org.whispersystems:webrtc-android:66cb312eb024eaf6aa93e662d37d0c46632e049d47a2dcc9c291207589ee7a43', 'me.leolin:ShortcutBadger:e3cb3e7625892129b0c92dd5e4bc649faffdd526d5af26d9c45ee31ff8851774', 'se.emilsjolander:stickylistheaders:a08ca948aa6b220f09d82f16bbbac395f6b78897e9eeac6a9f0b0ba755928eeb', 'com.jpardogo.materialtabstrip:library:c6ef812fba4f74be7dc4a905faa4c2908cba261a94c13d4f96d5e67e4aad4aaa', diff --git a/src/org/thoughtcrime/securesms/service/WebRtcCallService.java b/src/org/thoughtcrime/securesms/service/WebRtcCallService.java index dc517e4183..243b9cc545 100644 --- a/src/org/thoughtcrime/securesms/service/WebRtcCallService.java +++ b/src/org/thoughtcrime/securesms/service/WebRtcCallService.java @@ -66,6 +66,7 @@ import org.webrtc.PeerConnection; import org.webrtc.PeerConnectionFactory; import org.webrtc.RtpReceiver; import org.webrtc.SessionDescription; +import org.webrtc.SurfaceEglRenderer; import org.webrtc.SurfaceViewRenderer; import org.webrtc.VideoRenderer; import org.webrtc.VideoTrack; @@ -285,7 +286,7 @@ public class WebRtcCallService extends Service implements InjectableType, this.callState = CallState.STATE_IDLE; this.lockManager = new LockManager(this); - this.peerConnectionFactory = new PeerConnectionFactory(new PeerConnectionFactoryOptions()); + this.peerConnectionFactory = PeerConnectionFactory.builder().setOptions(new PeerConnectionFactoryOptions()).createPeerConnectionFactory(); this.audioManager = new SignalAudioManager(this); this.bluetoothStateManager = new BluetoothStateManager(this, this); this.messageSender.setSoTimeoutMillis(TimeUnit.SECONDS.toMillis(10)); @@ -1098,7 +1099,7 @@ public class WebRtcCallService extends Service implements InjectableType, if (stream.videoTracks != null && stream.videoTracks.size() == 1) { VideoTrack videoTrack = stream.videoTracks.get(0); videoTrack.setEnabled(true); - videoTrack.addRenderer(new VideoRenderer(remoteRenderer)); + videoTrack.addSink(remoteRenderer); } } diff --git a/src/org/thoughtcrime/securesms/webrtc/PeerConnectionWrapper.java b/src/org/thoughtcrime/securesms/webrtc/PeerConnectionWrapper.java index f48c399906..3e9191ecd8 100644 --- a/src/org/thoughtcrime/securesms/webrtc/PeerConnectionWrapper.java +++ b/src/org/thoughtcrime/securesms/webrtc/PeerConnectionWrapper.java @@ -22,6 +22,7 @@ import org.webrtc.PeerConnectionFactory; import org.webrtc.SdpObserver; import org.webrtc.SessionDescription; import org.webrtc.VideoRenderer; +import org.webrtc.VideoSink; import org.webrtc.VideoSource; import org.webrtc.VideoTrack; @@ -49,7 +50,7 @@ public class PeerConnectionWrapper { public PeerConnectionWrapper(@NonNull Context context, @NonNull PeerConnectionFactory factory, @NonNull PeerConnection.Observer observer, - @NonNull VideoRenderer.Callbacks localRenderer, + @NonNull VideoSink localRenderer, @NonNull List turnServers, @NonNull CameraEventListener cameraEventListener, boolean hideIp) @@ -88,7 +89,7 @@ public class PeerConnectionWrapper { this.videoSource = factory.createVideoSource(camera.capturer); this.videoTrack = factory.createVideoTrack("ARDAMSv0", videoSource); - this.videoTrack.addRenderer(new VideoRenderer(localRenderer)); + this.videoTrack.addSink(localRenderer); this.videoTrack.setEnabled(false); mediaStream.addTrack(videoTrack); } else {