OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "remoting/protocol/webrtc_transport.h" | 5 #include "remoting/protocol/webrtc_transport.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 rtc_config.servers.push_back(stun_server); | 189 rtc_config.servers.push_back(stun_server); |
190 | 190 |
191 webrtc::FakeConstraints constraints; | 191 webrtc::FakeConstraints constraints; |
192 constraints.AddMandatory(webrtc::MediaConstraintsInterface::kEnableDtlsSrtp, | 192 constraints.AddMandatory(webrtc::MediaConstraintsInterface::kEnableDtlsSrtp, |
193 webrtc::MediaConstraintsInterface::kValueTrue); | 193 webrtc::MediaConstraintsInterface::kValueTrue); |
194 | 194 |
195 std::unique_ptr<cricket::PortAllocator> port_allocator = | 195 std::unique_ptr<cricket::PortAllocator> port_allocator = |
196 transport_context_->port_allocator_factory()->CreatePortAllocator( | 196 transport_context_->port_allocator_factory()->CreatePortAllocator( |
197 transport_context_); | 197 transport_context_); |
198 peer_connection_ = peer_connection_factory_->CreatePeerConnection( | 198 peer_connection_ = peer_connection_factory_->CreatePeerConnection( |
199 rtc_config, &constraints, | 199 rtc_config, &constraints, std::move(port_allocator), nullptr, this); |
200 rtc::scoped_ptr<cricket::PortAllocator>(port_allocator.release()), | |
201 nullptr, this); | |
202 | 200 |
203 outgoing_data_stream_adapter_.Initialize(peer_connection_); | 201 outgoing_data_stream_adapter_.Initialize(peer_connection_); |
204 incoming_data_stream_adapter_.Initialize(peer_connection_); | 202 incoming_data_stream_adapter_.Initialize(peer_connection_); |
205 | 203 |
206 event_handler_->OnWebrtcTransportConnecting(); | 204 event_handler_->OnWebrtcTransportConnecting(); |
207 | 205 |
208 if (transport_context_->role() == TransportRole::SERVER) | 206 if (transport_context_->role() == TransportRole::SERVER) |
209 RequestNegotiation(); | 207 RequestNegotiation(); |
210 } | 208 } |
211 | 209 |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 peer_connection_->Close(); | 565 peer_connection_->Close(); |
568 peer_connection_ = nullptr; | 566 peer_connection_ = nullptr; |
569 peer_connection_factory_ = nullptr; | 567 peer_connection_factory_ = nullptr; |
570 | 568 |
571 if (error != OK) | 569 if (error != OK) |
572 event_handler_->OnWebrtcTransportError(error); | 570 event_handler_->OnWebrtcTransportError(error); |
573 } | 571 } |
574 | 572 |
575 } // namespace protocol | 573 } // namespace protocol |
576 } // namespace remoting | 574 } // namespace remoting |
OLD | NEW |