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-Commit-Position: refs/heads/master@{#16593}
This commit is contained in:
zhihuang
2017-02-13 14:04:50 -08:00
committed by Commit bot
parent 02c739f4ef
commit 8586c8ee88
6 changed files with 23 additions and 13 deletions

View File

@ -245,12 +245,16 @@ class PCOJava : public PeerConnectionObserver {
std::string sdp;
RTC_CHECK(candidate->ToString(&sdp)) << "got so far: " << sdp;
jclass candidate_class = FindClass(jni(), "org/webrtc/IceCandidate");
jmethodID ctor = GetMethodID(jni(), candidate_class,
"<init>", "(Ljava/lang/String;ILjava/lang/String;)V");
jmethodID ctor = GetMethodID(
jni(), candidate_class, "<init>",
"(Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;)V");
jstring j_mid = JavaStringFromStdString(jni(), candidate->sdp_mid());
jstring j_sdp = JavaStringFromStdString(jni(), sdp);
jobject j_candidate = jni()->NewObject(candidate_class, ctor, j_mid,
candidate->sdp_mline_index(), j_sdp);
jstring j_url =
JavaStringFromStdString(jni(), candidate->candidate().url());
jobject j_candidate =
jni()->NewObject(candidate_class, ctor, j_mid,
candidate->sdp_mline_index(), j_sdp, j_url);
CHECK_EXCEPTION(jni()) << "error during NewObject";
jmethodID m = GetMethodID(jni(), *j_observer_class_,
"onIceCandidate", "(Lorg/webrtc/IceCandidate;)V");