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/CMakeLists.txt +2 -1
- package/binding.c +1256 -90
- package/index.js +37 -12
- package/lib/codec-context.js +56 -10
- package/lib/codec-parameters.js +34 -1
- package/lib/codec.js +4 -0
- package/lib/constants.js +18 -1
- package/lib/dictionary.js +33 -0
- package/lib/format-context.js +115 -13
- package/lib/frame.js +39 -5
- package/lib/input-format.js +24 -0
- package/lib/io-context.js +6 -8
- package/lib/output-format.js +7 -0
- package/lib/packet.js +30 -9
- package/lib/rational.js +6 -0
- package/lib/reference-counted.js +39 -0
- package/lib/scaler.js +5 -7
- package/lib/stream.js +15 -3
- package/package.json +2 -2
- package/prebuilds/android-arm/bare-ffmpeg.bare +0 -0
- package/prebuilds/android-arm64/bare-ffmpeg.bare +0 -0
- package/prebuilds/android-ia32/bare-ffmpeg.bare +0 -0
- package/prebuilds/android-x64/bare-ffmpeg.bare +0 -0
- package/prebuilds/darwin-arm64/bare-ffmpeg.bare +0 -0
- package/prebuilds/darwin-x64/bare-ffmpeg.bare +0 -0
- package/prebuilds/ios-arm64/bare-ffmpeg.bare +0 -0
- package/prebuilds/ios-arm64-simulator/bare-ffmpeg.bare +0 -0
- package/prebuilds/ios-x64-simulator/bare-ffmpeg.bare +0 -0
- package/prebuilds/linux-arm64/bare-ffmpeg.bare +0 -0
- package/prebuilds/linux-x64/bare-ffmpeg.bare +0 -0
- package/prebuilds/win32-arm64/bare-ffmpeg.bare +0 -0
- package/prebuilds/win32-x64/bare-ffmpeg.bare +0 -0
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
|
-
|
|
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
|
-
|
|
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-
|
|
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.
|
|
34
|
+
"cmake-ports": "^1.5.0",
|
|
35
35
|
"prettier": "^3.3.3",
|
|
36
36
|
"prettier-config-standard": "^7.0.0"
|
|
37
37
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|