Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(882)

Side by Side Diff: webrtc/api/android/jni/peerconnection_jni.cc

Issue 2295493002: Add a switch to redetermine role when ICE restarts. (Closed)
Patch Set: Remove the objective-c change to submit Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/api/peerconnection.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « no previous file | webrtc/api/peerconnection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698