Skip to content

Commit

Permalink
Use jpeg-turbo for decompressing the JPGs. It's super fast compared to
Browse files Browse the repository at this point in the history
what it was before.
  • Loading branch information
sorccu committed Sep 14, 2015
1 parent a98cc67 commit ced0bf9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,15 @@ As the product has evolved from an internal tool running in our internal network
* [GraphicsMagick](http://www.graphicsmagick.org/) (for resizing screenshots)
* [ZeroMQ](http://zeromq.org/) libraries installed
* [Protocol Buffers](https://github.com/google/protobuf) libraries installed
* [jpeg-turbo](http://libjpeg-turbo.virtualgl.org/) libraries installed (for quick VNC format conversions)
* [pkg-config](http://www.freedesktop.org/wiki/Software/pkg-config/) so that Node.js can find the libraries

Note that you need these dependencies even if you've installed STF directly from [NPM](https://www.npmjs.com/), because they can't be included.

On OS X, you can use [homebrew](http://brew.sh/) to install most of the dependencies:

```bash
brew install rethinkdb graphicsmagick zeromq protobuf pkg-config
brew install rethinkdb graphicsmagick zeromq protobuf jpeg-turbo pkg-config
```

On Windows you're on your own. In theory you might be able to get STF installed via [Cygwin](https://www.cygwin.com/) or similar, but we've never tried. In principle we will not provide any Windows installation support, but please do send a documentation pull request if you figure out what to do.
Expand Down
4 changes: 2 additions & 2 deletions lib/units/device/plugins/vnc/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var util = require('util')
var syrup = require('stf-syrup')
var Promise = require('bluebird')
var uuid = require('node-uuid')
var jpeg = require('jpeg-js')
var jpeg = require('jpeg-turbo')

var logger = require('../../../../util/logger')
var lifecycle = require('../../../../util/lifecycle')
Expand Down Expand Up @@ -113,7 +113,7 @@ module.exports = syrup.serial()
return
}

var decoded = jpeg.decode(connState.lastFrame)
var decoded = jpeg.decompressSync(connState.lastFrame)
conn.writeFramebufferUpdate([
{ xPosition: 0
, yPosition: 0
Expand Down
2 changes: 1 addition & 1 deletion lib/units/device/plugins/vnc/util/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function VncConnection(conn, options) {
this._serverWidth = 1080
this._serverHeight = 1920
this._serverPixelFormat = new PixelFormat({
bitsPerPixel: 32
bitsPerPixel: 24
, depth: 24
, bigEndianFlag: 0
, trueColorFlag: 1
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"http-proxy": "^1.11.2",
"in-publish": "^2.0.0",
"jade": "^1.9.2",
"jpeg-turbo": "^0.1.1",
"jws": "^3.1.0",
"ldapjs": "git+https://github.com/mcavage/node-ldapjs.git#acc1ca8f4314fd9d67561feabc8ce4c235076a5e",
"lodash": "^3.10.1",
Expand Down

0 comments on commit ced0bf9

Please sign in to comment.