Extended RTCConfiguration in Android SDK.

"enableImplicitRollback" is necessary for perfect negotiation algorithm

"offerExtmapAllowMixed" is necessary for backward compatibility with
legacy clients.

Bug: webrtc:12609
Change-Id: I30a5a01c519ca9080a346e2d36b58f7bab28f15a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/212741
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33639}
This commit is contained in:
Yura Yaroshevich
2021-03-22 17:10:33 +03:00
committed by Commit Bot
parent b6c3e89a8a
commit 90fab63b98
2 changed files with 30 additions and 0 deletions

View File

@ -550,6 +550,19 @@ public class PeerConnection {
*/
@Nullable public String turnLoggingId;
/**
* Allow implicit rollback of local description when remote description
* conflicts with local description.
* See: https://w3c.github.io/webrtc-pc/#dom-peerconnection-setremotedescription
*/
public boolean enableImplicitRollback;
/**
* Control if "a=extmap-allow-mixed" is included in the offer.
* See: https://www.chromestatus.com/feature/6269234631933952
*/
public boolean offerExtmapAllowMixed;
// TODO(deadbeef): Instead of duplicating the defaults here, we should do
// something to pick up the defaults from C++. The Objective-C equivalent
// of RTCConfiguration does that.
@ -593,6 +606,8 @@ public class PeerConnection {
cryptoOptions = null;
turnLoggingId = null;
allowCodecSwitching = null;
enableImplicitRollback = false;
offerExtmapAllowMixed = true;
}
@CalledByNative("RTCConfiguration")
@ -813,6 +828,16 @@ public class PeerConnection {
String getTurnLoggingId() {
return turnLoggingId;
}
@CalledByNative("RTCConfiguration")
boolean getEnableImplicitRollback() {
return enableImplicitRollback;
}
@CalledByNative("RTCConfiguration")
boolean getOfferExtmapAllowMixed() {
return offerExtmapAllowMixed;
}
};
private final List<MediaStream> localStreams = new ArrayList<>();

View File

@ -271,6 +271,11 @@ void JavaToNativeRTCConfiguration(
rtc_config->allow_codec_switching = JavaToNativeOptionalBool(
jni, Java_RTCConfiguration_getAllowCodecSwitching(jni, j_rtc_config));
rtc_config->offer_extmap_allow_mixed =
Java_RTCConfiguration_getOfferExtmapAllowMixed(jni, j_rtc_config);
rtc_config->enable_implicit_rollback =
Java_RTCConfiguration_getEnableImplicitRollback(jni, j_rtc_config);
ScopedJavaLocalRef<jstring> j_turn_logging_id =
Java_RTCConfiguration_getTurnLoggingId(jni, j_rtc_config);
if (!IsNull(jni, j_turn_logging_id)) {