Chromium Code Reviews| Index: webrtc/examples/androidapp/src/org/appspot/apprtc/PeerConnectionClient.java |
| diff --git a/webrtc/examples/androidapp/src/org/appspot/apprtc/PeerConnectionClient.java b/webrtc/examples/androidapp/src/org/appspot/apprtc/PeerConnectionClient.java |
| index eb4d95906795f37a0ceb999185b6b78994826185..ea29fed60760f6080de3e6db0e3e35ffebf82de9 100644 |
| --- a/webrtc/examples/androidapp/src/org/appspot/apprtc/PeerConnectionClient.java |
| +++ b/webrtc/examples/androidapp/src/org/appspot/apprtc/PeerConnectionClient.java |
| @@ -28,6 +28,7 @@ import org.webrtc.MediaConstraints.KeyValuePair; |
| import org.webrtc.MediaStream; |
| import org.webrtc.PeerConnection; |
| import org.webrtc.PeerConnection.IceConnectionState; |
| +import org.webrtc.PeerConnection.ContinualGatheringPolicy; |
| import org.webrtc.PeerConnectionFactory; |
| import org.webrtc.SdpObserver; |
| import org.webrtc.SessionDescription; |
| @@ -184,6 +185,11 @@ public class PeerConnectionClient { |
| public void onIceCandidate(final IceCandidate candidate); |
| /** |
| + * Callback fired once local ICE candidates are removed. |
| + */ |
| + public void onIceCandidatesRemoved(final IceCandidate[] candidates); |
| + |
| + /** |
| * Callback fired once connection is established (IceConnectionState is |
| * CONNECTED). |
| */ |
| @@ -454,6 +460,8 @@ public class PeerConnectionClient { |
| rtcConfig.tcpCandidatePolicy = PeerConnection.TcpCandidatePolicy.DISABLED; |
| rtcConfig.bundlePolicy = PeerConnection.BundlePolicy.MAXBUNDLE; |
| rtcConfig.rtcpMuxPolicy = PeerConnection.RtcpMuxPolicy.REQUIRE; |
| + rtcConfig.continualGatheringPolicy = |
| + ContinualGatheringPolicy.GATHER_CONTINUALLY; |
|
pthatcher1
2016/03/01 23:51:54
Should we put this in a different CL?
honghaiz3
2016/03/02 19:06:40
Done.
|
| // Use ECDSA encryption. |
| rtcConfig.keyType = PeerConnection.KeyType.ECDSA; |
| @@ -655,6 +663,23 @@ public class PeerConnectionClient { |
| }); |
| } |
| + public void removeRemoteIceCandidates(final IceCandidate[] candidates) { |
| + executor.execute(new Runnable() { |
| + @Override |
| + public void run() { |
| + if (peerConnection == null || isError) { |
| + return; |
| + } |
| + // Drain the queued remote candidates if there is any so that |
| + // they are processed in the proper order. |
| + if (queuedRemoteCandidates != null) { |
| + drainCandidates(); |
| + } |
| + peerConnection.removeIceCandidates(candidates); |
| + } |
| + }); |
| + } |
| + |
| public void setRemoteDescription(final SessionDescription sdp) { |
| executor.execute(new Runnable() { |
| @Override |
| @@ -924,6 +949,16 @@ public class PeerConnectionClient { |
| } |
| @Override |
| + public void onIceCandidatesRemoved(final IceCandidate[] candidates) { |
| + executor.execute(new Runnable() { |
| + @Override |
| + public void run() { |
| + events.onIceCandidatesRemoved(candidates); |
| + } |
| + }); |
| + } |
| + |
| + @Override |
| public void onSignalingChange( |
| PeerConnection.SignalingState newState) { |
| Log.d(TAG, "SignalingState: " + newState); |