addIceCandidate with callback into Android's SDK.

Bug: webrtc:12609
Change-Id: I059a246f5ade201b6a8decac264a8dd79fef3f9a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/212740
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Xavier Lepaul‎ <xalep@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33681}
This commit is contained in:
Yura Yaroshevich
2021-04-08 16:56:56 +03:00
committed by Commit Bot
parent f075917cb0
commit 1cdeb0a56e
7 changed files with 148 additions and 2 deletions

View File

@ -36,6 +36,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.appspot.apprtc.AppRTCClient.SignalingParameters;
import org.appspot.apprtc.RecordedAudioToFileController;
import org.webrtc.AddIceObserver;
import org.webrtc.AudioSource;
import org.webrtc.AudioTrack;
import org.webrtc.CameraVideoCapturer;
@ -824,7 +825,16 @@ public class PeerConnectionClient {
if (queuedRemoteCandidates != null) {
queuedRemoteCandidates.add(candidate);
} else {
peerConnection.addIceCandidate(candidate);
peerConnection.addIceCandidate(candidate, new AddIceObserver() {
@Override
public void onAddSuccess() {
Log.d(TAG, "Candidate " + candidate + " successfully added.");
}
@Override
public void onAddFailure(String error) {
Log.d(TAG, "Candidate " + candidate + " addition failed: " + error);
}
});
}
}
});
@ -1146,7 +1156,16 @@ public class PeerConnectionClient {
if (queuedRemoteCandidates != null) {
Log.d(TAG, "Add " + queuedRemoteCandidates.size() + " remote candidates");
for (IceCandidate candidate : queuedRemoteCandidates) {
peerConnection.addIceCandidate(candidate);
peerConnection.addIceCandidate(candidate, new AddIceObserver() {
@Override
public void onAddSuccess() {
Log.d(TAG, "Candidate " + candidate + " successfully added.");
}
@Override
public void onAddFailure(String error) {
Log.d(TAG, "Candidate " + candidate + " addition failed: " + error);
}
});
}
queuedRemoteCandidates = null;
}