mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 06:53:20 +02:00
add frame rate management (#558)
Signed-off-by: Denis barbaron <denis.barbaron@orange.com>
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
/**
|
||||
* Copyright © 2022 contains code contributed by Orange SA, authors: Denis Barbaron - Licensed under the Apache license 2.0
|
||||
**/
|
||||
|
||||
var util = require('util')
|
||||
|
||||
var Promise = require('bluebird')
|
||||
@@ -26,6 +30,7 @@ module.exports = syrup.serial()
|
||||
.define(function(options, adb, minicap, display, screenOptions) {
|
||||
var log = logger.createLogger('device:plugins:screen:stream')
|
||||
log.info('ScreenGrabber option set to %s', options.screenGrabber)
|
||||
log.info('ScreenFrameRate option set to %d', options.screenFrameRate)
|
||||
|
||||
function FrameProducer(config, grabber) {
|
||||
EventEmitter.call(this)
|
||||
@@ -230,12 +235,23 @@ module.exports = syrup.serial()
|
||||
|
||||
FrameProducer.prototype._startService = function() {
|
||||
log.info('Launching screen service %s', this.grabber)
|
||||
return minicap.run(this.grabber, util.format(
|
||||
'-S -Q %d -P %s'
|
||||
, options.screenJpegQuality
|
||||
, this.frameConfig.toString()
|
||||
))
|
||||
.timeout(10000)
|
||||
if (options.screenFrameRate <= 0.0) {
|
||||
return minicap.run(this.grabber, util.format(
|
||||
'-S -Q %d -P %s'
|
||||
, options.screenJpegQuality
|
||||
, this.frameConfig.toString()
|
||||
))
|
||||
.timeout(10000)
|
||||
}
|
||||
else {
|
||||
return minicap.run(this.grabber, util.format(
|
||||
'-S -r %d -Q %d -P %s'
|
||||
, options.screenFrameRate
|
||||
, options.screenJpegQuality
|
||||
, this.frameConfig.toString()
|
||||
))
|
||||
.timeout(10000)
|
||||
}
|
||||
}
|
||||
|
||||
FrameProducer.prototype._readOutput = function(out) {
|
||||
|
||||
Reference in New Issue
Block a user