mirror of
https://github.com/openstf/stf
synced 2025-10-05 02:29:26 +02:00
Limit VNC size by default.
This commit is contained in:
parent
d5bfcb16d4
commit
9d20484dcb
5 changed files with 29 additions and 5 deletions
|
@ -25,7 +25,6 @@ module.exports = syrup.serial()
|
|||
.dependency(require('./options'))
|
||||
.define(function(options, adb, minicap, display, screenOptions) {
|
||||
var log = logger.createLogger('device:plugins:screen:stream')
|
||||
var plugin = Object.create(null)
|
||||
|
||||
function FrameProducer(config) {
|
||||
EventEmitter.call(this)
|
||||
|
@ -443,9 +442,9 @@ module.exports = syrup.serial()
|
|||
|
||||
return createServer()
|
||||
.then(function(wss) {
|
||||
var broadcastSet = plugin.broadcastSet = new BroadcastSet()
|
||||
var frameProducer = new FrameProducer(
|
||||
new FrameConfig(display.properties, display.properties))
|
||||
var broadcastSet = frameProducer.broadcastSet = new BroadcastSet()
|
||||
|
||||
broadcastSet.on('nonempty', function() {
|
||||
frameProducer.start()
|
||||
|
@ -589,6 +588,7 @@ module.exports = syrup.serial()
|
|||
lifecycle.observe(function() {
|
||||
frameProducer.stop()
|
||||
})
|
||||
|
||||
return frameProducer
|
||||
})
|
||||
.return(plugin)
|
||||
})
|
||||
|
|
|
@ -24,6 +24,8 @@ module.exports = syrup.serial()
|
|||
|
||||
var opts = {
|
||||
name: options.serial
|
||||
, width: options.vncInitialSize[0]
|
||||
, height: options.vncInitialSize[1]
|
||||
}
|
||||
|
||||
var vnc = new VncServer(net.createServer({
|
||||
|
@ -135,6 +137,8 @@ module.exports = syrup.serial()
|
|||
}
|
||||
|
||||
conn.on('authenticated', function() {
|
||||
screenStream.updateProjection(
|
||||
options.vncInitialSize[0], options.vncInitialSize[1])
|
||||
screenStream.broadcastSet.insert(id, {
|
||||
onStart: vncStartListener
|
||||
, onFrame: vncFrameListener
|
||||
|
|
|
@ -21,8 +21,8 @@ function VncConnection(conn, options) {
|
|||
|
||||
this._serverVersion = VncConnection.V3_008
|
||||
this._serverSupportedSecurity = [VncConnection.SECURITY_NONE]
|
||||
this._serverWidth = 1080
|
||||
this._serverHeight = 1920
|
||||
this._serverWidth = this.options.width
|
||||
this._serverHeight = this.options.height
|
||||
this._serverPixelFormat = new PixelFormat({
|
||||
bitsPerPixel: 24
|
||||
, depth: 24
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue