From 4601b67d6e94c931dc90d4ec89633cf200c1752f Mon Sep 17 00:00:00 2001 From: Brad Lassey Date: Wed, 17 Dec 2014 18:38:09 -0500 Subject: [PATCH] bug 1112338 - increase max output stream to 720p r=rbarker, mfinkle --- toolkit/modules/secondscreen/RokuApp.jsm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/toolkit/modules/secondscreen/RokuApp.jsm b/toolkit/modules/secondscreen/RokuApp.jsm index 5feb5d47c3f3..e7ae830ed478 100644 --- a/toolkit/modules/secondscreen/RokuApp.jsm +++ b/toolkit/modules/secondscreen/RokuApp.jsm @@ -285,23 +285,24 @@ function RemoteMirror(url, win, viewport, mirrorStartedCallback, contentWindow) this._iceCandidates = []; this.mirrorStarted = mirrorStartedCallback; - // This code insures the generated tab mirror is not wider than 800 nor taller than 600 + // This code insures the generated tab mirror is not wider than 1280 nor taller than 720 // Better dimensions should be chosen after the Roku Channel is working. let windowId = contentWindow.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils).outerWindowID; let cWidth = Math.max(viewport.cssWidth, viewport.width); let cHeight = Math.max(viewport.cssHeight, viewport.height); - const MAX_WIDTH = 800; - const MAX_HEIGHT = 600; + const MAX_WIDTH = 1280; + const MAX_HEIGHT = 720; let tWidth = 0; let tHeight = 0; + // division and multiplication by 4 to ensure dimensions are multiples of 4 if ((cWidth / MAX_WIDTH) > (cHeight / MAX_HEIGHT)) { - tHeight = Math.ceil((MAX_WIDTH / cWidth) * cHeight); + tHeight = Math.ceil((MAX_WIDTH / (4* cWidth)) * cHeight) * 4; tWidth = MAX_WIDTH; } else { - tWidth = Math.ceil((MAX_HEIGHT / cHeight) * cWidth); + tWidth = Math.ceil((MAX_HEIGHT / (4 * cHeight)) * cWidth) * 4; tHeight = MAX_HEIGHT; }