node-av 2.0.0 → 2.4.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 +18 -5
- package/binding.gyp +12 -0
- package/dist/api/bitstream-filter.d.ts +132 -0
- package/dist/api/bitstream-filter.js +198 -0
- package/dist/api/bitstream-filter.js.map +1 -1
- package/dist/api/decoder.d.ts +194 -0
- package/dist/api/decoder.js +313 -0
- package/dist/api/decoder.js.map +1 -1
- package/dist/api/encoder.d.ts +263 -0
- package/dist/api/encoder.js +427 -0
- package/dist/api/encoder.js.map +1 -1
- package/dist/api/filter-presets.d.ts +92 -0
- package/dist/api/filter-presets.js +92 -0
- package/dist/api/filter-presets.js.map +1 -1
- package/dist/api/filter.d.ts +234 -9
- package/dist/api/filter.js +372 -9
- package/dist/api/filter.js.map +1 -1
- package/dist/api/hardware.d.ts +17 -0
- package/dist/api/hardware.js +28 -17
- package/dist/api/hardware.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 +214 -1
- package/dist/api/media-input.js +341 -0
- package/dist/api/media-input.js.map +1 -1
- package/dist/api/media-output.d.ts +132 -1
- package/dist/api/media-output.js +339 -0
- package/dist/api/media-output.js.map +1 -1
- package/dist/api/pipeline.d.ts +73 -8
- package/dist/api/pipeline.js +61 -0
- package/dist/api/pipeline.js.map +1 -1
- package/dist/api/types.d.ts +7 -0
- 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 +32 -7
- 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 +16 -0
- package/dist/lib/dictionary.js +16 -0
- 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 +100 -0
- package/dist/lib/filter-context.js +104 -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 +338 -2
- package/dist/lib/format-context.js +355 -3
- package/dist/lib/format-context.js.map +1 -1
- package/dist/lib/frame.d.ts +41 -0
- package/dist/lib/frame.js +43 -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 +218 -0
- package/dist/lib/io-context.js +234 -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 +19 -17
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
|
|
@@ -175,12 +177,22 @@ export declare class IOContext extends OptionMember<NativeIOContext> implements
|
|
|
175
177
|
* Creates an I/O context with custom read, write, and seek callbacks.
|
|
176
178
|
* Enables implementing custom protocols or data sources.
|
|
177
179
|
*
|
|
180
|
+
* NOTE: When using JavaScript callbacks, synchronous operations
|
|
181
|
+
* (e.g., readSync, seekSync) cannot be used on this context.
|
|
182
|
+
* This is because JavaScript callbacks require the event loop to be available,
|
|
183
|
+
* which is blocked during synchronous operations. Always use async methods
|
|
184
|
+
* (read, seek) when working with custom callbacks.
|
|
185
|
+
*
|
|
178
186
|
* Direct mapping to avio_alloc_context() with callbacks.
|
|
179
187
|
*
|
|
180
188
|
* @param bufferSize - Size of internal buffer
|
|
189
|
+
*
|
|
181
190
|
* @param writeFlag - 1 for write mode, 0 for read mode
|
|
191
|
+
*
|
|
182
192
|
* @param readCallback - Function to read data (null for write-only)
|
|
193
|
+
*
|
|
183
194
|
* @param writeCallback - Function to write data (null for read-only)
|
|
195
|
+
*
|
|
184
196
|
* @param seekCallback - Function to seek in stream (optional)
|
|
185
197
|
*
|
|
186
198
|
* @example
|
|
@@ -239,7 +251,9 @@ export declare class IOContext extends OptionMember<NativeIOContext> implements
|
|
|
239
251
|
* Direct mapping to avio_open2().
|
|
240
252
|
*
|
|
241
253
|
* @param url - URL or file path to open
|
|
254
|
+
*
|
|
242
255
|
* @param flags - Open flags (AVIO_FLAG_READ, AVIO_FLAG_WRITE, etc.)
|
|
256
|
+
*
|
|
243
257
|
* @returns 0 on success, negative AVERROR on error:
|
|
244
258
|
* - AVERROR_ENOENT: File not found
|
|
245
259
|
* - AVERROR_EACCES: Permission denied
|
|
@@ -262,6 +276,41 @@ export declare class IOContext extends OptionMember<NativeIOContext> implements
|
|
|
262
276
|
* @see {@link closep} To close after use
|
|
263
277
|
*/
|
|
264
278
|
open2(url: string, flags?: AVIOFlag): Promise<number>;
|
|
279
|
+
/**
|
|
280
|
+
* Open resource for I/O synchronously.
|
|
281
|
+
* Synchronous version of open2.
|
|
282
|
+
*
|
|
283
|
+
* Opens a URL or file for reading or writing.
|
|
284
|
+
* Automatically selects the appropriate protocol handler.
|
|
285
|
+
*
|
|
286
|
+
* Direct mapping to avio_open2().
|
|
287
|
+
*
|
|
288
|
+
* @param url - URL or file path to open
|
|
289
|
+
*
|
|
290
|
+
* @param flags - Open flags (AVIO_FLAG_READ, AVIO_FLAG_WRITE, etc.)
|
|
291
|
+
*
|
|
292
|
+
* @returns 0 on success, negative AVERROR on error:
|
|
293
|
+
* - AVERROR_ENOENT: File not found
|
|
294
|
+
* - AVERROR_EACCES: Permission denied
|
|
295
|
+
* - AVERROR_ENOMEM: Memory allocation failure
|
|
296
|
+
*
|
|
297
|
+
* @example
|
|
298
|
+
* ```typescript
|
|
299
|
+
* import { FFmpegError } from 'node-av';
|
|
300
|
+
* import { AVIO_FLAG_READ, AVIO_FLAG_WRITE } from 'node-av/constants';
|
|
301
|
+
*
|
|
302
|
+
* // Open for reading
|
|
303
|
+
* const ret = io.open2Sync('input.mp4', AVIO_FLAG_READ);
|
|
304
|
+
* FFmpegError.throwIfError(ret, 'open2');
|
|
305
|
+
*
|
|
306
|
+
* // Open for writing
|
|
307
|
+
* const ret2 = io.open2Sync('output.mp4', AVIO_FLAG_WRITE);
|
|
308
|
+
* FFmpegError.throwIfError(ret2, 'open2');
|
|
309
|
+
* ```
|
|
310
|
+
*
|
|
311
|
+
* @see {@link open2} For async version
|
|
312
|
+
*/
|
|
313
|
+
open2Sync(url: string, flags?: AVIOFlag): number;
|
|
265
314
|
/**
|
|
266
315
|
* Close I/O context.
|
|
267
316
|
*
|
|
@@ -283,6 +332,28 @@ export declare class IOContext extends OptionMember<NativeIOContext> implements
|
|
|
283
332
|
* @see {@link open2} To open resources
|
|
284
333
|
*/
|
|
285
334
|
closep(): Promise<number>;
|
|
335
|
+
/**
|
|
336
|
+
* Close I/O context synchronously.
|
|
337
|
+
* Synchronous version of closep.
|
|
338
|
+
*
|
|
339
|
+
* Closes the I/O context and frees resources.
|
|
340
|
+
* Sets internal pointer to NULL.
|
|
341
|
+
*
|
|
342
|
+
* Direct mapping to avio_closep().
|
|
343
|
+
*
|
|
344
|
+
* @returns 0 on success, negative AVERROR on error
|
|
345
|
+
*
|
|
346
|
+
* @example
|
|
347
|
+
* ```typescript
|
|
348
|
+
* const ret = io.closepSync();
|
|
349
|
+
* if (ret < 0) {
|
|
350
|
+
* console.error(`Failed to close: ${ret}`);
|
|
351
|
+
* }
|
|
352
|
+
* ```
|
|
353
|
+
*
|
|
354
|
+
* @see {@link closep} For async version
|
|
355
|
+
*/
|
|
356
|
+
closepSync(): number;
|
|
286
357
|
/**
|
|
287
358
|
* Read data from I/O context.
|
|
288
359
|
*
|
|
@@ -291,6 +362,7 @@ export declare class IOContext extends OptionMember<NativeIOContext> implements
|
|
|
291
362
|
* Direct mapping to avio_read().
|
|
292
363
|
*
|
|
293
364
|
* @param size - Maximum number of bytes to read
|
|
365
|
+
*
|
|
294
366
|
* @returns Buffer with data, or error code if negative:
|
|
295
367
|
* - AVERROR_EOF: End of file reached
|
|
296
368
|
* - AVERROR_EIO: I/O error
|
|
@@ -308,6 +380,31 @@ export declare class IOContext extends OptionMember<NativeIOContext> implements
|
|
|
308
380
|
* @see {@link write} For writing data
|
|
309
381
|
*/
|
|
310
382
|
read(size: number): Promise<Buffer | number>;
|
|
383
|
+
/**
|
|
384
|
+
* Read data from I/O context synchronously.
|
|
385
|
+
* Synchronous version of read.
|
|
386
|
+
*
|
|
387
|
+
* Reads up to the specified number of bytes from the stream.
|
|
388
|
+
*
|
|
389
|
+
* Direct mapping to avio_read().
|
|
390
|
+
*
|
|
391
|
+
* @param size - Number of bytes to read
|
|
392
|
+
*
|
|
393
|
+
* @returns Buffer with data, or negative AVERROR on error
|
|
394
|
+
*
|
|
395
|
+
* @example
|
|
396
|
+
* ```typescript
|
|
397
|
+
* const result = io.readSync(4096);
|
|
398
|
+
* if (Buffer.isBuffer(result)) {
|
|
399
|
+
* console.log(`Read ${result.length} bytes`);
|
|
400
|
+
* } else {
|
|
401
|
+
* console.log(`Read error: ${result}`);
|
|
402
|
+
* }
|
|
403
|
+
* ```
|
|
404
|
+
*
|
|
405
|
+
* @see {@link read} For async version
|
|
406
|
+
*/
|
|
407
|
+
readSync(size: number): Buffer | number;
|
|
311
408
|
/**
|
|
312
409
|
* Write data to I/O context.
|
|
313
410
|
*
|
|
@@ -327,6 +424,25 @@ export declare class IOContext extends OptionMember<NativeIOContext> implements
|
|
|
327
424
|
* @see {@link flush} To flush buffers
|
|
328
425
|
*/
|
|
329
426
|
write(buffer: Buffer): Promise<void>;
|
|
427
|
+
/**
|
|
428
|
+
* Write data to I/O context synchronously.
|
|
429
|
+
* Synchronous version of write.
|
|
430
|
+
*
|
|
431
|
+
* Writes buffer data to the stream.
|
|
432
|
+
*
|
|
433
|
+
* Direct mapping to avio_write().
|
|
434
|
+
*
|
|
435
|
+
* @param buffer - Data to write
|
|
436
|
+
*
|
|
437
|
+
* @example
|
|
438
|
+
* ```typescript
|
|
439
|
+
* const data = Buffer.from('Hello, World!');
|
|
440
|
+
* io.writeSync(data);
|
|
441
|
+
* ```
|
|
442
|
+
*
|
|
443
|
+
* @see {@link write} For async version
|
|
444
|
+
*/
|
|
445
|
+
writeSync(buffer: Buffer): void;
|
|
330
446
|
/**
|
|
331
447
|
* Seek to position in stream.
|
|
332
448
|
*
|
|
@@ -336,7 +452,9 @@ export declare class IOContext extends OptionMember<NativeIOContext> implements
|
|
|
336
452
|
* Direct mapping to avio_seek().
|
|
337
453
|
*
|
|
338
454
|
* @param offset - Byte offset to seek to
|
|
455
|
+
*
|
|
339
456
|
* @param whence - Seek origin (AVSEEK_SET, AVSEEK_CUR, AVSEEK_END)
|
|
457
|
+
*
|
|
340
458
|
* @returns New position, or negative AVERROR on error:
|
|
341
459
|
* - AVERROR_EINVAL: Invalid arguments
|
|
342
460
|
* - AVERROR_ENOSYS: Seeking not supported
|
|
@@ -359,6 +477,40 @@ export declare class IOContext extends OptionMember<NativeIOContext> implements
|
|
|
359
477
|
* @see {@link skip} For relative seeking
|
|
360
478
|
*/
|
|
361
479
|
seek(offset: bigint, whence: AVSeekWhence): Promise<bigint>;
|
|
480
|
+
/**
|
|
481
|
+
* Seek to position in stream synchronously.
|
|
482
|
+
* Synchronous version of seek.
|
|
483
|
+
*
|
|
484
|
+
* Changes the current position in the stream.
|
|
485
|
+
* Not all streams support seeking.
|
|
486
|
+
*
|
|
487
|
+
* Direct mapping to avio_seek().
|
|
488
|
+
*
|
|
489
|
+
* @param offset - Byte offset to seek to
|
|
490
|
+
*
|
|
491
|
+
* @param whence - Seek origin (AVSEEK_SET, AVSEEK_CUR, AVSEEK_END)
|
|
492
|
+
*
|
|
493
|
+
* @returns New position, or negative AVERROR on error:
|
|
494
|
+
* - AVERROR_EINVAL: Invalid arguments
|
|
495
|
+
* - AVERROR_ENOSYS: Seeking not supported
|
|
496
|
+
*
|
|
497
|
+
* @example
|
|
498
|
+
* ```typescript
|
|
499
|
+
* import { AVSEEK_SET, AVSEEK_CUR, AVSEEK_END } from 'node-av/constants';
|
|
500
|
+
*
|
|
501
|
+
* // Seek to absolute position
|
|
502
|
+
* const pos1 = io.seekSync(1024n, AVSEEK_SET);
|
|
503
|
+
*
|
|
504
|
+
* // Seek relative to current position
|
|
505
|
+
* const pos2 = io.seekSync(512n, AVSEEK_CUR);
|
|
506
|
+
*
|
|
507
|
+
* // Seek relative to end
|
|
508
|
+
* const pos3 = io.seekSync(-1024n, AVSEEK_END);
|
|
509
|
+
* ```
|
|
510
|
+
*
|
|
511
|
+
* @see {@link seek} For async version
|
|
512
|
+
*/
|
|
513
|
+
seekSync(offset: bigint, whence: AVSeekWhence): bigint;
|
|
362
514
|
/**
|
|
363
515
|
* Get stream size.
|
|
364
516
|
*
|
|
@@ -381,6 +533,31 @@ export declare class IOContext extends OptionMember<NativeIOContext> implements
|
|
|
381
533
|
* ```
|
|
382
534
|
*/
|
|
383
535
|
size(): Promise<bigint>;
|
|
536
|
+
/**
|
|
537
|
+
* Get stream size synchronously.
|
|
538
|
+
* Synchronous version of size.
|
|
539
|
+
*
|
|
540
|
+
* Returns the total size of the stream in bytes.
|
|
541
|
+
* Not all streams have a known size.
|
|
542
|
+
*
|
|
543
|
+
* Direct mapping to avio_size().
|
|
544
|
+
*
|
|
545
|
+
* @returns Size in bytes, or negative AVERROR if unknown:
|
|
546
|
+
* - AVERROR_ENOSYS: Size not available
|
|
547
|
+
*
|
|
548
|
+
* @example
|
|
549
|
+
* ```typescript
|
|
550
|
+
* const size = io.sizeSync();
|
|
551
|
+
* if (size >= 0n) {
|
|
552
|
+
* console.log(`Stream size: ${size} bytes`);
|
|
553
|
+
* } else {
|
|
554
|
+
* console.log('Stream size unknown');
|
|
555
|
+
* }
|
|
556
|
+
* ```
|
|
557
|
+
*
|
|
558
|
+
* @see {@link size} For async version
|
|
559
|
+
*/
|
|
560
|
+
sizeSync(): bigint;
|
|
384
561
|
/**
|
|
385
562
|
* Flush buffered data.
|
|
386
563
|
*
|
|
@@ -397,6 +574,23 @@ export declare class IOContext extends OptionMember<NativeIOContext> implements
|
|
|
397
574
|
* @see {@link write} For writing data
|
|
398
575
|
*/
|
|
399
576
|
flush(): Promise<void>;
|
|
577
|
+
/**
|
|
578
|
+
* Flush buffered data synchronously.
|
|
579
|
+
* Synchronous version of flush.
|
|
580
|
+
*
|
|
581
|
+
* Forces any buffered data to be written to the underlying resource.
|
|
582
|
+
*
|
|
583
|
+
* Direct mapping to avio_flush().
|
|
584
|
+
*
|
|
585
|
+
* @example
|
|
586
|
+
* ```typescript
|
|
587
|
+
* io.writeSync(data);
|
|
588
|
+
* io.flushSync(); // Ensure data is written
|
|
589
|
+
* ```
|
|
590
|
+
*
|
|
591
|
+
* @see {@link flush} For async version
|
|
592
|
+
*/
|
|
593
|
+
flushSync(): void;
|
|
400
594
|
/**
|
|
401
595
|
* Skip bytes in stream.
|
|
402
596
|
*
|
|
@@ -406,6 +600,7 @@ export declare class IOContext extends OptionMember<NativeIOContext> implements
|
|
|
406
600
|
* Direct mapping to avio_skip().
|
|
407
601
|
*
|
|
408
602
|
* @param offset - Number of bytes to skip
|
|
603
|
+
*
|
|
409
604
|
* @returns New position after skipping
|
|
410
605
|
*
|
|
411
606
|
* @example
|
|
@@ -418,6 +613,29 @@ export declare class IOContext extends OptionMember<NativeIOContext> implements
|
|
|
418
613
|
* @see {@link seek} For absolute positioning
|
|
419
614
|
*/
|
|
420
615
|
skip(offset: bigint): Promise<bigint>;
|
|
616
|
+
/**
|
|
617
|
+
* Skip bytes in stream synchronously.
|
|
618
|
+
* Synchronous version of skip.
|
|
619
|
+
*
|
|
620
|
+
* Advances the position by the specified offset.
|
|
621
|
+
* More efficient than reading and discarding data.
|
|
622
|
+
*
|
|
623
|
+
* Direct mapping to avio_skip().
|
|
624
|
+
*
|
|
625
|
+
* @param offset - Number of bytes to skip
|
|
626
|
+
*
|
|
627
|
+
* @returns New position after skipping
|
|
628
|
+
*
|
|
629
|
+
* @example
|
|
630
|
+
* ```typescript
|
|
631
|
+
* // Skip 1024 bytes forward
|
|
632
|
+
* const newPos = io.skipSync(1024n);
|
|
633
|
+
* console.log(`New position: ${newPos}`);
|
|
634
|
+
* ```
|
|
635
|
+
*
|
|
636
|
+
* @see {@link skip} For async version
|
|
637
|
+
*/
|
|
638
|
+
skipSync(offset: bigint): bigint;
|
|
421
639
|
/**
|
|
422
640
|
* Get current position.
|
|
423
641
|
*
|
package/dist/lib/io-context.js
CHANGED
|
@@ -78,6 +78,7 @@ export class IOContext extends OptionMember {
|
|
|
78
78
|
* Used internally for wrapping native I/O contexts.
|
|
79
79
|
*
|
|
80
80
|
* @param native - Native IOContext binding object
|
|
81
|
+
*
|
|
81
82
|
* @returns Wrapped IOContext instance
|
|
82
83
|
*
|
|
83
84
|
* @internal
|
|
@@ -184,6 +185,7 @@ export class IOContext extends OptionMember {
|
|
|
184
185
|
* Direct mapping to avio_alloc_context() without callbacks.
|
|
185
186
|
*
|
|
186
187
|
* @param bufferSize - Size of internal buffer
|
|
188
|
+
*
|
|
187
189
|
* @param writeFlag - 1 for write, 0 for read
|
|
188
190
|
*
|
|
189
191
|
* @example
|
|
@@ -203,12 +205,22 @@ export class IOContext extends OptionMember {
|
|
|
203
205
|
* Creates an I/O context with custom read, write, and seek callbacks.
|
|
204
206
|
* Enables implementing custom protocols or data sources.
|
|
205
207
|
*
|
|
208
|
+
* NOTE: When using JavaScript callbacks, synchronous operations
|
|
209
|
+
* (e.g., readSync, seekSync) cannot be used on this context.
|
|
210
|
+
* This is because JavaScript callbacks require the event loop to be available,
|
|
211
|
+
* which is blocked during synchronous operations. Always use async methods
|
|
212
|
+
* (read, seek) when working with custom callbacks.
|
|
213
|
+
*
|
|
206
214
|
* Direct mapping to avio_alloc_context() with callbacks.
|
|
207
215
|
*
|
|
208
216
|
* @param bufferSize - Size of internal buffer
|
|
217
|
+
*
|
|
209
218
|
* @param writeFlag - 1 for write mode, 0 for read mode
|
|
219
|
+
*
|
|
210
220
|
* @param readCallback - Function to read data (null for write-only)
|
|
221
|
+
*
|
|
211
222
|
* @param writeCallback - Function to write data (null for read-only)
|
|
223
|
+
*
|
|
212
224
|
* @param seekCallback - Function to seek in stream (optional)
|
|
213
225
|
*
|
|
214
226
|
* @example
|
|
@@ -271,7 +283,9 @@ export class IOContext extends OptionMember {
|
|
|
271
283
|
* Direct mapping to avio_open2().
|
|
272
284
|
*
|
|
273
285
|
* @param url - URL or file path to open
|
|
286
|
+
*
|
|
274
287
|
* @param flags - Open flags (AVIO_FLAG_READ, AVIO_FLAG_WRITE, etc.)
|
|
288
|
+
*
|
|
275
289
|
* @returns 0 on success, negative AVERROR on error:
|
|
276
290
|
* - AVERROR_ENOENT: File not found
|
|
277
291
|
* - AVERROR_EACCES: Permission denied
|
|
@@ -296,6 +310,43 @@ export class IOContext extends OptionMember {
|
|
|
296
310
|
async open2(url, flags = AVIO_FLAG_READ) {
|
|
297
311
|
return await this.native.open2(url, flags);
|
|
298
312
|
}
|
|
313
|
+
/**
|
|
314
|
+
* Open resource for I/O synchronously.
|
|
315
|
+
* Synchronous version of open2.
|
|
316
|
+
*
|
|
317
|
+
* Opens a URL or file for reading or writing.
|
|
318
|
+
* Automatically selects the appropriate protocol handler.
|
|
319
|
+
*
|
|
320
|
+
* Direct mapping to avio_open2().
|
|
321
|
+
*
|
|
322
|
+
* @param url - URL or file path to open
|
|
323
|
+
*
|
|
324
|
+
* @param flags - Open flags (AVIO_FLAG_READ, AVIO_FLAG_WRITE, etc.)
|
|
325
|
+
*
|
|
326
|
+
* @returns 0 on success, negative AVERROR on error:
|
|
327
|
+
* - AVERROR_ENOENT: File not found
|
|
328
|
+
* - AVERROR_EACCES: Permission denied
|
|
329
|
+
* - AVERROR_ENOMEM: Memory allocation failure
|
|
330
|
+
*
|
|
331
|
+
* @example
|
|
332
|
+
* ```typescript
|
|
333
|
+
* import { FFmpegError } from 'node-av';
|
|
334
|
+
* import { AVIO_FLAG_READ, AVIO_FLAG_WRITE } from 'node-av/constants';
|
|
335
|
+
*
|
|
336
|
+
* // Open for reading
|
|
337
|
+
* const ret = io.open2Sync('input.mp4', AVIO_FLAG_READ);
|
|
338
|
+
* FFmpegError.throwIfError(ret, 'open2');
|
|
339
|
+
*
|
|
340
|
+
* // Open for writing
|
|
341
|
+
* const ret2 = io.open2Sync('output.mp4', AVIO_FLAG_WRITE);
|
|
342
|
+
* FFmpegError.throwIfError(ret2, 'open2');
|
|
343
|
+
* ```
|
|
344
|
+
*
|
|
345
|
+
* @see {@link open2} For async version
|
|
346
|
+
*/
|
|
347
|
+
open2Sync(url, flags = AVIO_FLAG_READ) {
|
|
348
|
+
return this.native.open2Sync(url, flags);
|
|
349
|
+
}
|
|
299
350
|
/**
|
|
300
351
|
* Close I/O context.
|
|
301
352
|
*
|
|
@@ -319,6 +370,30 @@ export class IOContext extends OptionMember {
|
|
|
319
370
|
async closep() {
|
|
320
371
|
return await this.native.closep();
|
|
321
372
|
}
|
|
373
|
+
/**
|
|
374
|
+
* Close I/O context synchronously.
|
|
375
|
+
* Synchronous version of closep.
|
|
376
|
+
*
|
|
377
|
+
* Closes the I/O context and frees resources.
|
|
378
|
+
* Sets internal pointer to NULL.
|
|
379
|
+
*
|
|
380
|
+
* Direct mapping to avio_closep().
|
|
381
|
+
*
|
|
382
|
+
* @returns 0 on success, negative AVERROR on error
|
|
383
|
+
*
|
|
384
|
+
* @example
|
|
385
|
+
* ```typescript
|
|
386
|
+
* const ret = io.closepSync();
|
|
387
|
+
* if (ret < 0) {
|
|
388
|
+
* console.error(`Failed to close: ${ret}`);
|
|
389
|
+
* }
|
|
390
|
+
* ```
|
|
391
|
+
*
|
|
392
|
+
* @see {@link closep} For async version
|
|
393
|
+
*/
|
|
394
|
+
closepSync() {
|
|
395
|
+
return this.native.closepSync();
|
|
396
|
+
}
|
|
322
397
|
/**
|
|
323
398
|
* Read data from I/O context.
|
|
324
399
|
*
|
|
@@ -327,6 +402,7 @@ export class IOContext extends OptionMember {
|
|
|
327
402
|
* Direct mapping to avio_read().
|
|
328
403
|
*
|
|
329
404
|
* @param size - Maximum number of bytes to read
|
|
405
|
+
*
|
|
330
406
|
* @returns Buffer with data, or error code if negative:
|
|
331
407
|
* - AVERROR_EOF: End of file reached
|
|
332
408
|
* - AVERROR_EIO: I/O error
|
|
@@ -346,6 +422,33 @@ export class IOContext extends OptionMember {
|
|
|
346
422
|
async read(size) {
|
|
347
423
|
return await this.native.read(size);
|
|
348
424
|
}
|
|
425
|
+
/**
|
|
426
|
+
* Read data from I/O context synchronously.
|
|
427
|
+
* Synchronous version of read.
|
|
428
|
+
*
|
|
429
|
+
* Reads up to the specified number of bytes from the stream.
|
|
430
|
+
*
|
|
431
|
+
* Direct mapping to avio_read().
|
|
432
|
+
*
|
|
433
|
+
* @param size - Number of bytes to read
|
|
434
|
+
*
|
|
435
|
+
* @returns Buffer with data, or negative AVERROR on error
|
|
436
|
+
*
|
|
437
|
+
* @example
|
|
438
|
+
* ```typescript
|
|
439
|
+
* const result = io.readSync(4096);
|
|
440
|
+
* if (Buffer.isBuffer(result)) {
|
|
441
|
+
* console.log(`Read ${result.length} bytes`);
|
|
442
|
+
* } else {
|
|
443
|
+
* console.log(`Read error: ${result}`);
|
|
444
|
+
* }
|
|
445
|
+
* ```
|
|
446
|
+
*
|
|
447
|
+
* @see {@link read} For async version
|
|
448
|
+
*/
|
|
449
|
+
readSync(size) {
|
|
450
|
+
return this.native.readSync(size);
|
|
451
|
+
}
|
|
349
452
|
/**
|
|
350
453
|
* Write data to I/O context.
|
|
351
454
|
*
|
|
@@ -367,6 +470,27 @@ export class IOContext extends OptionMember {
|
|
|
367
470
|
async write(buffer) {
|
|
368
471
|
await this.native.write(buffer);
|
|
369
472
|
}
|
|
473
|
+
/**
|
|
474
|
+
* Write data to I/O context synchronously.
|
|
475
|
+
* Synchronous version of write.
|
|
476
|
+
*
|
|
477
|
+
* Writes buffer data to the stream.
|
|
478
|
+
*
|
|
479
|
+
* Direct mapping to avio_write().
|
|
480
|
+
*
|
|
481
|
+
* @param buffer - Data to write
|
|
482
|
+
*
|
|
483
|
+
* @example
|
|
484
|
+
* ```typescript
|
|
485
|
+
* const data = Buffer.from('Hello, World!');
|
|
486
|
+
* io.writeSync(data);
|
|
487
|
+
* ```
|
|
488
|
+
*
|
|
489
|
+
* @see {@link write} For async version
|
|
490
|
+
*/
|
|
491
|
+
writeSync(buffer) {
|
|
492
|
+
this.native.writeSync(buffer);
|
|
493
|
+
}
|
|
370
494
|
/**
|
|
371
495
|
* Seek to position in stream.
|
|
372
496
|
*
|
|
@@ -376,7 +500,9 @@ export class IOContext extends OptionMember {
|
|
|
376
500
|
* Direct mapping to avio_seek().
|
|
377
501
|
*
|
|
378
502
|
* @param offset - Byte offset to seek to
|
|
503
|
+
*
|
|
379
504
|
* @param whence - Seek origin (AVSEEK_SET, AVSEEK_CUR, AVSEEK_END)
|
|
505
|
+
*
|
|
380
506
|
* @returns New position, or negative AVERROR on error:
|
|
381
507
|
* - AVERROR_EINVAL: Invalid arguments
|
|
382
508
|
* - AVERROR_ENOSYS: Seeking not supported
|
|
@@ -401,6 +527,42 @@ export class IOContext extends OptionMember {
|
|
|
401
527
|
async seek(offset, whence) {
|
|
402
528
|
return await this.native.seek(offset, whence);
|
|
403
529
|
}
|
|
530
|
+
/**
|
|
531
|
+
* Seek to position in stream synchronously.
|
|
532
|
+
* Synchronous version of seek.
|
|
533
|
+
*
|
|
534
|
+
* Changes the current position in the stream.
|
|
535
|
+
* Not all streams support seeking.
|
|
536
|
+
*
|
|
537
|
+
* Direct mapping to avio_seek().
|
|
538
|
+
*
|
|
539
|
+
* @param offset - Byte offset to seek to
|
|
540
|
+
*
|
|
541
|
+
* @param whence - Seek origin (AVSEEK_SET, AVSEEK_CUR, AVSEEK_END)
|
|
542
|
+
*
|
|
543
|
+
* @returns New position, or negative AVERROR on error:
|
|
544
|
+
* - AVERROR_EINVAL: Invalid arguments
|
|
545
|
+
* - AVERROR_ENOSYS: Seeking not supported
|
|
546
|
+
*
|
|
547
|
+
* @example
|
|
548
|
+
* ```typescript
|
|
549
|
+
* import { AVSEEK_SET, AVSEEK_CUR, AVSEEK_END } from 'node-av/constants';
|
|
550
|
+
*
|
|
551
|
+
* // Seek to absolute position
|
|
552
|
+
* const pos1 = io.seekSync(1024n, AVSEEK_SET);
|
|
553
|
+
*
|
|
554
|
+
* // Seek relative to current position
|
|
555
|
+
* const pos2 = io.seekSync(512n, AVSEEK_CUR);
|
|
556
|
+
*
|
|
557
|
+
* // Seek relative to end
|
|
558
|
+
* const pos3 = io.seekSync(-1024n, AVSEEK_END);
|
|
559
|
+
* ```
|
|
560
|
+
*
|
|
561
|
+
* @see {@link seek} For async version
|
|
562
|
+
*/
|
|
563
|
+
seekSync(offset, whence) {
|
|
564
|
+
return this.native.seekSync(offset, whence);
|
|
565
|
+
}
|
|
404
566
|
/**
|
|
405
567
|
* Get stream size.
|
|
406
568
|
*
|
|
@@ -425,6 +587,33 @@ export class IOContext extends OptionMember {
|
|
|
425
587
|
async size() {
|
|
426
588
|
return await this.native.size();
|
|
427
589
|
}
|
|
590
|
+
/**
|
|
591
|
+
* Get stream size synchronously.
|
|
592
|
+
* Synchronous version of size.
|
|
593
|
+
*
|
|
594
|
+
* Returns the total size of the stream in bytes.
|
|
595
|
+
* Not all streams have a known size.
|
|
596
|
+
*
|
|
597
|
+
* Direct mapping to avio_size().
|
|
598
|
+
*
|
|
599
|
+
* @returns Size in bytes, or negative AVERROR if unknown:
|
|
600
|
+
* - AVERROR_ENOSYS: Size not available
|
|
601
|
+
*
|
|
602
|
+
* @example
|
|
603
|
+
* ```typescript
|
|
604
|
+
* const size = io.sizeSync();
|
|
605
|
+
* if (size >= 0n) {
|
|
606
|
+
* console.log(`Stream size: ${size} bytes`);
|
|
607
|
+
* } else {
|
|
608
|
+
* console.log('Stream size unknown');
|
|
609
|
+
* }
|
|
610
|
+
* ```
|
|
611
|
+
*
|
|
612
|
+
* @see {@link size} For async version
|
|
613
|
+
*/
|
|
614
|
+
sizeSync() {
|
|
615
|
+
return this.native.sizeSync();
|
|
616
|
+
}
|
|
428
617
|
/**
|
|
429
618
|
* Flush buffered data.
|
|
430
619
|
*
|
|
@@ -443,6 +632,25 @@ export class IOContext extends OptionMember {
|
|
|
443
632
|
async flush() {
|
|
444
633
|
await this.native.flush();
|
|
445
634
|
}
|
|
635
|
+
/**
|
|
636
|
+
* Flush buffered data synchronously.
|
|
637
|
+
* Synchronous version of flush.
|
|
638
|
+
*
|
|
639
|
+
* Forces any buffered data to be written to the underlying resource.
|
|
640
|
+
*
|
|
641
|
+
* Direct mapping to avio_flush().
|
|
642
|
+
*
|
|
643
|
+
* @example
|
|
644
|
+
* ```typescript
|
|
645
|
+
* io.writeSync(data);
|
|
646
|
+
* io.flushSync(); // Ensure data is written
|
|
647
|
+
* ```
|
|
648
|
+
*
|
|
649
|
+
* @see {@link flush} For async version
|
|
650
|
+
*/
|
|
651
|
+
flushSync() {
|
|
652
|
+
this.native.flushSync();
|
|
653
|
+
}
|
|
446
654
|
/**
|
|
447
655
|
* Skip bytes in stream.
|
|
448
656
|
*
|
|
@@ -452,6 +660,7 @@ export class IOContext extends OptionMember {
|
|
|
452
660
|
* Direct mapping to avio_skip().
|
|
453
661
|
*
|
|
454
662
|
* @param offset - Number of bytes to skip
|
|
663
|
+
*
|
|
455
664
|
* @returns New position after skipping
|
|
456
665
|
*
|
|
457
666
|
* @example
|
|
@@ -466,6 +675,31 @@ export class IOContext extends OptionMember {
|
|
|
466
675
|
async skip(offset) {
|
|
467
676
|
return await this.native.skip(offset);
|
|
468
677
|
}
|
|
678
|
+
/**
|
|
679
|
+
* Skip bytes in stream synchronously.
|
|
680
|
+
* Synchronous version of skip.
|
|
681
|
+
*
|
|
682
|
+
* Advances the position by the specified offset.
|
|
683
|
+
* More efficient than reading and discarding data.
|
|
684
|
+
*
|
|
685
|
+
* Direct mapping to avio_skip().
|
|
686
|
+
*
|
|
687
|
+
* @param offset - Number of bytes to skip
|
|
688
|
+
*
|
|
689
|
+
* @returns New position after skipping
|
|
690
|
+
*
|
|
691
|
+
* @example
|
|
692
|
+
* ```typescript
|
|
693
|
+
* // Skip 1024 bytes forward
|
|
694
|
+
* const newPos = io.skipSync(1024n);
|
|
695
|
+
* console.log(`New position: ${newPos}`);
|
|
696
|
+
* ```
|
|
697
|
+
*
|
|
698
|
+
* @see {@link skip} For async version
|
|
699
|
+
*/
|
|
700
|
+
skipSync(offset) {
|
|
701
|
+
return this.native.skipSync(offset);
|
|
702
|
+
}
|
|
469
703
|
/**
|
|
470
704
|
* Get current position.
|
|
471
705
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"io-context.js","sourceRoot":"","sources":["../../src/lib/io-context.ts"],"names":[],"mapp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AC,IAAI,EAAE,CAAC;IAC5B,CAAC;IAED;;;;;;OAMG;IACH,SAAS;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC;QACzB,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC;IAC3C,CAAC;CACF"}
|
package/dist/lib/log.d.ts
CHANGED
|
@@ -95,6 +95,7 @@ export declare class Log {
|
|
|
95
95
|
* Direct mapping to av_log().
|
|
96
96
|
*
|
|
97
97
|
* @param level - Log level for this message
|
|
98
|
+
*
|
|
98
99
|
* @param message - Message to log
|
|
99
100
|
*
|
|
100
101
|
* @example
|
|
@@ -116,6 +117,7 @@ export declare class Log {
|
|
|
116
117
|
* Direct mapping to av_log_set_callback().
|
|
117
118
|
*
|
|
118
119
|
* @param callback - Function to handle log messages, or null to remove
|
|
120
|
+
*
|
|
119
121
|
* @param options - Additional logging options
|
|
120
122
|
*
|
|
121
123
|
* @example
|