webrtc/sdk/objc/api/peerconnection/RTCPeerConnectionFactoryOptions.mm
Benjamin Wright e4cccae299 Removed ability to set CryptoOptions through PeerConnectionFactory from bindings.
This change removes the ability to set CryptoOptions through the PeerConnection
Factory in both Java and IOS. Native will be removed after the Chromium change
lands. The semantics have been changed such that these options should only be
set on individual PeerConnections and not directly on the Factory itself. This
allows for more flexibility in setting CryptoOptions for PeerConnections which
are created as part of a factory.

Bug: webrtc:10020
Change-Id: I9ef3d431e728927b9ced5de6188cedeb2671254b
Reviewed-on: https://webrtc-review.googlesource.com/c/111560
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Commit-Queue: Benjamin Wright <benwright@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25736}
2018-11-21 18:52:45 +00:00

56 lines
2 KiB
Text

/*
* Copyright 2017 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.
*/
#import "RTCPeerConnectionFactoryOptions+Private.h"
#include "rtc_base/network_constants.h"
namespace {
void setNetworkBit(webrtc::PeerConnectionFactoryInterface::Options* options,
rtc::AdapterType type,
bool ignore) {
if (ignore) {
options->network_ignore_mask |= type;
} else {
options->network_ignore_mask &= ~type;
}
}
} // namespace
@implementation RTCPeerConnectionFactoryOptions
@synthesize disableEncryption = _disableEncryption;
@synthesize disableNetworkMonitor = _disableNetworkMonitor;
@synthesize ignoreLoopbackNetworkAdapter = _ignoreLoopbackNetworkAdapter;
@synthesize ignoreVPNNetworkAdapter = _ignoreVPNNetworkAdapter;
@synthesize ignoreCellularNetworkAdapter = _ignoreCellularNetworkAdapter;
@synthesize ignoreWiFiNetworkAdapter = _ignoreWiFiNetworkAdapter;
@synthesize ignoreEthernetNetworkAdapter = _ignoreEthernetNetworkAdapter;
- (instancetype)init {
return [super init];
}
- (webrtc::PeerConnectionFactoryInterface::Options)nativeOptions {
webrtc::PeerConnectionFactoryInterface::Options options;
options.disable_encryption = self.disableEncryption;
options.disable_network_monitor = self.disableNetworkMonitor;
setNetworkBit(&options, rtc::ADAPTER_TYPE_LOOPBACK, self.ignoreLoopbackNetworkAdapter);
setNetworkBit(&options, rtc::ADAPTER_TYPE_VPN, self.ignoreVPNNetworkAdapter);
setNetworkBit(&options, rtc::ADAPTER_TYPE_CELLULAR, self.ignoreCellularNetworkAdapter);
setNetworkBit(&options, rtc::ADAPTER_TYPE_WIFI, self.ignoreWiFiNetworkAdapter);
setNetworkBit(&options, rtc::ADAPTER_TYPE_ETHERNET, self.ignoreEthernetNetworkAdapter);
return options;
}
@end