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 1323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1334 jni, j_rtc_config_class, "tcpCandidatePolicy", | 1334 jni, j_rtc_config_class, "tcpCandidatePolicy", |
1335 "Lorg/webrtc/PeerConnection$TcpCandidatePolicy;"); | 1335 "Lorg/webrtc/PeerConnection$TcpCandidatePolicy;"); |
1336 jobject j_tcp_candidate_policy = GetObjectField( | 1336 jobject j_tcp_candidate_policy = GetObjectField( |
1337 jni, j_rtc_config, j_tcp_candidate_policy_id); | 1337 jni, j_rtc_config, j_tcp_candidate_policy_id); |
1338 | 1338 |
1339 jfieldID j_ice_servers_id = GetFieldID( | 1339 jfieldID j_ice_servers_id = GetFieldID( |
1340 jni, j_rtc_config_class, "iceServers", | 1340 jni, j_rtc_config_class, "iceServers", |
1341 "Ljava/util/List;"); | 1341 "Ljava/util/List;"); |
1342 jobject j_ice_servers = GetObjectField(jni, j_rtc_config, j_ice_servers_id); | 1342 jobject j_ice_servers = GetObjectField(jni, j_rtc_config, j_ice_servers_id); |
1343 | 1343 |
1344 jfieldID j_audio_jitter_buffer_max_packets_id = GetFieldID( | 1344 jfieldID j_audio_jitter_buffer_max_packets_id = |
1345 jni, j_rtc_config_class, "audioJitterBufferMaxPackets", | 1345 GetFieldID(jni, j_rtc_config_class, "audioJitterBufferMaxPackets", "I"); |
1346 "I"); | |
1347 jfieldID j_audio_jitter_buffer_fast_accelerate_id = GetFieldID( | 1346 jfieldID j_audio_jitter_buffer_fast_accelerate_id = GetFieldID( |
1348 jni, j_rtc_config_class, "audioJitterBufferFastAccelerate", "Z"); | 1347 jni, j_rtc_config_class, "audioJitterBufferFastAccelerate", "Z"); |
| 1348 |
| 1349 jfieldID j_ice_connection_receiving_timeout_id = |
| 1350 GetFieldID(jni, j_rtc_config_class, "iceConnectionReceivingTimeout", "I"); |
| 1351 |
1349 PeerConnectionInterface::RTCConfiguration rtc_config; | 1352 PeerConnectionInterface::RTCConfiguration rtc_config; |
1350 | |
1351 rtc_config.type = | 1353 rtc_config.type = |
1352 JavaIceTransportsTypeToNativeType(jni, j_ice_transports_type); | 1354 JavaIceTransportsTypeToNativeType(jni, j_ice_transports_type); |
1353 rtc_config.bundle_policy = JavaBundlePolicyToNativeType(jni, j_bundle_policy); | 1355 rtc_config.bundle_policy = JavaBundlePolicyToNativeType(jni, j_bundle_policy); |
1354 rtc_config.rtcp_mux_policy = | 1356 rtc_config.rtcp_mux_policy = |
1355 JavaRtcpMuxPolicyToNativeType(jni, j_rtcp_mux_policy); | 1357 JavaRtcpMuxPolicyToNativeType(jni, j_rtcp_mux_policy); |
1356 rtc_config.tcp_candidate_policy = | 1358 rtc_config.tcp_candidate_policy = |
1357 JavaTcpCandidatePolicyToNativeType(jni, j_tcp_candidate_policy); | 1359 JavaTcpCandidatePolicyToNativeType(jni, j_tcp_candidate_policy); |
1358 JavaIceServersToJsepIceServers(jni, j_ice_servers, &rtc_config.servers); | 1360 JavaIceServersToJsepIceServers(jni, j_ice_servers, &rtc_config.servers); |
1359 rtc_config.audio_jitter_buffer_max_packets = | 1361 rtc_config.audio_jitter_buffer_max_packets = |
1360 GetIntField(jni, j_rtc_config, j_audio_jitter_buffer_max_packets_id); | 1362 GetIntField(jni, j_rtc_config, j_audio_jitter_buffer_max_packets_id); |
1361 rtc_config.audio_jitter_buffer_fast_accelerate = GetBooleanField( | 1363 rtc_config.audio_jitter_buffer_fast_accelerate = GetBooleanField( |
1362 jni, j_rtc_config, j_audio_jitter_buffer_fast_accelerate_id); | 1364 jni, j_rtc_config, j_audio_jitter_buffer_fast_accelerate_id); |
| 1365 rtc_config.ice_connection_receiving_timeout = |
| 1366 GetIntField(jni, j_rtc_config, j_ice_connection_receiving_timeout_id); |
1363 | 1367 |
1364 PCOJava* observer = reinterpret_cast<PCOJava*>(observer_p); | 1368 PCOJava* observer = reinterpret_cast<PCOJava*>(observer_p); |
1365 observer->SetConstraints(new ConstraintsWrapper(jni, j_constraints)); | 1369 observer->SetConstraints(new ConstraintsWrapper(jni, j_constraints)); |
1366 rtc::scoped_refptr<PeerConnectionInterface> pc(f->CreatePeerConnection( | 1370 rtc::scoped_refptr<PeerConnectionInterface> pc(f->CreatePeerConnection( |
1367 rtc_config, observer->constraints(), NULL, NULL, observer)); | 1371 rtc_config, observer->constraints(), NULL, NULL, observer)); |
1368 return (jlong)pc.release(); | 1372 return (jlong)pc.release(); |
1369 } | 1373 } |
1370 | 1374 |
1371 static rtc::scoped_refptr<PeerConnectionInterface> ExtractNativePC( | 1375 static rtc::scoped_refptr<PeerConnectionInterface> ExtractNativePC( |
1372 JNIEnv* jni, jobject j_pc) { | 1376 JNIEnv* jni, jobject j_pc) { |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1469 JOW(void, PeerConnection_setRemoteDescription)( | 1473 JOW(void, PeerConnection_setRemoteDescription)( |
1470 JNIEnv* jni, jobject j_pc, | 1474 JNIEnv* jni, jobject j_pc, |
1471 jobject j_observer, jobject j_sdp) { | 1475 jobject j_observer, jobject j_sdp) { |
1472 rtc::scoped_refptr<SetSdpObserverWrapper> observer( | 1476 rtc::scoped_refptr<SetSdpObserverWrapper> observer( |
1473 new rtc::RefCountedObject<SetSdpObserverWrapper>( | 1477 new rtc::RefCountedObject<SetSdpObserverWrapper>( |
1474 jni, j_observer, reinterpret_cast<ConstraintsWrapper*>(NULL))); | 1478 jni, j_observer, reinterpret_cast<ConstraintsWrapper*>(NULL))); |
1475 ExtractNativePC(jni, j_pc)->SetRemoteDescription( | 1479 ExtractNativePC(jni, j_pc)->SetRemoteDescription( |
1476 observer, JavaSdpToNativeSdp(jni, j_sdp)); | 1480 observer, JavaSdpToNativeSdp(jni, j_sdp)); |
1477 } | 1481 } |
1478 | 1482 |
1479 JOW(void, PeerConnection_setIceConnectionReceivingTimeout)(JNIEnv* jni, | |
1480 jobject j_pc, | |
1481 jint timeout_ms) { | |
1482 return ExtractNativePC(jni, j_pc) | |
1483 ->SetIceConnectionReceivingTimeout(timeout_ms); | |
1484 } | |
1485 | |
1486 JOW(jboolean, PeerConnection_updateIce)( | 1483 JOW(jboolean, PeerConnection_updateIce)( |
1487 JNIEnv* jni, jobject j_pc, jobject j_ice_servers, jobject j_constraints) { | 1484 JNIEnv* jni, jobject j_pc, jobject j_ice_servers, jobject j_constraints) { |
1488 PeerConnectionInterface::IceServers ice_servers; | 1485 PeerConnectionInterface::IceServers ice_servers; |
1489 JavaIceServersToJsepIceServers(jni, j_ice_servers, &ice_servers); | 1486 JavaIceServersToJsepIceServers(jni, j_ice_servers, &ice_servers); |
1490 scoped_ptr<ConstraintsWrapper> constraints( | 1487 scoped_ptr<ConstraintsWrapper> constraints( |
1491 new ConstraintsWrapper(jni, j_constraints)); | 1488 new ConstraintsWrapper(jni, j_constraints)); |
1492 return ExtractNativePC(jni, j_pc)->UpdateIce(ice_servers, constraints.get()); | 1489 return ExtractNativePC(jni, j_pc)->UpdateIce(ice_servers, constraints.get()); |
1493 } | 1490 } |
1494 | 1491 |
1495 JOW(jboolean, PeerConnection_nativeAddIceCandidate)( | 1492 JOW(jboolean, PeerConnection_nativeAddIceCandidate)( |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1697 } | 1694 } |
1698 | 1695 |
1699 JOW(void, VideoTrack_nativeRemoveRenderer)( | 1696 JOW(void, VideoTrack_nativeRemoveRenderer)( |
1700 JNIEnv* jni, jclass, | 1697 JNIEnv* jni, jclass, |
1701 jlong j_video_track_pointer, jlong j_renderer_pointer) { | 1698 jlong j_video_track_pointer, jlong j_renderer_pointer) { |
1702 reinterpret_cast<VideoTrackInterface*>(j_video_track_pointer)->RemoveRenderer( | 1699 reinterpret_cast<VideoTrackInterface*>(j_video_track_pointer)->RemoveRenderer( |
1703 reinterpret_cast<VideoRendererInterface*>(j_renderer_pointer)); | 1700 reinterpret_cast<VideoRendererInterface*>(j_renderer_pointer)); |
1704 } | 1701 } |
1705 | 1702 |
1706 } // namespace webrtc_jni | 1703 } // namespace webrtc_jni |
OLD | NEW |