OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2017 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 | 342 |
343 RTC_CHECK(false) << "Unexpected TlsCertPolicy enum_name " << enum_name; | 343 RTC_CHECK(false) << "Unexpected TlsCertPolicy enum_name " << enum_name; |
344 return PeerConnectionInterface::kTlsCertPolicySecure; | 344 return PeerConnectionInterface::kTlsCertPolicySecure; |
345 } | 345 } |
346 | 346 |
347 void JavaToNativeIceServers(JNIEnv* jni, | 347 void JavaToNativeIceServers(JNIEnv* jni, |
348 jobject j_ice_servers, | 348 jobject j_ice_servers, |
349 PeerConnectionInterface::IceServers* ice_servers) { | 349 PeerConnectionInterface::IceServers* ice_servers) { |
350 for (jobject j_ice_server : Iterable(jni, j_ice_servers)) { | 350 for (jobject j_ice_server : Iterable(jni, j_ice_servers)) { |
351 jclass j_ice_server_class = GetObjectClass(jni, j_ice_server); | 351 jclass j_ice_server_class = GetObjectClass(jni, j_ice_server); |
352 jfieldID j_ice_server_uri_id = | 352 jfieldID j_ice_server_urls_id = |
353 GetFieldID(jni, j_ice_server_class, "uri", "Ljava/lang/String;"); | 353 GetFieldID(jni, j_ice_server_class, "urls", "Ljava/util/List;"); |
354 jfieldID j_ice_server_username_id = | 354 jfieldID j_ice_server_username_id = |
355 GetFieldID(jni, j_ice_server_class, "username", "Ljava/lang/String;"); | 355 GetFieldID(jni, j_ice_server_class, "username", "Ljava/lang/String;"); |
356 jfieldID j_ice_server_password_id = | 356 jfieldID j_ice_server_password_id = |
357 GetFieldID(jni, j_ice_server_class, "password", "Ljava/lang/String;"); | 357 GetFieldID(jni, j_ice_server_class, "password", "Ljava/lang/String;"); |
358 jfieldID j_ice_server_tls_cert_policy_id = | 358 jfieldID j_ice_server_tls_cert_policy_id = |
359 GetFieldID(jni, j_ice_server_class, "tlsCertPolicy", | 359 GetFieldID(jni, j_ice_server_class, "tlsCertPolicy", |
360 "Lorg/webrtc/PeerConnection$TlsCertPolicy;"); | 360 "Lorg/webrtc/PeerConnection$TlsCertPolicy;"); |
361 jobject j_ice_server_tls_cert_policy = | 361 jobject j_ice_server_tls_cert_policy = |
362 GetObjectField(jni, j_ice_server, j_ice_server_tls_cert_policy_id); | 362 GetObjectField(jni, j_ice_server, j_ice_server_tls_cert_policy_id); |
363 jfieldID j_ice_server_hostname_id = | 363 jfieldID j_ice_server_hostname_id = |
364 GetFieldID(jni, j_ice_server_class, "hostname", "Ljava/lang/String;"); | 364 GetFieldID(jni, j_ice_server_class, "hostname", "Ljava/lang/String;"); |
365 jfieldID j_ice_server_tls_alpn_protocols_id = GetFieldID( | 365 jfieldID j_ice_server_tls_alpn_protocols_id = GetFieldID( |
366 jni, j_ice_server_class, "tlsAlpnProtocols", "Ljava/util/List;"); | 366 jni, j_ice_server_class, "tlsAlpnProtocols", "Ljava/util/List;"); |
367 jfieldID j_ice_server_tls_elliptic_curves_id = GetFieldID( | 367 jfieldID j_ice_server_tls_elliptic_curves_id = GetFieldID( |
368 jni, j_ice_server_class, "tlsEllipticCurves", "Ljava/util/List;"); | 368 jni, j_ice_server_class, "tlsEllipticCurves", "Ljava/util/List;"); |
369 jstring uri = reinterpret_cast<jstring>( | 369 jobject urls = GetObjectField(jni, j_ice_server, j_ice_server_urls_id); |
370 GetObjectField(jni, j_ice_server, j_ice_server_uri_id)); | |
371 jstring username = reinterpret_cast<jstring>( | 370 jstring username = reinterpret_cast<jstring>( |
372 GetObjectField(jni, j_ice_server, j_ice_server_username_id)); | 371 GetObjectField(jni, j_ice_server, j_ice_server_username_id)); |
373 jstring password = reinterpret_cast<jstring>( | 372 jstring password = reinterpret_cast<jstring>( |
374 GetObjectField(jni, j_ice_server, j_ice_server_password_id)); | 373 GetObjectField(jni, j_ice_server, j_ice_server_password_id)); |
375 PeerConnectionInterface::TlsCertPolicy tls_cert_policy = | 374 PeerConnectionInterface::TlsCertPolicy tls_cert_policy = |
376 JavaToNativeTlsCertPolicy(jni, j_ice_server_tls_cert_policy); | 375 JavaToNativeTlsCertPolicy(jni, j_ice_server_tls_cert_policy); |
377 jstring hostname = reinterpret_cast<jstring>( | 376 jstring hostname = reinterpret_cast<jstring>( |
378 GetObjectField(jni, j_ice_server, j_ice_server_hostname_id)); | 377 GetObjectField(jni, j_ice_server, j_ice_server_hostname_id)); |
379 jobject tls_alpn_protocols = GetNullableObjectField( | 378 jobject tls_alpn_protocols = GetNullableObjectField( |
380 jni, j_ice_server, j_ice_server_tls_alpn_protocols_id); | 379 jni, j_ice_server, j_ice_server_tls_alpn_protocols_id); |
381 jobject tls_elliptic_curves = GetNullableObjectField( | 380 jobject tls_elliptic_curves = GetNullableObjectField( |
382 jni, j_ice_server, j_ice_server_tls_elliptic_curves_id); | 381 jni, j_ice_server, j_ice_server_tls_elliptic_curves_id); |
383 PeerConnectionInterface::IceServer server; | 382 PeerConnectionInterface::IceServer server; |
384 server.uri = JavaToStdString(jni, uri); | 383 server.urls = JavaToStdVectorStrings(jni, urls); |
385 server.username = JavaToStdString(jni, username); | 384 server.username = JavaToStdString(jni, username); |
386 server.password = JavaToStdString(jni, password); | 385 server.password = JavaToStdString(jni, password); |
387 server.tls_cert_policy = tls_cert_policy; | 386 server.tls_cert_policy = tls_cert_policy; |
388 server.hostname = JavaToStdString(jni, hostname); | 387 server.hostname = JavaToStdString(jni, hostname); |
389 server.tls_alpn_protocols = JavaToStdVectorStrings(jni, tls_alpn_protocols); | 388 server.tls_alpn_protocols = JavaToStdVectorStrings(jni, tls_alpn_protocols); |
390 server.tls_elliptic_curves = | 389 server.tls_elliptic_curves = |
391 JavaToStdVectorStrings(jni, tls_elliptic_curves); | 390 JavaToStdVectorStrings(jni, tls_elliptic_curves); |
392 ice_servers->push_back(server); | 391 ice_servers->push_back(server); |
393 } | 392 } |
394 } | 393 } |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
703 jboolean added = jni->CallBooleanMethod(j_codecs, codecs_add, j_codec); | 702 jboolean added = jni->CallBooleanMethod(j_codecs, codecs_add, j_codec); |
704 CHECK_EXCEPTION(jni) << "error during CallBooleanMethod"; | 703 CHECK_EXCEPTION(jni) << "error during CallBooleanMethod"; |
705 RTC_CHECK(added); | 704 RTC_CHECK(added); |
706 } | 705 } |
707 | 706 |
708 return j_parameters; | 707 return j_parameters; |
709 } | 708 } |
710 | 709 |
711 } // namespace jni | 710 } // namespace jni |
712 } // namespace webrtc | 711 } // namespace webrtc |
OLD | NEW |