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

Unified Diff: remoting/webapp/client_plugin.js

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/webapp/client_plugin.js
diff --git a/remoting/webapp/client_plugin.js b/remoting/webapp/client_plugin.js
index c2c15f2a6b4ec0d7061fa8ce694df63938579dd3..712ee2e0d010d4f08721412a339b522156620cce 100644
--- a/remoting/webapp/client_plugin.js
+++ b/remoting/webapp/client_plugin.js
@@ -104,7 +104,8 @@ remoting.ClientPlugin.Feature = {
TRAP_KEY: 'trapKey',
PINLESS_AUTH: 'pinlessAuth',
EXTENSION_MESSAGE: 'extensionMessage',
- MEDIA_SOURCE_RENDERING: 'mediaSourceRendering'
+ MEDIA_SOURCE_RENDERING: 'mediaSourceRendering',
+ VIDEO_CONTROL: 'videoControl',
};
/**
@@ -548,11 +549,13 @@ remoting.ClientPlugin.prototype.notifyClientResolution =
*/
remoting.ClientPlugin.prototype.pauseVideo =
function(pause) {
- if (!this.hasFeature(remoting.ClientPlugin.Feature.PAUSE_VIDEO)) {
- return;
+ if (this.hasFeature(remoting.ClientPlugin.Feature.VIDEO_CONTROL)) {
+ this.plugin.postMessage(JSON.stringify(
+ { method: 'videoControl', data: { enable: !pause }}));
+ } else if (this.hasFeature(remoting.ClientPlugin.Feature.PAUSE_VIDEO)) {
+ this.plugin.postMessage(JSON.stringify(
+ { method: 'pauseVideo', data: { pause: pause }}));
}
- this.plugin.postMessage(JSON.stringify(
- { method: 'pauseVideo', data: { pause: pause }}));
};
/**
@@ -570,6 +573,34 @@ remoting.ClientPlugin.prototype.pauseAudio =
};
/**
+ * Requests that the host configure the video codec for lossless encode.
+ *
+ * @param {boolean} want_lossless True to request lossless encoding.
Jamie 2014/05/28 22:21:19 Nit: camelCase :)
Wez 2014/05/28 22:41:07 Done.
+ */
+remoting.ClientPlugin.prototype.setLosslessEncode =
+ function(want_lossless) {
+ if (!this.hasFeature(remoting.ClientPlugin.Feature.VIDEO_CONTROL)) {
+ return;
+ }
+ this.plugin.postMessage(JSON.stringify(
+ { method: 'videoControl', data: { lossless_encode: want_lossless }}));
Jamie 2014/05/28 22:21:19 Nit: Quotes around dictionary keys, for consistenc
Wez 2014/05/28 22:41:07 Not sure what you mean; this file consistently _do
Jamie 2014/05/28 22:53:56 My mistake. I was reading 'videoControl' as a key
+};
+
+/**
+ * Requests that the host configure the video codec for lossless color.
+ *
+ * @param {boolean} want_lossless True to request lossless color.
+ */
+remoting.ClientPlugin.prototype.setLosslessColor =
+ function(want_lossless) {
+ if (!this.hasFeature(remoting.ClientPlugin.Feature.VIDEO_CONTROL)) {
+ return;
+ }
+ this.plugin.postMessage(JSON.stringify(
+ { method: 'videoControl', data: { lossless_color: want_lossless }}));
+};
+
+/**
* Called when a PIN is obtained from the user.
*
* @param {string} pin The PIN.

Powered by Google App Engine
This is Rietveld 408576698