| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
| (...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 bool CastExtensionSession::SetupVideoStream( | 522 bool CastExtensionSession::SetupVideoStream( |
| 523 scoped_ptr<webrtc::DesktopCapturer> desktop_capturer) { | 523 scoped_ptr<webrtc::DesktopCapturer> desktop_capturer) { |
| 524 DCHECK(caller_task_runner_->BelongsToCurrentThread()); | 524 DCHECK(caller_task_runner_->BelongsToCurrentThread()); |
| 525 DCHECK(desktop_capturer); | 525 DCHECK(desktop_capturer); |
| 526 | 526 |
| 527 if (stream_) { | 527 if (stream_) { |
| 528 VLOG(1) << "Already added MediaStream. Aborting Setup."; | 528 VLOG(1) << "Already added MediaStream. Aborting Setup."; |
| 529 return false; | 529 return false; |
| 530 } | 530 } |
| 531 | 531 |
| 532 scoped_ptr<WebrtcVideoCapturerAdapter> video_capturer_adapter( | 532 scoped_ptr<protocol::WebrtcVideoCapturerAdapter> video_capturer_adapter( |
| 533 new WebrtcVideoCapturerAdapter(std::move(desktop_capturer))); | 533 new protocol::WebrtcVideoCapturerAdapter(std::move(desktop_capturer))); |
| 534 | 534 |
| 535 // Set video stream constraints. | 535 // Set video stream constraints. |
| 536 webrtc::FakeConstraints video_constraints; | 536 webrtc::FakeConstraints video_constraints; |
| 537 video_constraints.AddMandatory( | 537 video_constraints.AddMandatory( |
| 538 webrtc::MediaConstraintsInterface::kMinFrameRate, kMinFramesPerSecond); | 538 webrtc::MediaConstraintsInterface::kMinFrameRate, kMinFramesPerSecond); |
| 539 | 539 |
| 540 rtc::scoped_refptr<webrtc::VideoTrackInterface> video_track = | 540 rtc::scoped_refptr<webrtc::VideoTrackInterface> video_track = |
| 541 peer_conn_factory_->CreateVideoTrack( | 541 peer_conn_factory_->CreateVideoTrack( |
| 542 kVideoLabel, | 542 kVideoLabel, |
| 543 peer_conn_factory_->CreateVideoSource( | 543 peer_conn_factory_->CreateVideoSource( |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 647 json.SetString(kWebRtcCandidate, candidate_str); | 647 json.SetString(kWebRtcCandidate, candidate_str); |
| 648 std::string json_str; | 648 std::string json_str; |
| 649 if (!base::JSONWriter::Write(json, &json_str)) { | 649 if (!base::JSONWriter::Write(json, &json_str)) { |
| 650 LOG(ERROR) << "Failed to serialize candidate message."; | 650 LOG(ERROR) << "Failed to serialize candidate message."; |
| 651 return; | 651 return; |
| 652 } | 652 } |
| 653 SendMessageToClient(kSubjectNewCandidate, json_str); | 653 SendMessageToClient(kSubjectNewCandidate, json_str); |
| 654 } | 654 } |
| 655 | 655 |
| 656 } // namespace remoting | 656 } // namespace remoting |
| OLD | NEW |