Index: remoting/host/remoting_me2me_host.cc |
diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc |
index eb54ab876cc7cd2e1919a1a4dafb8b78eec3db8d..4b12f418817983bb703101fb529f59e288aa90ef 100644 |
--- a/remoting/host/remoting_me2me_host.cc |
+++ b/remoting/host/remoting_me2me_host.cc |
@@ -124,6 +124,9 @@ const char kAuthSocknameSwitchName[] = "ssh-auth-sockname"; |
// when it is successfully started. |
const char kSignalParentSwitchName[] = "signal-parent"; |
+// Command line switch used to enable VP9 encoding. |
+const char kEnableVp9SwitchName[] = "enable-vp9"; |
+ |
// Value used for --host-config option to indicate that the path must be read |
// from stdin. |
const char kStdinConfigPath[] = "-"; |
@@ -287,6 +290,7 @@ class HostProcess |
std::string serialized_config_; |
std::string host_owner_; |
bool use_service_account_; |
+ bool enable_vp9_; |
scoped_ptr<policy_hack::PolicyWatcher> policy_watcher_; |
std::string host_domain_; |
@@ -331,6 +335,8 @@ HostProcess::HostProcess(scoped_ptr<ChromotingHostContext> context, |
: context_(context.Pass()), |
state_(HOST_INITIALIZING), |
use_service_account_(false), |
+ enable_vp9_( |
+ CommandLine::ForCurrentProcess()->HasSwitch(kEnableVp9SwitchName)), |
host_username_match_required_(false), |
allow_nat_traversal_(true), |
allow_relay_(true), |
@@ -816,6 +822,10 @@ bool HostProcess::ApplyConfig(scoped_ptr<JsonHostConfig> config) { |
host_owner_ = xmpp_server_config_.username; |
use_service_account_ = false; |
} |
+ |
+ // If the enable VP9 option is unspecified, or false, then VP9 is not offered. |
Jamie
2014/06/17 17:35:48
It actually falls back on the command-line, I thin
Sergey Ulanov
2014/06/17 17:37:58
I think this should also mention the optional CL f
|
+ config->GetBoolean(kEnableVp9ConfigPath, &enable_vp9_); |
Sergey Ulanov
2014/06/17 17:37:59
Shouldn't command-line option override the flag in
Wez
2014/06/17 17:58:23
Done.
|
+ |
return true; |
} |
@@ -1190,6 +1200,14 @@ void HostProcess::StartHost() { |
context_->network_task_runner(), |
context_->ui_task_runner())); |
+ // Enable VP9 if configured via the host config. |
Jamie
2014/06/17 17:35:48
It can also be configured on the command-line. I t
Wez
2014/06/17 17:58:23
Done.
|
+ if (enable_vp9_) { |
+ scoped_ptr<protocol::CandidateSessionConfig> config = |
+ host_->protocol_config()->Clone(); |
+ config->EnableVideoCodec(protocol::ChannelConfig::CODEC_VP9); |
+ host_->set_protocol_config(config.Pass()); |
+ } |
+ |
// TODO(simonmorris): Get the maximum session duration from a policy. |
#if defined(OS_LINUX) |
host_->SetMaximumSessionDuration(base::TimeDelta::FromHours(20)); |