Add pruneTurnPorts to the java RTCConfiguration.

And adds a log about the flag.

BUG=
R=pthatcher@webrtc.org

Review URL: https://codereview.webrtc.org/2118873002 .

Cr-Commit-Position: refs/heads/master@{#13369}
This commit is contained in:
Honghai Zhang 2016-07-01 14:40:40 -07:00
parent e2e35ca55d
commit d78ecf78c9
3 changed files with 10 additions and 0 deletions

View File

@ -146,6 +146,7 @@ public class PeerConnection {
public KeyType keyType;
public ContinualGatheringPolicy continualGatheringPolicy;
public int iceCandidatePoolSize;
public boolean pruneTurnPorts;
public boolean presumeWritableWhenFullyRelayed;
public RTCConfiguration(List<IceServer> iceServers) {
@ -162,6 +163,7 @@ public class PeerConnection {
keyType = KeyType.ECDSA;
continualGatheringPolicy = ContinualGatheringPolicy.GATHER_ONCE;
iceCandidatePoolSize = 0;
pruneTurnPorts = false;
presumeWritableWhenFullyRelayed = false;
}
};

View File

@ -1592,6 +1592,9 @@ static void JavaRTCConfigurationToJsepRTCConfiguration(
jfieldID j_presume_writable_when_fully_relayed_id = GetFieldID(
jni, j_rtc_config_class, "presumeWritableWhenFullyRelayed", "Z");
jfieldID j_prune_turn_ports_id =
GetFieldID(jni, j_rtc_config_class, "pruneTurnPorts", "Z");
rtc_config->type =
JavaIceTransportsTypeToNativeType(jni, j_ice_transports_type);
rtc_config->bundle_policy =
@ -1616,6 +1619,8 @@ static void JavaRTCConfigurationToJsepRTCConfiguration(
jni, j_continual_gathering_policy);
rtc_config->ice_candidate_pool_size =
GetIntField(jni, j_rtc_config, j_ice_candidate_pool_size_id);
rtc_config->prune_turn_ports =
GetBooleanField(jni, j_rtc_config, j_prune_turn_ports_id);
rtc_config->presume_writable_when_fully_relayed = GetBooleanField(
jni, j_rtc_config, j_presume_writable_when_fully_relayed_id);
}

View File

@ -246,6 +246,9 @@ void BasicPortAllocatorSession::StartGettingPorts() {
}
network_thread_->Post(RTC_FROM_HERE, this, MSG_CONFIG_START);
LOG(LS_INFO) << "Pruning turn ports "
<< (prune_turn_ports_ ? "enabled" : "disabled");
}
void BasicPortAllocatorSession::StopGettingPorts() {