OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2015 Google Inc. | 3 * Copyright 2015 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 20 matching lines...) Expand all Loading... |
31 #import "talk/app/webrtc/objc/RTCICEServer+Internal.h" | 31 #import "talk/app/webrtc/objc/RTCICEServer+Internal.h" |
32 | 32 |
33 @implementation RTCConfiguration | 33 @implementation RTCConfiguration |
34 | 34 |
35 @synthesize iceTransportsType = _iceTransportsType; | 35 @synthesize iceTransportsType = _iceTransportsType; |
36 @synthesize iceServers = _iceServers; | 36 @synthesize iceServers = _iceServers; |
37 @synthesize bundlePolicy = _bundlePolicy; | 37 @synthesize bundlePolicy = _bundlePolicy; |
38 @synthesize rtcpMuxPolicy = _rtcpMuxPolicy; | 38 @synthesize rtcpMuxPolicy = _rtcpMuxPolicy; |
39 @synthesize tcpCandidatePolicy = _tcpCandidatePolicy; | 39 @synthesize tcpCandidatePolicy = _tcpCandidatePolicy; |
40 @synthesize audioJitterBufferMaxPackets = _audioJitterBufferMaxPackets; | 40 @synthesize audioJitterBufferMaxPackets = _audioJitterBufferMaxPackets; |
| 41 @synthesize iceConnectionReceivingTimeout = _iceConnectionReceivingTimeout; |
41 | 42 |
42 - (instancetype)init { | 43 - (instancetype)init { |
43 if (self = [super init]) { | 44 if (self = [super init]) { |
44 // Copy defaults. | 45 // Copy defaults. |
45 webrtc::PeerConnectionInterface::RTCConfiguration config; | 46 webrtc::PeerConnectionInterface::RTCConfiguration config; |
46 _iceTransportsType = [RTCEnumConverter iceTransportsTypeForNativeEnum:config
.type]; | 47 _iceTransportsType = [RTCEnumConverter iceTransportsTypeForNativeEnum:config
.type]; |
47 _bundlePolicy = [RTCEnumConverter bundlePolicyForNativeEnum:config.bundle_po
licy]; | 48 _bundlePolicy = [RTCEnumConverter bundlePolicyForNativeEnum:config.bundle_po
licy]; |
48 _rtcpMuxPolicy = [RTCEnumConverter rtcpMuxPolicyForNativeEnum:config.rtcp_mu
x_policy]; | 49 _rtcpMuxPolicy = [RTCEnumConverter rtcpMuxPolicyForNativeEnum:config.rtcp_mu
x_policy]; |
49 _tcpCandidatePolicy = | 50 _tcpCandidatePolicy = |
50 [RTCEnumConverter tcpCandidatePolicyForNativeEnum:config.tcp_candidate_p
olicy]; | 51 [RTCEnumConverter tcpCandidatePolicyForNativeEnum:config.tcp_candidate_p
olicy]; |
51 _audioJitterBufferMaxPackets = config.audio_jitter_buffer_max_packets; | 52 _audioJitterBufferMaxPackets = config.audio_jitter_buffer_max_packets; |
| 53 _iceConnectionReceivingTimeout = config.ice_connection_receiving_timeout; |
52 } | 54 } |
53 return self; | 55 return self; |
54 } | 56 } |
55 | 57 |
56 - (instancetype)initWithIceTransportsType:(RTCIceTransportsType)iceTransportsTyp
e | 58 - (instancetype)initWithIceTransportsType:(RTCIceTransportsType)iceTransportsTyp
e |
57 bundlePolicy:(RTCBundlePolicy)bundlePolicy | 59 bundlePolicy:(RTCBundlePolicy)bundlePolicy |
58 rtcpMuxPolicy:(RTCRtcpMuxPolicy)rtcpMuxPolicy | 60 rtcpMuxPolicy:(RTCRtcpMuxPolicy)rtcpMuxPolicy |
59 tcpCandidatePolicy:(RTCTcpCandidatePolicy)tcpCandidatePol
icy | 61 tcpCandidatePolicy:(RTCTcpCandidatePolicy)tcpCandidatePol
icy |
60 audioJitterBufferMaxPackets:(int)audioJitterBufferMaxPackets { | 62 audioJitterBufferMaxPackets:(int)audioJitterBufferMaxPackets |
| 63 iceConnectionReceivingTimeout:(int)iceConnectionReceivingTimeout { |
61 if (self = [super init]) { | 64 if (self = [super init]) { |
62 _iceTransportsType = iceTransportsType; | 65 _iceTransportsType = iceTransportsType; |
63 _bundlePolicy = bundlePolicy; | 66 _bundlePolicy = bundlePolicy; |
64 _rtcpMuxPolicy = rtcpMuxPolicy; | 67 _rtcpMuxPolicy = rtcpMuxPolicy; |
65 _tcpCandidatePolicy = tcpCandidatePolicy; | 68 _tcpCandidatePolicy = tcpCandidatePolicy; |
66 _audioJitterBufferMaxPackets = audioJitterBufferMaxPackets; | 69 _audioJitterBufferMaxPackets = audioJitterBufferMaxPackets; |
| 70 _iceConnectionReceivingTimeout = iceConnectionReceivingTimeout; |
67 } | 71 } |
68 return self; | 72 return self; |
69 } | 73 } |
70 | 74 |
71 #pragma mark - Private | 75 #pragma mark - Private |
72 | 76 |
73 - (webrtc::PeerConnectionInterface::RTCConfiguration)nativeConfiguration { | 77 - (webrtc::PeerConnectionInterface::RTCConfiguration)nativeConfiguration { |
74 webrtc::PeerConnectionInterface::RTCConfiguration nativeConfig; | 78 webrtc::PeerConnectionInterface::RTCConfiguration nativeConfig; |
75 nativeConfig.type = [RTCEnumConverter nativeEnumForIceTransportsType:_iceTrans
portsType]; | 79 nativeConfig.type = [RTCEnumConverter nativeEnumForIceTransportsType:_iceTrans
portsType]; |
76 for (RTCICEServer *iceServer : _iceServers) { | 80 for (RTCICEServer *iceServer : _iceServers) { |
77 nativeConfig.servers.push_back(iceServer.iceServer); | 81 nativeConfig.servers.push_back(iceServer.iceServer); |
78 } | 82 } |
79 nativeConfig.bundle_policy = [RTCEnumConverter nativeEnumForBundlePolicy:_bund
lePolicy]; | 83 nativeConfig.bundle_policy = [RTCEnumConverter nativeEnumForBundlePolicy:_bund
lePolicy]; |
80 nativeConfig.rtcp_mux_policy = [RTCEnumConverter nativeEnumForRtcpMuxPolicy:_r
tcpMuxPolicy]; | 84 nativeConfig.rtcp_mux_policy = [RTCEnumConverter nativeEnumForRtcpMuxPolicy:_r
tcpMuxPolicy]; |
81 nativeConfig.tcp_candidate_policy = | 85 nativeConfig.tcp_candidate_policy = |
82 [RTCEnumConverter nativeEnumForTcpCandidatePolicy:_tcpCandidatePolicy]; | 86 [RTCEnumConverter nativeEnumForTcpCandidatePolicy:_tcpCandidatePolicy]; |
83 nativeConfig.audio_jitter_buffer_max_packets = _audioJitterBufferMaxPackets; | 87 nativeConfig.audio_jitter_buffer_max_packets = _audioJitterBufferMaxPackets; |
| 88 nativeConfig.ice_connection_receiving_timeout = |
| 89 _iceConnectionReceivingTimeout; |
84 return nativeConfig; | 90 return nativeConfig; |
85 } | 91 } |
86 | 92 |
87 @end | 93 @end |
OLD | NEW |