Skip to content

Commit

Permalink
ios_proxy.patch を m132 対応する
Browse files Browse the repository at this point in the history
  • Loading branch information
melpon committed Dec 17, 2024
1 parent 00bbe73 commit 340e25c
Showing 1 changed file with 19 additions and 42 deletions.
61 changes: 19 additions & 42 deletions patches/ios_proxy.patch
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
# iOS に Proxy を設定する機能を入れるパッチ。
# Objective-C では以下のように利用する。
#
# [factory peerConnectionWithConfiguration:configuration
# constraints:constraints
# certificateVerifier:certificateVerifier
# delegate:delegate
# proxyType:RTCProxyTypeHttps
# proxyAgent:@"user-agent"
# proxyHostname:@"192.168.100.11"
# proxyPort:3456
# proxyUsername:@"username"
# proxyPassword:@"password"]
#
diff --git a/sdk/objc/api/peerconnection/RTCPeerConnection+Private.h b/sdk/objc/api/peerconnection/RTCPeerConnection+Private.h
index 00f2ef7834..6e0966fe3a 100644
index 9714f504ac..96caea635d 100644
--- a/sdk/objc/api/peerconnection/RTCPeerConnection+Private.h
+++ b/sdk/objc/api/peerconnection/RTCPeerConnection+Private.h
@@ -92,6 +92,19 @@ class PeerConnectionDelegateAdapter : public PeerConnectionObserver {
Expand All @@ -37,7 +23,7 @@ index 00f2ef7834..6e0966fe3a 100644
* delegate and PeerConnectionDependencies.
*/
diff --git a/sdk/objc/api/peerconnection/RTCPeerConnection.h b/sdk/objc/api/peerconnection/RTCPeerConnection.h
index 466e053492..8f5185d7e4 100644
index 8b663fad99..2873f716b2 100644
--- a/sdk/objc/api/peerconnection/RTCPeerConnection.h
+++ b/sdk/objc/api/peerconnection/RTCPeerConnection.h
@@ -82,6 +82,13 @@ typedef NS_ENUM(NSInteger, RTCStatsOutputLevel) {
Expand All @@ -55,10 +41,10 @@ index 466e053492..8f5185d7e4 100644
RTC_OBJC_TYPE(RTCSessionDescription) *_Nullable sdp, NSError *_Nullable error);

diff --git a/sdk/objc/api/peerconnection/RTCPeerConnection.mm b/sdk/objc/api/peerconnection/RTCPeerConnection.mm
index f4db472380..45a2b873f2 100644
index 5a9f14a50b..f0a1c4ea52 100644
--- a/sdk/objc/api/peerconnection/RTCPeerConnection.mm
+++ b/sdk/objc/api/peerconnection/RTCPeerConnection.mm
@@ -322,6 +322,37 @@ void OnFailure(RTCError error) override {
@@ -321,6 +321,37 @@ JsepIceCandidate remote_candidate_wrapper(

} // namespace webrtc

Expand Down Expand Up @@ -96,7 +82,7 @@ index f4db472380..45a2b873f2 100644
@implementation RTC_OBJC_TYPE (RTCPeerConnection) {
RTC_OBJC_TYPE(RTCPeerConnectionFactory) * _factory;
NSMutableArray<RTC_OBJC_TYPE(RTCMediaStream) *> *_localStreams;
@@ -353,6 +383,53 @@ - (nullable instancetype)initWithFactory:(RTC_OBJC_TYPE(RTCPeerConnectionFactory
@@ -352,6 +383,53 @@ - (nullable instancetype)initWithFactory:(RTC_OBJC_TYPE(RTCPeerConnectionFactory
delegate:delegate];
}

Expand Down Expand Up @@ -151,7 +137,7 @@ index f4db472380..45a2b873f2 100644
initWithDependencies:(RTC_OBJC_TYPE(RTCPeerConnectionFactory) *)factory
configuration:(RTC_OBJC_TYPE(RTCConfiguration) *)configuration
diff --git a/sdk/objc/api/peerconnection/RTCPeerConnectionFactory+Private.h b/sdk/objc/api/peerconnection/RTCPeerConnectionFactory+Private.h
index 9613646270..b7f3b778b9 100644
index 822585ddc2..b1b6b89f4b 100644
--- a/sdk/objc/api/peerconnection/RTCPeerConnectionFactory+Private.h
+++ b/sdk/objc/api/peerconnection/RTCPeerConnectionFactory+Private.h
@@ -13,6 +13,7 @@
Expand All @@ -162,28 +148,28 @@ index 9613646270..b7f3b778b9 100644

NS_ASSUME_NONNULL_BEGIN

@@ -30,6 +31,7 @@ NS_ASSUME_NONNULL_BEGIN
@property(nonatomic, readonly) rtc::Thread* signalingThread;
@@ -31,6 +32,7 @@ NS_ASSUME_NONNULL_BEGIN
@property(nonatomic, readonly) rtc::Thread* workerThread;
@property(nonatomic, readonly) rtc::Thread* networkThread;

+ @property(nonatomic, readonly) rtc::scoped_refptr<webrtc::ConnectionContext> connectionContext;
@end

NS_ASSUME_NONNULL_END
diff --git a/sdk/objc/api/peerconnection/RTCPeerConnectionFactory.h b/sdk/objc/api/peerconnection/RTCPeerConnectionFactory.h
index 88aac990f2..feca021d9a 100644
index 9abee87c7e..87df18fa76 100644
--- a/sdk/objc/api/peerconnection/RTCPeerConnectionFactory.h
+++ b/sdk/objc/api/peerconnection/RTCPeerConnectionFactory.h
@@ -32,6 +32,8 @@ NS_ASSUME_NONNULL_BEGIN
@@ -35,6 +35,8 @@ NS_ASSUME_NONNULL_BEGIN
@protocol RTC_OBJC_TYPE
(RTCSSLCertificateVerifier);
(RTCAudioDevice);

+typedef NS_ENUM(NSInteger, RTCProxyType);
+
RTC_OBJC_EXPORT
@interface RTC_OBJC_TYPE (RTCPeerConnectionFactory) : NSObject

@@ -91,6 +93,19 @@ RTC_OBJC_EXPORT
@@ -112,6 +114,19 @@ RTC_OBJC_EXPORT
(id<RTC_OBJC_TYPE(RTCSSLCertificateVerifier)>)certificateVerifier
delegate:(nullable id<RTC_OBJC_TYPE(RTCPeerConnectionDelegate)>)delegate;

Expand All @@ -202,12 +188,12 @@ index 88aac990f2..feca021d9a 100644
+
/** Set the options to be used for subsequently created RTCPeerConnections */
- (void)setOptions:(nonnull RTC_OBJC_TYPE(RTCPeerConnectionFactoryOptions) *)options;

diff --git a/sdk/objc/api/peerconnection/RTCPeerConnectionFactory.mm b/sdk/objc/api/peerconnection/RTCPeerConnectionFactory.mm
index 15f9eb9ee4..b7a6bcaae7 100644
index fa1a024716..7ac255279b 100644
--- a/sdk/objc/api/peerconnection/RTCPeerConnectionFactory.mm
+++ b/sdk/objc/api/peerconnection/RTCPeerConnectionFactory.mm
@@ -51,6 +51,68 @@
@@ -53,6 +53,68 @@
#import "sdk/objc/native/api/audio_device_module.h"
#endif

Expand Down Expand Up @@ -276,33 +262,24 @@ index 15f9eb9ee4..b7a6bcaae7 100644
@implementation RTC_OBJC_TYPE (RTCPeerConnectionFactory) {
std::unique_ptr<rtc::Thread> _networkThread;
std::unique_ptr<rtc::Thread> _workerThread;
@@ -59,6 +121,7 @@ @implementation RTC_OBJC_TYPE (RTCPeerConnectionFactory) {
@@ -61,6 +123,7 @@ @implementation RTC_OBJC_TYPE (RTCPeerConnectionFactory) {
}

@synthesize nativeFactory = _nativeFactory;
+@synthesize connectionContext = _connectionContext;

- (rtc::scoped_refptr<webrtc::AudioDeviceModule>)audioDeviceModule {
#if defined(WEBRTC_IOS)
@@ -145,7 +208,7 @@ - (instancetype)initWithNoMedia {
if (webrtc::field_trial::IsEnabled("WebRTC-Network-UseNWPathMonitor")) {
@@ -143,7 +206,7 @@ - (instancetype)initWithNativeDependencies:(webrtc::PeerConnectionFactoryDepende
dependencies.network_monitor_factory = webrtc::CreateNetworkMonitorFactory();
}

- _nativeFactory = webrtc::CreateModularPeerConnectionFactory(std::move(dependencies));
+ _nativeFactory = webrtc::CreateModularPeerConnectionFactoryWithContext(std::move(dependencies), _connectionContext);
NSAssert(_nativeFactory, @"Failed to initialize PeerConnectionFactory!");
}
return self;
@@ -209,7 +272,7 @@ - (instancetype)initWithNativeAudioEncoderFactory:
dependencies.event_log_factory =
std::make_unique<webrtc::RtcEventLogFactory>(dependencies.task_queue_factory.get());
dependencies.network_controller_factory = std::move(networkControllerFactory);
- _nativeFactory = webrtc::CreateModularPeerConnectionFactory(std::move(dependencies));
+ _nativeFactory = webrtc::CreateModularPeerConnectionFactoryWithContext(std::move(dependencies), _connectionContext);
NSAssert(_nativeFactory, @"Failed to initialize PeerConnectionFactory!");
}
return self;
@@ -261,6 +324,31 @@ - (instancetype)initWithNativeAudioEncoderFactory:
@@ -280,6 +343,31 @@ - (instancetype)initWithMediaAndDependencies:
return [[RTC_OBJC_TYPE(RTCMediaStream) alloc] initWithFactory:self streamId:streamId];
}

Expand Down

0 comments on commit 340e25c

Please sign in to comment.