| Index: remoting/client/plugin/chromoting_instance.cc
|
| diff --git a/remoting/client/plugin/chromoting_instance.cc b/remoting/client/plugin/chromoting_instance.cc
|
| index d87953145de03eacfaff2dff99ee37942d5ba35c..311d6585aceba0ed81c5abc99c1f8a59e555cfed 100644
|
| --- a/remoting/client/plugin/chromoting_instance.cc
|
| +++ b/remoting/client/plugin/chromoting_instance.cc
|
| @@ -182,7 +182,8 @@ logging::LogMessageHandlerFunction g_logging_old_handler = NULL;
|
| const char ChromotingInstance::kApiFeatures[] =
|
| "highQualityScaling injectKeyEvent sendClipboardItem remapKey trapKey "
|
| "notifyClientResolution pauseVideo pauseAudio asyncPin thirdPartyAuth "
|
| - "pinlessAuth extensionMessage allowMouseLock mediaSourceRendering";
|
| + "pinlessAuth extensionMessage allowMouseLock mediaSourceRendering "
|
| + "videoControl";
|
|
|
| const char ChromotingInstance::kRequestedCapabilities[] = "";
|
| const char ChromotingInstance::kSupportedCapabilities[] = "desktopShape";
|
| @@ -347,6 +348,8 @@ void ChromotingInstance::HandleMessage(const pp::Var& message) {
|
| HandleNotifyClientResolution(*data);
|
| } else if (method == "pauseVideo") {
|
| HandlePauseVideo(*data);
|
| + } else if (method == "videoControl") {
|
| + HandleVideoControl(*data);
|
| } else if (method == "pauseAudio") {
|
| HandlePauseAudio(*data);
|
| } else if (method == "useAsyncPinDialog") {
|
| @@ -871,16 +874,30 @@ void ChromotingInstance::HandleNotifyClientResolution(
|
| }
|
|
|
| void ChromotingInstance::HandlePauseVideo(const base::DictionaryValue& data) {
|
| - bool pause = false;
|
| - if (!data.GetBoolean("pause", &pause)) {
|
| + if (!data.HasKey("pause")) {
|
| LOG(ERROR) << "Invalid pauseVideo.";
|
| return;
|
| }
|
| + HandleVideoControl(data);
|
| +}
|
| +
|
| +void ChromotingInstance::HandleVideoControl(const base::DictionaryValue& data) {
|
| + protocol::VideoControl video_control;
|
| + bool pause_video = false;
|
| + if (data.GetBoolean("pause", &pause_video)) {
|
| + video_control.set_enable(!pause_video);
|
| + }
|
| + bool lossless_encode = false;
|
| + if (data.GetBoolean("losslessEncode", &lossless_encode)) {
|
| + video_control.set_lossless_encode(lossless_encode);
|
| + }
|
| + bool lossless_color = false;
|
| + if (data.GetBoolean("losslessColor", &lossless_color)) {
|
| + video_control.set_lossless_color(lossless_color);
|
| + }
|
| if (!IsConnected()) {
|
| return;
|
| }
|
| - protocol::VideoControl video_control;
|
| - video_control.set_enable(!pause);
|
| host_connection_->host_stub()->ControlVideo(video_control);
|
| }
|
|
|
|
|