OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2013 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 1740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1751 GetObjectField(jni, j_rtc_config, j_continual_gathering_policy_id); | 1751 GetObjectField(jni, j_rtc_config, j_continual_gathering_policy_id); |
1752 | 1752 |
1753 jfieldID j_ice_candidate_pool_size_id = | 1753 jfieldID j_ice_candidate_pool_size_id = |
1754 GetFieldID(jni, j_rtc_config_class, "iceCandidatePoolSize", "I"); | 1754 GetFieldID(jni, j_rtc_config_class, "iceCandidatePoolSize", "I"); |
1755 jfieldID j_presume_writable_when_fully_relayed_id = GetFieldID( | 1755 jfieldID j_presume_writable_when_fully_relayed_id = GetFieldID( |
1756 jni, j_rtc_config_class, "presumeWritableWhenFullyRelayed", "Z"); | 1756 jni, j_rtc_config_class, "presumeWritableWhenFullyRelayed", "Z"); |
1757 | 1757 |
1758 jfieldID j_prune_turn_ports_id = | 1758 jfieldID j_prune_turn_ports_id = |
1759 GetFieldID(jni, j_rtc_config_class, "pruneTurnPorts", "Z"); | 1759 GetFieldID(jni, j_rtc_config_class, "pruneTurnPorts", "Z"); |
1760 | 1760 |
| 1761 jfieldID j_ice_check_min_interval_id = GetFieldID( |
| 1762 jni, j_rtc_config_class, "iceCheckMinInterval", "Ljava/lang/Integer;"); |
| 1763 jclass j_integer_class = jni->FindClass("java/lang/Integer"); |
| 1764 jmethodID int_value_id = GetMethodID(jni, j_integer_class, "intValue", "()I"); |
| 1765 |
1761 rtc_config->type = | 1766 rtc_config->type = |
1762 JavaIceTransportsTypeToNativeType(jni, j_ice_transports_type); | 1767 JavaIceTransportsTypeToNativeType(jni, j_ice_transports_type); |
1763 rtc_config->bundle_policy = | 1768 rtc_config->bundle_policy = |
1764 JavaBundlePolicyToNativeType(jni, j_bundle_policy); | 1769 JavaBundlePolicyToNativeType(jni, j_bundle_policy); |
1765 rtc_config->rtcp_mux_policy = | 1770 rtc_config->rtcp_mux_policy = |
1766 JavaRtcpMuxPolicyToNativeType(jni, j_rtcp_mux_policy); | 1771 JavaRtcpMuxPolicyToNativeType(jni, j_rtcp_mux_policy); |
1767 rtc_config->tcp_candidate_policy = | 1772 rtc_config->tcp_candidate_policy = |
1768 JavaTcpCandidatePolicyToNativeType(jni, j_tcp_candidate_policy); | 1773 JavaTcpCandidatePolicyToNativeType(jni, j_tcp_candidate_policy); |
1769 rtc_config->candidate_network_policy = | 1774 rtc_config->candidate_network_policy = |
1770 JavaCandidateNetworkPolicyToNativeType(jni, j_candidate_network_policy); | 1775 JavaCandidateNetworkPolicyToNativeType(jni, j_candidate_network_policy); |
1771 JavaIceServersToJsepIceServers(jni, j_ice_servers, &rtc_config->servers); | 1776 JavaIceServersToJsepIceServers(jni, j_ice_servers, &rtc_config->servers); |
1772 rtc_config->audio_jitter_buffer_max_packets = | 1777 rtc_config->audio_jitter_buffer_max_packets = |
1773 GetIntField(jni, j_rtc_config, j_audio_jitter_buffer_max_packets_id); | 1778 GetIntField(jni, j_rtc_config, j_audio_jitter_buffer_max_packets_id); |
1774 rtc_config->audio_jitter_buffer_fast_accelerate = GetBooleanField( | 1779 rtc_config->audio_jitter_buffer_fast_accelerate = GetBooleanField( |
1775 jni, j_rtc_config, j_audio_jitter_buffer_fast_accelerate_id); | 1780 jni, j_rtc_config, j_audio_jitter_buffer_fast_accelerate_id); |
1776 rtc_config->ice_connection_receiving_timeout = | 1781 rtc_config->ice_connection_receiving_timeout = |
1777 GetIntField(jni, j_rtc_config, j_ice_connection_receiving_timeout_id); | 1782 GetIntField(jni, j_rtc_config, j_ice_connection_receiving_timeout_id); |
1778 rtc_config->ice_backup_candidate_pair_ping_interval = GetIntField( | 1783 rtc_config->ice_backup_candidate_pair_ping_interval = GetIntField( |
1779 jni, j_rtc_config, j_ice_backup_candidate_pair_ping_interval_id); | 1784 jni, j_rtc_config, j_ice_backup_candidate_pair_ping_interval_id); |
1780 rtc_config->continual_gathering_policy = | 1785 rtc_config->continual_gathering_policy = |
1781 JavaContinualGatheringPolicyToNativeType( | 1786 JavaContinualGatheringPolicyToNativeType( |
1782 jni, j_continual_gathering_policy); | 1787 jni, j_continual_gathering_policy); |
1783 rtc_config->ice_candidate_pool_size = | 1788 rtc_config->ice_candidate_pool_size = |
1784 GetIntField(jni, j_rtc_config, j_ice_candidate_pool_size_id); | 1789 GetIntField(jni, j_rtc_config, j_ice_candidate_pool_size_id); |
1785 rtc_config->prune_turn_ports = | 1790 rtc_config->prune_turn_ports = |
1786 GetBooleanField(jni, j_rtc_config, j_prune_turn_ports_id); | 1791 GetBooleanField(jni, j_rtc_config, j_prune_turn_ports_id); |
1787 rtc_config->presume_writable_when_fully_relayed = GetBooleanField( | 1792 rtc_config->presume_writable_when_fully_relayed = GetBooleanField( |
1788 jni, j_rtc_config, j_presume_writable_when_fully_relayed_id); | 1793 jni, j_rtc_config, j_presume_writable_when_fully_relayed_id); |
| 1794 jobject j_ice_check_min_interval = |
| 1795 GetNullableObjectField(jni, j_rtc_config, j_ice_check_min_interval_id); |
| 1796 if (!IsNull(jni, j_ice_check_min_interval)) { |
| 1797 int ice_check_min_interval_value = |
| 1798 jni->CallIntMethod(j_ice_check_min_interval, int_value_id); |
| 1799 rtc_config->ice_check_min_interval = |
| 1800 rtc::Optional<int>(ice_check_min_interval_value); |
| 1801 } |
1789 } | 1802 } |
1790 | 1803 |
1791 JOW(jlong, PeerConnectionFactory_nativeCreatePeerConnection)( | 1804 JOW(jlong, PeerConnectionFactory_nativeCreatePeerConnection)( |
1792 JNIEnv *jni, jclass, jlong factory, jobject j_rtc_config, | 1805 JNIEnv *jni, jclass, jlong factory, jobject j_rtc_config, |
1793 jobject j_constraints, jlong observer_p) { | 1806 jobject j_constraints, jlong observer_p) { |
1794 rtc::scoped_refptr<PeerConnectionFactoryInterface> f( | 1807 rtc::scoped_refptr<PeerConnectionFactoryInterface> f( |
1795 reinterpret_cast<PeerConnectionFactoryInterface*>( | 1808 reinterpret_cast<PeerConnectionFactoryInterface*>( |
1796 factoryFromJava(factory))); | 1809 factoryFromJava(factory))); |
1797 | 1810 |
1798 PeerConnectionInterface::RTCConfiguration rtc_config( | 1811 PeerConnectionInterface::RTCConfiguration rtc_config( |
(...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2609 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer) | 2622 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer) |
2610 ->SetObserver(nullptr); | 2623 ->SetObserver(nullptr); |
2611 RtpReceiverObserver* observer = | 2624 RtpReceiverObserver* observer = |
2612 reinterpret_cast<RtpReceiverObserver*>(j_observer_pointer); | 2625 reinterpret_cast<RtpReceiverObserver*>(j_observer_pointer); |
2613 if (observer) { | 2626 if (observer) { |
2614 delete observer; | 2627 delete observer; |
2615 } | 2628 } |
2616 } | 2629 } |
2617 | 2630 |
2618 } // namespace webrtc_jni | 2631 } // namespace webrtc_jni |
OLD | NEW |