| 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 1650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1661 jni, j_rtc_config, j_presume_writable_when_fully_relayed_id); | 1661 jni, j_rtc_config, j_presume_writable_when_fully_relayed_id); |
| 1662 } | 1662 } |
| 1663 | 1663 |
| 1664 JOW(jlong, PeerConnectionFactory_nativeCreatePeerConnection)( | 1664 JOW(jlong, PeerConnectionFactory_nativeCreatePeerConnection)( |
| 1665 JNIEnv *jni, jclass, jlong factory, jobject j_rtc_config, | 1665 JNIEnv *jni, jclass, jlong factory, jobject j_rtc_config, |
| 1666 jobject j_constraints, jlong observer_p) { | 1666 jobject j_constraints, jlong observer_p) { |
| 1667 rtc::scoped_refptr<PeerConnectionFactoryInterface> f( | 1667 rtc::scoped_refptr<PeerConnectionFactoryInterface> f( |
| 1668 reinterpret_cast<PeerConnectionFactoryInterface*>( | 1668 reinterpret_cast<PeerConnectionFactoryInterface*>( |
| 1669 factoryFromJava(factory))); | 1669 factoryFromJava(factory))); |
| 1670 | 1670 |
| 1671 PeerConnectionInterface::RTCConfiguration rtc_config; | 1671 PeerConnectionInterface::RTCConfiguration rtc_config = |
| 1672 PeerConnectionInterface::RTCConfiguration::AggressiveConfiguration(); |
| 1672 JavaRTCConfigurationToJsepRTCConfiguration(jni, j_rtc_config, &rtc_config); | 1673 JavaRTCConfigurationToJsepRTCConfiguration(jni, j_rtc_config, &rtc_config); |
| 1673 | 1674 |
| 1674 jclass j_rtc_config_class = GetObjectClass(jni, j_rtc_config); | 1675 jclass j_rtc_config_class = GetObjectClass(jni, j_rtc_config); |
| 1675 jfieldID j_key_type_id = GetFieldID(jni, j_rtc_config_class, "keyType", | 1676 jfieldID j_key_type_id = GetFieldID(jni, j_rtc_config_class, "keyType", |
| 1676 "Lorg/webrtc/PeerConnection$KeyType;"); | 1677 "Lorg/webrtc/PeerConnection$KeyType;"); |
| 1677 jobject j_key_type = GetObjectField(jni, j_rtc_config, j_key_type_id); | 1678 jobject j_key_type = GetObjectField(jni, j_rtc_config, j_key_type_id); |
| 1678 | 1679 |
| 1679 // Generate non-default certificate. | 1680 // Generate non-default certificate. |
| 1680 rtc::KeyType key_type = JavaKeyTypeToNativeType(jni, j_key_type); | 1681 rtc::KeyType key_type = JavaKeyTypeToNativeType(jni, j_key_type); |
| 1681 if (key_type != rtc::KT_DEFAULT) { | 1682 if (key_type != rtc::KT_DEFAULT) { |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1802 jobject j_observer, jobject j_sdp) { | 1803 jobject j_observer, jobject j_sdp) { |
| 1803 rtc::scoped_refptr<SetSdpObserverWrapper> observer( | 1804 rtc::scoped_refptr<SetSdpObserverWrapper> observer( |
| 1804 new rtc::RefCountedObject<SetSdpObserverWrapper>( | 1805 new rtc::RefCountedObject<SetSdpObserverWrapper>( |
| 1805 jni, j_observer, reinterpret_cast<ConstraintsWrapper*>(NULL))); | 1806 jni, j_observer, reinterpret_cast<ConstraintsWrapper*>(NULL))); |
| 1806 ExtractNativePC(jni, j_pc)->SetRemoteDescription( | 1807 ExtractNativePC(jni, j_pc)->SetRemoteDescription( |
| 1807 observer, JavaSdpToNativeSdp(jni, j_sdp)); | 1808 observer, JavaSdpToNativeSdp(jni, j_sdp)); |
| 1808 } | 1809 } |
| 1809 | 1810 |
| 1810 JOW(jboolean, PeerConnection_setConfiguration)( | 1811 JOW(jboolean, PeerConnection_setConfiguration)( |
| 1811 JNIEnv* jni, jobject j_pc, jobject j_rtc_config) { | 1812 JNIEnv* jni, jobject j_pc, jobject j_rtc_config) { |
| 1812 PeerConnectionInterface::RTCConfiguration rtc_config; | 1813 PeerConnectionInterface::RTCConfiguration rtc_config = |
| 1814 PeerConnectionInterface::RTCConfiguration::AggressiveConfiguration(); |
| 1813 JavaRTCConfigurationToJsepRTCConfiguration(jni, j_rtc_config, &rtc_config); | 1815 JavaRTCConfigurationToJsepRTCConfiguration(jni, j_rtc_config, &rtc_config); |
| 1814 return ExtractNativePC(jni, j_pc)->SetConfiguration(rtc_config); | 1816 return ExtractNativePC(jni, j_pc)->SetConfiguration(rtc_config); |
| 1815 } | 1817 } |
| 1816 | 1818 |
| 1817 JOW(jboolean, PeerConnection_nativeAddIceCandidate)( | 1819 JOW(jboolean, PeerConnection_nativeAddIceCandidate)( |
| 1818 JNIEnv* jni, jobject j_pc, jstring j_sdp_mid, | 1820 JNIEnv* jni, jobject j_pc, jstring j_sdp_mid, |
| 1819 jint j_sdp_mline_index, jstring j_candidate_sdp) { | 1821 jint j_sdp_mline_index, jstring j_candidate_sdp) { |
| 1820 std::string sdp_mid = JavaToStdString(jni, j_sdp_mid); | 1822 std::string sdp_mid = JavaToStdString(jni, j_sdp_mid); |
| 1821 std::string sdp = JavaToStdString(jni, j_candidate_sdp); | 1823 std::string sdp = JavaToStdString(jni, j_candidate_sdp); |
| 1822 std::unique_ptr<IceCandidateInterface> candidate( | 1824 std::unique_ptr<IceCandidateInterface> candidate( |
| (...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2349 return JavaStringFromStdString( | 2351 return JavaStringFromStdString( |
| 2350 jni, | 2352 jni, |
| 2351 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id()); | 2353 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id()); |
| 2352 } | 2354 } |
| 2353 | 2355 |
| 2354 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) { | 2356 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) { |
| 2355 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release(); | 2357 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release(); |
| 2356 } | 2358 } |
| 2357 | 2359 |
| 2358 } // namespace webrtc_jni | 2360 } // namespace webrtc_jni |
| OLD | NEW |