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

Unified Diff: remoting/client/plugin/chromoting_instance.cc

Issue 307463005: Client-side changes to support requesting lossless encode & color. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Replace losslessVideo feature w/ videoControl Created 6 years, 7 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
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..28ae90f591aa71bdbe190e46163a21a86145335f 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("lossless_encode", &lossless_encode)) {
Jamie 2014/05/28 22:21:19 JS uses camelCase for variables. I'm not sure how
Wez 2014/05/28 22:41:07 Makes sense. Done!
+ video_control.set_lossless_encode(lossless_encode);
+ }
+ bool lossless_color = false;
+ if (data.GetBoolean("lossless_color", &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);
}

Powered by Google App Engine
This is Rietveld 408576698