Add the url attribute to the IceCandidate (Java Wrapper)
The url of the ICE server is added to the IceCandiate class.
This can be used to tell which server this candidate was gathered from.
BUG=webrtc:7128
Review-Url: https://codereview.webrtc.org/2690593002
Cr-Original-Commit-Position: refs/heads/master@{#16593}
Committed: 8586c8ee88
Review-Url: https://codereview.webrtc.org/2690593002
Cr-Commit-Position: refs/heads/master@{#16615}
This commit is contained in:
@ -187,6 +187,7 @@ public class DirectRTCClient implements AppRTCClient, TCPChannelClient.TCPChanne
|
||||
jsonPut(json, "label", candidate.sdpMLineIndex);
|
||||
jsonPut(json, "id", candidate.sdpMid);
|
||||
jsonPut(json, "candidate", candidate.sdp);
|
||||
jsonPut(json, "url", candidate.serverUrl);
|
||||
|
||||
if (roomState != ConnectionState.CONNECTED) {
|
||||
reportError("Sending ICE candidate in non connected state.");
|
||||
@ -336,12 +337,13 @@ public class DirectRTCClient implements AppRTCClient, TCPChannelClient.TCPChanne
|
||||
jsonPut(json, "label", candidate.sdpMLineIndex);
|
||||
jsonPut(json, "id", candidate.sdpMid);
|
||||
jsonPut(json, "candidate", candidate.sdp);
|
||||
jsonPut(json, "url", candidate.serverUrl);
|
||||
return json;
|
||||
}
|
||||
|
||||
// Converts a JSON candidate to a Java object.
|
||||
private static IceCandidate toJavaCandidate(JSONObject json) throws JSONException {
|
||||
return new IceCandidate(
|
||||
json.getString("id"), json.getInt("label"), json.getString("candidate"));
|
||||
return new IceCandidate(json.getString("id"), json.getInt("label"), json.getString("candidate"),
|
||||
json.getString("url"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -115,8 +115,8 @@ public class RoomParametersFetcher {
|
||||
offerSdp = new SessionDescription(
|
||||
SessionDescription.Type.fromCanonicalForm(messageType), message.getString("sdp"));
|
||||
} else if (messageType.equals("candidate")) {
|
||||
IceCandidate candidate = new IceCandidate(
|
||||
message.getString("id"), message.getInt("label"), message.getString("candidate"));
|
||||
IceCandidate candidate = new IceCandidate(message.getString("id"),
|
||||
message.getInt("label"), message.getString("candidate"), message.getString("url"));
|
||||
iceCandidates.add(candidate);
|
||||
} else {
|
||||
Log.e(TAG, "Unknown message: " + messageString);
|
||||
|
||||
@ -408,12 +408,13 @@ public class WebSocketRTCClient implements AppRTCClient, WebSocketChannelEvents
|
||||
jsonPut(json, "label", candidate.sdpMLineIndex);
|
||||
jsonPut(json, "id", candidate.sdpMid);
|
||||
jsonPut(json, "candidate", candidate.sdp);
|
||||
jsonPut(json, "url", candidate.serverUrl);
|
||||
return json;
|
||||
}
|
||||
|
||||
// Converts a JSON candidate to a Java object.
|
||||
IceCandidate toJavaCandidate(JSONObject json) throws JSONException {
|
||||
return new IceCandidate(
|
||||
json.getString("id"), json.getInt("label"), json.getString("candidate"));
|
||||
return new IceCandidate(json.getString("id"), json.getInt("label"), json.getString("candidate"),
|
||||
json.getString("url"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user