Skip to content

Commit

Permalink
add Broadway as submoduler, cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
matijagaspar committed Oct 19, 2019
1 parent bfb9e90 commit 22b966a
Show file tree
Hide file tree
Showing 19 changed files with 17 additions and 968 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
@@ -0,0 +1,3 @@
[submodule "Broadway"]
path = Broadway
url = https://github.com/mbebenita/Broadway.git
1 change: 1 addition & 0 deletions Broadway
Submodule Broadway added at d32f9d
3 changes: 2 additions & 1 deletion README.md
Expand Up @@ -67,11 +67,12 @@ npm run example raspivid
It will automatically run raspivid too

# TODO:
* Decoder as worker
* ~Decoder as worker~
* More docs
* More cleanup
* Audio
* ~Ability to change video resolution or better parse sps/pps~
* ~Decent performance~

# Credits
* [matijagaspar](https://github.com/matijagaspar)
Expand Down
2 changes: 1 addition & 1 deletion lib/WSAvcPlayer.js

Large diffs are not rendered by default.

218 changes: 0 additions & 218 deletions player/WSAvcPlayer-old.js

This file was deleted.

20 changes: 1 addition & 19 deletions player/WSAvcPlayer.js
@@ -1,14 +1,9 @@
'use strict'

// import Avc from 'broadway/Decoder'

// import Size from 'utils/Size'
// import DecoderAsWorker from './DecoderAsWorker'
const Player = require('Broadway/Player')
const { EventEmitter } = require('events')
const debug = require('debug')


const log = debug('wsavc')
class WSAvcPlayer extends EventEmitter {
constructor ({ useWorker, workerFile } = {}) {
Expand All @@ -26,34 +21,21 @@ class WSAvcPlayer extends EventEmitter {
height: 368,
},
})
// this.AvcPlayer.canvas
this.width = 1280
this.height = 1024
this.AvcPlayer.onPictureDecoded = (_, w, h, i) => {
// console.log('pic decoded', i)
this.AvcPlayer.onPictureDecoded = (_, w, h) => {
if (w !== this.width || h !== this.height) {
this.emit('resized', { width: w, height: h })
this.width = w
this.height = h
}
// if (this.running) {
// clearTimeout(this.shiftFrameTimeout)
// this.shiftFrameTimeout = null
// this.shiftFrameTimeout = setTimeout(this.shiftFrame, 1)
// }
}

this.ws
this.pktnum = 0
this.framesList = []
this.running = false
this.shiftFrameTimeout = null
this.AvcPlayer.onRenderFrameComplete = (...s) => {
// console.log('render frame complete', s)
// if (this.framesList.length > 0) {

}
// onPictureDecoded
}

shiftFrame = () => {
Expand Down
28 changes: 0 additions & 28 deletions player/canvas/Program.js

This file was deleted.

4 changes: 0 additions & 4 deletions player/canvas/README.md

This file was deleted.

38 changes: 0 additions & 38 deletions player/canvas/Script.js

This file was deleted.

33 changes: 0 additions & 33 deletions player/canvas/Shader.js

This file was deleted.

0 comments on commit 22b966a

Please sign in to comment.