Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(347)

Unified Diff: webrtc/examples/androidapp/src/org/appspot/apprtc/PeerConnectionClient.java

Issue 1648813004: Remove candidates when doing continual gathering (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Delete ice_candidate when it is removed and add a test Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..422e3bc0ea83c0f29c930021f2abc48efb33dcc8 100644
--- a/webrtc/examples/androidapp/src/org/appspot/apprtc/PeerConnectionClient.java
+++ b/webrtc/examples/androidapp/src/org/appspot/apprtc/PeerConnectionClient.java
@@ -184,6 +184,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).
*/
@@ -655,6 +660,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) {
AlexG 2016/03/11 19:18:52 Just call drainCandidates() - check if (queuedRemo
honghaiz3 2016/03/11 19:47:14 Done. Thanks!
+ drainCandidates();
+ }
+ peerConnection.removeIceCandidates(candidates);
+ }
+ });
+ }
+
public void setRemoteDescription(final SessionDescription sdp) {
executor.execute(new Runnable() {
@Override
@@ -924,6 +946,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);

Powered by Google App Engine
This is Rietveld 408576698