| 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 "remoting/host/client_session.h" | 5 #include "remoting/host/client_session.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
| 10 #include "remoting/base/capabilities.h" | 10 #include "remoting/base/capabilities.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "remoting/host/host_extension_session.h" | 21 #include "remoting/host/host_extension_session.h" |
| 22 #include "remoting/host/input_injector.h" | 22 #include "remoting/host/input_injector.h" |
| 23 #include "remoting/host/screen_controls.h" | 23 #include "remoting/host/screen_controls.h" |
| 24 #include "remoting/host/screen_resolution.h" | 24 #include "remoting/host/screen_resolution.h" |
| 25 #include "remoting/host/video_scheduler.h" | 25 #include "remoting/host/video_scheduler.h" |
| 26 #include "remoting/proto/control.pb.h" | 26 #include "remoting/proto/control.pb.h" |
| 27 #include "remoting/proto/event.pb.h" | 27 #include "remoting/proto/event.pb.h" |
| 28 #include "remoting/protocol/client_stub.h" | 28 #include "remoting/protocol/client_stub.h" |
| 29 #include "remoting/protocol/clipboard_thread_proxy.h" | 29 #include "remoting/protocol/clipboard_thread_proxy.h" |
| 30 #include "remoting/protocol/pairing_registry.h" | 30 #include "remoting/protocol/pairing_registry.h" |
| 31 #include "third_party/webrtc/modules/desktop_capture/screen_capturer.h" | 31 #include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h" |
| 32 | 32 |
| 33 // Default DPI to assume for old clients that use notifyClientDimensions. | 33 // Default DPI to assume for old clients that use notifyClientDimensions. |
| 34 const int kDefaultDPI = 96; | 34 const int kDefaultDPI = 96; |
| 35 | 35 |
| 36 namespace remoting { | 36 namespace remoting { |
| 37 | 37 |
| 38 ClientSession::ClientSession( | 38 ClientSession::ClientSession( |
| 39 EventHandler* event_handler, | 39 EventHandler* event_handler, |
| 40 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner, | 40 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner, |
| 41 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, | 41 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 } | 446 } |
| 447 | 447 |
| 448 void ClientSession::ResetVideoPipeline() { | 448 void ClientSession::ResetVideoPipeline() { |
| 449 DCHECK(CalledOnValidThread()); | 449 DCHECK(CalledOnValidThread()); |
| 450 | 450 |
| 451 if (video_scheduler_.get()) { | 451 if (video_scheduler_.get()) { |
| 452 video_scheduler_->Stop(); | 452 video_scheduler_->Stop(); |
| 453 video_scheduler_ = NULL; | 453 video_scheduler_ = NULL; |
| 454 } | 454 } |
| 455 | 455 |
| 456 // Create VideoEncoder and ScreenCapturer to match the session's video channel | 456 // Create VideoEncoder and DesktopCapturer to match the session's video |
| 457 // configuration. | 457 // channel configuration. |
| 458 scoped_ptr<webrtc::ScreenCapturer> video_capturer = | 458 scoped_ptr<webrtc::DesktopCapturer> video_capturer = |
| 459 extension_manager_->OnCreateVideoCapturer( | 459 extension_manager_->OnCreateVideoCapturer( |
| 460 desktop_environment_->CreateVideoCapturer()); | 460 desktop_environment_->CreateVideoCapturer()); |
| 461 scoped_ptr<VideoEncoder> video_encoder = | 461 scoped_ptr<VideoEncoder> video_encoder = |
| 462 extension_manager_->OnCreateVideoEncoder( | 462 extension_manager_->OnCreateVideoEncoder( |
| 463 CreateVideoEncoder(connection_->session()->config())); | 463 CreateVideoEncoder(connection_->session()->config())); |
| 464 | 464 |
| 465 // Don't start the VideoScheduler if either capturer or encoder are missing. | 465 // Don't start the VideoScheduler if either capturer or encoder are missing. |
| 466 if (!video_capturer || !video_encoder) | 466 if (!video_capturer || !video_encoder) |
| 467 return; | 467 return; |
| 468 | 468 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 return scoped_ptr<AudioEncoder>(new AudioEncoderVerbatim()); | 528 return scoped_ptr<AudioEncoder>(new AudioEncoderVerbatim()); |
| 529 } else if (audio_config.codec == protocol::ChannelConfig::CODEC_OPUS) { | 529 } else if (audio_config.codec == protocol::ChannelConfig::CODEC_OPUS) { |
| 530 return scoped_ptr<AudioEncoder>(new AudioEncoderOpus()); | 530 return scoped_ptr<AudioEncoder>(new AudioEncoderOpus()); |
| 531 } | 531 } |
| 532 | 532 |
| 533 NOTREACHED(); | 533 NOTREACHED(); |
| 534 return scoped_ptr<AudioEncoder>(); | 534 return scoped_ptr<AudioEncoder>(); |
| 535 } | 535 } |
| 536 | 536 |
| 537 } // namespace remoting | 537 } // namespace remoting |
| OLD | NEW |