Implement network monitor for iOS.
Notably, this should detect whether an interface is "available" or not, which should prevent the failure is with dual SIM card setups. This is gated behind a field trial for now, to ensure this doesn't cause any regressions due to false negatives (interfaces that are usable but not listed as available by NWPathMonitor). Bug: webrtc:10966 Change-Id: Ia3942c4c57b525d08d8b340e2325f3705cfd0304 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/180923 Commit-Queue: Taylor <deadbeef@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Reviewed-by: Jonas Oreland <jonaso@webrtc.org> Reviewed-by: Anders Carlsson <andersc@webrtc.org> Cr-Commit-Position: refs/heads/master@{#31977}
This commit is contained in:
committed by
Commit Bot
parent
bedb605c82
commit
ea7fbfb966
@ -21,6 +21,7 @@ RTC_EXTERN NSString * const kRTCFieldTrialFlexFec03AdvertisedKey;
|
||||
RTC_EXTERN NSString * const kRTCFieldTrialFlexFec03Key;
|
||||
RTC_EXTERN NSString * const kRTCFieldTrialH264HighProfileKey;
|
||||
RTC_EXTERN NSString * const kRTCFieldTrialMinimizeResamplingOnMobileKey;
|
||||
RTC_EXTERN NSString *const kRTCFieldTrialUseNWPathMonitor;
|
||||
|
||||
/** The valid value for field trials above. */
|
||||
RTC_EXTERN NSString * const kRTCFieldTrialEnabledValue;
|
||||
|
||||
@ -25,6 +25,7 @@ NSString * const kRTCFieldTrialFlexFec03Key = @"WebRTC-FlexFEC-03";
|
||||
NSString * const kRTCFieldTrialH264HighProfileKey = @"WebRTC-H264HighProfile";
|
||||
NSString * const kRTCFieldTrialMinimizeResamplingOnMobileKey =
|
||||
@"WebRTC-Audio-MinimizeResamplingOnMobile";
|
||||
NSString *const kRTCFieldTrialUseNWPathMonitor = @"WebRTC-Network-UseNWPathMonitor";
|
||||
NSString * const kRTCFieldTrialEnabledValue = @"Enabled";
|
||||
|
||||
static std::unique_ptr<char[]> gFieldTrialInitString;
|
||||
|
||||
@ -25,6 +25,9 @@
|
||||
#import "base/RTCVideoDecoderFactory.h"
|
||||
#import "base/RTCVideoEncoderFactory.h"
|
||||
#import "helpers/NSString+StdString.h"
|
||||
#include "sdk/objc/native/api/network_monitor_factory.h"
|
||||
#include "system_wrappers/include/field_trial.h"
|
||||
|
||||
#ifndef HAVE_NO_MEDIA
|
||||
#import "components/video_codec/RTCVideoDecoderFactoryH264.h"
|
||||
#import "components/video_codec/RTCVideoEncoderFactoryH264.h"
|
||||
@ -135,6 +138,9 @@
|
||||
dependencies.network_thread = _networkThread.get();
|
||||
dependencies.worker_thread = _workerThread.get();
|
||||
dependencies.signaling_thread = _signalingThread.get();
|
||||
if (webrtc::field_trial::IsEnabled("WebRTC-Network-UseNWPathMonitor")) {
|
||||
dependencies.network_monitor_factory = webrtc::CreateNetworkMonitorFactory();
|
||||
}
|
||||
_nativeFactory = webrtc::CreateModularPeerConnectionFactory(std::move(dependencies));
|
||||
NSAssert(_nativeFactory, @"Failed to initialize PeerConnectionFactory!");
|
||||
}
|
||||
@ -179,6 +185,9 @@
|
||||
dependencies.network_thread = _networkThread.get();
|
||||
dependencies.worker_thread = _workerThread.get();
|
||||
dependencies.signaling_thread = _signalingThread.get();
|
||||
if (webrtc::field_trial::IsEnabled("WebRTC-Network-UseNWPathMonitor")) {
|
||||
dependencies.network_monitor_factory = webrtc::CreateNetworkMonitorFactory();
|
||||
}
|
||||
#ifndef HAVE_NO_MEDIA
|
||||
dependencies.task_queue_factory = webrtc::CreateDefaultTaskQueueFactory();
|
||||
cricket::MediaEngineDependencies media_deps;
|
||||
|
||||
Reference in New Issue
Block a user