node-av 1.3.0 → 2.1.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/README.md +47 -40
- package/binding.gyp +12 -0
- package/dist/api/bitstream-filter.d.ts +134 -2
- package/dist/api/bitstream-filter.js +200 -2
- package/dist/api/bitstream-filter.js.map +1 -1
- package/dist/api/decoder.d.ts +261 -105
- package/dist/api/decoder.js +384 -171
- package/dist/api/decoder.js.map +1 -1
- package/dist/api/encoder.d.ts +338 -74
- package/dist/api/encoder.js +546 -188
- package/dist/api/encoder.js.map +1 -1
- package/dist/api/filter-presets.d.ts +479 -1513
- package/dist/api/filter-presets.js +1044 -2005
- package/dist/api/filter-presets.js.map +1 -1
- package/dist/api/filter.d.ts +370 -150
- package/dist/api/filter.js +647 -364
- package/dist/api/filter.js.map +1 -1
- package/dist/api/hardware.d.ts +25 -31
- package/dist/api/hardware.js +36 -70
- package/dist/api/hardware.js.map +1 -1
- package/dist/api/index.d.ts +1 -1
- package/dist/api/index.js +1 -1
- package/dist/api/index.js.map +1 -1
- package/dist/api/io-stream.d.ts +6 -0
- package/dist/api/io-stream.js +2 -0
- package/dist/api/io-stream.js.map +1 -1
- package/dist/api/media-input.d.ts +208 -2
- package/dist/api/media-input.js +356 -8
- package/dist/api/media-input.js.map +1 -1
- package/dist/api/media-output.d.ts +142 -104
- package/dist/api/media-output.js +446 -179
- package/dist/api/media-output.js.map +1 -1
- package/dist/api/pipeline.d.ts +82 -17
- package/dist/api/pipeline.js +80 -42
- package/dist/api/pipeline.js.map +1 -1
- package/dist/api/types.d.ts +24 -57
- package/dist/api/utils.js +2 -0
- package/dist/api/utils.js.map +1 -1
- package/dist/lib/audio-fifo.d.ts +103 -0
- package/dist/lib/audio-fifo.js +109 -0
- package/dist/lib/audio-fifo.js.map +1 -1
- package/dist/lib/binding.d.ts +1 -0
- package/dist/lib/binding.js.map +1 -1
- package/dist/lib/bitstream-filter-context.d.ts +79 -0
- package/dist/lib/bitstream-filter-context.js +83 -0
- package/dist/lib/bitstream-filter-context.js.map +1 -1
- package/dist/lib/bitstream-filter.d.ts +2 -0
- package/dist/lib/bitstream-filter.js +2 -0
- package/dist/lib/bitstream-filter.js.map +1 -1
- package/dist/lib/codec-context.d.ts +168 -0
- package/dist/lib/codec-context.js +178 -0
- package/dist/lib/codec-context.js.map +1 -1
- package/dist/lib/codec-parameters.d.ts +3 -0
- package/dist/lib/codec-parameters.js +3 -0
- package/dist/lib/codec-parameters.js.map +1 -1
- package/dist/lib/codec-parser.d.ts +6 -0
- package/dist/lib/codec-parser.js +6 -0
- package/dist/lib/codec-parser.js.map +1 -1
- package/dist/lib/codec.d.ts +12 -0
- package/dist/lib/codec.js +12 -0
- package/dist/lib/codec.js.map +1 -1
- package/dist/lib/dictionary.d.ts +18 -2
- package/dist/lib/dictionary.js +18 -2
- package/dist/lib/dictionary.js.map +1 -1
- package/dist/lib/error.d.ts +8 -0
- package/dist/lib/error.js +9 -0
- package/dist/lib/error.js.map +1 -1
- package/dist/lib/filter-context.d.ts +119 -2
- package/dist/lib/filter-context.js +119 -0
- package/dist/lib/filter-context.js.map +1 -1
- package/dist/lib/filter-graph.d.ts +80 -0
- package/dist/lib/filter-graph.js +84 -0
- package/dist/lib/filter-graph.js.map +1 -1
- package/dist/lib/filter-inout.d.ts +1 -0
- package/dist/lib/filter-inout.js +1 -0
- package/dist/lib/filter-inout.js.map +1 -1
- package/dist/lib/filter.d.ts +2 -0
- package/dist/lib/filter.js +2 -0
- package/dist/lib/filter.js.map +1 -1
- package/dist/lib/format-context.d.ts +356 -20
- package/dist/lib/format-context.js +375 -23
- package/dist/lib/format-context.js.map +1 -1
- package/dist/lib/frame.d.ts +84 -1
- package/dist/lib/frame.js +96 -0
- package/dist/lib/frame.js.map +1 -1
- package/dist/lib/hardware-device-context.d.ts +8 -0
- package/dist/lib/hardware-device-context.js +8 -0
- package/dist/lib/hardware-device-context.js.map +1 -1
- package/dist/lib/hardware-frames-context.d.ts +55 -0
- package/dist/lib/hardware-frames-context.js +57 -0
- package/dist/lib/hardware-frames-context.js.map +1 -1
- package/dist/lib/input-format.d.ts +43 -3
- package/dist/lib/input-format.js +48 -0
- package/dist/lib/input-format.js.map +1 -1
- package/dist/lib/io-context.d.ts +212 -0
- package/dist/lib/io-context.js +228 -0
- package/dist/lib/io-context.js.map +1 -1
- package/dist/lib/log.d.ts +2 -0
- package/dist/lib/log.js +2 -0
- package/dist/lib/log.js.map +1 -1
- package/dist/lib/native-types.d.ts +39 -1
- package/dist/lib/option.d.ts +90 -0
- package/dist/lib/option.js +97 -0
- package/dist/lib/option.js.map +1 -1
- package/dist/lib/output-format.d.ts +4 -0
- package/dist/lib/output-format.js +4 -0
- package/dist/lib/output-format.js.map +1 -1
- package/dist/lib/packet.d.ts +7 -0
- package/dist/lib/packet.js +7 -0
- package/dist/lib/packet.js.map +1 -1
- package/dist/lib/rational.d.ts +1 -0
- package/dist/lib/rational.js +1 -0
- package/dist/lib/rational.js.map +1 -1
- package/dist/lib/software-resample-context.d.ts +64 -0
- package/dist/lib/software-resample-context.js +66 -0
- package/dist/lib/software-resample-context.js.map +1 -1
- package/dist/lib/software-scale-context.d.ts +98 -0
- package/dist/lib/software-scale-context.js +102 -0
- package/dist/lib/software-scale-context.js.map +1 -1
- package/dist/lib/stream.d.ts +1 -0
- package/dist/lib/stream.js +1 -0
- package/dist/lib/stream.js.map +1 -1
- package/dist/lib/utilities.d.ts +60 -0
- package/dist/lib/utilities.js +60 -0
- package/dist/lib/utilities.js.map +1 -1
- package/package.json +18 -18
- package/release_notes.md +0 -29
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hardware-frames-context.js","sourceRoot":"","sources":["../../src/lib/hardware-frames-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAMrE;;;;;;;;;;;;;;;;;;;;;;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AAI,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;YAClC,OAAO,IAAI,CAAC,UAAU,CAAC;QACzB,CAAC;QAED,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC;QACrC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;YACvB,OAAO,IAAI,CAAC;QACd,CAAC;QAED,+BAA+B;QAC/B,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,qBAAqB,CAAC,SAAS,CAA0B,CAAC;QACtF,MAAc,CAAC,MAAM,GAAG,MAAM,CAAC;QAChC,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC;QACzB,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,KAAK,CAAC,MAA6B;QACjC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;IACxC,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,IAAI;QACF,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IAC5B,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,IAAI;QACF,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IACrB,CAAC;IAED
|
|
1
|
+
{"version":3,"file":"hardware-frames-context.js","sourceRoot":"","sources":["../../src/lib/hardware-frames-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAMrE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,MAAM,OAAO,qBAAqB;IACxB,MAAM,CAA8B;IACpC,UAAU,CAAgC,CAAC,mCAAmC;IAEtF;QACE,IAAI,CAAC,MAAM,GAAG,I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AgB,CAAC,GAAU,EAAE,GAAU,EAAE,KAAc;QACrD,OAAO,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,GAAG,CAAC,SAAS,EAAE,EAAE,GAAG,CAAC,SAAS,EAAE,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC;IACpF,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,kBAAkB,CAAC,SAAqC;QACtD,OAAO,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;IACnD,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,GAAG,CAAC,GAAU,EAAE,GAAU,EAAE,KAAc;QACxC,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,EAAE,EAAE,GAAG,CAAC,SAAS,EAAE,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC;IACvE,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmCG;IACH,aAAa,CAAC,MAAqB,EAAE,aAAoC,EAAE,MAA6B,EAAE,KAAc;QACtH,OAAO,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,EAAE,aAAa,CAAC,SAAS,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC;IACjG,CAAC;IAED;;;;;;OAMG;IACH,SAAS;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,CAAC,MAAM,CAAC,OAAO,CAAC;QACd,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;IAChC,CAAC;CACF"}
|
|
@@ -44,6 +44,7 @@ export declare class InputFormat implements NativeWrapper<NativeInputFormat> {
|
|
|
44
44
|
private native;
|
|
45
45
|
/**
|
|
46
46
|
* @param native - The native input format instance
|
|
47
|
+
*
|
|
47
48
|
* @internal
|
|
48
49
|
*/
|
|
49
50
|
constructor(native: NativeInputFormat);
|
|
@@ -55,6 +56,7 @@ export declare class InputFormat implements NativeWrapper<NativeInputFormat> {
|
|
|
55
56
|
* Direct mapping to av_find_input_format().
|
|
56
57
|
*
|
|
57
58
|
* @param shortName - Format short name (e.g., 'mp4', 'mkv', 'avi')
|
|
59
|
+
*
|
|
58
60
|
* @returns Input format if found, null otherwise
|
|
59
61
|
*
|
|
60
62
|
* @example
|
|
@@ -82,7 +84,9 @@ export declare class InputFormat implements NativeWrapper<NativeInputFormat> {
|
|
|
82
84
|
* Direct mapping to av_probe_input_format2().
|
|
83
85
|
*
|
|
84
86
|
* @param buffer - Buffer containing file header/start
|
|
87
|
+
*
|
|
85
88
|
* @param filename - Optional filename for format hints
|
|
89
|
+
*
|
|
86
90
|
* @returns Detected format, or null if not recognized
|
|
87
91
|
*
|
|
88
92
|
* @example
|
|
@@ -113,8 +117,11 @@ export declare class InputFormat implements NativeWrapper<NativeInputFormat> {
|
|
|
113
117
|
* Direct mapping to av_probe_input_buffer2().
|
|
114
118
|
*
|
|
115
119
|
* @param ioContext - IO context to read from
|
|
120
|
+
*
|
|
116
121
|
* @param ioContext.getNative - Method to get native IO context
|
|
122
|
+
*
|
|
117
123
|
* @param maxProbeSize - Maximum bytes to read for probing
|
|
124
|
+
*
|
|
118
125
|
* @returns Detected format, or null if not recognized
|
|
119
126
|
*
|
|
120
127
|
* @example
|
|
@@ -134,9 +141,42 @@ export declare class InputFormat implements NativeWrapper<NativeInputFormat> {
|
|
|
134
141
|
*
|
|
135
142
|
* @see {@link probe} For buffer probing
|
|
136
143
|
*/
|
|
137
|
-
static probeBuffer(ioContext:
|
|
138
|
-
|
|
139
|
-
|
|
144
|
+
static probeBuffer(ioContext: NativeWrapper<NativeIOContext>, maxProbeSize?: number): Promise<InputFormat | null>;
|
|
145
|
+
/**
|
|
146
|
+
* Probe format from IO context synchronously.
|
|
147
|
+
* Synchronous version of probeBuffer.
|
|
148
|
+
*
|
|
149
|
+
* Reads data from an IO context to determine format.
|
|
150
|
+
* Useful for custom IO scenarios and network streams.
|
|
151
|
+
*
|
|
152
|
+
* Direct mapping to av_probe_input_buffer2().
|
|
153
|
+
*
|
|
154
|
+
* @param ioContext - IO context to read from
|
|
155
|
+
*
|
|
156
|
+
* @param ioContext.getNative - Method to get native IO context
|
|
157
|
+
*
|
|
158
|
+
* @param maxProbeSize - Maximum bytes to read for probing
|
|
159
|
+
*
|
|
160
|
+
* @returns Detected format, or null if not recognized
|
|
161
|
+
*
|
|
162
|
+
* @example
|
|
163
|
+
* ```typescript
|
|
164
|
+
* import { IOContext } from 'node-av';
|
|
165
|
+
*
|
|
166
|
+
* // Create IO context
|
|
167
|
+
* const ioContext = new IOContext();
|
|
168
|
+
* // ... configure IO context ...
|
|
169
|
+
*
|
|
170
|
+
* // Probe format
|
|
171
|
+
* const format = InputFormat.probeBufferSync(ioContext, 32768);
|
|
172
|
+
* if (format) {
|
|
173
|
+
* console.log(`Format: ${format.name}`);
|
|
174
|
+
* }
|
|
175
|
+
* ```
|
|
176
|
+
*
|
|
177
|
+
* @see {@link probeBuffer} For async version
|
|
178
|
+
*/
|
|
179
|
+
static probeBufferSync(ioContext: NativeWrapper<NativeIOContext>, maxProbeSize?: number): InputFormat | null;
|
|
140
180
|
/**
|
|
141
181
|
* Format short name.
|
|
142
182
|
*
|
package/dist/lib/input-format.js
CHANGED
|
@@ -43,6 +43,7 @@ export class InputFormat {
|
|
|
43
43
|
native;
|
|
44
44
|
/**
|
|
45
45
|
* @param native - The native input format instance
|
|
46
|
+
*
|
|
46
47
|
* @internal
|
|
47
48
|
*/
|
|
48
49
|
constructor(native) {
|
|
@@ -56,6 +57,7 @@ export class InputFormat {
|
|
|
56
57
|
* Direct mapping to av_find_input_format().
|
|
57
58
|
*
|
|
58
59
|
* @param shortName - Format short name (e.g., 'mp4', 'mkv', 'avi')
|
|
60
|
+
*
|
|
59
61
|
* @returns Input format if found, null otherwise
|
|
60
62
|
*
|
|
61
63
|
* @example
|
|
@@ -89,7 +91,9 @@ export class InputFormat {
|
|
|
89
91
|
* Direct mapping to av_probe_input_format2().
|
|
90
92
|
*
|
|
91
93
|
* @param buffer - Buffer containing file header/start
|
|
94
|
+
*
|
|
92
95
|
* @param filename - Optional filename for format hints
|
|
96
|
+
*
|
|
93
97
|
* @returns Detected format, or null if not recognized
|
|
94
98
|
*
|
|
95
99
|
* @example
|
|
@@ -126,8 +130,11 @@ export class InputFormat {
|
|
|
126
130
|
* Direct mapping to av_probe_input_buffer2().
|
|
127
131
|
*
|
|
128
132
|
* @param ioContext - IO context to read from
|
|
133
|
+
*
|
|
129
134
|
* @param ioContext.getNative - Method to get native IO context
|
|
135
|
+
*
|
|
130
136
|
* @param maxProbeSize - Maximum bytes to read for probing
|
|
137
|
+
*
|
|
131
138
|
* @returns Detected format, or null if not recognized
|
|
132
139
|
*
|
|
133
140
|
* @example
|
|
@@ -154,6 +161,47 @@ export class InputFormat {
|
|
|
154
161
|
}
|
|
155
162
|
return new InputFormat(native);
|
|
156
163
|
}
|
|
164
|
+
/**
|
|
165
|
+
* Probe format from IO context synchronously.
|
|
166
|
+
* Synchronous version of probeBuffer.
|
|
167
|
+
*
|
|
168
|
+
* Reads data from an IO context to determine format.
|
|
169
|
+
* Useful for custom IO scenarios and network streams.
|
|
170
|
+
*
|
|
171
|
+
* Direct mapping to av_probe_input_buffer2().
|
|
172
|
+
*
|
|
173
|
+
* @param ioContext - IO context to read from
|
|
174
|
+
*
|
|
175
|
+
* @param ioContext.getNative - Method to get native IO context
|
|
176
|
+
*
|
|
177
|
+
* @param maxProbeSize - Maximum bytes to read for probing
|
|
178
|
+
*
|
|
179
|
+
* @returns Detected format, or null if not recognized
|
|
180
|
+
*
|
|
181
|
+
* @example
|
|
182
|
+
* ```typescript
|
|
183
|
+
* import { IOContext } from 'node-av';
|
|
184
|
+
*
|
|
185
|
+
* // Create IO context
|
|
186
|
+
* const ioContext = new IOContext();
|
|
187
|
+
* // ... configure IO context ...
|
|
188
|
+
*
|
|
189
|
+
* // Probe format
|
|
190
|
+
* const format = InputFormat.probeBufferSync(ioContext, 32768);
|
|
191
|
+
* if (format) {
|
|
192
|
+
* console.log(`Format: ${format.name}`);
|
|
193
|
+
* }
|
|
194
|
+
* ```
|
|
195
|
+
*
|
|
196
|
+
* @see {@link probeBuffer} For async version
|
|
197
|
+
*/
|
|
198
|
+
static probeBufferSync(ioContext, maxProbeSize) {
|
|
199
|
+
const native = bindings.InputFormat.probeBufferSync(ioContext.getNative(), maxProbeSize);
|
|
200
|
+
if (!native) {
|
|
201
|
+
return null;
|
|
202
|
+
}
|
|
203
|
+
return new InputFormat(native);
|
|
204
|
+
}
|
|
157
205
|
/**
|
|
158
206
|
* Format short name.
|
|
159
207
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-format.js","sourceRoot":"","sources":["../../src/lib/input-format.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAKxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,MAAM,OAAO,WAAW;IACd,MAAM,CAAoB;IAElC
|
|
1
|
+
{"version":3,"file":"input-format.js","sourceRoot":"","sources":["../../src/lib/input-format.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAKxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,MAAM,OAAO,WAAW;IACd,MAAM,CAAoB;IAElC;;;;OAIG;IACH,YAAY,MAAyB;QACnC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,MAAM,CAAC,eAAe,CAAC,SAAiB;QACtC,MAAM,MAAM,GAAG,QAAQ,CAAC,WAAW,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;QAC/D,IAAI,CAAC,MAA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AMG;IACH,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;IAC9B,CAAC;IAED;;;;;;OAMG;IACH,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC;IAChC,CAAC;IAED;;;;;;OAMG;IACH,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;IAC9B,CAAC;IAED;;;;;;OAMG;IACH,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;IAC3B,CAAC;IAED;;;;;;OAMG;IACH,SAAS;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF"}
|
package/dist/lib/io-context.d.ts
CHANGED
|
@@ -76,6 +76,7 @@ export declare class IOContext extends OptionMember<NativeIOContext> implements
|
|
|
76
76
|
* Used internally for wrapping native I/O contexts.
|
|
77
77
|
*
|
|
78
78
|
* @param native - Native IOContext binding object
|
|
79
|
+
*
|
|
79
80
|
* @returns Wrapped IOContext instance
|
|
80
81
|
*
|
|
81
82
|
* @internal
|
|
@@ -158,6 +159,7 @@ export declare class IOContext extends OptionMember<NativeIOContext> implements
|
|
|
158
159
|
* Direct mapping to avio_alloc_context() without callbacks.
|
|
159
160
|
*
|
|
160
161
|
* @param bufferSize - Size of internal buffer
|
|
162
|
+
*
|
|
161
163
|
* @param writeFlag - 1 for write, 0 for read
|
|
162
164
|
*
|
|
163
165
|
* @example
|
|
@@ -178,9 +180,13 @@ export declare class IOContext extends OptionMember<NativeIOContext> implements
|
|
|
178
180
|
* Direct mapping to avio_alloc_context() with callbacks.
|
|
179
181
|
*
|
|
180
182
|
* @param bufferSize - Size of internal buffer
|
|
183
|
+
*
|
|
181
184
|
* @param writeFlag - 1 for write mode, 0 for read mode
|
|
185
|
+
*
|
|
182
186
|
* @param readCallback - Function to read data (null for write-only)
|
|
187
|
+
*
|
|
183
188
|
* @param writeCallback - Function to write data (null for read-only)
|
|
189
|
+
*
|
|
184
190
|
* @param seekCallback - Function to seek in stream (optional)
|
|
185
191
|
*
|
|
186
192
|
* @example
|
|
@@ -239,7 +245,9 @@ export declare class IOContext extends OptionMember<NativeIOContext> implements
|
|
|
239
245
|
* Direct mapping to avio_open2().
|
|
240
246
|
*
|
|
241
247
|
* @param url - URL or file path to open
|
|
248
|
+
*
|
|
242
249
|
* @param flags - Open flags (AVIO_FLAG_READ, AVIO_FLAG_WRITE, etc.)
|
|
250
|
+
*
|
|
243
251
|
* @returns 0 on success, negative AVERROR on error:
|
|
244
252
|
* - AVERROR_ENOENT: File not found
|
|
245
253
|
* - AVERROR_EACCES: Permission denied
|
|
@@ -262,6 +270,41 @@ export declare class IOContext extends OptionMember<NativeIOContext> implements
|
|
|
262
270
|
* @see {@link closep} To close after use
|
|
263
271
|
*/
|
|
264
272
|
open2(url: string, flags?: AVIOFlag): Promise<number>;
|
|
273
|
+
/**
|
|
274
|
+
* Open resource for I/O synchronously.
|
|
275
|
+
* Synchronous version of open2.
|
|
276
|
+
*
|
|
277
|
+
* Opens a URL or file for reading or writing.
|
|
278
|
+
* Automatically selects the appropriate protocol handler.
|
|
279
|
+
*
|
|
280
|
+
* Direct mapping to avio_open2().
|
|
281
|
+
*
|
|
282
|
+
* @param url - URL or file path to open
|
|
283
|
+
*
|
|
284
|
+
* @param flags - Open flags (AVIO_FLAG_READ, AVIO_FLAG_WRITE, etc.)
|
|
285
|
+
*
|
|
286
|
+
* @returns 0 on success, negative AVERROR on error:
|
|
287
|
+
* - AVERROR_ENOENT: File not found
|
|
288
|
+
* - AVERROR_EACCES: Permission denied
|
|
289
|
+
* - AVERROR_ENOMEM: Memory allocation failure
|
|
290
|
+
*
|
|
291
|
+
* @example
|
|
292
|
+
* ```typescript
|
|
293
|
+
* import { FFmpegError } from 'node-av';
|
|
294
|
+
* import { AVIO_FLAG_READ, AVIO_FLAG_WRITE } from 'node-av/constants';
|
|
295
|
+
*
|
|
296
|
+
* // Open for reading
|
|
297
|
+
* const ret = io.open2Sync('input.mp4', AVIO_FLAG_READ);
|
|
298
|
+
* FFmpegError.throwIfError(ret, 'open2');
|
|
299
|
+
*
|
|
300
|
+
* // Open for writing
|
|
301
|
+
* const ret2 = io.open2Sync('output.mp4', AVIO_FLAG_WRITE);
|
|
302
|
+
* FFmpegError.throwIfError(ret2, 'open2');
|
|
303
|
+
* ```
|
|
304
|
+
*
|
|
305
|
+
* @see {@link open2} For async version
|
|
306
|
+
*/
|
|
307
|
+
open2Sync(url: string, flags?: AVIOFlag): number;
|
|
265
308
|
/**
|
|
266
309
|
* Close I/O context.
|
|
267
310
|
*
|
|
@@ -283,6 +326,28 @@ export declare class IOContext extends OptionMember<NativeIOContext> implements
|
|
|
283
326
|
* @see {@link open2} To open resources
|
|
284
327
|
*/
|
|
285
328
|
closep(): Promise<number>;
|
|
329
|
+
/**
|
|
330
|
+
* Close I/O context synchronously.
|
|
331
|
+
* Synchronous version of closep.
|
|
332
|
+
*
|
|
333
|
+
* Closes the I/O context and frees resources.
|
|
334
|
+
* Sets internal pointer to NULL.
|
|
335
|
+
*
|
|
336
|
+
* Direct mapping to avio_closep().
|
|
337
|
+
*
|
|
338
|
+
* @returns 0 on success, negative AVERROR on error
|
|
339
|
+
*
|
|
340
|
+
* @example
|
|
341
|
+
* ```typescript
|
|
342
|
+
* const ret = io.closepSync();
|
|
343
|
+
* if (ret < 0) {
|
|
344
|
+
* console.error(`Failed to close: ${ret}`);
|
|
345
|
+
* }
|
|
346
|
+
* ```
|
|
347
|
+
*
|
|
348
|
+
* @see {@link closep} For async version
|
|
349
|
+
*/
|
|
350
|
+
closepSync(): number;
|
|
286
351
|
/**
|
|
287
352
|
* Read data from I/O context.
|
|
288
353
|
*
|
|
@@ -291,6 +356,7 @@ export declare class IOContext extends OptionMember<NativeIOContext> implements
|
|
|
291
356
|
* Direct mapping to avio_read().
|
|
292
357
|
*
|
|
293
358
|
* @param size - Maximum number of bytes to read
|
|
359
|
+
*
|
|
294
360
|
* @returns Buffer with data, or error code if negative:
|
|
295
361
|
* - AVERROR_EOF: End of file reached
|
|
296
362
|
* - AVERROR_EIO: I/O error
|
|
@@ -308,6 +374,31 @@ export declare class IOContext extends OptionMember<NativeIOContext> implements
|
|
|
308
374
|
* @see {@link write} For writing data
|
|
309
375
|
*/
|
|
310
376
|
read(size: number): Promise<Buffer | number>;
|
|
377
|
+
/**
|
|
378
|
+
* Read data from I/O context synchronously.
|
|
379
|
+
* Synchronous version of read.
|
|
380
|
+
*
|
|
381
|
+
* Reads up to the specified number of bytes from the stream.
|
|
382
|
+
*
|
|
383
|
+
* Direct mapping to avio_read().
|
|
384
|
+
*
|
|
385
|
+
* @param size - Number of bytes to read
|
|
386
|
+
*
|
|
387
|
+
* @returns Buffer with data, or negative AVERROR on error
|
|
388
|
+
*
|
|
389
|
+
* @example
|
|
390
|
+
* ```typescript
|
|
391
|
+
* const result = io.readSync(4096);
|
|
392
|
+
* if (Buffer.isBuffer(result)) {
|
|
393
|
+
* console.log(`Read ${result.length} bytes`);
|
|
394
|
+
* } else {
|
|
395
|
+
* console.log(`Read error: ${result}`);
|
|
396
|
+
* }
|
|
397
|
+
* ```
|
|
398
|
+
*
|
|
399
|
+
* @see {@link read} For async version
|
|
400
|
+
*/
|
|
401
|
+
readSync(size: number): Buffer | number;
|
|
311
402
|
/**
|
|
312
403
|
* Write data to I/O context.
|
|
313
404
|
*
|
|
@@ -327,6 +418,25 @@ export declare class IOContext extends OptionMember<NativeIOContext> implements
|
|
|
327
418
|
* @see {@link flush} To flush buffers
|
|
328
419
|
*/
|
|
329
420
|
write(buffer: Buffer): Promise<void>;
|
|
421
|
+
/**
|
|
422
|
+
* Write data to I/O context synchronously.
|
|
423
|
+
* Synchronous version of write.
|
|
424
|
+
*
|
|
425
|
+
* Writes buffer data to the stream.
|
|
426
|
+
*
|
|
427
|
+
* Direct mapping to avio_write().
|
|
428
|
+
*
|
|
429
|
+
* @param buffer - Data to write
|
|
430
|
+
*
|
|
431
|
+
* @example
|
|
432
|
+
* ```typescript
|
|
433
|
+
* const data = Buffer.from('Hello, World!');
|
|
434
|
+
* io.writeSync(data);
|
|
435
|
+
* ```
|
|
436
|
+
*
|
|
437
|
+
* @see {@link write} For async version
|
|
438
|
+
*/
|
|
439
|
+
writeSync(buffer: Buffer): void;
|
|
330
440
|
/**
|
|
331
441
|
* Seek to position in stream.
|
|
332
442
|
*
|
|
@@ -336,7 +446,9 @@ export declare class IOContext extends OptionMember<NativeIOContext> implements
|
|
|
336
446
|
* Direct mapping to avio_seek().
|
|
337
447
|
*
|
|
338
448
|
* @param offset - Byte offset to seek to
|
|
449
|
+
*
|
|
339
450
|
* @param whence - Seek origin (AVSEEK_SET, AVSEEK_CUR, AVSEEK_END)
|
|
451
|
+
*
|
|
340
452
|
* @returns New position, or negative AVERROR on error:
|
|
341
453
|
* - AVERROR_EINVAL: Invalid arguments
|
|
342
454
|
* - AVERROR_ENOSYS: Seeking not supported
|
|
@@ -359,6 +471,40 @@ export declare class IOContext extends OptionMember<NativeIOContext> implements
|
|
|
359
471
|
* @see {@link skip} For relative seeking
|
|
360
472
|
*/
|
|
361
473
|
seek(offset: bigint, whence: AVSeekWhence): Promise<bigint>;
|
|
474
|
+
/**
|
|
475
|
+
* Seek to position in stream synchronously.
|
|
476
|
+
* Synchronous version of seek.
|
|
477
|
+
*
|
|
478
|
+
* Changes the current position in the stream.
|
|
479
|
+
* Not all streams support seeking.
|
|
480
|
+
*
|
|
481
|
+
* Direct mapping to avio_seek().
|
|
482
|
+
*
|
|
483
|
+
* @param offset - Byte offset to seek to
|
|
484
|
+
*
|
|
485
|
+
* @param whence - Seek origin (AVSEEK_SET, AVSEEK_CUR, AVSEEK_END)
|
|
486
|
+
*
|
|
487
|
+
* @returns New position, or negative AVERROR on error:
|
|
488
|
+
* - AVERROR_EINVAL: Invalid arguments
|
|
489
|
+
* - AVERROR_ENOSYS: Seeking not supported
|
|
490
|
+
*
|
|
491
|
+
* @example
|
|
492
|
+
* ```typescript
|
|
493
|
+
* import { AVSEEK_SET, AVSEEK_CUR, AVSEEK_END } from 'node-av/constants';
|
|
494
|
+
*
|
|
495
|
+
* // Seek to absolute position
|
|
496
|
+
* const pos1 = io.seekSync(1024n, AVSEEK_SET);
|
|
497
|
+
*
|
|
498
|
+
* // Seek relative to current position
|
|
499
|
+
* const pos2 = io.seekSync(512n, AVSEEK_CUR);
|
|
500
|
+
*
|
|
501
|
+
* // Seek relative to end
|
|
502
|
+
* const pos3 = io.seekSync(-1024n, AVSEEK_END);
|
|
503
|
+
* ```
|
|
504
|
+
*
|
|
505
|
+
* @see {@link seek} For async version
|
|
506
|
+
*/
|
|
507
|
+
seekSync(offset: bigint, whence: AVSeekWhence): bigint;
|
|
362
508
|
/**
|
|
363
509
|
* Get stream size.
|
|
364
510
|
*
|
|
@@ -381,6 +527,31 @@ export declare class IOContext extends OptionMember<NativeIOContext> implements
|
|
|
381
527
|
* ```
|
|
382
528
|
*/
|
|
383
529
|
size(): Promise<bigint>;
|
|
530
|
+
/**
|
|
531
|
+
* Get stream size synchronously.
|
|
532
|
+
* Synchronous version of size.
|
|
533
|
+
*
|
|
534
|
+
* Returns the total size of the stream in bytes.
|
|
535
|
+
* Not all streams have a known size.
|
|
536
|
+
*
|
|
537
|
+
* Direct mapping to avio_size().
|
|
538
|
+
*
|
|
539
|
+
* @returns Size in bytes, or negative AVERROR if unknown:
|
|
540
|
+
* - AVERROR_ENOSYS: Size not available
|
|
541
|
+
*
|
|
542
|
+
* @example
|
|
543
|
+
* ```typescript
|
|
544
|
+
* const size = io.sizeSync();
|
|
545
|
+
* if (size >= 0n) {
|
|
546
|
+
* console.log(`Stream size: ${size} bytes`);
|
|
547
|
+
* } else {
|
|
548
|
+
* console.log('Stream size unknown');
|
|
549
|
+
* }
|
|
550
|
+
* ```
|
|
551
|
+
*
|
|
552
|
+
* @see {@link size} For async version
|
|
553
|
+
*/
|
|
554
|
+
sizeSync(): bigint;
|
|
384
555
|
/**
|
|
385
556
|
* Flush buffered data.
|
|
386
557
|
*
|
|
@@ -397,6 +568,23 @@ export declare class IOContext extends OptionMember<NativeIOContext> implements
|
|
|
397
568
|
* @see {@link write} For writing data
|
|
398
569
|
*/
|
|
399
570
|
flush(): Promise<void>;
|
|
571
|
+
/**
|
|
572
|
+
* Flush buffered data synchronously.
|
|
573
|
+
* Synchronous version of flush.
|
|
574
|
+
*
|
|
575
|
+
* Forces any buffered data to be written to the underlying resource.
|
|
576
|
+
*
|
|
577
|
+
* Direct mapping to avio_flush().
|
|
578
|
+
*
|
|
579
|
+
* @example
|
|
580
|
+
* ```typescript
|
|
581
|
+
* io.writeSync(data);
|
|
582
|
+
* io.flushSync(); // Ensure data is written
|
|
583
|
+
* ```
|
|
584
|
+
*
|
|
585
|
+
* @see {@link flush} For async version
|
|
586
|
+
*/
|
|
587
|
+
flushSync(): void;
|
|
400
588
|
/**
|
|
401
589
|
* Skip bytes in stream.
|
|
402
590
|
*
|
|
@@ -406,6 +594,7 @@ export declare class IOContext extends OptionMember<NativeIOContext> implements
|
|
|
406
594
|
* Direct mapping to avio_skip().
|
|
407
595
|
*
|
|
408
596
|
* @param offset - Number of bytes to skip
|
|
597
|
+
*
|
|
409
598
|
* @returns New position after skipping
|
|
410
599
|
*
|
|
411
600
|
* @example
|
|
@@ -418,6 +607,29 @@ export declare class IOContext extends OptionMember<NativeIOContext> implements
|
|
|
418
607
|
* @see {@link seek} For absolute positioning
|
|
419
608
|
*/
|
|
420
609
|
skip(offset: bigint): Promise<bigint>;
|
|
610
|
+
/**
|
|
611
|
+
* Skip bytes in stream synchronously.
|
|
612
|
+
* Synchronous version of skip.
|
|
613
|
+
*
|
|
614
|
+
* Advances the position by the specified offset.
|
|
615
|
+
* More efficient than reading and discarding data.
|
|
616
|
+
*
|
|
617
|
+
* Direct mapping to avio_skip().
|
|
618
|
+
*
|
|
619
|
+
* @param offset - Number of bytes to skip
|
|
620
|
+
*
|
|
621
|
+
* @returns New position after skipping
|
|
622
|
+
*
|
|
623
|
+
* @example
|
|
624
|
+
* ```typescript
|
|
625
|
+
* // Skip 1024 bytes forward
|
|
626
|
+
* const newPos = io.skipSync(1024n);
|
|
627
|
+
* console.log(`New position: ${newPos}`);
|
|
628
|
+
* ```
|
|
629
|
+
*
|
|
630
|
+
* @see {@link skip} For async version
|
|
631
|
+
*/
|
|
632
|
+
skipSync(offset: bigint): bigint;
|
|
421
633
|
/**
|
|
422
634
|
* Get current position.
|
|
423
635
|
*
|