Skip to content

Commit

Permalink
Merge pull request #40 from NetrisTV/develop
Browse files Browse the repository at this point in the history
Refactoring
Support NetrisTV/ws-qvh backend
Remove h264bsd decoder
  • Loading branch information
drauggres authored Oct 5, 2020
2 parents ff6a87b + 94eec27 commit 532cf19
Show file tree
Hide file tree
Showing 143 changed files with 3,198 additions and 1,934 deletions.
6 changes: 3 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
src/public/**/*.js
src/vendor/**/*.js
src/Util.ts
src/h264-live-player/**/*.ts
vendor/**/*.js
src/app/Util.ts
src/app/h264-live-player/**/*.ts
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (C) 2019 by Netris, CJSC.
Copyright (C) 2020 by Netris, JSC.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Web client prototype for [scrcpy](https://github.com/Genymobile/scrcpy).

You'll need a web browser that supports the following technologies:
* WebSockets
* Media Source Extensions and h264 decoding ([MseDecoder](/src/decoder/MseDecoder.ts))
* WebWorkers ([h264bsd](/src/decoder/H264bsdDecoder.ts), [tinyh264](/src/decoder/Tinyh264Decoder.ts))
* WebAssembly ([Broadway.js](/src/decoder/BroadwayDecoder.ts) and [h264bsd](/src/decoder/H264bsdDecoder.ts), [tinyh264](/src/decoder/Tinyh264Decoder.ts))
* Media Source Extensions and h264 decoding ([MseDecoder](/src/app/decoder/MseDecoder.ts))
* WebWorkers [tinyh264](/src/app/decoder/Tinyh264Decoder.ts))
* WebAssembly ([Broadway.js](/src/app/decoder/BroadwayDecoder.ts) and [tinyh264](/src/app/decoder/Tinyh264Decoder.ts))

## Build and Start

Expand Down Expand Up @@ -39,7 +39,7 @@ Drag & drop an APK file to push it to the `/data/local/tmp` directory. You can i

* New versions are most likely not incompatible with previous ones. If you do upgrade, then manually stop `app_process` or just reboot the device.
* The server on the Android Emulator listens on the internal interface and not available from the outside (as workaround you can do `adb forward tcp:8886 tcp:8886` and use `127.0.0.1` instead of emulator IP address)
* H264bsdDecoder and Tinyh264Decoder may fail to start, try to reload the page.
* Tinyh264Decoder may fail to start, try to reload the page.
* MseDecoder reports too many dropped frames in quality statistics: needs further investigation.

## Security warning
Expand All @@ -50,11 +50,18 @@ Be advised and keep in mind:
* The modified version of scrcpy with integrated WebSocket server is listening for connections on all network interfaces.
* The modified version of scrcpy will keep running after the last client disconnected.

## WS QVH
This project also contains frontend for [NetrisTV/ws-qvh](https://github.com/NetrisTV/ws-qvh). Run this to build it:

```shell script
npm install
npm run dist:qvhack:frontend
```

## Related projects
* [Genymobile/scrcpy](https://github.com/Genymobile/scrcpy)
* [xevokk/h264-converter](https://github.com/xevokk/h264-converter)
* [131/h264-live-player](https://github.com/131/h264-live-player)
* [oneam/h264bsd](https://github.com/oneam/h264bsd)
* [mbebenita/Broadway](https://github.com/mbebenita/Broadway)
* [openstf/adbkit](https://github.com/openstf/adbkit)
* [xtermjs/xterm.js](https://github.com/xtermjs/xterm.js)
Expand All @@ -63,5 +70,5 @@ Be advised and keep in mind:
## scrcpy websocket fork

Currently, support of WebSocket protocol added to v1.16 of scrcpy
* [Prebuilt package](/src/public/scrcpy-server.jar)
* [Prebuilt package](/vendor/Genymobile/scrcpy/scrcpy-server.jar)
* [Source code](https://github.com/NetrisTV/scrcpy/tree/feature/websocket-v1.16.x)
26 changes: 12 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
{
"name": "ws-scrcpy",
"version": "0.4.1",
"version": "0.5.0",
"description": "ws client for scrcpy",
"scripts": {
"build": "npm run compile && npm run copy:vendor && npm run build:webpack",
"clean": "npm run clean:build && npm run clean:dist",
"clean:build": "npx rimraf build",
"clean:dist": "npx rimraf dist",
"build:webpack": "webpack --config webpack.config.js",
"compile": "npx tsc -p .",
"copy:bundle": "node -e \"fs.copyFile('build/bundle.js','dist/public/bundle.js',function(e){if(e)process.exit(1);process.exit(0);})\"",
"copy:public": "node -e \"require('recursive-copy')('src/public','dist/public', {overwrite: true, debug: true} ,function(e){if(e)process.exit(1);process.exit(0);})\"",
"copy:server": "node -e \"require('recursive-copy')('build/server','dist/server', {overwrite: true, debug: true} ,function(e){if(e)process.exit(1);process.exit(0);})\"",
"copy:vendor": "node -e \"require('recursive-copy')('src/vendor','build', {overwrite: true, debug: true} ,function(e){if(e)process.exit(1);process.exit(0);})\"",
"copy:xterm.css": "node -e \"require('recursive-copy')('node_modules/xterm/css','dist/public', {overwrite: true, debug: true} ,function(e){if(e)process.exit(1);process.exit(0);})\"",
"dist": "npm run build && npm run mkdirs && npm run copy:package.json && npm run copy:public && npm run copy:xterm.css && npm run copy:server",
"clean": "npx rimraf dist",
"build:webpack": "webpack --config webpack.ws-scrcpy.config.js",
"copy:license": "node -e \"require('fs').copyFileSync('LICENSE', 'dist/LICENSE')\"",
"dist": "npm run build:webpack && npm run copy:package.json && npm run copy:license",
"build:qvhack:frontend": "webpack --config webpack.qvhack.config.js",
"dist:qvhack:frontend": "npm run build:qvhack:frontend && npm run copy:license",
"copy:package.json": "node -e \"const j=require('./package.json');const {name,version,description,author,license,dependencies,scripts}=j; const p={name, version, description,author,license,dependencies}; p.scripts={start: scripts['dist:start']};fs.writeFileSync('./dist/package.json', JSON.stringify(p, null, ' '))\"",
"mkdirs": "npx mkdirp dist/public",
"start": "npm run dist && npm run start:dist",
"start:dist": "cd dist && npm start",
"dist:start": "cd server && node index.js",
Expand All @@ -38,22 +31,27 @@
"@typescript-eslint/eslint-plugin": "^3.8.0",
"@typescript-eslint/parser": "^3.8.0",
"buffer": "^5.2.1",
"css-loader": "^4.3.0",
"eslint": "^7.6.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-progress": "0.0.1",
"file-loader": "^6.0.0",
"h264-converter": "^0.1.2",
"html-webpack-plugin": "^4.5.0",
"mini-css-extract-plugin": "^0.11.2",
"mkdirp": "^0.5.1",
"prettier": "^2.0.5",
"recursive-copy": "^2.0.10",
"rimraf": "^3.0.0",
"svg-inline-loader": "^0.8.2",
"sylvester.js": "^0.1.1",
"tinyh264": "0.0.6",
"ts-loader": "^8.0.4",
"typescript": "^3.4.5",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.12",
"webpack-node-externals": "^2.5.2",
"worker-loader": "^2.0.0",
"xterm": "^4.5.0",
"xterm-addon-attach": "^0.5.0",
Expand Down
Loading

0 comments on commit 532cf19

Please sign in to comment.