node-av 6.0.0-beta.4 → 6.0.0-beta.6
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/README.md +9 -1
- package/dist/api/filter-complex.d.ts +2 -1
- package/dist/api/filter-complex.js +3 -1
- package/dist/api/filter-complex.js.map +1 -1
- package/dist/api/filter-presets.d.ts +107 -0
- package/dist/api/filter-presets.js +115 -0
- package/dist/api/filter-presets.js.map +1 -1
- package/dist/api/index.d.ts +3 -2
- package/dist/api/index.js +4 -2
- package/dist/api/index.js.map +1 -1
- package/dist/api/pipeline.d.ts +50 -0
- package/dist/api/pipeline.js +132 -16
- package/dist/api/pipeline.js.map +1 -1
- package/dist/api/probe.d.ts +128 -0
- package/dist/api/probe.js +227 -0
- package/dist/api/probe.js.map +1 -0
- package/dist/api/utilities/electron-shared-texture.d.ts +41 -1
- package/dist/api/utilities/electron-shared-texture.js +41 -4
- package/dist/api/utilities/electron-shared-texture.js.map +1 -1
- package/dist/lib/error.d.ts +69 -0
- package/dist/lib/error.js +92 -0
- package/dist/lib/error.js.map +1 -1
- package/package.json +9 -9
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
|
2
|
+
if (value !== null && value !== void 0) {
|
|
3
|
+
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
4
|
+
var dispose, inner;
|
|
5
|
+
if (async) {
|
|
6
|
+
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
7
|
+
dispose = value[Symbol.asyncDispose];
|
|
8
|
+
}
|
|
9
|
+
if (dispose === void 0) {
|
|
10
|
+
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
11
|
+
dispose = value[Symbol.dispose];
|
|
12
|
+
if (async) inner = dispose;
|
|
13
|
+
}
|
|
14
|
+
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
15
|
+
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
|
|
16
|
+
env.stack.push({ value: value, dispose: dispose, async: async });
|
|
17
|
+
}
|
|
18
|
+
else if (async) {
|
|
19
|
+
env.stack.push({ async: true });
|
|
20
|
+
}
|
|
21
|
+
return value;
|
|
22
|
+
};
|
|
23
|
+
var __disposeResources = (this && this.__disposeResources) || (function (SuppressedError) {
|
|
24
|
+
return function (env) {
|
|
25
|
+
function fail(e) {
|
|
26
|
+
env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
27
|
+
env.hasError = true;
|
|
28
|
+
}
|
|
29
|
+
var r, s = 0;
|
|
30
|
+
function next() {
|
|
31
|
+
while (r = env.stack.pop()) {
|
|
32
|
+
try {
|
|
33
|
+
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
|
34
|
+
if (r.dispose) {
|
|
35
|
+
var result = r.dispose.call(r.value);
|
|
36
|
+
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
|
37
|
+
}
|
|
38
|
+
else s |= 1;
|
|
39
|
+
}
|
|
40
|
+
catch (e) {
|
|
41
|
+
fail(e);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
|
45
|
+
if (env.hasError) throw env.error;
|
|
46
|
+
}
|
|
47
|
+
return next();
|
|
48
|
+
};
|
|
49
|
+
})(typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
50
|
+
var e = new Error(message);
|
|
51
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
52
|
+
});
|
|
53
|
+
import { AVMEDIA_TYPE_ATTACHMENT, AVMEDIA_TYPE_AUDIO, AVMEDIA_TYPE_DATA, AVMEDIA_TYPE_SUBTITLE, AVMEDIA_TYPE_VIDEO } from '../constants/constants.js';
|
|
54
|
+
import { Codec } from '../lib/codec.js';
|
|
55
|
+
import { avGetPixFmtName, avGetSampleFmtName } from '../lib/utilities.js';
|
|
56
|
+
import { Demuxer } from './demuxer.js';
|
|
57
|
+
/**
|
|
58
|
+
* Map an `AVMediaType` to a readable stream type.
|
|
59
|
+
*
|
|
60
|
+
* @param codecType - The `AVMediaType` value
|
|
61
|
+
*
|
|
62
|
+
* @returns Readable stream type
|
|
63
|
+
*
|
|
64
|
+
* @internal
|
|
65
|
+
*/
|
|
66
|
+
function mediaTypeToString(codecType) {
|
|
67
|
+
switch (codecType) {
|
|
68
|
+
case AVMEDIA_TYPE_VIDEO:
|
|
69
|
+
return 'video';
|
|
70
|
+
case AVMEDIA_TYPE_AUDIO:
|
|
71
|
+
return 'audio';
|
|
72
|
+
case AVMEDIA_TYPE_SUBTITLE:
|
|
73
|
+
return 'subtitle';
|
|
74
|
+
case AVMEDIA_TYPE_DATA:
|
|
75
|
+
return 'data';
|
|
76
|
+
case AVMEDIA_TYPE_ATTACHMENT:
|
|
77
|
+
return 'attachment';
|
|
78
|
+
default:
|
|
79
|
+
return 'unknown';
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Build a {@link ProbeStream} from a low-level stream.
|
|
84
|
+
*
|
|
85
|
+
* @param stream - The low-level stream to summarize
|
|
86
|
+
*
|
|
87
|
+
* @returns Structured stream info
|
|
88
|
+
*
|
|
89
|
+
* @internal
|
|
90
|
+
*/
|
|
91
|
+
function buildProbeStream(stream) {
|
|
92
|
+
const par = stream.codecpar;
|
|
93
|
+
const type = mediaTypeToString(par.codecType);
|
|
94
|
+
const codec = Codec.findDecoder(par.codecId);
|
|
95
|
+
const metadata = stream.metadata?.getAll() ?? {};
|
|
96
|
+
const info = {
|
|
97
|
+
index: stream.index,
|
|
98
|
+
type,
|
|
99
|
+
codec: codec?.name ?? 'unknown',
|
|
100
|
+
codecLongName: codec?.longName ?? '',
|
|
101
|
+
codecId: par.codecId,
|
|
102
|
+
bitrate: par.bitRate > 0n ? Number(par.bitRate) : 0,
|
|
103
|
+
metadata,
|
|
104
|
+
language: metadata.language,
|
|
105
|
+
default: (stream.disposition & 0x0001) !== 0,
|
|
106
|
+
};
|
|
107
|
+
if (type === 'video') {
|
|
108
|
+
info.width = par.width;
|
|
109
|
+
info.height = par.height;
|
|
110
|
+
info.pixelFormat = avGetPixFmtName(par.format) ?? undefined;
|
|
111
|
+
const fr = stream.avgFrameRate;
|
|
112
|
+
info.frameRate = fr && fr.den > 0 ? fr.num / fr.den : 0;
|
|
113
|
+
const sar = par.sampleAspectRatio;
|
|
114
|
+
if (sar && sar.num > 0 && sar.den > 0) {
|
|
115
|
+
info.sampleAspectRatio = { num: sar.num, den: sar.den };
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
else if (type === 'audio') {
|
|
119
|
+
info.sampleRate = par.sampleRate;
|
|
120
|
+
info.channels = par.channels;
|
|
121
|
+
info.sampleFormat = avGetSampleFmtName(par.format) ?? undefined;
|
|
122
|
+
}
|
|
123
|
+
return info;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Build the full {@link ProbeResult} from an open demuxer.
|
|
127
|
+
*
|
|
128
|
+
* @param demuxer - An open demuxer with stream info read
|
|
129
|
+
*
|
|
130
|
+
* @returns Structured probe result
|
|
131
|
+
*
|
|
132
|
+
* @internal
|
|
133
|
+
*/
|
|
134
|
+
function buildProbeResult(demuxer) {
|
|
135
|
+
const streams = demuxer.streams.map(buildProbeStream);
|
|
136
|
+
return {
|
|
137
|
+
format: demuxer.formatName,
|
|
138
|
+
formatLongName: demuxer.formatLongName,
|
|
139
|
+
duration: demuxer.duration,
|
|
140
|
+
startTime: demuxer.startTime,
|
|
141
|
+
bitrate: Math.round(demuxer.bitRate * 1000),
|
|
142
|
+
nbStreams: streams.length,
|
|
143
|
+
streams,
|
|
144
|
+
metadata: demuxer.metadata,
|
|
145
|
+
video: streams.find((s) => s.type === 'video'),
|
|
146
|
+
audio: streams.find((s) => s.type === 'audio'),
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Probe a media source and return structured metadata.
|
|
151
|
+
*
|
|
152
|
+
* Opens the input, reads stream information, builds a typed summary, and closes
|
|
153
|
+
* the input again. Equivalent to `ffprobe -show_format -show_streams`, but as a
|
|
154
|
+
* plain object.
|
|
155
|
+
*
|
|
156
|
+
* @param input - Media source: a file path/URL or an in-memory buffer
|
|
157
|
+
*
|
|
158
|
+
* @param options - Optional format hint and demuxer options
|
|
159
|
+
*
|
|
160
|
+
* @returns Structured probe result
|
|
161
|
+
*
|
|
162
|
+
* @throws {FFmpegError} If the input cannot be opened or has no stream info
|
|
163
|
+
*
|
|
164
|
+
* @example
|
|
165
|
+
* ```typescript
|
|
166
|
+
* const info = await probe('input.mkv');
|
|
167
|
+
* if (info.video) {
|
|
168
|
+
* console.log(`${info.video.codec} ${info.video.width}x${info.video.height} @ ${info.video.frameRate}fps`);
|
|
169
|
+
* }
|
|
170
|
+
* ```
|
|
171
|
+
*
|
|
172
|
+
* @see {@link probeSync} For the synchronous version
|
|
173
|
+
* @see {@link Demuxer} For full streaming access
|
|
174
|
+
*/
|
|
175
|
+
// eslint-disable-next-line space-before-function-paren
|
|
176
|
+
export async function probe(input, options) {
|
|
177
|
+
const env_1 = { stack: [], error: void 0, hasError: false };
|
|
178
|
+
try {
|
|
179
|
+
const demuxer = __addDisposableResource(env_1, await Demuxer.open(input, options), true);
|
|
180
|
+
return buildProbeResult(demuxer);
|
|
181
|
+
}
|
|
182
|
+
catch (e_1) {
|
|
183
|
+
env_1.error = e_1;
|
|
184
|
+
env_1.hasError = true;
|
|
185
|
+
}
|
|
186
|
+
finally {
|
|
187
|
+
const result_1 = __disposeResources(env_1);
|
|
188
|
+
if (result_1)
|
|
189
|
+
await result_1;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Probe a media source and return structured metadata synchronously.
|
|
194
|
+
* Synchronous version of {@link probe}.
|
|
195
|
+
*
|
|
196
|
+
* @param input - Media source: a file path/URL or an in-memory buffer
|
|
197
|
+
*
|
|
198
|
+
* @param options - Optional format hint and demuxer options
|
|
199
|
+
*
|
|
200
|
+
* @returns Structured probe result
|
|
201
|
+
*
|
|
202
|
+
* @throws {FFmpegError} If the input cannot be opened or has no stream info
|
|
203
|
+
*
|
|
204
|
+
* @example
|
|
205
|
+
* ```typescript
|
|
206
|
+
* const info = probeSync('input.mkv');
|
|
207
|
+
* console.log(info.duration, info.streams.length);
|
|
208
|
+
* ```
|
|
209
|
+
*
|
|
210
|
+
* @see {@link probe} For the asynchronous version
|
|
211
|
+
*/
|
|
212
|
+
// eslint-disable-next-line space-before-function-paren
|
|
213
|
+
export function probeSync(input, options) {
|
|
214
|
+
const env_2 = { stack: [], error: void 0, hasError: false };
|
|
215
|
+
try {
|
|
216
|
+
const demuxer = __addDisposableResource(env_2, Demuxer.openSync(input, options), false);
|
|
217
|
+
return buildProbeResult(demuxer);
|
|
218
|
+
}
|
|
219
|
+
catch (e_2) {
|
|
220
|
+
env_2.error = e_2;
|
|
221
|
+
env_2.hasError = true;
|
|
222
|
+
}
|
|
223
|
+
finally {
|
|
224
|
+
__disposeResources(env_2);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
//# sourceMappingURL=probe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"probe.js","sourceRoot":"","sources":["../../src/api/probe.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACtJ,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,M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,QAAQ;QAC1B,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;QAC3C,SAAS,EAAE,OAAO,CAAC,MAAM;QACzB,OAAO;QACP,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC;QAC9C,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC;KAC/C,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,uDAAuD;AACvD,MAAM,CAAC,KAAK,UAAU,KAAK,CACzB,KAAsB,EACtB,OAAyB;;;QAEzB,MAAY,OAAO,kCAAG,MAAM,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,OAAA,CAAC;QACzD,OAAO,gBAAgB,CAAC,OAAO,CAAC,CAAC;;;;;;;;;;;CAClC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,uDAAuD;AACvD,MAAM,UAAU,SAAS,CAAgF,KAAsB,EAAE,OAAyB;;;QACxJ,MAAM,OAAO,kCAAG,OAAO,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,QAAA,CAAC;QACjD,OAAO,gBAAgB,CAAC,OAAO,CAAC,CAAC;;;;;;;;;CAClC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Frame } from '../../lib/frame.js';
|
|
2
|
-
import type { AVPixelFormat } from '../../constants/constants.js';
|
|
2
|
+
import type { AVColorPrimaries, AVColorRange, AVColorSpace, AVColorTransferCharacteristic, AVPixelFormat } from '../../constants/constants.js';
|
|
3
3
|
import type { IRational } from '../../lib/types.js';
|
|
4
4
|
import type { HardwareContext } from '../hardware.js';
|
|
5
5
|
/**
|
|
@@ -69,6 +69,45 @@ export interface ImportHandleProps {
|
|
|
69
69
|
pts?: bigint;
|
|
70
70
|
timeBase?: IRational;
|
|
71
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* Map an Electron color space descriptor to FFmpeg color properties.
|
|
74
|
+
*
|
|
75
|
+
* Translates Electron's `textureInfo.colorSpace` strings (range, primaries,
|
|
76
|
+
* transfer, matrix) to the corresponding `AVCOL_*` enums. Unknown values map to
|
|
77
|
+
* the `UNSPECIFIED` variants; a missing descriptor falls back to the BGRA/sRGB
|
|
78
|
+
* defaults typical of Electron textures.
|
|
79
|
+
*
|
|
80
|
+
* @param colorSpace - Electron color space descriptor from textureInfo.colorSpace
|
|
81
|
+
*
|
|
82
|
+
* @returns Mapped FFmpeg color properties (colorRange, colorPrimaries, colorTrc, colorSpace) with fallbacks
|
|
83
|
+
*
|
|
84
|
+
* @internal
|
|
85
|
+
*/
|
|
86
|
+
export declare function mapColorSpace(colorSpace?: TextureColorSpace): {
|
|
87
|
+
colorRange: AVColorRange;
|
|
88
|
+
colorPrimaries: AVColorPrimaries;
|
|
89
|
+
colorTrc: AVColorTransferCharacteristic;
|
|
90
|
+
colorSpace: AVColorSpace;
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Resolve the software pixel format for a hardware mapping context.
|
|
94
|
+
*
|
|
95
|
+
* The mapping context's sw_format must be the *software* layout of the frames
|
|
96
|
+
* (e.g. NV12, BGRA), never a hardware wrapper format like AV_PIX_FMT_DRM_PRIME /
|
|
97
|
+
* D3D11 / VIDEOTOOLBOX (which is what `srcFrame.format` is for an imported GPU
|
|
98
|
+
* frame). Prefer the source frame's own hwframe context software format (set on
|
|
99
|
+
* macOS IOSurface imports), and fall back to the layout used at the last import
|
|
100
|
+
* for bare frames (Windows D3D11, Linux DMA-BUF) that carry no hwframe context.
|
|
101
|
+
*
|
|
102
|
+
* @param srcFrame - The source hardware frame being mapped
|
|
103
|
+
*
|
|
104
|
+
* @param fallback - Software format to use when the frame carries no hwframe context
|
|
105
|
+
*
|
|
106
|
+
* @returns The software pixel format to set on the mapping context
|
|
107
|
+
*
|
|
108
|
+
* @internal
|
|
109
|
+
*/
|
|
110
|
+
export declare function resolveMappingSwFormat(srcFrame: Frame, fallback: AVPixelFormat): AVPixelFormat;
|
|
72
111
|
/**
|
|
73
112
|
* High-level GPU texture import for Electron shared textures.
|
|
74
113
|
*
|
|
@@ -103,6 +142,7 @@ export declare class SharedTexture implements Disposable {
|
|
|
103
142
|
private _currentWidth;
|
|
104
143
|
private _currentHeight;
|
|
105
144
|
private _swFormat;
|
|
145
|
+
private _importSwFormat;
|
|
106
146
|
private _isDisposed;
|
|
107
147
|
private _mappingCtx;
|
|
108
148
|
private _mappingHw;
|
|
@@ -51,13 +51,20 @@ const MATRIX_MAP = {
|
|
|
51
51
|
'bt2020-ncl': AVCOL_SPC_BT2020_NCL,
|
|
52
52
|
};
|
|
53
53
|
/**
|
|
54
|
+
* Map an Electron color space descriptor to FFmpeg color properties.
|
|
55
|
+
*
|
|
56
|
+
* Translates Electron's `textureInfo.colorSpace` strings (range, primaries,
|
|
57
|
+
* transfer, matrix) to the corresponding `AVCOL_*` enums. Unknown values map to
|
|
58
|
+
* the `UNSPECIFIED` variants; a missing descriptor falls back to the BGRA/sRGB
|
|
59
|
+
* defaults typical of Electron textures.
|
|
60
|
+
*
|
|
54
61
|
* @param colorSpace - Electron color space descriptor from textureInfo.colorSpace
|
|
55
62
|
*
|
|
56
63
|
* @returns Mapped FFmpeg color properties (colorRange, colorPrimaries, colorTrc, colorSpace) with fallbacks
|
|
57
64
|
*
|
|
58
65
|
* @internal
|
|
59
66
|
*/
|
|
60
|
-
function mapColorSpace(colorSpace) {
|
|
67
|
+
export function mapColorSpace(colorSpace) {
|
|
61
68
|
if (!colorSpace) {
|
|
62
69
|
// Fallback: Electron textures are typically BGRA (full range, sRGB)
|
|
63
70
|
return {
|
|
@@ -74,6 +81,27 @@ function mapColorSpace(colorSpace) {
|
|
|
74
81
|
colorSpace: MATRIX_MAP[colorSpace.matrix ?? ''] ?? AVCOL_SPC_UNSPECIFIED,
|
|
75
82
|
};
|
|
76
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* Resolve the software pixel format for a hardware mapping context.
|
|
86
|
+
*
|
|
87
|
+
* The mapping context's sw_format must be the *software* layout of the frames
|
|
88
|
+
* (e.g. NV12, BGRA), never a hardware wrapper format like AV_PIX_FMT_DRM_PRIME /
|
|
89
|
+
* D3D11 / VIDEOTOOLBOX (which is what `srcFrame.format` is for an imported GPU
|
|
90
|
+
* frame). Prefer the source frame's own hwframe context software format (set on
|
|
91
|
+
* macOS IOSurface imports), and fall back to the layout used at the last import
|
|
92
|
+
* for bare frames (Windows D3D11, Linux DMA-BUF) that carry no hwframe context.
|
|
93
|
+
*
|
|
94
|
+
* @param srcFrame - The source hardware frame being mapped
|
|
95
|
+
*
|
|
96
|
+
* @param fallback - Software format to use when the frame carries no hwframe context
|
|
97
|
+
*
|
|
98
|
+
* @returns The software pixel format to set on the mapping context
|
|
99
|
+
*
|
|
100
|
+
* @internal
|
|
101
|
+
*/
|
|
102
|
+
export function resolveMappingSwFormat(srcFrame, fallback) {
|
|
103
|
+
return srcFrame.hwFramesCtx?.swFormat ?? fallback;
|
|
104
|
+
}
|
|
77
105
|
/**
|
|
78
106
|
* High-level GPU texture import for Electron shared textures.
|
|
79
107
|
*
|
|
@@ -108,6 +136,7 @@ export class SharedTexture {
|
|
|
108
136
|
_currentWidth = 0;
|
|
109
137
|
_currentHeight = 0;
|
|
110
138
|
_swFormat;
|
|
139
|
+
_importSwFormat;
|
|
111
140
|
_isDisposed = false;
|
|
112
141
|
// Mapping context cache for mapTo() helper
|
|
113
142
|
_mappingCtx = null;
|
|
@@ -115,6 +144,7 @@ export class SharedTexture {
|
|
|
115
144
|
constructor(hardware, options) {
|
|
116
145
|
this._hardware = hardware;
|
|
117
146
|
this._swFormat = options.swFormat ?? AV_PIX_FMT_BGRA;
|
|
147
|
+
this._importSwFormat = this._swFormat;
|
|
118
148
|
if (options.width)
|
|
119
149
|
this._currentWidth = options.width;
|
|
120
150
|
if (options.height)
|
|
@@ -313,8 +343,12 @@ export class SharedTexture {
|
|
|
313
343
|
* @internal
|
|
314
344
|
*/
|
|
315
345
|
ensureMappingContext(srcFrame, targetHw) {
|
|
316
|
-
|
|
317
|
-
|
|
346
|
+
const swFormat = resolveMappingSwFormat(srcFrame, this._importSwFormat);
|
|
347
|
+
// Re-create if target hardware, dimensions, or software format changed
|
|
348
|
+
if (this._mappingHw !== targetHw ||
|
|
349
|
+
this._mappingCtx?.width !== srcFrame.width ||
|
|
350
|
+
this._mappingCtx?.height !== srcFrame.height ||
|
|
351
|
+
this._mappingCtx?.swFormat !== swFormat) {
|
|
318
352
|
// Free previous context
|
|
319
353
|
if (this._mappingCtx) {
|
|
320
354
|
this._mappingCtx.free();
|
|
@@ -324,7 +358,7 @@ export class SharedTexture {
|
|
|
324
358
|
const ctx = new HardwareFramesContext();
|
|
325
359
|
ctx.alloc(targetHw.deviceContext);
|
|
326
360
|
ctx.format = targetHw.devicePixelFormat;
|
|
327
|
-
ctx.swFormat =
|
|
361
|
+
ctx.swFormat = swFormat;
|
|
328
362
|
ctx.width = srcFrame.width;
|
|
329
363
|
ctx.height = srcFrame.height;
|
|
330
364
|
const ret = ctx.init();
|
|
@@ -379,6 +413,9 @@ export class SharedTexture {
|
|
|
379
413
|
* @internal
|
|
380
414
|
*/
|
|
381
415
|
importFromHandle(handle, width, height, swFormat, options, colorSpace) {
|
|
416
|
+
// Remember the layout actually used, so mapTo() can fall back to it for
|
|
417
|
+
// bare hardware frames (D3D11/DMA-BUF) that carry no hw_frames_ctx.
|
|
418
|
+
this._importSwFormat = swFormat;
|
|
382
419
|
let frame;
|
|
383
420
|
if (handle.ioSurface && handle.ioSurface.length > 0) {
|
|
384
421
|
// macOS — IOSurface
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"electron-shared-texture.js","sourceRoot":"","sources":["../../../src/api/utilities/electron-shared-texture.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAChB,gBAAgB,EAChB,uBAAuB,EACvB,oBAAoB,EACpB,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,aAAa,EACb,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,eAAe,EACf,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,sBAAsB,EACtB,sBAAsB,EACtB,gBAAgB,EAChB,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EACf,eAAe,GAChB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAwErD,MAAM,SAAS,GAAiC;IAC9C,IAAI,EAAE,gBAAgB;IACtB,OAAO,EAAE,gBAAgB;CAC1B,CAAC;AAEF,MAAM,aAAa,GAAqC;IACtD,KAAK,EAAE,eAAe;IACtB,MAAM,EAAE,gBAAgB;IACxB,OAAO,EAAE,iBAAiB;IAC1B,SAAS,EAAE,mBAAmB;IAC9B,SAAS,EAAE,mBAAmB;IAC9B,IAAI,EAAE,cAAc;IACpB,MAAM,EAAE,gBAAgB;IACxB,cAAc,EAAE,kBAAkB;IAClC,cAAc,EAAE,kBAAkB;IAClC,EAAE,EAAE,kBAAkB;IACtB,YAAY,EAAE,iBAAiB;CAChC,CAAC;AAEF,MAAM,YAAY,GAAkD;IAClE,KAAK,EAAE,eAAe;IACtB,aAAa,EAAE,eAAe;IAC9B,OAAO,EAAE,iBAAiB;IAC1B,OAAO,EAAE,iBAAiB;IAC1B,SAAS,EAAE,mBAAmB;IAC9B,SAAS,EAAE,mBAAmB;IAC9B,MAAM,EAAE,gBAAgB;IACxB,GAAG,EAAE,aAAa;IAClB,UAAU,EAAE,kBAAkB;IAC9B,cAAc,EAAE,sBAAsB;IACtC,YAAY,EAAE,oBAAoB;IAClC,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,mBAAmB;IAChC,WAAW,EAAE,mBAAmB;IAChC,EAAE,EAAE,mBAAmB;IACvB,cAAc,EAAE,kBAAkB;IAClC,GAAG,EAAE,sBAAsB;CAC5B,CAAC;AAEF,MAAM,UAAU,GAAiC;IAC/C,GAAG,EAAE,aAAa;IAClB,GAAG,EAAE,aAAa;IAClB,KAAK,EAAE,eAAe;IACtB,GAAG,EAAE,aAAa;IAClB,OAAO,EAAE,iBAAiB;IAC1B,SAAS,EAAE,mBAAmB;IAC9B,SAAS,EAAE,mBAAmB;IAC9B,KAAK,EAAE,eAAe;IACtB,YAAY,EAAE,oBAAoB;CACnC,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"electron-shared-texture.js","sourceRoot":"","sources":["../../../src/api/utilities/electron-shared-texture.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAChB,gBAAgB,EAChB,uBAAuB,EACvB,oBAAoB,EACpB,iBAAiB,EACj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,qBAAqB,EAAE,CAAC;QAC9C,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;QAC9C,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC;QACpD,SAAS,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC9B,SAAS,CAAC,KAAK,GAAG,KAAK,CAAC;QACxB,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC;QAE1B,MAAM,GAAG,GAAG,SAAS,CAAC,IAAI,EAAE,CAAC;QAC7B,WAAW,CAAC,YAAY,CAAC,GAAG,EAAE,4CAA4C,CAAC,CAAC;QAE5E,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;QAC3B,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC;QAC7B,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAE1B,OAAO,SAAS,CAAC;IACnB,CAAC;IAED;;;;;;;;;;OAUG;IACK,kBAAkB,CAAC,IAAY;QACrC,8EAA8E;QAC9E,MAAM,GAAG,GAAG,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;QAC1D,IAAI,GAAG,KAAK,eAAe,EAAE,CAAC;YAC5B,OAAO,IAAI,CAAC,SAAS,CAAC;QACxB,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,CAAC,MAAM,CAAC,OAAO,CAAC;QACd,IAAI,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;CACF"}
|
package/dist/lib/error.d.ts
CHANGED
|
@@ -231,6 +231,75 @@ export declare class FFmpegError extends Error implements NativeWrapper<NativeFF
|
|
|
231
231
|
* Human-readable description of the error.
|
|
232
232
|
*/
|
|
233
233
|
get message(): string;
|
|
234
|
+
/**
|
|
235
|
+
* Whether this is EAGAIN (resource temporarily unavailable).
|
|
236
|
+
*
|
|
237
|
+
* In codec/filter contexts this means "output not available yet, feed more
|
|
238
|
+
* input" rather than a hard failure.
|
|
239
|
+
*
|
|
240
|
+
* @example
|
|
241
|
+
* ```typescript
|
|
242
|
+
* const error = FFmpegError.fromCode(ret);
|
|
243
|
+
* if (error?.isEAGAIN) {
|
|
244
|
+
* // send more input, then retry
|
|
245
|
+
* }
|
|
246
|
+
* ```
|
|
247
|
+
*/
|
|
248
|
+
get isEAGAIN(): boolean;
|
|
249
|
+
/**
|
|
250
|
+
* Whether this is the end of stream (AVERROR_EOF).
|
|
251
|
+
*/
|
|
252
|
+
get isEOF(): boolean;
|
|
253
|
+
/**
|
|
254
|
+
* Whether this is invalid data found while processing input (AVERROR_INVALIDDATA).
|
|
255
|
+
*/
|
|
256
|
+
get isInvalidData(): boolean;
|
|
257
|
+
/**
|
|
258
|
+
* Whether this is EINVAL (invalid argument).
|
|
259
|
+
*/
|
|
260
|
+
get isEINVAL(): boolean;
|
|
261
|
+
/**
|
|
262
|
+
* Whether this is ENOMEM (out of memory).
|
|
263
|
+
*/
|
|
264
|
+
get isENOMEM(): boolean;
|
|
265
|
+
/**
|
|
266
|
+
* Whether this is ENOENT (no such file or directory).
|
|
267
|
+
*/
|
|
268
|
+
get isENOENT(): boolean;
|
|
269
|
+
/**
|
|
270
|
+
* Whether this is EACCES (permission denied).
|
|
271
|
+
*/
|
|
272
|
+
get isEACCES(): boolean;
|
|
273
|
+
/**
|
|
274
|
+
* Whether this is EIO (I/O error).
|
|
275
|
+
*/
|
|
276
|
+
get isEIO(): boolean;
|
|
277
|
+
/**
|
|
278
|
+
* Whether this is EPIPE (broken pipe).
|
|
279
|
+
*/
|
|
280
|
+
get isEPIPE(): boolean;
|
|
281
|
+
/**
|
|
282
|
+
* Whether this is the immediate-exit request (AVERROR_EXIT).
|
|
283
|
+
*/
|
|
284
|
+
get isExit(): boolean;
|
|
285
|
+
/**
|
|
286
|
+
* Check if this error matches a specific code.
|
|
287
|
+
*
|
|
288
|
+
* @param errorCode - FFmpeg error code to compare against
|
|
289
|
+
*
|
|
290
|
+
* @returns True if this error's code matches
|
|
291
|
+
*
|
|
292
|
+
* @example
|
|
293
|
+
* ```typescript
|
|
294
|
+
* import { AVERROR_DECODER_NOT_FOUND } from 'node-av/constants';
|
|
295
|
+
*
|
|
296
|
+
* const error = FFmpegError.fromCode(ret);
|
|
297
|
+
* if (error?.is(AVERROR_DECODER_NOT_FOUND)) {
|
|
298
|
+
* // handle missing decoder
|
|
299
|
+
* }
|
|
300
|
+
* ```
|
|
301
|
+
*/
|
|
302
|
+
is(errorCode: number): boolean;
|
|
234
303
|
/**
|
|
235
304
|
* Get the underlying native FFmpegError object.
|
|
236
305
|
*
|
package/dist/lib/error.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AVERROR_EOF, AVERROR_EXIT, AVERROR_INVALIDDATA } from '../constants/constants.js';
|
|
1
2
|
import { bindings } from './binding.js';
|
|
2
3
|
/**
|
|
3
4
|
* POSIX error names that can be converted to FFmpeg error codes.
|
|
@@ -289,6 +290,97 @@ export class FFmpegError extends Error {
|
|
|
289
290
|
get message() {
|
|
290
291
|
return this.native.message;
|
|
291
292
|
}
|
|
293
|
+
/**
|
|
294
|
+
* Whether this is EAGAIN (resource temporarily unavailable).
|
|
295
|
+
*
|
|
296
|
+
* In codec/filter contexts this means "output not available yet, feed more
|
|
297
|
+
* input" rather than a hard failure.
|
|
298
|
+
*
|
|
299
|
+
* @example
|
|
300
|
+
* ```typescript
|
|
301
|
+
* const error = FFmpegError.fromCode(ret);
|
|
302
|
+
* if (error?.isEAGAIN) {
|
|
303
|
+
* // send more input, then retry
|
|
304
|
+
* }
|
|
305
|
+
* ```
|
|
306
|
+
*/
|
|
307
|
+
get isEAGAIN() {
|
|
308
|
+
return this.native.code === AVERROR_EAGAIN;
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Whether this is the end of stream (AVERROR_EOF).
|
|
312
|
+
*/
|
|
313
|
+
get isEOF() {
|
|
314
|
+
return this.native.code === AVERROR_EOF;
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Whether this is invalid data found while processing input (AVERROR_INVALIDDATA).
|
|
318
|
+
*/
|
|
319
|
+
get isInvalidData() {
|
|
320
|
+
return this.native.code === AVERROR_INVALIDDATA;
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Whether this is EINVAL (invalid argument).
|
|
324
|
+
*/
|
|
325
|
+
get isEINVAL() {
|
|
326
|
+
return this.native.code === AVERROR_EINVAL;
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Whether this is ENOMEM (out of memory).
|
|
330
|
+
*/
|
|
331
|
+
get isENOMEM() {
|
|
332
|
+
return this.native.code === AVERROR_ENOMEM;
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Whether this is ENOENT (no such file or directory).
|
|
336
|
+
*/
|
|
337
|
+
get isENOENT() {
|
|
338
|
+
return this.native.code === AVERROR_ENOENT;
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* Whether this is EACCES (permission denied).
|
|
342
|
+
*/
|
|
343
|
+
get isEACCES() {
|
|
344
|
+
return this.native.code === AVERROR_EACCES;
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* Whether this is EIO (I/O error).
|
|
348
|
+
*/
|
|
349
|
+
get isEIO() {
|
|
350
|
+
return this.native.code === AVERROR_EIO;
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* Whether this is EPIPE (broken pipe).
|
|
354
|
+
*/
|
|
355
|
+
get isEPIPE() {
|
|
356
|
+
return this.native.code === AVERROR_EPIPE;
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* Whether this is the immediate-exit request (AVERROR_EXIT).
|
|
360
|
+
*/
|
|
361
|
+
get isExit() {
|
|
362
|
+
return this.native.code === AVERROR_EXIT;
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Check if this error matches a specific code.
|
|
366
|
+
*
|
|
367
|
+
* @param errorCode - FFmpeg error code to compare against
|
|
368
|
+
*
|
|
369
|
+
* @returns True if this error's code matches
|
|
370
|
+
*
|
|
371
|
+
* @example
|
|
372
|
+
* ```typescript
|
|
373
|
+
* import { AVERROR_DECODER_NOT_FOUND } from 'node-av/constants';
|
|
374
|
+
*
|
|
375
|
+
* const error = FFmpegError.fromCode(ret);
|
|
376
|
+
* if (error?.is(AVERROR_DECODER_NOT_FOUND)) {
|
|
377
|
+
* // handle missing decoder
|
|
378
|
+
* }
|
|
379
|
+
* ```
|
|
380
|
+
*/
|
|
381
|
+
is(errorCode) {
|
|
382
|
+
return this.native.code === errorCode;
|
|
383
|
+
}
|
|
292
384
|
/**
|
|
293
385
|
* Get the underlying native FFmpegError object.
|
|
294
386
|
*
|
package/dist/lib/error.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/lib/error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAKxC;;;;;;;;;;;;GAYG;AACH,MAAM,CAAN,IAAY,UAiBX;AAjBD,WAAY,UAAU;IACpB,+BAAiB,CAAA;IACjB,+BAAiB,CAAA;IACjB,+BAAiB,CAAA;IACjB,yBAAW,CAAA;IACX,6BAAe,CAAA;IACf,+BAAiB,CAAA;IACjB,+BAAiB,CAAA;IACjB,+BAAiB,CAAA;IACjB,6BAAe,CAAA;IACf,+BAAiB,CAAA;IACjB,+BAAiB,CAAA;IACjB,iCAAmB,CAAA;IACnB,+BAAiB,CAAA;IACjB,6BAAe,CAAA;IACf,+BAAiB,CAAA;IACjB,+BAAiB,CAAA;AACnB,CAAC,EAjBW,UAAU,KAAV,UAAU,QAiBrB;AAED,uDAAuD;AACvD,MAAM,UAAU,GAA4B,EAAE,CAAC;AAE/C;;;;;;;;GAQG;AACH,SAAS,cAAc,CAAC,IAAgB;IACtC,IAAI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AQ;QACV,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,cAAc,CAAC;IAC7C,CAAC;IAED;;OAEG;IACH,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,cAAc,CAAC;IAC7C,CAAC;IAED;;OAEG;IACH,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,cAAc,CAAC;IAC7C,CAAC;IAED;;OAEG;IACH,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,cAAc,CAAC;IAC7C,CAAC;IAED;;OAEG;IACH,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,WAAW,CAAC;IAC1C,CAAC;IAED;;OAEG;IACH,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,aAAa,CAAC;IAC5C,CAAC;IAED;;OAEG;IACH,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,YAAY,CAAC;IAC3C,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,EAAE,CAAC,SAAiB;QAClB,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS,CAAC;IACxC,CAAC;IAED;;;;;;OAMG;IACH,SAAS;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-av",
|
|
3
|
-
"version": "6.0.0-beta.
|
|
3
|
+
"version": "6.0.0-beta.6",
|
|
4
4
|
"description": "FFmpeg bindings for Node.js",
|
|
5
5
|
"author": "seydx (https://github.com/seydx/node-av)",
|
|
6
6
|
"type": "module",
|
|
@@ -85,14 +85,14 @@
|
|
|
85
85
|
},
|
|
86
86
|
"optionalDependencies": {
|
|
87
87
|
"werift": "^0.23.0",
|
|
88
|
-
"@seydx/node-av-darwin-arm64": "^6.0.0-beta.
|
|
89
|
-
"@seydx/node-av-darwin-x64": "^6.0.0-beta.
|
|
90
|
-
"@seydx/node-av-linux-arm64": "^6.0.0-beta.
|
|
91
|
-
"@seydx/node-av-linux-x64": "^6.0.0-beta.
|
|
92
|
-
"@seydx/node-av-win32-arm64-mingw": "^6.0.0-beta.
|
|
93
|
-
"@seydx/node-av-win32-arm64-msvc": "^6.0.0-beta.
|
|
94
|
-
"@seydx/node-av-win32-x64-mingw": "^6.0.0-beta.
|
|
95
|
-
"@seydx/node-av-win32-x64-msvc": "^6.0.0-beta.
|
|
88
|
+
"@seydx/node-av-darwin-arm64": "^6.0.0-beta.6",
|
|
89
|
+
"@seydx/node-av-darwin-x64": "^6.0.0-beta.6",
|
|
90
|
+
"@seydx/node-av-linux-arm64": "^6.0.0-beta.6",
|
|
91
|
+
"@seydx/node-av-linux-x64": "^6.0.0-beta.6",
|
|
92
|
+
"@seydx/node-av-win32-arm64-mingw": "^6.0.0-beta.6",
|
|
93
|
+
"@seydx/node-av-win32-arm64-msvc": "^6.0.0-beta.6",
|
|
94
|
+
"@seydx/node-av-win32-x64-mingw": "^6.0.0-beta.6",
|
|
95
|
+
"@seydx/node-av-win32-x64-msvc": "^6.0.0-beta.6"
|
|
96
96
|
},
|
|
97
97
|
"devDependencies": {
|
|
98
98
|
"@stylistic/eslint-plugin": "^5.10.0",
|