OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
65 static const char kRecvonly[] = "recvonly"; | 65 static const char kRecvonly[] = "recvonly"; |
66 static const char kSendrecv[] = "sendrecv"; | 66 static const char kSendrecv[] = "sendrecv"; |
67 | 67 |
68 // Reference SDP with a MediaStream with label "stream1" and audio track with | 68 // Reference SDP with a MediaStream with label "stream1" and audio track with |
69 // id "audio_1" and a video track with id "video_1; | 69 // id "audio_1" and a video track with id "video_1; |
70 static const char kSdpStringWithStream1[] = | 70 static const char kSdpStringWithStream1[] = |
71 "v=0\r\n" | 71 "v=0\r\n" |
72 "o=- 0 0 IN IP4 127.0.0.1\r\n" | 72 "o=- 0 0 IN IP4 127.0.0.1\r\n" |
73 "s=-\r\n" | 73 "s=-\r\n" |
74 "t=0 0\r\n" | 74 "t=0 0\r\n" |
75 "m=audio 1 RTP/AVPF 103\r\n" | |
75 "a=ice-ufrag:e5785931\r\n" | 76 "a=ice-ufrag:e5785931\r\n" |
76 "a=ice-pwd:36fb7878390db89481c1d46daa4278d8\r\n" | 77 "a=ice-pwd:36fb7878390db89481c1d46daa4278d8\r\n" |
77 "a=fingerprint:sha-256 58:AB:6E:F5:F1:E4:57:B7:E9:46:F4:86:04:28:F9:A7:ED:" | 78 "a=fingerprint:sha-256 58:AB:6E:F5:F1:E4:57:B7:E9:46:F4:86:04:28:F9:A7:ED:" |
78 "BD:AB:AE:40:EF:CE:9A:51:2C:2A:B1:9B:8B:78:84\r\n" | 79 "BD:AB:AE:40:EF:CE:9A:51:2C:2A:B1:9B:8B:78:84\r\n" |
79 "m=audio 1 RTP/AVPF 103\r\n" | |
80 "a=mid:audio\r\n" | 80 "a=mid:audio\r\n" |
81 "a=sendrecv\r\n" | 81 "a=sendrecv\r\n" |
82 "a=rtcp-mux\r\n" | 82 "a=rtcp-mux\r\n" |
83 "a=rtpmap:103 ISAC/16000\r\n" | 83 "a=rtpmap:103 ISAC/16000\r\n" |
84 "a=ssrc:1 cname:stream1\r\n" | 84 "a=ssrc:1 cname:stream1\r\n" |
85 "a=ssrc:1 mslabel:stream1\r\n" | 85 "a=ssrc:1 mslabel:stream1\r\n" |
86 "a=ssrc:1 label:audiotrack0\r\n" | 86 "a=ssrc:1 label:audiotrack0\r\n" |
87 "m=video 1 RTP/AVPF 120\r\n" | 87 "m=video 1 RTP/AVPF 120\r\n" |
88 "a=ice-ufrag:e5785931\r\n" | |
89 "a=ice-pwd:36fb7878390db89481c1d46daa4278d8\r\n" | |
90 "a=fingerprint:sha-256 58:AB:6E:F5:F1:E4:57:B7:E9:46:F4:86:04:28:F9:A7:ED:" | |
91 "BD:AB:AE:40:EF:CE:9A:51:2C:2A:B1:9B:8B:78:84\r\n" | |
88 "a=mid:video\r\n" | 92 "a=mid:video\r\n" |
89 "a=sendrecv\r\n" | 93 "a=sendrecv\r\n" |
90 "a=rtcp-mux\r\n" | 94 "a=rtcp-mux\r\n" |
91 "a=rtpmap:120 VP8/90000\r\n" | 95 "a=rtpmap:120 VP8/90000\r\n" |
92 "a=ssrc:2 cname:stream1\r\n" | 96 "a=ssrc:2 cname:stream1\r\n" |
93 "a=ssrc:2 mslabel:stream1\r\n" | 97 "a=ssrc:2 mslabel:stream1\r\n" |
94 "a=ssrc:2 label:videotrack0\r\n"; | 98 "a=ssrc:2 label:videotrack0\r\n"; |
95 | 99 |
96 // Reference SDP with a MediaStream with label "stream1" and audio track with | 100 // Reference SDP with a MediaStream with label "stream1" and audio track with |
97 // id "audio_1"; | 101 // id "audio_1"; |
98 static const char kSdpStringWithStream1AudioTrackOnly[] = | 102 static const char kSdpStringWithStream1AudioTrackOnly[] = |
99 "v=0\r\n" | 103 "v=0\r\n" |
100 "o=- 0 0 IN IP4 127.0.0.1\r\n" | 104 "o=- 0 0 IN IP4 127.0.0.1\r\n" |
101 "s=-\r\n" | 105 "s=-\r\n" |
102 "t=0 0\r\n" | 106 "t=0 0\r\n" |
107 "m=audio 1 RTP/AVPF 103\r\n" | |
103 "a=ice-ufrag:e5785931\r\n" | 108 "a=ice-ufrag:e5785931\r\n" |
104 "a=ice-pwd:36fb7878390db89481c1d46daa4278d8\r\n" | 109 "a=ice-pwd:36fb7878390db89481c1d46daa4278d8\r\n" |
105 "a=fingerprint:sha-256 58:AB:6E:F5:F1:E4:57:B7:E9:46:F4:86:04:28:F9:A7:ED:" | 110 "a=fingerprint:sha-256 58:AB:6E:F5:F1:E4:57:B7:E9:46:F4:86:04:28:F9:A7:ED:" |
106 "BD:AB:AE:40:EF:CE:9A:51:2C:2A:B1:9B:8B:78:84\r\n" | 111 "BD:AB:AE:40:EF:CE:9A:51:2C:2A:B1:9B:8B:78:84\r\n" |
107 "m=audio 1 RTP/AVPF 103\r\n" | |
108 "a=mid:audio\r\n" | 112 "a=mid:audio\r\n" |
109 "a=sendrecv\r\n" | 113 "a=sendrecv\r\n" |
110 "a=rtpmap:103 ISAC/16000\r\n" | 114 "a=rtpmap:103 ISAC/16000\r\n" |
111 "a=ssrc:1 cname:stream1\r\n" | 115 "a=ssrc:1 cname:stream1\r\n" |
112 "a=ssrc:1 mslabel:stream1\r\n" | 116 "a=ssrc:1 mslabel:stream1\r\n" |
113 "a=ssrc:1 label:audiotrack0\r\n" | 117 "a=ssrc:1 label:audiotrack0\r\n" |
114 "a=rtcp-mux\r\n"; | 118 "a=rtcp-mux\r\n"; |
115 | 119 |
116 // Reference SDP with two MediaStreams with label "stream1" and "stream2. Each | 120 // Reference SDP with two MediaStreams with label "stream1" and "stream2. Each |
117 // MediaStreams have one audio track and one video track. | 121 // MediaStreams have one audio track and one video track. |
118 // This uses MSID. | 122 // This uses MSID. |
119 static const char kSdpStringWithStream1And2[] = | 123 static const char kSdpStringWithStream1And2[] = |
120 "v=0\r\n" | 124 "v=0\r\n" |
121 "o=- 0 0 IN IP4 127.0.0.1\r\n" | 125 "o=- 0 0 IN IP4 127.0.0.1\r\n" |
122 "s=-\r\n" | 126 "s=-\r\n" |
123 "t=0 0\r\n" | 127 "t=0 0\r\n" |
128 "a=msid-semantic: WMS stream1 stream2\r\n" | |
129 "m=audio 1 RTP/AVPF 103\r\n" | |
124 "a=ice-ufrag:e5785931\r\n" | 130 "a=ice-ufrag:e5785931\r\n" |
125 "a=ice-pwd:36fb7878390db89481c1d46daa4278d8\r\n" | 131 "a=ice-pwd:36fb7878390db89481c1d46daa4278d8\r\n" |
126 "a=fingerprint:sha-256 58:AB:6E:F5:F1:E4:57:B7:E9:46:F4:86:04:28:F9:A7:ED:" | 132 "a=fingerprint:sha-256 58:AB:6E:F5:F1:E4:57:B7:E9:46:F4:86:04:28:F9:A7:ED:" |
127 "BD:AB:AE:40:EF:CE:9A:51:2C:2A:B1:9B:8B:78:84\r\n" | 133 "BD:AB:AE:40:EF:CE:9A:51:2C:2A:B1:9B:8B:78:84\r\n" |
128 "a=msid-semantic: WMS stream1 stream2\r\n" | |
129 "m=audio 1 RTP/AVPF 103\r\n" | |
130 "a=mid:audio\r\n" | 134 "a=mid:audio\r\n" |
131 "a=sendrecv\r\n" | 135 "a=sendrecv\r\n" |
132 "a=rtcp-mux\r\n" | 136 "a=rtcp-mux\r\n" |
133 "a=rtpmap:103 ISAC/16000\r\n" | 137 "a=rtpmap:103 ISAC/16000\r\n" |
134 "a=ssrc:1 cname:stream1\r\n" | 138 "a=ssrc:1 cname:stream1\r\n" |
135 "a=ssrc:1 msid:stream1 audiotrack0\r\n" | 139 "a=ssrc:1 msid:stream1 audiotrack0\r\n" |
136 "a=ssrc:3 cname:stream2\r\n" | 140 "a=ssrc:3 cname:stream2\r\n" |
137 "a=ssrc:3 msid:stream2 audiotrack1\r\n" | 141 "a=ssrc:3 msid:stream2 audiotrack1\r\n" |
138 "m=video 1 RTP/AVPF 120\r\n" | 142 "m=video 1 RTP/AVPF 120\r\n" |
143 "a=ice-ufrag:e5785931\r\n" | |
144 "a=ice-pwd:36fb7878390db89481c1d46daa4278d8\r\n" | |
145 "a=fingerprint:sha-256 58:AB:6E:F5:F1:E4:57:B7:E9:46:F4:86:04:28:F9:A7:ED:" | |
146 "BD:AB:AE:40:EF:CE:9A:51:2C:2A:B1:9B:8B:78:84\r\n" | |
139 "a=mid:video\r\n" | 147 "a=mid:video\r\n" |
140 "a=sendrecv\r\n" | 148 "a=sendrecv\r\n" |
141 "a=rtcp-mux\r\n" | 149 "a=rtcp-mux\r\n" |
142 "a=rtpmap:120 VP8/0\r\n" | 150 "a=rtpmap:120 VP8/0\r\n" |
143 "a=ssrc:2 cname:stream1\r\n" | 151 "a=ssrc:2 cname:stream1\r\n" |
144 "a=ssrc:2 msid:stream1 videotrack0\r\n" | 152 "a=ssrc:2 msid:stream1 videotrack0\r\n" |
145 "a=ssrc:4 cname:stream2\r\n" | 153 "a=ssrc:4 cname:stream2\r\n" |
146 "a=ssrc:4 msid:stream2 videotrack1\r\n"; | 154 "a=ssrc:4 msid:stream2 videotrack1\r\n"; |
147 | 155 |
148 // Reference SDP without MediaStreams. Msid is not supported. | 156 // Reference SDP without MediaStreams. Msid is not supported. |
149 static const char kSdpStringWithoutStreams[] = | 157 static const char kSdpStringWithoutStreams[] = |
150 "v=0\r\n" | 158 "v=0\r\n" |
151 "o=- 0 0 IN IP4 127.0.0.1\r\n" | 159 "o=- 0 0 IN IP4 127.0.0.1\r\n" |
152 "s=-\r\n" | 160 "s=-\r\n" |
153 "t=0 0\r\n" | 161 "t=0 0\r\n" |
162 "m=audio 1 RTP/AVPF 103\r\n" | |
154 "a=ice-ufrag:e5785931\r\n" | 163 "a=ice-ufrag:e5785931\r\n" |
155 "a=ice-pwd:36fb7878390db89481c1d46daa4278d8\r\n" | 164 "a=ice-pwd:36fb7878390db89481c1d46daa4278d8\r\n" |
156 "a=fingerprint:sha-256 58:AB:6E:F5:F1:E4:57:B7:E9:46:F4:86:04:28:F9:A7:ED:" | 165 "a=fingerprint:sha-256 58:AB:6E:F5:F1:E4:57:B7:E9:46:F4:86:04:28:F9:A7:ED:" |
157 "BD:AB:AE:40:EF:CE:9A:51:2C:2A:B1:9B:8B:78:84\r\n" | 166 "BD:AB:AE:40:EF:CE:9A:51:2C:2A:B1:9B:8B:78:84\r\n" |
158 "m=audio 1 RTP/AVPF 103\r\n" | |
159 "a=mid:audio\r\n" | 167 "a=mid:audio\r\n" |
160 "a=sendrecv\r\n" | 168 "a=sendrecv\r\n" |
161 "a=rtcp-mux\r\n" | 169 "a=rtcp-mux\r\n" |
162 "a=rtpmap:103 ISAC/16000\r\n" | 170 "a=rtpmap:103 ISAC/16000\r\n" |
163 "m=video 1 RTP/AVPF 120\r\n" | 171 "m=video 1 RTP/AVPF 120\r\n" |
172 "a=ice-ufrag:e5785931\r\n" | |
173 "a=ice-pwd:36fb7878390db89481c1d46daa4278d8\r\n" | |
174 "a=fingerprint:sha-256 58:AB:6E:F5:F1:E4:57:B7:E9:46:F4:86:04:28:F9:A7:ED:" | |
175 "BD:AB:AE:40:EF:CE:9A:51:2C:2A:B1:9B:8B:78:84\r\n" | |
164 "a=mid:video\r\n" | 176 "a=mid:video\r\n" |
165 "a=sendrecv\r\n" | 177 "a=sendrecv\r\n" |
166 "a=rtcp-mux\r\n" | 178 "a=rtcp-mux\r\n" |
167 "a=rtpmap:120 VP8/90000\r\n"; | 179 "a=rtpmap:120 VP8/90000\r\n"; |
168 | 180 |
169 // Reference SDP without MediaStreams. Msid is supported. | 181 // Reference SDP without MediaStreams. Msid is supported. |
170 static const char kSdpStringWithMsidWithoutStreams[] = | 182 static const char kSdpStringWithMsidWithoutStreams[] = |
171 "v=0\r\n" | 183 "v=0\r\n" |
172 "o=- 0 0 IN IP4 127.0.0.1\r\n" | 184 "o=- 0 0 IN IP4 127.0.0.1\r\n" |
173 "s=-\r\n" | 185 "s=-\r\n" |
174 "t=0 0\r\n" | 186 "t=0 0\r\n" |
187 "a=msid-semantic: WMS\r\n" | |
188 "m=audio 1 RTP/AVPF 103\r\n" | |
175 "a=ice-ufrag:e5785931\r\n" | 189 "a=ice-ufrag:e5785931\r\n" |
176 "a=ice-pwd:36fb7878390db89481c1d46daa4278d8\r\n" | 190 "a=ice-pwd:36fb7878390db89481c1d46daa4278d8\r\n" |
177 "a=fingerprint:sha-256 58:AB:6E:F5:F1:E4:57:B7:E9:46:F4:86:04:28:F9:A7:ED:" | 191 "a=fingerprint:sha-256 58:AB:6E:F5:F1:E4:57:B7:E9:46:F4:86:04:28:F9:A7:ED:" |
178 "BD:AB:AE:40:EF:CE:9A:51:2C:2A:B1:9B:8B:78:84\r\n" | 192 "BD:AB:AE:40:EF:CE:9A:51:2C:2A:B1:9B:8B:78:84\r\n" |
179 "a=msid-semantic: WMS\r\n" | |
180 "m=audio 1 RTP/AVPF 103\r\n" | |
181 "a=mid:audio\r\n" | 193 "a=mid:audio\r\n" |
182 "a=sendrecv\r\n" | 194 "a=sendrecv\r\n" |
183 "a=rtcp-mux\r\n" | 195 "a=rtcp-mux\r\n" |
184 "a=rtpmap:103 ISAC/16000\r\n" | 196 "a=rtpmap:103 ISAC/16000\r\n" |
185 "m=video 1 RTP/AVPF 120\r\n" | 197 "m=video 1 RTP/AVPF 120\r\n" |
198 "a=ice-ufrag:e5785931\r\n" | |
199 "a=ice-pwd:36fb7878390db89481c1d46daa4278d8\r\n" | |
200 "a=fingerprint:sha-256 58:AB:6E:F5:F1:E4:57:B7:E9:46:F4:86:04:28:F9:A7:ED:" | |
201 "BD:AB:AE:40:EF:CE:9A:51:2C:2A:B1:9B:8B:78:84\r\n" | |
186 "a=mid:video\r\n" | 202 "a=mid:video\r\n" |
187 "a=sendrecv\r\n" | 203 "a=sendrecv\r\n" |
188 "a=rtcp-mux\r\n" | 204 "a=rtcp-mux\r\n" |
189 "a=rtpmap:120 VP8/90000\r\n"; | 205 "a=rtpmap:120 VP8/90000\r\n"; |
190 | 206 |
191 // Reference SDP without MediaStreams and audio only. | 207 // Reference SDP without MediaStreams and audio only. |
192 static const char kSdpStringWithoutStreamsAudioOnly[] = | 208 static const char kSdpStringWithoutStreamsAudioOnly[] = |
193 "v=0\r\n" | 209 "v=0\r\n" |
194 "o=- 0 0 IN IP4 127.0.0.1\r\n" | 210 "o=- 0 0 IN IP4 127.0.0.1\r\n" |
195 "s=-\r\n" | 211 "s=-\r\n" |
196 "t=0 0\r\n" | 212 "t=0 0\r\n" |
213 "m=audio 1 RTP/AVPF 103\r\n" | |
197 "a=ice-ufrag:e5785931\r\n" | 214 "a=ice-ufrag:e5785931\r\n" |
198 "a=ice-pwd:36fb7878390db89481c1d46daa4278d8\r\n" | 215 "a=ice-pwd:36fb7878390db89481c1d46daa4278d8\r\n" |
199 "a=fingerprint:sha-256 58:AB:6E:F5:F1:E4:57:B7:E9:46:F4:86:04:28:F9:A7:ED:" | 216 "a=fingerprint:sha-256 58:AB:6E:F5:F1:E4:57:B7:E9:46:F4:86:04:28:F9:A7:ED:" |
200 "BD:AB:AE:40:EF:CE:9A:51:2C:2A:B1:9B:8B:78:84\r\n" | 217 "BD:AB:AE:40:EF:CE:9A:51:2C:2A:B1:9B:8B:78:84\r\n" |
201 "m=audio 1 RTP/AVPF 103\r\n" | |
202 "a=mid:audio\r\n" | 218 "a=mid:audio\r\n" |
203 "a=sendrecv\r\n" | 219 "a=sendrecv\r\n" |
204 "a=rtcp-mux\r\n" | 220 "a=rtcp-mux\r\n" |
205 "a=rtpmap:103 ISAC/16000\r\n"; | 221 "a=rtpmap:103 ISAC/16000\r\n"; |
206 | 222 |
207 // Reference SENDONLY SDP without MediaStreams. Msid is not supported. | 223 // Reference SENDONLY SDP without MediaStreams. Msid is not supported. |
208 static const char kSdpStringSendOnlyWithoutStreams[] = | 224 static const char kSdpStringSendOnlyWithoutStreams[] = |
209 "v=0\r\n" | 225 "v=0\r\n" |
210 "o=- 0 0 IN IP4 127.0.0.1\r\n" | 226 "o=- 0 0 IN IP4 127.0.0.1\r\n" |
211 "s=-\r\n" | 227 "s=-\r\n" |
212 "t=0 0\r\n" | 228 "t=0 0\r\n" |
229 "m=audio 1 RTP/AVPF 103\r\n" | |
213 "a=ice-ufrag:e5785931\r\n" | 230 "a=ice-ufrag:e5785931\r\n" |
214 "a=ice-pwd:36fb7878390db89481c1d46daa4278d8\r\n" | 231 "a=ice-pwd:36fb7878390db89481c1d46daa4278d8\r\n" |
215 "a=fingerprint:sha-256 58:AB:6E:F5:F1:E4:57:B7:E9:46:F4:86:04:28:F9:A7:ED:" | 232 "a=fingerprint:sha-256 58:AB:6E:F5:F1:E4:57:B7:E9:46:F4:86:04:28:F9:A7:ED:" |
216 "BD:AB:AE:40:EF:CE:9A:51:2C:2A:B1:9B:8B:78:84\r\n" | 233 "BD:AB:AE:40:EF:CE:9A:51:2C:2A:B1:9B:8B:78:84\r\n" |
217 "m=audio 1 RTP/AVPF 103\r\n" | |
218 "a=mid:audio\r\n" | 234 "a=mid:audio\r\n" |
219 "a=sendrecv\r\n" | 235 "a=sendrecv\r\n" |
220 "a=sendonly\r\n" | 236 "a=sendonly\r\n" |
221 "a=rtcp-mux\r\n" | 237 "a=rtcp-mux\r\n" |
222 "a=rtpmap:103 ISAC/16000\r\n" | 238 "a=rtpmap:103 ISAC/16000\r\n" |
223 "m=video 1 RTP/AVPF 120\r\n" | 239 "m=video 1 RTP/AVPF 120\r\n" |
240 "a=ice-ufrag:e5785931\r\n" | |
241 "a=ice-pwd:36fb7878390db89481c1d46daa4278d8\r\n" | |
242 "a=fingerprint:sha-256 58:AB:6E:F5:F1:E4:57:B7:E9:46:F4:86:04:28:F9:A7:ED:" | |
243 "BD:AB:AE:40:EF:CE:9A:51:2C:2A:B1:9B:8B:78:84\r\n" | |
224 "a=mid:video\r\n" | 244 "a=mid:video\r\n" |
225 "a=sendrecv\r\n" | 245 "a=sendrecv\r\n" |
226 "a=sendonly\r\n" | 246 "a=sendonly\r\n" |
227 "a=rtcp-mux\r\n" | 247 "a=rtcp-mux\r\n" |
228 "a=rtpmap:120 VP8/90000\r\n"; | 248 "a=rtpmap:120 VP8/90000\r\n"; |
229 | 249 |
230 static const char kSdpStringInit[] = | 250 static const char kSdpStringInit[] = |
231 "v=0\r\n" | 251 "v=0\r\n" |
232 "o=- 0 0 IN IP4 127.0.0.1\r\n" | 252 "o=- 0 0 IN IP4 127.0.0.1\r\n" |
233 "s=-\r\n" | 253 "s=-\r\n" |
234 "t=0 0\r\n" | 254 "t=0 0\r\n" |
255 "a=msid-semantic: WMS\r\n"; | |
256 | |
257 static const char kSdpStringAudio[] = | |
258 "m=audio 1 RTP/AVPF 103\r\n" | |
235 "a=ice-ufrag:e5785931\r\n" | 259 "a=ice-ufrag:e5785931\r\n" |
236 "a=ice-pwd:36fb7878390db89481c1d46daa4278d8\r\n" | 260 "a=ice-pwd:36fb7878390db89481c1d46daa4278d8\r\n" |
237 "a=fingerprint:sha-256 58:AB:6E:F5:F1:E4:57:B7:E9:46:F4:86:04:28:F9:A7:ED:" | 261 "a=fingerprint:sha-256 58:AB:6E:F5:F1:E4:57:B7:E9:46:F4:86:04:28:F9:A7:ED:" |
238 "BD:AB:AE:40:EF:CE:9A:51:2C:2A:B1:9B:8B:78:84\r\n" | 262 "BD:AB:AE:40:EF:CE:9A:51:2C:2A:B1:9B:8B:78:84\r\n" |
239 "a=msid-semantic: WMS\r\n"; | |
240 | |
241 static const char kSdpStringAudio[] = | |
242 "m=audio 1 RTP/AVPF 103\r\n" | |
243 "a=mid:audio\r\n" | 263 "a=mid:audio\r\n" |
244 "a=sendrecv\r\n" | 264 "a=sendrecv\r\n" |
245 "a=rtcp-mux\r\n" | 265 "a=rtcp-mux\r\n" |
246 "a=rtpmap:103 ISAC/16000\r\n"; | 266 "a=rtpmap:103 ISAC/16000\r\n"; |
247 | 267 |
248 static const char kSdpStringVideo[] = | 268 static const char kSdpStringVideo[] = |
249 "m=video 1 RTP/AVPF 120\r\n" | 269 "m=video 1 RTP/AVPF 120\r\n" |
270 "a=ice-ufrag:e5785931\r\n" | |
271 "a=ice-pwd:36fb7878390db89481c1d46daa4278d8\r\n" | |
272 "a=fingerprint:sha-256 58:AB:6E:F5:F1:E4:57:B7:E9:46:F4:86:04:28:F9:A7:ED:" | |
273 "BD:AB:AE:40:EF:CE:9A:51:2C:2A:B1:9B:8B:78:84\r\n" | |
250 "a=mid:video\r\n" | 274 "a=mid:video\r\n" |
251 "a=sendrecv\r\n" | 275 "a=sendrecv\r\n" |
252 "a=rtcp-mux\r\n" | 276 "a=rtcp-mux\r\n" |
253 "a=rtpmap:120 VP8/90000\r\n"; | 277 "a=rtpmap:120 VP8/90000\r\n"; |
254 | 278 |
255 static const char kSdpStringMs1Audio0[] = | 279 static const char kSdpStringMs1Audio0[] = |
256 "a=ssrc:1 cname:stream1\r\n" | 280 "a=ssrc:1 cname:stream1\r\n" |
257 "a=ssrc:1 msid:stream1 audiotrack0\r\n"; | 281 "a=ssrc:1 msid:stream1 audiotrack0\r\n"; |
258 | 282 |
259 static const char kSdpStringMs1Video0[] = | 283 static const char kSdpStringMs1Video0[] = |
(...skipping 2459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2719 CreateAndSetRemoteOffer(kSdpStringWithStream1AudioTrackOnly); | 2743 CreateAndSetRemoteOffer(kSdpStringWithStream1AudioTrackOnly); |
2720 EXPECT_EQ(observer_.num_added_tracks_, 1); | 2744 EXPECT_EQ(observer_.num_added_tracks_, 1); |
2721 EXPECT_EQ(observer_.last_added_track_label_, kAudioTracks[0]); | 2745 EXPECT_EQ(observer_.last_added_track_label_, kAudioTracks[0]); |
2722 | 2746 |
2723 // Create and set the updated remote SDP. | 2747 // Create and set the updated remote SDP. |
2724 CreateAndSetRemoteOffer(kSdpStringWithStream1); | 2748 CreateAndSetRemoteOffer(kSdpStringWithStream1); |
2725 EXPECT_EQ(observer_.num_added_tracks_, 2); | 2749 EXPECT_EQ(observer_.num_added_tracks_, 2); |
2726 EXPECT_EQ(observer_.last_added_track_label_, kVideoTracks[0]); | 2750 EXPECT_EQ(observer_.last_added_track_label_, kVideoTracks[0]); |
2727 } | 2751 } |
2728 | 2752 |
2753 // Test that when SetConfiguration is called and the configuration is | |
2754 // changing, the next offer causes an ICE restart. | |
2755 TEST_F(PeerConnectionInterfaceTest, SetConfigurationCausingIceRetart) { | |
2756 PeerConnectionInterface::RTCConfiguration config; | |
2757 config.type = PeerConnectionInterface::kRelay; | |
2758 // Need to pass default constraints to prevent disabling of DTLS... | |
2759 FakeConstraints default_constraints; | |
2760 CreatePeerConnection(config, &default_constraints); | |
2761 AddAudioVideoStream(kStreamLabel1, "audio_label", "video_label"); | |
2762 | |
2763 // Do initial offer/answer so there's something to restart. | |
2764 CreateOfferAsLocalDescription(); | |
2765 CreateAnswerAsRemoteDescription(kSdpStringWithStream1); | |
2766 | |
2767 // Grab the ufrags. | |
2768 const cricket::SessionDescription* initial_offer = | |
2769 pc_->local_description()->description(); | |
2770 std::vector<std::string> initial_ufrags; | |
2771 for (const cricket::TransportInfo& info : initial_offer->transport_infos()) { | |
2772 initial_ufrags.push_back(info.description.ice_ufrag); | |
2773 } | |
2774 | |
2775 // Change ICE policy, which should trigger an ICE restart on the next offer. | |
2776 config.type = PeerConnectionInterface::kAll; | |
2777 EXPECT_TRUE(pc_->SetConfiguration(config)); | |
2778 CreateOfferAsLocalDescription(); | |
2779 | |
2780 // Grab the new ufrags. | |
2781 const cricket::SessionDescription* subsequent_offer = | |
2782 pc_->local_description()->description(); | |
2783 std::vector<std::string> subsequent_ufrags; | |
2784 for (const cricket::TransportInfo& info : | |
2785 subsequent_offer->transport_infos()) { | |
2786 subsequent_ufrags.push_back(info.description.ice_ufrag); | |
2787 } | |
2788 | |
2789 // Sanity check. | |
2790 EXPECT_EQ(initial_ufrags.size(), subsequent_ufrags.size()); | |
2791 // Check that each ufrag is different. | |
2792 for (int i = 0; i < initial_ufrags.size(); ++i) { | |
2793 EXPECT_NE(initial_ufrags[i], subsequent_ufrags[i]); | |
2794 } | |
2795 } | |
2796 | |
2797 // Test that when SetConfiguration is called and the configuration *isn't* | |
2798 // changing, the next offer does *not* cause an ICE restart. | |
2799 TEST_F(PeerConnectionInterfaceTest, SetConfigurationNotCausingIceRetart) { | |
2800 PeerConnectionInterface::RTCConfiguration config; | |
2801 config.type = PeerConnectionInterface::kRelay; | |
2802 // Need to pass default constraints to prevent disabling of DTLS... | |
2803 FakeConstraints default_constraints; | |
2804 CreatePeerConnection(config, &default_constraints); | |
2805 AddAudioVideoStream(kStreamLabel1, "audio_label", "video_label"); | |
2806 | |
2807 // Do initial offer/answer so there's something to restart. | |
2808 CreateOfferAsLocalDescription(); | |
2809 CreateAnswerAsRemoteDescription(kSdpStringWithStream1); | |
2810 | |
2811 // Grab the ufrags. | |
2812 const cricket::SessionDescription* initial_offer = | |
2813 pc_->local_description()->description(); | |
2814 std::vector<std::string> initial_ufrags; | |
2815 for (const cricket::TransportInfo& info : initial_offer->transport_infos()) { | |
2816 initial_ufrags.push_back(info.description.ice_ufrag); | |
2817 } | |
2818 | |
2819 // Call SetConfiguration with a config identical to what the PC was | |
2820 // constructed with. | |
2821 EXPECT_TRUE(pc_->SetConfiguration(config)); | |
2822 CreateOfferAsLocalDescription(); | |
2823 | |
2824 // Grab the new ufrags. | |
2825 const cricket::SessionDescription* subsequent_offer = | |
2826 pc_->local_description()->description(); | |
2827 std::vector<std::string> subsequent_ufrags; | |
2828 for (const cricket::TransportInfo& info : | |
2829 subsequent_offer->transport_infos()) { | |
2830 subsequent_ufrags.push_back(info.description.ice_ufrag); | |
2831 } | |
2832 | |
2833 EXPECT_EQ(initial_ufrags, subsequent_ufrags); | |
2834 } | |
2835 | |
2836 // Test for a weird corner case scenario: | |
2837 // 1. Audio/video session established. | |
2838 // 2. SetConfiguration changes ICE config; ICE restart needed. | |
2839 // 3. ICE restart initiated by remote peer, but only for one m= section. | |
2840 // 4. Next createOffer should initiate an ICE restart, but only for the other | |
2841 // m= section; it would be pointless to do an ICE restart for the m= section | |
2842 // that was already restarted. | |
2843 TEST_F(PeerConnectionInterfaceTest, SetConfigurationCausingPartialIceRestart) { | |
2844 PeerConnectionInterface::RTCConfiguration config; | |
2845 config.type = PeerConnectionInterface::kRelay; | |
2846 // Need to pass default constraints to prevent disabling of DTLS... | |
2847 FakeConstraints default_constraints; | |
2848 CreatePeerConnection(config, &default_constraints); | |
2849 AddAudioVideoStream(kStreamLabel1, "audio_label", "video_label"); | |
2850 | |
2851 // Do initial offer/answer so there's something to restart. | |
2852 CreateOfferAsLocalDescription(); | |
2853 CreateAnswerAsRemoteDescription(kSdpStringWithStream1); | |
2854 | |
2855 // Change ICE policy, which should set the "needs-ice-restart" flag. | |
2856 config.type = PeerConnectionInterface::kAll; | |
2857 EXPECT_TRUE(pc_->SetConfiguration(config)); | |
2858 | |
2859 // Do ICE restart for the first m= section, initiated by remote peer. | |
2860 webrtc::JsepSessionDescription* remote_offer = | |
2861 new webrtc::JsepSessionDescription(SessionDescriptionInterface::kOffer); | |
2862 EXPECT_TRUE(remote_offer->Initialize(kSdpStringWithStream1, nullptr)); | |
2863 remote_offer->description()->transport_infos()[0].description.ice_ufrag = | |
2864 "modified"; | |
2865 EXPECT_TRUE(DoSetRemoteDescription(remote_offer)); | |
2866 CreateAnswerAsLocalDescription(); | |
2867 | |
2868 // Grab the ufrags. | |
2869 const cricket::SessionDescription* local_answer = | |
2870 pc_->local_description()->description(); | |
2871 std::vector<std::string> initial_ufrags; | |
2872 for (const cricket::TransportInfo& info : local_answer->transport_infos()) { | |
2873 initial_ufrags.push_back(info.description.ice_ufrag); | |
2874 } | |
2875 | |
2876 // Create offer and grab the new ufrags. | |
2877 CreateOfferAsLocalDescription(); | |
2878 const cricket::SessionDescription* subsequent_offer = | |
2879 pc_->local_description()->description(); | |
2880 std::vector<std::string> subsequent_ufrags; | |
2881 for (const cricket::TransportInfo& info : | |
2882 subsequent_offer->transport_infos()) { | |
2883 subsequent_ufrags.push_back(info.description.ice_ufrag); | |
2884 } | |
2885 | |
2886 // Ensure that only the ufrag for the second m= section changed. | |
2887 EXPECT_EQ(initial_ufrags[0], subsequent_ufrags[0]); | |
2888 EXPECT_NE(initial_ufrags[1], subsequent_ufrags[1]); | |
2889 } | |
Taylor Brandstetter
2016/12/09 22:15:53
Note that this test was passing even before I impl
| |
2890 | |
2729 class PeerConnectionMediaConfigTest : public testing::Test { | 2891 class PeerConnectionMediaConfigTest : public testing::Test { |
2730 protected: | 2892 protected: |
2731 void SetUp() override { | 2893 void SetUp() override { |
2732 pcf_ = new rtc::RefCountedObject<PeerConnectionFactoryForTest>(); | 2894 pcf_ = new rtc::RefCountedObject<PeerConnectionFactoryForTest>(); |
2733 pcf_->Initialize(); | 2895 pcf_->Initialize(); |
2734 } | 2896 } |
2735 const cricket::MediaConfig& TestCreatePeerConnection( | 2897 const cricket::MediaConfig& TestCreatePeerConnection( |
2736 const PeerConnectionInterface::RTCConfiguration& config, | 2898 const PeerConnectionInterface::RTCConfiguration& config, |
2737 const MediaConstraintsInterface *constraints) { | 2899 const MediaConstraintsInterface *constraints) { |
2738 pcf_->create_media_controller_called_ = false; | 2900 pcf_->create_media_controller_called_ = false; |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2982 FakeConstraints updated_answer_c; | 3144 FakeConstraints updated_answer_c; |
2983 answer_c.SetMandatoryReceiveAudio(false); | 3145 answer_c.SetMandatoryReceiveAudio(false); |
2984 answer_c.SetMandatoryReceiveVideo(false); | 3146 answer_c.SetMandatoryReceiveVideo(false); |
2985 | 3147 |
2986 cricket::MediaSessionOptions updated_answer_options; | 3148 cricket::MediaSessionOptions updated_answer_options; |
2987 EXPECT_TRUE( | 3149 EXPECT_TRUE( |
2988 ParseConstraintsForAnswer(&updated_answer_c, &updated_answer_options)); | 3150 ParseConstraintsForAnswer(&updated_answer_c, &updated_answer_options)); |
2989 EXPECT_TRUE(updated_answer_options.has_audio()); | 3151 EXPECT_TRUE(updated_answer_options.has_audio()); |
2990 EXPECT_TRUE(updated_answer_options.has_video()); | 3152 EXPECT_TRUE(updated_answer_options.has_video()); |
2991 } | 3153 } |
OLD | NEW |