Allow injection of network controller factory in Java.

Bug: webrtc:9155
Change-Id: I3303a5a9d13a2b7028c24ceede4565b0f4350d7d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/133570
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27686}
This commit is contained in:
Sebastian Jansson
2019-04-18 13:40:56 +02:00
committed by Commit Bot
parent 76723ae836
commit ad60afbd0f
4 changed files with 40 additions and 2 deletions

View File

@ -173,6 +173,7 @@ public class PeerConnectionFactory {
@Nullable private VideoDecoderFactory videoDecoderFactory;
@Nullable private AudioProcessingFactory audioProcessingFactory;
@Nullable private FecControllerFactoryFactoryInterface fecControllerFactoryFactory;
@Nullable private NetworkControllerFactoryFactory networkControllerFactoryFactory;
@Nullable private NetworkStatePredictorFactoryFactory networkStatePredictorFactoryFactory;
@Nullable private MediaTransportFactoryFactory mediaTransportFactoryFactory;
@ -233,6 +234,12 @@ public class PeerConnectionFactory {
return this;
}
public Builder setNetworkControllerFactoryFactory(
NetworkControllerFactoryFactory networkControllerFactoryFactory) {
this.networkControllerFactoryFactory = networkControllerFactoryFactory;
return this;
}
public Builder setNetworkStatePredictorFactoryFactory(
NetworkStatePredictorFactoryFactory networkStatePredictorFactoryFactory) {
this.networkStatePredictorFactoryFactory = networkStatePredictorFactoryFactory;
@ -259,6 +266,9 @@ public class PeerConnectionFactory {
videoDecoderFactory,
audioProcessingFactory == null ? 0 : audioProcessingFactory.createNative(),
fecControllerFactoryFactory == null ? 0 : fecControllerFactoryFactory.createNative(),
networkControllerFactoryFactory == null
? 0
: networkControllerFactoryFactory.createNativeNetworkControllerFactory(),
networkStatePredictorFactoryFactory == null
? 0
: networkStatePredictorFactoryFactory.createNativeNetworkStatePredictorFactory(),
@ -585,8 +595,8 @@ public class PeerConnectionFactory {
Options options, long nativeAudioDeviceModule, long audioEncoderFactory,
long audioDecoderFactory, VideoEncoderFactory encoderFactory,
VideoDecoderFactory decoderFactory, long nativeAudioProcessor,
long nativeFecControllerFactory, long nativeNetworkStatePredictorFactory,
long mediaTransportFactory);
long nativeFecControllerFactory, long nativeNetworkControllerFactory,
long nativeNetworkStatePredictorFactory, long mediaTransportFactory);
private static native long nativeCreatePeerConnection(long factory,
PeerConnection.RTCConfiguration rtcConfig, MediaConstraints constraints, long nativeObserver,