Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Unified Diff: remoting/host/client_session.cc

Issue 398873005: Preparations for Cast Host Extension (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« remoting/host/client_session.h ('K') | « remoting/host/client_session.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/client_session.cc
diff --git a/remoting/host/client_session.cc b/remoting/host/client_session.cc
index 55e4decc1ca3bb70e29df4836cd787e0f1fbed1c..3a15e0022be54108ec5c1c441bd6ae60ca83a4ee 100644
--- a/remoting/host/client_session.cc
+++ b/remoting/host/client_session.cc
@@ -67,7 +67,8 @@ ClientSession::ClientSession(
video_encode_task_runner_(video_encode_task_runner),
network_task_runner_(network_task_runner),
ui_task_runner_(ui_task_runner),
- pairing_registry_(pairing_registry) {
+ pairing_registry_(pairing_registry),
+ enable_cast_(false) {
connection_->SetEventHandler(this);
// TODO(sergeyu): Currently ConnectionToClient expects stubs to be
@@ -148,6 +149,11 @@ void ClientSession::NotifyClientResolution(
void ClientSession::ControlVideo(const protocol::VideoControl& video_control) {
DCHECK(CalledOnValidThread());
+ // If cast is enabled, do nothing.
+ if (enable_cast_) {
+ return;
+ }
+
if (video_control.has_enable()) {
VLOG(1) << "Received VideoControl (enable="
<< video_control.enable() << ")";
@@ -310,6 +316,11 @@ void ClientSession::OnConnectionAuthenticated(
// Create the event executor.
input_injector_ = desktop_environment_->CreateInputInjector();
+ // Create the screen capturer.
+ // TODO(aiguha): Implement dynamic sharing of the screen capturer between
+ // VideoScheduler and the CastExtension/CastVideoCapturer.
+ screen_capturer_ = desktop_environment_->CreateVideoCapturer();
+
// Connect the host clipboard and input stubs.
host_input_filter_.set_input_stub(input_injector_.get());
clipboard_echo_filter_.set_host_stub(input_injector_.get());
@@ -319,15 +330,18 @@ void ClientSession::OnConnectionAuthenticated(
CreateVideoEncoder(connection_->session()->config());
// Create a VideoScheduler to pump frames from the capturer to the client.
- video_scheduler_ = new VideoScheduler(
+ // If cast mode is enabled, do not create it since screen capturer sharing
+ // has not yet been implemented.
+ if (!enable_cast_) {
+ video_scheduler_ = new VideoScheduler(
video_capture_task_runner_,
video_encode_task_runner_,
network_task_runner_,
- desktop_environment_->CreateVideoCapturer(),
+ screen_capturer_.Pass(),
video_encoder.Pass(),
connection_->client_stub(),
&mouse_clamping_filter_);
-
+ }
// Create an AudioScheduler if audio is enabled, to pump audio samples.
if (connection_->session()->config().is_audio_enabled()) {
scoped_ptr<AudioEncoder> audio_encoder =
@@ -363,8 +377,10 @@ void ClientSession::OnConnectionChannelsConnected(
input_injector_->Start(CreateClipboardProxy());
SetDisableInputs(false);
- // Start capturing the screen.
- video_scheduler_->Start();
+ // Start capturing the screen, if cast is not enabled.
+ if (!enable_cast_) {
+ video_scheduler_->Start();
+ }
// Start recording audio.
if (connection_->session()->config().is_audio_enabled())
« remoting/host/client_session.h ('K') | « remoting/host/client_session.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698