OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/renderer/media/rtc_peer_connection_handler.h" | 5 #include "content/renderer/media/rtc_peer_connection_handler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 DCHECK(frame_); | 340 DCHECK(frame_); |
341 | 341 |
342 peer_connection_tracker_ = | 342 peer_connection_tracker_ = |
343 RenderThreadImpl::current()->peer_connection_tracker(); | 343 RenderThreadImpl::current()->peer_connection_tracker(); |
344 | 344 |
345 webrtc::PeerConnectionInterface::IceServers servers; | 345 webrtc::PeerConnectionInterface::IceServers servers; |
346 GetNativeIceServers(server_configuration, &servers); | 346 GetNativeIceServers(server_configuration, &servers); |
347 | 347 |
348 RTCMediaConstraints constraints(options); | 348 RTCMediaConstraints constraints(options); |
349 | 349 |
350 if (!CommandLine::ForCurrentProcess()->HasSwitch( | |
351 switches::kDisableSCTPDataChannels)) { | |
352 constraints.AddOptional( | |
353 webrtc::MediaConstraintsInterface::kEnableSctpDataChannels, "true"); | |
354 } | |
355 | |
356 native_peer_connection_ = | 350 native_peer_connection_ = |
357 dependency_factory_->CreatePeerConnection( | 351 dependency_factory_->CreatePeerConnection( |
358 servers, &constraints, frame_, this); | 352 servers, &constraints, frame_, this); |
359 if (!native_peer_connection_.get()) { | 353 if (!native_peer_connection_.get()) { |
360 LOG(ERROR) << "Failed to initialize native PeerConnection."; | 354 LOG(ERROR) << "Failed to initialize native PeerConnection."; |
361 return false; | 355 return false; |
362 } | 356 } |
363 if (peer_connection_tracker_) | 357 if (peer_connection_tracker_) |
364 peer_connection_tracker_->RegisterPeerConnection( | 358 peer_connection_tracker_->RegisterPeerConnection( |
365 this, servers, constraints, frame_); | 359 this, servers, constraints, frame_); |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
776 webrtc::SessionDescriptionInterface* native_desc = | 770 webrtc::SessionDescriptionInterface* native_desc = |
777 dependency_factory_->CreateSessionDescription(type, sdp, error); | 771 dependency_factory_->CreateSessionDescription(type, sdp, error); |
778 | 772 |
779 LOG_IF(ERROR, !native_desc) << "Failed to create native session description." | 773 LOG_IF(ERROR, !native_desc) << "Failed to create native session description." |
780 << " Type: " << type << " SDP: " << sdp; | 774 << " Type: " << type << " SDP: " << sdp; |
781 | 775 |
782 return native_desc; | 776 return native_desc; |
783 } | 777 } |
784 | 778 |
785 } // namespace content | 779 } // namespace content |
OLD | NEW |