Add base class NetworkPredictor and NetworkPredictorFactory and wire up.
Add base class NetworkPredictor and NetworkPredictorFactory in /api, make it possible to inject customized NetworkPredictor in PeerConnectionFactory level. The NetworkPredictor object will be pass down to GoogCCNetworkControl and DelayBasedBwe. Bug: webrtc:10492 Change-Id: Iceeadbe1c9388b11ce4ac01ee56554cb0bf64d04 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/130201 Commit-Queue: Ying Wang <yinwa@webrtc.org> Reviewed-by: Per Kjellander <perkj@webrtc.org> Reviewed-by: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org> Reviewed-by: Christoffer Rodbro <crodbro@webrtc.org> Cr-Commit-Position: refs/heads/master@{#27543}
This commit is contained in:
@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2019 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
package org.webrtc;
|
||||
|
||||
/** Factory for creating webrtc::NetworkStatePredictorFactory instances. */
|
||||
public interface NetworkStatePredictorFactoryFactory {
|
||||
/**
|
||||
* Dynamically allocates a webrtc::NetworkStatePredictorFactory instance and returns a pointer to
|
||||
* it. The caller takes ownership of the object.
|
||||
*/
|
||||
public long createNativeNetworkStatePredictorFactory();
|
||||
}
|
||||
@ -173,6 +173,7 @@ public class PeerConnectionFactory {
|
||||
@Nullable private VideoDecoderFactory videoDecoderFactory;
|
||||
@Nullable private AudioProcessingFactory audioProcessingFactory;
|
||||
@Nullable private FecControllerFactoryFactoryInterface fecControllerFactoryFactory;
|
||||
@Nullable private NetworkStatePredictorFactoryFactory networkStatePredictorFactoryFactory;
|
||||
@Nullable private MediaTransportFactoryFactory mediaTransportFactoryFactory;
|
||||
|
||||
private Builder() {}
|
||||
@ -232,6 +233,12 @@ public class PeerConnectionFactory {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder NetworkStatePredictorFactoryFactory(
|
||||
NetworkStatePredictorFactoryFactory networkStatePredictorFactoryFactory) {
|
||||
this.networkStatePredictorFactoryFactory = networkStatePredictorFactoryFactory;
|
||||
return this;
|
||||
}
|
||||
|
||||
/** Sets a MediaTransportFactoryFactory for a PeerConnectionFactory. */
|
||||
public Builder setMediaTransportFactoryFactory(
|
||||
MediaTransportFactoryFactory mediaTransportFactoryFactory) {
|
||||
@ -252,6 +259,9 @@ public class PeerConnectionFactory {
|
||||
videoDecoderFactory,
|
||||
audioProcessingFactory == null ? 0 : audioProcessingFactory.createNative(),
|
||||
fecControllerFactoryFactory == null ? 0 : fecControllerFactoryFactory.createNative(),
|
||||
networkStatePredictorFactoryFactory == null
|
||||
? 0
|
||||
: networkStatePredictorFactoryFactory.createNativeNetworkStatePredictorFactory(),
|
||||
mediaTransportFactoryFactory == null
|
||||
? 0
|
||||
: mediaTransportFactoryFactory.createNativeMediaTransportFactory());
|
||||
@ -575,7 +585,8 @@ public class PeerConnectionFactory {
|
||||
Options options, long nativeAudioDeviceModule, long audioEncoderFactory,
|
||||
long audioDecoderFactory, VideoEncoderFactory encoderFactory,
|
||||
VideoDecoderFactory decoderFactory, long nativeAudioProcessor,
|
||||
long nativeFecControllerFactory, long mediaTransportFactory);
|
||||
long nativeFecControllerFactory, long nativeNetworkStatePredictorFactory,
|
||||
long mediaTransportFactory);
|
||||
|
||||
private static native long nativeCreatePeerConnection(long factory,
|
||||
PeerConnection.RTCConfiguration rtcConfig, MediaConstraints constraints, long nativeObserver,
|
||||
|
||||
Reference in New Issue
Block a user