bare-ffmpeg 1.0.0-0 → 1.0.0-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/stream.js CHANGED
@@ -2,9 +2,12 @@ const binding = require('../binding')
2
2
  const Codec = require('./codec')
3
3
  const CodecContext = require('./codec-context')
4
4
  const CodecParameters = require('./codec-parameters')
5
+ const ReferenceCounted = require('./reference-counted')
5
6
 
6
- module.exports = class FFmpegStream {
7
+ module.exports = class FFmpegStream extends ReferenceCounted {
7
8
  constructor(handle) {
9
+ super()
10
+
8
11
  this._handle = handle
9
12
 
10
13
  this._codec = Codec.for(binding.getStreamCodec(this._handle))
@@ -14,6 +17,11 @@ module.exports = class FFmpegStream {
14
17
  )
15
18
  }
16
19
 
20
+ _destroy() {
21
+ this._codecParameters.destroy()
22
+ this._codecParameters = null
23
+ }
24
+
17
25
  get codec() {
18
26
  return this._codec
19
27
  }
@@ -23,10 +31,14 @@ module.exports = class FFmpegStream {
23
31
  }
24
32
 
25
33
  decoder() {
26
- return new CodecContext(this._codec.decoder, this._codecParameters)
34
+ const context = new CodecContext(this._codec.decoder)
35
+ this._codecParameters.toContext(context)
36
+ return context.open()
27
37
  }
28
38
 
29
39
  encoder() {
30
- return new CodecContext(this._codec.encoder, this._codecParameters)
40
+ const context = new CodecContext(this._codec.encoder)
41
+ this._codecParameters.toContext(context)
42
+ return context.open()
31
43
  }
32
44
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bare-ffmpeg",
3
- "version": "1.0.0-0",
3
+ "version": "1.0.0-2",
4
4
  "description": "Low-level FFmpeg bindings for Bare",
5
5
  "exports": {
6
6
  ".": "./index.js",
@@ -31,7 +31,7 @@
31
31
  "devDependencies": {
32
32
  "brittle": "^3.4.0",
33
33
  "cmake-bare": "^1.1.2",
34
- "cmake-ports": "^1.1.7",
34
+ "cmake-ports": "^1.5.0",
35
35
  "prettier": "^3.3.3",
36
36
  "prettier-config-standard": "^7.0.0"
37
37
  }