зеркало из https://github.com/mozilla/gecko-dev.git
bug 1112338 - increase max output stream to 720p r=rbarker, mfinkle
This commit is contained in:
Родитель
a13b01e386
Коммит
4601b67d6e
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче