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

Unified Diff: webrtc/sdk/android/src/jni/peerconnection_jni.cc

Issue 2603653002: Merge RTCConfiguration with RTCMediaConstraints in Java/Obj-C wrappers. (Closed)
Patch Set: . Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/sdk/android/src/jni/peerconnection_jni.cc
diff --git a/webrtc/sdk/android/src/jni/peerconnection_jni.cc b/webrtc/sdk/android/src/jni/peerconnection_jni.cc
index 88c4f3ff46a321efeef8889914d8342624a99e87..a8e61a2d9f193e7be852b6d92cf409788c49ff00 100644
--- a/webrtc/sdk/android/src/jni/peerconnection_jni.cc
+++ b/webrtc/sdk/android/src/jni/peerconnection_jni.cc
@@ -1785,8 +1785,9 @@ JOW(jlong, PeerConnectionFactory_nativeCreatePeerConnection)(
PCOJava* observer = reinterpret_cast<PCOJava*>(observer_p);
observer->SetConstraints(new ConstraintsWrapper(jni, j_constraints));
- rtc::scoped_refptr<PeerConnectionInterface> pc(f->CreatePeerConnection(
- rtc_config, observer->constraints(), NULL, NULL, observer));
+ CopyConstraintsIntoRtcConfiguration(observer->constraints(), &rtc_config);
+ rtc::scoped_refptr<PeerConnectionInterface> pc(
+ f->CreatePeerConnection(rtc_config, nullptr, nullptr, observer));
return (jlong)pc.release();
}
@@ -1901,11 +1902,15 @@ JOW(void, PeerConnection_setRemoteDescription)(
observer, JavaSdpToNativeSdp(jni, j_sdp));
}
-JOW(jboolean, PeerConnection_setConfiguration)(
- JNIEnv* jni, jobject j_pc, jobject j_rtc_config) {
+JOW(jboolean, PeerConnection_nativeSetConfiguration)(
+ JNIEnv* jni, jobject j_pc, jobject j_rtc_config, jlong native_observer) {
+ // Need to merge constraints into RTCConfiguration again, which are stored
+ // in the observer object.
+ PCOJava* observer = reinterpret_cast<PCOJava*>(native_observer);
PeerConnectionInterface::RTCConfiguration rtc_config(
PeerConnectionInterface::RTCConfigurationType::kAggressive);
JavaRTCConfigurationToJsepRTCConfiguration(jni, j_rtc_config, &rtc_config);
+ CopyConstraintsIntoRtcConfiguration(observer->constraints(), &rtc_config);
return ExtractNativePC(jni, j_pc)->SetConfiguration(rtc_config);
}

Powered by Google App Engine
This is Rietveld 408576698