OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 1391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1402 jfieldID j_audio_jitter_buffer_fast_accelerate_id = GetFieldID( | 1402 jfieldID j_audio_jitter_buffer_fast_accelerate_id = GetFieldID( |
1403 jni, j_rtc_config_class, "audioJitterBufferFastAccelerate", "Z"); | 1403 jni, j_rtc_config_class, "audioJitterBufferFastAccelerate", "Z"); |
1404 | 1404 |
1405 jfieldID j_ice_connection_receiving_timeout_id = | 1405 jfieldID j_ice_connection_receiving_timeout_id = |
1406 GetFieldID(jni, j_rtc_config_class, "iceConnectionReceivingTimeout", "I"); | 1406 GetFieldID(jni, j_rtc_config_class, "iceConnectionReceivingTimeout", "I"); |
1407 | 1407 |
1408 jfieldID j_key_type_id = GetFieldID(jni, j_rtc_config_class, "keyType", | 1408 jfieldID j_key_type_id = GetFieldID(jni, j_rtc_config_class, "keyType", |
1409 "Lorg/webrtc/PeerConnection$KeyType;"); | 1409 "Lorg/webrtc/PeerConnection$KeyType;"); |
1410 jobject j_key_type = GetObjectField(jni, j_rtc_config, j_key_type_id); | 1410 jobject j_key_type = GetObjectField(jni, j_rtc_config, j_key_type_id); |
1411 | 1411 |
| 1412 jfieldID j_ice_continue_getting_ports_id = |
| 1413 GetFieldID(jni, j_rtc_config_class, "iceContinueGettingPorts", "Z"); |
| 1414 |
1412 PeerConnectionInterface::RTCConfiguration rtc_config; | 1415 PeerConnectionInterface::RTCConfiguration rtc_config; |
1413 rtc_config.type = | 1416 rtc_config.type = |
1414 JavaIceTransportsTypeToNativeType(jni, j_ice_transports_type); | 1417 JavaIceTransportsTypeToNativeType(jni, j_ice_transports_type); |
1415 rtc_config.bundle_policy = JavaBundlePolicyToNativeType(jni, j_bundle_policy); | 1418 rtc_config.bundle_policy = JavaBundlePolicyToNativeType(jni, j_bundle_policy); |
1416 rtc_config.rtcp_mux_policy = | 1419 rtc_config.rtcp_mux_policy = |
1417 JavaRtcpMuxPolicyToNativeType(jni, j_rtcp_mux_policy); | 1420 JavaRtcpMuxPolicyToNativeType(jni, j_rtcp_mux_policy); |
1418 rtc_config.tcp_candidate_policy = | 1421 rtc_config.tcp_candidate_policy = |
1419 JavaTcpCandidatePolicyToNativeType(jni, j_tcp_candidate_policy); | 1422 JavaTcpCandidatePolicyToNativeType(jni, j_tcp_candidate_policy); |
1420 JavaIceServersToJsepIceServers(jni, j_ice_servers, &rtc_config.servers); | 1423 JavaIceServersToJsepIceServers(jni, j_ice_servers, &rtc_config.servers); |
1421 rtc_config.audio_jitter_buffer_max_packets = | 1424 rtc_config.audio_jitter_buffer_max_packets = |
1422 GetIntField(jni, j_rtc_config, j_audio_jitter_buffer_max_packets_id); | 1425 GetIntField(jni, j_rtc_config, j_audio_jitter_buffer_max_packets_id); |
1423 rtc_config.audio_jitter_buffer_fast_accelerate = GetBooleanField( | 1426 rtc_config.audio_jitter_buffer_fast_accelerate = GetBooleanField( |
1424 jni, j_rtc_config, j_audio_jitter_buffer_fast_accelerate_id); | 1427 jni, j_rtc_config, j_audio_jitter_buffer_fast_accelerate_id); |
1425 rtc_config.ice_connection_receiving_timeout = | 1428 rtc_config.ice_connection_receiving_timeout = |
1426 GetIntField(jni, j_rtc_config, j_ice_connection_receiving_timeout_id); | 1429 GetIntField(jni, j_rtc_config, j_ice_connection_receiving_timeout_id); |
| 1430 rtc_config.ice_continue_getting_ports = |
| 1431 GetBooleanField(jni, j_rtc_config, j_ice_continue_getting_ports_id); |
1427 | 1432 |
1428 // Create ECDSA certificate. | 1433 // Create ECDSA certificate. |
1429 if (JavaKeyTypeToNativeType(jni, j_key_type) == rtc::KT_ECDSA) { | 1434 if (JavaKeyTypeToNativeType(jni, j_key_type) == rtc::KT_ECDSA) { |
1430 scoped_ptr<rtc::SSLIdentity> ssl_identity( | 1435 scoped_ptr<rtc::SSLIdentity> ssl_identity( |
1431 rtc::SSLIdentity::Generate(webrtc::kIdentityName, rtc::KT_ECDSA)); | 1436 rtc::SSLIdentity::Generate(webrtc::kIdentityName, rtc::KT_ECDSA)); |
1432 if (ssl_identity.get()) { | 1437 if (ssl_identity.get()) { |
1433 rtc_config.certificates.push_back( | 1438 rtc_config.certificates.push_back( |
1434 rtc::RTCCertificate::Create(ssl_identity.Pass())); | 1439 rtc::RTCCertificate::Create(ssl_identity.Pass())); |
1435 LOG(LS_INFO) << "ECDSA certificate created."; | 1440 LOG(LS_INFO) << "ECDSA certificate created."; |
1436 } else { | 1441 } else { |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1822 rtc::scoped_ptr<jbyte> buffer(static_cast<jbyte*>(malloc(log_size))); | 1827 rtc::scoped_ptr<jbyte> buffer(static_cast<jbyte*>(malloc(log_size))); |
1823 stream->ReadAll(buffer.get(), log_size, &read, nullptr); | 1828 stream->ReadAll(buffer.get(), log_size, &read, nullptr); |
1824 | 1829 |
1825 jbyteArray result = jni->NewByteArray(read); | 1830 jbyteArray result = jni->NewByteArray(read); |
1826 jni->SetByteArrayRegion(result, 0, read, buffer.get()); | 1831 jni->SetByteArrayRegion(result, 0, read, buffer.get()); |
1827 | 1832 |
1828 return result; | 1833 return result; |
1829 } | 1834 } |
1830 | 1835 |
1831 } // namespace webrtc_jni | 1836 } // namespace webrtc_jni |
OLD | NEW |