Add PortAllocator min/max ports to JAVA API
This helps Java clients control the port range. Bug: None Change-Id: Icfe16cdfac4e08cd21346a3cb4bb65b9fb2fa0d0 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/374841 Reviewed-by: Harald Alvestrand <hta@webrtc.org> Commit-Queue: Youjie Zhou <youjiezhou@google.com> Reviewed-by: Jonas Oreland <jonaso@webrtc.org> Cr-Commit-Position: refs/heads/main@{#43789}
This commit is contained in:
parent
79e5e721b5
commit
a2a528c20b
@ -579,6 +579,10 @@ public class PeerConnection {
|
|||||||
*/
|
*/
|
||||||
public boolean offerExtmapAllowMixed;
|
public boolean offerExtmapAllowMixed;
|
||||||
|
|
||||||
|
/** Limit ports used for connections. */
|
||||||
|
public int portAllocatorMinPort;
|
||||||
|
public int portAllocatorMaxPort;
|
||||||
|
|
||||||
/** Control port allocation, including what kinds of ports are allocated. */
|
/** Control port allocation, including what kinds of ports are allocated. */
|
||||||
@PortAllocatorFlags public int portAllocatorFlags;
|
@PortAllocatorFlags public int portAllocatorFlags;
|
||||||
|
|
||||||
@ -623,6 +627,8 @@ public class PeerConnection {
|
|||||||
turnLoggingId = null;
|
turnLoggingId = null;
|
||||||
enableImplicitRollback = false;
|
enableImplicitRollback = false;
|
||||||
offerExtmapAllowMixed = true;
|
offerExtmapAllowMixed = true;
|
||||||
|
portAllocatorMinPort = 0;
|
||||||
|
portAllocatorMaxPort = 0;
|
||||||
portAllocatorFlags = 0;
|
portAllocatorFlags = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -833,6 +839,16 @@ public class PeerConnection {
|
|||||||
return offerExtmapAllowMixed;
|
return offerExtmapAllowMixed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CalledByNative("RTCConfiguration")
|
||||||
|
int getPortAllocatorMinPort() {
|
||||||
|
return portAllocatorMinPort;
|
||||||
|
}
|
||||||
|
|
||||||
|
@CalledByNative("RTCConfiguration")
|
||||||
|
int getPortAllocatorMaxPort() {
|
||||||
|
return portAllocatorMaxPort;
|
||||||
|
}
|
||||||
|
|
||||||
@CalledByNative("RTCConfiguration")
|
@CalledByNative("RTCConfiguration")
|
||||||
@PortAllocatorFlags
|
@PortAllocatorFlags
|
||||||
int getPortAllocatorFlags() {
|
int getPortAllocatorFlags() {
|
||||||
|
|||||||
@ -284,6 +284,10 @@ void JavaToNativeRTCConfiguration(
|
|||||||
rtc_config->turn_logging_id = JavaToNativeString(jni, j_turn_logging_id);
|
rtc_config->turn_logging_id = JavaToNativeString(jni, j_turn_logging_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rtc_config->port_allocator_config.min_port =
|
||||||
|
Java_RTCConfiguration_getPortAllocatorMinPort(jni, j_rtc_config);
|
||||||
|
rtc_config->port_allocator_config.max_port =
|
||||||
|
Java_RTCConfiguration_getPortAllocatorMaxPort(jni, j_rtc_config);
|
||||||
rtc_config->port_allocator_config.flags =
|
rtc_config->port_allocator_config.flags =
|
||||||
Java_RTCConfiguration_getPortAllocatorFlags(jni, j_rtc_config);
|
Java_RTCConfiguration_getPortAllocatorFlags(jni, j_rtc_config);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user