OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/host/cast_extension_session.h" | 5 #include "remoting/host/cast_extension_session.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/synchronization/waitable_event.h" | 11 #include "base/synchronization/waitable_event.h" |
12 #include "net/url_request/url_request_context_getter.h" | 12 #include "net/url_request/url_request_context_getter.h" |
13 #include "remoting/host/cast_video_capturer_adapter.h" | 13 #include "remoting/host/cast_video_capturer_adapter.h" |
14 #include "remoting/host/chromium_port_allocator_factory.h" | |
15 #include "remoting/host/client_session.h" | 14 #include "remoting/host/client_session.h" |
16 #include "remoting/proto/control.pb.h" | 15 #include "remoting/proto/control.pb.h" |
| 16 #include "remoting/protocol/chromium_port_allocator_factory.h" |
17 #include "remoting/protocol/client_stub.h" | 17 #include "remoting/protocol/client_stub.h" |
18 #include "third_party/libjingle/source/talk/app/webrtc/mediastreaminterface.h" | 18 #include "third_party/libjingle/source/talk/app/webrtc/mediastreaminterface.h" |
19 #include "third_party/libjingle/source/talk/app/webrtc/test/fakeconstraints.h" | 19 #include "third_party/libjingle/source/talk/app/webrtc/test/fakeconstraints.h" |
20 #include "third_party/libjingle/source/talk/app/webrtc/videosourceinterface.h" | 20 #include "third_party/libjingle/source/talk/app/webrtc/videosourceinterface.h" |
21 | 21 |
22 namespace remoting { | 22 namespace remoting { |
23 | 23 |
24 // Used as the type attribute of all Cast protocol::ExtensionMessages. | 24 // Used as the type attribute of all Cast protocol::ExtensionMessages. |
25 const char kExtensionMessageType[] = "cast_message"; | 25 const char kExtensionMessageType[] = "cast_message"; |
26 | 26 |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 // DTLS-SRTP is the preferred encryption method. If set to kValueFalse, the | 491 // DTLS-SRTP is the preferred encryption method. If set to kValueFalse, the |
492 // peer connection uses SDES. Disabling SDES as well will cause the peer | 492 // peer connection uses SDES. Disabling SDES as well will cause the peer |
493 // connection to fail to connect. | 493 // connection to fail to connect. |
494 // Note: For protection and unprotection of SRTP packets, the libjingle | 494 // Note: For protection and unprotection of SRTP packets, the libjingle |
495 // ENABLE_EXTERNAL_AUTH flag must not be set. | 495 // ENABLE_EXTERNAL_AUTH flag must not be set. |
496 webrtc::FakeConstraints constraints; | 496 webrtc::FakeConstraints constraints; |
497 constraints.AddMandatory(webrtc::MediaConstraintsInterface::kEnableDtlsSrtp, | 497 constraints.AddMandatory(webrtc::MediaConstraintsInterface::kEnableDtlsSrtp, |
498 webrtc::MediaConstraintsInterface::kValueTrue); | 498 webrtc::MediaConstraintsInterface::kValueTrue); |
499 | 499 |
500 rtc::scoped_refptr<webrtc::PortAllocatorFactoryInterface> | 500 rtc::scoped_refptr<webrtc::PortAllocatorFactoryInterface> |
501 port_allocator_factory = ChromiumPortAllocatorFactory::Create( | 501 port_allocator_factory = protocol::ChromiumPortAllocatorFactory::Create( |
502 network_settings_, url_request_context_getter_); | 502 network_settings_, url_request_context_getter_); |
503 | 503 |
504 peer_connection_ = peer_conn_factory_->CreatePeerConnection( | 504 peer_connection_ = peer_conn_factory_->CreatePeerConnection( |
505 rtc_config, &constraints, port_allocator_factory, nullptr, this); | 505 rtc_config, &constraints, port_allocator_factory, nullptr, this); |
506 | 506 |
507 if (!peer_connection_.get()) { | 507 if (!peer_connection_.get()) { |
508 CleanupPeerConnection(); | 508 CleanupPeerConnection(); |
509 return false; | 509 return false; |
510 } | 510 } |
511 | 511 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 json.SetString(kWebRtcCandidate, candidate_str); | 653 json.SetString(kWebRtcCandidate, candidate_str); |
654 std::string json_str; | 654 std::string json_str; |
655 if (!base::JSONWriter::Write(json, &json_str)) { | 655 if (!base::JSONWriter::Write(json, &json_str)) { |
656 LOG(ERROR) << "Failed to serialize candidate message."; | 656 LOG(ERROR) << "Failed to serialize candidate message."; |
657 return; | 657 return; |
658 } | 658 } |
659 SendMessageToClient(kSubjectNewCandidate, json_str); | 659 SendMessageToClient(kSubjectNewCandidate, json_str); |
660 } | 660 } |
661 | 661 |
662 } // namespace remoting | 662 } // namespace remoting |
OLD | NEW |