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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 DCHECK(frame_); | 342 DCHECK(frame_); |
343 | 343 |
344 peer_connection_tracker_ = | 344 peer_connection_tracker_ = |
345 RenderThreadImpl::current()->peer_connection_tracker(); | 345 RenderThreadImpl::current()->peer_connection_tracker(); |
346 | 346 |
347 webrtc::PeerConnectionInterface::IceServers servers; | 347 webrtc::PeerConnectionInterface::IceServers servers; |
348 GetNativeIceServers(server_configuration, &servers); | 348 GetNativeIceServers(server_configuration, &servers); |
349 | 349 |
350 RTCMediaConstraints constraints(options); | 350 RTCMediaConstraints constraints(options); |
351 | 351 |
352 if (CommandLine::ForCurrentProcess()->HasSwitch( | 352 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
353 switches::kEnableSCTPDataChannels)) { | 353 switches::kDisableSCTPDataChannels)) { |
354 // TODO(jiayl): replace the hard coded string with | 354 constraints.AddOptional( |
355 // webrtc::MediaConstraintsInterface::kEnableSctpDataChannels when | 355 webrtc::MediaConstraintsInterface::kEnableSctpDataChannels, "true"); |
356 // the Libjingle change is rolled. | |
357 constraints.AddOptional("internalSctpDataChannels", "true"); | |
358 } | 356 } |
359 | 357 |
360 native_peer_connection_ = | 358 native_peer_connection_ = |
361 dependency_factory_->CreatePeerConnection( | 359 dependency_factory_->CreatePeerConnection( |
362 servers, &constraints, frame_, this); | 360 servers, &constraints, frame_, this); |
363 if (!native_peer_connection_.get()) { | 361 if (!native_peer_connection_.get()) { |
364 LOG(ERROR) << "Failed to initialize native PeerConnection."; | 362 LOG(ERROR) << "Failed to initialize native PeerConnection."; |
365 return false; | 363 return false; |
366 } | 364 } |
367 if (peer_connection_tracker_) | 365 if (peer_connection_tracker_) |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
769 webrtc::SessionDescriptionInterface* native_desc = | 767 webrtc::SessionDescriptionInterface* native_desc = |
770 dependency_factory_->CreateSessionDescription(type, sdp, error); | 768 dependency_factory_->CreateSessionDescription(type, sdp, error); |
771 | 769 |
772 LOG_IF(ERROR, !native_desc) << "Failed to create native session description." | 770 LOG_IF(ERROR, !native_desc) << "Failed to create native session description." |
773 << " Type: " << type << " SDP: " << sdp; | 771 << " Type: " << type << " SDP: " << sdp; |
774 | 772 |
775 return native_desc; | 773 return native_desc; |
776 } | 774 } |
777 | 775 |
778 } // namespace content | 776 } // namespace content |
OLD | NEW |