@theia/ffmpeg 1.31.0-next.7 → 1.31.0
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/ffmpeg.d.ts +4 -2
- package/lib/ffmpeg.d.ts.map +1 -1
- package/lib/ffmpeg.js +16 -12
- package/lib/ffmpeg.js.map +1 -1
- package/package.json +2 -2
- package/src/ffmpeg.ts +16 -13
package/lib/ffmpeg.d.ts
CHANGED
|
@@ -7,8 +7,6 @@ export interface Codec {
|
|
|
7
7
|
export interface FfmpegNativeAddon {
|
|
8
8
|
codecs(ffmpegPath: string): Codec[];
|
|
9
9
|
}
|
|
10
|
-
declare let _FFMPEG: FfmpegNativeAddon;
|
|
11
|
-
export { _FFMPEG };
|
|
12
10
|
export interface FfmpegNameAndLocation {
|
|
13
11
|
/**
|
|
14
12
|
* Name with extension of the shared library.
|
|
@@ -25,6 +23,10 @@ export interface FfmpegOptions {
|
|
|
25
23
|
ffmpegPath?: string;
|
|
26
24
|
platform?: NodeJS.Platform;
|
|
27
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
export declare function _loadFfmpegNativeAddon(): FfmpegNativeAddon;
|
|
28
30
|
/**
|
|
29
31
|
* @returns name and relative path from Electron's root where FFMPEG is located at.
|
|
30
32
|
*/
|
package/lib/ffmpeg.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ffmpeg.d.ts","sourceRoot":"","sources":["../src/ffmpeg.ts"],"names":[],"mappings":";AAkBA,MAAM,WAAW,KAAK;IAClB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,iBAAiB;IAC9B,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,KAAK,EAAE,CAAA;CACtC;AAED,
|
|
1
|
+
{"version":3,"file":"ffmpeg.d.ts","sourceRoot":"","sources":["../src/ffmpeg.ts"],"names":[],"mappings":";AAkBA,MAAM,WAAW,KAAK;IAClB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,iBAAiB;IAC9B,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,KAAK,EAAE,CAAA;CACtC;AAED,MAAM,WAAW,qBAAqB;IAClC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,aAAa;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAA;CAC7B;AAED;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,iBAAiB,CAU1D;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,EAClC,QAA2B,EAC9B,GAAE,aAAkB,GAAG,qBAAqB,CAoB5C;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,GAAE,aAAkB,GAAG,MAAM,CAGtE;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,GAAE,aAAkB,GAAG,MAAM,CAKtE;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,KAAK,EAAE,CAE3D"}
|
package/lib/ffmpeg.js
CHANGED
|
@@ -15,21 +15,25 @@
|
|
|
15
15
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
16
16
|
// *****************************************************************************
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.getFfmpegCodecs = exports.ffmpegAbsolutePath = exports.ffmpegRelativePath = exports.ffmpegNameAndLocation = exports.
|
|
18
|
+
exports.getFfmpegCodecs = exports.ffmpegAbsolutePath = exports.ffmpegRelativePath = exports.ffmpegNameAndLocation = exports._loadFfmpegNativeAddon = void 0;
|
|
19
19
|
const path = require("path");
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
if (error.code === 'MODULE_NOT_FOUND') {
|
|
27
|
-
exports._FFMPEG = _FFMPEG = require('../build/Debug/ffmpeg.node');
|
|
20
|
+
/**
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
function _loadFfmpegNativeAddon() {
|
|
24
|
+
try {
|
|
25
|
+
return require('../build/Release/ffmpeg.node');
|
|
28
26
|
}
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
catch (error) {
|
|
28
|
+
if (error.code === 'MODULE_NOT_FOUND') {
|
|
29
|
+
return require('../build/Debug/ffmpeg.node');
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
throw error;
|
|
33
|
+
}
|
|
31
34
|
}
|
|
32
35
|
}
|
|
36
|
+
exports._loadFfmpegNativeAddon = _loadFfmpegNativeAddon;
|
|
33
37
|
/**
|
|
34
38
|
* @returns name and relative path from Electron's root where FFMPEG is located at.
|
|
35
39
|
*/
|
|
@@ -77,7 +81,7 @@ exports.ffmpegAbsolutePath = ffmpegAbsolutePath;
|
|
|
77
81
|
* @returns list of codecs for the given ffmpeg shared library.
|
|
78
82
|
*/
|
|
79
83
|
function getFfmpegCodecs(ffmpegPath) {
|
|
80
|
-
return
|
|
84
|
+
return _loadFfmpegNativeAddon().codecs(ffmpegPath);
|
|
81
85
|
}
|
|
82
86
|
exports.getFfmpegCodecs = getFfmpegCodecs;
|
|
83
87
|
//# sourceMappingURL=ffmpeg.js.map
|
package/lib/ffmpeg.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ffmpeg.js","sourceRoot":"","sources":["../src/ffmpeg.ts"],"names":[],"mapp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,MAAM,IAAI,KAAK,CAAC,GAAG,QAAQ,mBAAmB,CAAC,CAAC;KACvD;AACL,CAAC;AAtBD,sDAsBC;AAED;;GAEG;AACH,SAAgB,kBAAkB,CAAC,UAAyB,EAAE;IAC1D,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,qBAAqB,CAAC,OAAO,CAAC,CAAC;IAC1D,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AACrC,CAAC;AAHD,gDAGC;AAED;;GAEG;AACH,SAAgB,kBAAkB,CAAC,UAAyB,EAAE;IAC1D,MAAM,EACF,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,uBAAuB,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,EACtF,GAAG,OAAO,CAAC;IACZ,OAAO,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC;AAChE,CAAC;AALD,gDAKC;AAED;;;;GAIG;AACH,SAAgB,eAAe,CAAC,UAAkB;IAC9C,OAAO,sBAAsB,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;AACvD,CAAC;AAFD,0CAEC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/ffmpeg",
|
|
3
|
-
"version": "1.31.0
|
|
3
|
+
"version": "1.31.0",
|
|
4
4
|
"description": "Theia FFMPEG reader utility.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/unzipper": "^0.9.2"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "861dbb5999f27955d88d16c5073a031a29a78988"
|
|
38
38
|
}
|
package/src/ffmpeg.ts
CHANGED
|
@@ -26,18 +26,6 @@ export interface FfmpegNativeAddon {
|
|
|
26
26
|
codecs(ffmpegPath: string): Codec[]
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
let _FFMPEG: FfmpegNativeAddon;
|
|
30
|
-
try {
|
|
31
|
-
_FFMPEG = require('../build/Release/ffmpeg.node');
|
|
32
|
-
} catch (error) {
|
|
33
|
-
if (error.code === 'MODULE_NOT_FOUND') {
|
|
34
|
-
_FFMPEG = require('../build/Debug/ffmpeg.node');
|
|
35
|
-
} else {
|
|
36
|
-
throw error;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
export { _FFMPEG };
|
|
40
|
-
|
|
41
29
|
export interface FfmpegNameAndLocation {
|
|
42
30
|
/**
|
|
43
31
|
* Name with extension of the shared library.
|
|
@@ -56,6 +44,21 @@ export interface FfmpegOptions {
|
|
|
56
44
|
platform?: NodeJS.Platform
|
|
57
45
|
}
|
|
58
46
|
|
|
47
|
+
/**
|
|
48
|
+
* @internal
|
|
49
|
+
*/
|
|
50
|
+
export function _loadFfmpegNativeAddon(): FfmpegNativeAddon {
|
|
51
|
+
try {
|
|
52
|
+
return require('../build/Release/ffmpeg.node');
|
|
53
|
+
} catch (error) {
|
|
54
|
+
if (error.code === 'MODULE_NOT_FOUND') {
|
|
55
|
+
return require('../build/Debug/ffmpeg.node');
|
|
56
|
+
} else {
|
|
57
|
+
throw error;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
59
62
|
/**
|
|
60
63
|
* @returns name and relative path from Electron's root where FFMPEG is located at.
|
|
61
64
|
*/
|
|
@@ -107,5 +110,5 @@ export function ffmpegAbsolutePath(options: FfmpegOptions = {}): string {
|
|
|
107
110
|
* @returns list of codecs for the given ffmpeg shared library.
|
|
108
111
|
*/
|
|
109
112
|
export function getFfmpegCodecs(ffmpegPath: string): Codec[] {
|
|
110
|
-
return
|
|
113
|
+
return _loadFfmpegNativeAddon().codecs(ffmpegPath);
|
|
111
114
|
}
|