node-av 2.0.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 +10 -2
- 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 +145 -0
- package/dist/api/decoder.js +225 -0
- package/dist/api/decoder.js.map +1 -1
- package/dist/api/encoder.d.ts +206 -0
- package/dist/api/encoder.js +315 -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 +225 -0
- package/dist/api/filter.js +363 -0
- package/dist/api/filter.js.map +1 -1
- package/dist/api/hardware.d.ts +17 -0
- package/dist/api/hardware.js +17 -0
- 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 +207 -1
- package/dist/api/media-input.js +353 -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 +65 -0
- 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.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 +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 +13 -13
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
|
*
|
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
|
|
@@ -206,9 +208,13 @@ export class IOContext extends OptionMember {
|
|
|
206
208
|
* Direct mapping to avio_alloc_context() with callbacks.
|
|
207
209
|
*
|
|
208
210
|
* @param bufferSize - Size of internal buffer
|
|
211
|
+
*
|
|
209
212
|
* @param writeFlag - 1 for write mode, 0 for read mode
|
|
213
|
+
*
|
|
210
214
|
* @param readCallback - Function to read data (null for write-only)
|
|
215
|
+
*
|
|
211
216
|
* @param writeCallback - Function to write data (null for read-only)
|
|
217
|
+
*
|
|
212
218
|
* @param seekCallback - Function to seek in stream (optional)
|
|
213
219
|
*
|
|
214
220
|
* @example
|
|
@@ -271,7 +277,9 @@ export class IOContext extends OptionMember {
|
|
|
271
277
|
* Direct mapping to avio_open2().
|
|
272
278
|
*
|
|
273
279
|
* @param url - URL or file path to open
|
|
280
|
+
*
|
|
274
281
|
* @param flags - Open flags (AVIO_FLAG_READ, AVIO_FLAG_WRITE, etc.)
|
|
282
|
+
*
|
|
275
283
|
* @returns 0 on success, negative AVERROR on error:
|
|
276
284
|
* - AVERROR_ENOENT: File not found
|
|
277
285
|
* - AVERROR_EACCES: Permission denied
|
|
@@ -296,6 +304,43 @@ export class IOContext extends OptionMember {
|
|
|
296
304
|
async open2(url, flags = AVIO_FLAG_READ) {
|
|
297
305
|
return await this.native.open2(url, flags);
|
|
298
306
|
}
|
|
307
|
+
/**
|
|
308
|
+
* Open resource for I/O synchronously.
|
|
309
|
+
* Synchronous version of open2.
|
|
310
|
+
*
|
|
311
|
+
* Opens a URL or file for reading or writing.
|
|
312
|
+
* Automatically selects the appropriate protocol handler.
|
|
313
|
+
*
|
|
314
|
+
* Direct mapping to avio_open2().
|
|
315
|
+
*
|
|
316
|
+
* @param url - URL or file path to open
|
|
317
|
+
*
|
|
318
|
+
* @param flags - Open flags (AVIO_FLAG_READ, AVIO_FLAG_WRITE, etc.)
|
|
319
|
+
*
|
|
320
|
+
* @returns 0 on success, negative AVERROR on error:
|
|
321
|
+
* - AVERROR_ENOENT: File not found
|
|
322
|
+
* - AVERROR_EACCES: Permission denied
|
|
323
|
+
* - AVERROR_ENOMEM: Memory allocation failure
|
|
324
|
+
*
|
|
325
|
+
* @example
|
|
326
|
+
* ```typescript
|
|
327
|
+
* import { FFmpegError } from 'node-av';
|
|
328
|
+
* import { AVIO_FLAG_READ, AVIO_FLAG_WRITE } from 'node-av/constants';
|
|
329
|
+
*
|
|
330
|
+
* // Open for reading
|
|
331
|
+
* const ret = io.open2Sync('input.mp4', AVIO_FLAG_READ);
|
|
332
|
+
* FFmpegError.throwIfError(ret, 'open2');
|
|
333
|
+
*
|
|
334
|
+
* // Open for writing
|
|
335
|
+
* const ret2 = io.open2Sync('output.mp4', AVIO_FLAG_WRITE);
|
|
336
|
+
* FFmpegError.throwIfError(ret2, 'open2');
|
|
337
|
+
* ```
|
|
338
|
+
*
|
|
339
|
+
* @see {@link open2} For async version
|
|
340
|
+
*/
|
|
341
|
+
open2Sync(url, flags = AVIO_FLAG_READ) {
|
|
342
|
+
return this.native.open2Sync(url, flags);
|
|
343
|
+
}
|
|
299
344
|
/**
|
|
300
345
|
* Close I/O context.
|
|
301
346
|
*
|
|
@@ -319,6 +364,30 @@ export class IOContext extends OptionMember {
|
|
|
319
364
|
async closep() {
|
|
320
365
|
return await this.native.closep();
|
|
321
366
|
}
|
|
367
|
+
/**
|
|
368
|
+
* Close I/O context synchronously.
|
|
369
|
+
* Synchronous version of closep.
|
|
370
|
+
*
|
|
371
|
+
* Closes the I/O context and frees resources.
|
|
372
|
+
* Sets internal pointer to NULL.
|
|
373
|
+
*
|
|
374
|
+
* Direct mapping to avio_closep().
|
|
375
|
+
*
|
|
376
|
+
* @returns 0 on success, negative AVERROR on error
|
|
377
|
+
*
|
|
378
|
+
* @example
|
|
379
|
+
* ```typescript
|
|
380
|
+
* const ret = io.closepSync();
|
|
381
|
+
* if (ret < 0) {
|
|
382
|
+
* console.error(`Failed to close: ${ret}`);
|
|
383
|
+
* }
|
|
384
|
+
* ```
|
|
385
|
+
*
|
|
386
|
+
* @see {@link closep} For async version
|
|
387
|
+
*/
|
|
388
|
+
closepSync() {
|
|
389
|
+
return this.native.closepSync();
|
|
390
|
+
}
|
|
322
391
|
/**
|
|
323
392
|
* Read data from I/O context.
|
|
324
393
|
*
|
|
@@ -327,6 +396,7 @@ export class IOContext extends OptionMember {
|
|
|
327
396
|
* Direct mapping to avio_read().
|
|
328
397
|
*
|
|
329
398
|
* @param size - Maximum number of bytes to read
|
|
399
|
+
*
|
|
330
400
|
* @returns Buffer with data, or error code if negative:
|
|
331
401
|
* - AVERROR_EOF: End of file reached
|
|
332
402
|
* - AVERROR_EIO: I/O error
|
|
@@ -346,6 +416,33 @@ export class IOContext extends OptionMember {
|
|
|
346
416
|
async read(size) {
|
|
347
417
|
return await this.native.read(size);
|
|
348
418
|
}
|
|
419
|
+
/**
|
|
420
|
+
* Read data from I/O context synchronously.
|
|
421
|
+
* Synchronous version of read.
|
|
422
|
+
*
|
|
423
|
+
* Reads up to the specified number of bytes from the stream.
|
|
424
|
+
*
|
|
425
|
+
* Direct mapping to avio_read().
|
|
426
|
+
*
|
|
427
|
+
* @param size - Number of bytes to read
|
|
428
|
+
*
|
|
429
|
+
* @returns Buffer with data, or negative AVERROR on error
|
|
430
|
+
*
|
|
431
|
+
* @example
|
|
432
|
+
* ```typescript
|
|
433
|
+
* const result = io.readSync(4096);
|
|
434
|
+
* if (Buffer.isBuffer(result)) {
|
|
435
|
+
* console.log(`Read ${result.length} bytes`);
|
|
436
|
+
* } else {
|
|
437
|
+
* console.log(`Read error: ${result}`);
|
|
438
|
+
* }
|
|
439
|
+
* ```
|
|
440
|
+
*
|
|
441
|
+
* @see {@link read} For async version
|
|
442
|
+
*/
|
|
443
|
+
readSync(size) {
|
|
444
|
+
return this.native.readSync(size);
|
|
445
|
+
}
|
|
349
446
|
/**
|
|
350
447
|
* Write data to I/O context.
|
|
351
448
|
*
|
|
@@ -367,6 +464,27 @@ export class IOContext extends OptionMember {
|
|
|
367
464
|
async write(buffer) {
|
|
368
465
|
await this.native.write(buffer);
|
|
369
466
|
}
|
|
467
|
+
/**
|
|
468
|
+
* Write data to I/O context synchronously.
|
|
469
|
+
* Synchronous version of write.
|
|
470
|
+
*
|
|
471
|
+
* Writes buffer data to the stream.
|
|
472
|
+
*
|
|
473
|
+
* Direct mapping to avio_write().
|
|
474
|
+
*
|
|
475
|
+
* @param buffer - Data to write
|
|
476
|
+
*
|
|
477
|
+
* @example
|
|
478
|
+
* ```typescript
|
|
479
|
+
* const data = Buffer.from('Hello, World!');
|
|
480
|
+
* io.writeSync(data);
|
|
481
|
+
* ```
|
|
482
|
+
*
|
|
483
|
+
* @see {@link write} For async version
|
|
484
|
+
*/
|
|
485
|
+
writeSync(buffer) {
|
|
486
|
+
this.native.writeSync(buffer);
|
|
487
|
+
}
|
|
370
488
|
/**
|
|
371
489
|
* Seek to position in stream.
|
|
372
490
|
*
|
|
@@ -376,7 +494,9 @@ export class IOContext extends OptionMember {
|
|
|
376
494
|
* Direct mapping to avio_seek().
|
|
377
495
|
*
|
|
378
496
|
* @param offset - Byte offset to seek to
|
|
497
|
+
*
|
|
379
498
|
* @param whence - Seek origin (AVSEEK_SET, AVSEEK_CUR, AVSEEK_END)
|
|
499
|
+
*
|
|
380
500
|
* @returns New position, or negative AVERROR on error:
|
|
381
501
|
* - AVERROR_EINVAL: Invalid arguments
|
|
382
502
|
* - AVERROR_ENOSYS: Seeking not supported
|
|
@@ -401,6 +521,42 @@ export class IOContext extends OptionMember {
|
|
|
401
521
|
async seek(offset, whence) {
|
|
402
522
|
return await this.native.seek(offset, whence);
|
|
403
523
|
}
|
|
524
|
+
/**
|
|
525
|
+
* Seek to position in stream synchronously.
|
|
526
|
+
* Synchronous version of seek.
|
|
527
|
+
*
|
|
528
|
+
* Changes the current position in the stream.
|
|
529
|
+
* Not all streams support seeking.
|
|
530
|
+
*
|
|
531
|
+
* Direct mapping to avio_seek().
|
|
532
|
+
*
|
|
533
|
+
* @param offset - Byte offset to seek to
|
|
534
|
+
*
|
|
535
|
+
* @param whence - Seek origin (AVSEEK_SET, AVSEEK_CUR, AVSEEK_END)
|
|
536
|
+
*
|
|
537
|
+
* @returns New position, or negative AVERROR on error:
|
|
538
|
+
* - AVERROR_EINVAL: Invalid arguments
|
|
539
|
+
* - AVERROR_ENOSYS: Seeking not supported
|
|
540
|
+
*
|
|
541
|
+
* @example
|
|
542
|
+
* ```typescript
|
|
543
|
+
* import { AVSEEK_SET, AVSEEK_CUR, AVSEEK_END } from 'node-av/constants';
|
|
544
|
+
*
|
|
545
|
+
* // Seek to absolute position
|
|
546
|
+
* const pos1 = io.seekSync(1024n, AVSEEK_SET);
|
|
547
|
+
*
|
|
548
|
+
* // Seek relative to current position
|
|
549
|
+
* const pos2 = io.seekSync(512n, AVSEEK_CUR);
|
|
550
|
+
*
|
|
551
|
+
* // Seek relative to end
|
|
552
|
+
* const pos3 = io.seekSync(-1024n, AVSEEK_END);
|
|
553
|
+
* ```
|
|
554
|
+
*
|
|
555
|
+
* @see {@link seek} For async version
|
|
556
|
+
*/
|
|
557
|
+
seekSync(offset, whence) {
|
|
558
|
+
return this.native.seekSync(offset, whence);
|
|
559
|
+
}
|
|
404
560
|
/**
|
|
405
561
|
* Get stream size.
|
|
406
562
|
*
|
|
@@ -425,6 +581,33 @@ export class IOContext extends OptionMember {
|
|
|
425
581
|
async size() {
|
|
426
582
|
return await this.native.size();
|
|
427
583
|
}
|
|
584
|
+
/**
|
|
585
|
+
* Get stream size synchronously.
|
|
586
|
+
* Synchronous version of size.
|
|
587
|
+
*
|
|
588
|
+
* Returns the total size of the stream in bytes.
|
|
589
|
+
* Not all streams have a known size.
|
|
590
|
+
*
|
|
591
|
+
* Direct mapping to avio_size().
|
|
592
|
+
*
|
|
593
|
+
* @returns Size in bytes, or negative AVERROR if unknown:
|
|
594
|
+
* - AVERROR_ENOSYS: Size not available
|
|
595
|
+
*
|
|
596
|
+
* @example
|
|
597
|
+
* ```typescript
|
|
598
|
+
* const size = io.sizeSync();
|
|
599
|
+
* if (size >= 0n) {
|
|
600
|
+
* console.log(`Stream size: ${size} bytes`);
|
|
601
|
+
* } else {
|
|
602
|
+
* console.log('Stream size unknown');
|
|
603
|
+
* }
|
|
604
|
+
* ```
|
|
605
|
+
*
|
|
606
|
+
* @see {@link size} For async version
|
|
607
|
+
*/
|
|
608
|
+
sizeSync() {
|
|
609
|
+
return this.native.sizeSync();
|
|
610
|
+
}
|
|
428
611
|
/**
|
|
429
612
|
* Flush buffered data.
|
|
430
613
|
*
|
|
@@ -443,6 +626,25 @@ export class IOContext extends OptionMember {
|
|
|
443
626
|
async flush() {
|
|
444
627
|
await this.native.flush();
|
|
445
628
|
}
|
|
629
|
+
/**
|
|
630
|
+
* Flush buffered data synchronously.
|
|
631
|
+
* Synchronous version of flush.
|
|
632
|
+
*
|
|
633
|
+
* Forces any buffered data to be written to the underlying resource.
|
|
634
|
+
*
|
|
635
|
+
* Direct mapping to avio_flush().
|
|
636
|
+
*
|
|
637
|
+
* @example
|
|
638
|
+
* ```typescript
|
|
639
|
+
* io.writeSync(data);
|
|
640
|
+
* io.flushSync(); // Ensure data is written
|
|
641
|
+
* ```
|
|
642
|
+
*
|
|
643
|
+
* @see {@link flush} For async version
|
|
644
|
+
*/
|
|
645
|
+
flushSync() {
|
|
646
|
+
this.native.flushSync();
|
|
647
|
+
}
|
|
446
648
|
/**
|
|
447
649
|
* Skip bytes in stream.
|
|
448
650
|
*
|
|
@@ -452,6 +654,7 @@ export class IOContext extends OptionMember {
|
|
|
452
654
|
* Direct mapping to avio_skip().
|
|
453
655
|
*
|
|
454
656
|
* @param offset - Number of bytes to skip
|
|
657
|
+
*
|
|
455
658
|
* @returns New position after skipping
|
|
456
659
|
*
|
|
457
660
|
* @example
|
|
@@ -466,6 +669,31 @@ export class IOContext extends OptionMember {
|
|
|
466
669
|
async skip(offset) {
|
|
467
670
|
return await this.native.skip(offset);
|
|
468
671
|
}
|
|
672
|
+
/**
|
|
673
|
+
* Skip bytes in stream synchronously.
|
|
674
|
+
* Synchronous version of skip.
|
|
675
|
+
*
|
|
676
|
+
* Advances the position by the specified offset.
|
|
677
|
+
* More efficient than reading and discarding data.
|
|
678
|
+
*
|
|
679
|
+
* Direct mapping to avio_skip().
|
|
680
|
+
*
|
|
681
|
+
* @param offset - Number of bytes to skip
|
|
682
|
+
*
|
|
683
|
+
* @returns New position after skipping
|
|
684
|
+
*
|
|
685
|
+
* @example
|
|
686
|
+
* ```typescript
|
|
687
|
+
* // Skip 1024 bytes forward
|
|
688
|
+
* const newPos = io.skipSync(1024n);
|
|
689
|
+
* console.log(`New position: ${newPos}`);
|
|
690
|
+
* ```
|
|
691
|
+
*
|
|
692
|
+
* @see {@link skip} For async version
|
|
693
|
+
*/
|
|
694
|
+
skipSync(offset) {
|
|
695
|
+
return this.native.skipSync(offset);
|
|
696
|
+
}
|
|
469
697
|
/**
|
|
470
698
|
* Get current position.
|
|
471
699
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"io-context.js","sourceRoot":"","sources":["../../src/lib/io-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAK3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AACH,MAAM,OAAO,SAAU,SAAQ,YAA6B;IAC1D;QACE,KAAK,CAAC,IAAI,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAC;IAClC,CAAC;IAED
|
|
1
|
+
{"version":3,"file":"io-context.js","sourceRoot":"","sources":["../../src/lib/io-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAK3C;;;;;;;;;;;;;;;;;;;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AAE,CAAC;IAChC,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,KAAK;QACT,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IAC5B,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,SAAS;QACP,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;IAC1B,CAAC;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,KAAK,CAAC,IAAI,CAAC,MAAc;QACvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,QAAQ,CAAC,MAAc;QACrB,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,IAAI;QACF,OAAO,IAAI,CAAC,MAAM,CAAC,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
|
package/dist/lib/log.js
CHANGED
|
@@ -98,6 +98,7 @@ export class Log {
|
|
|
98
98
|
* Direct mapping to av_log().
|
|
99
99
|
*
|
|
100
100
|
* @param level - Log level for this message
|
|
101
|
+
*
|
|
101
102
|
* @param message - Message to log
|
|
102
103
|
*
|
|
103
104
|
* @example
|
|
@@ -121,6 +122,7 @@ export class Log {
|
|
|
121
122
|
* Direct mapping to av_log_set_callback().
|
|
122
123
|
*
|
|
123
124
|
* @param callback - Function to handle log messages, or null to remove
|
|
125
|
+
*
|
|
124
126
|
* @param options - Additional logging options
|
|
125
127
|
*
|
|
126
128
|
* @example
|
package/dist/lib/log.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../src/lib/log.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAKxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,MAAM,OAAO,GAAG;IACd;;;;;;;;;;;;;;;;;;;OAmBG;IACH,MAAM,CAAC,QAAQ,CAAC,KAAiB;QAC/B,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAAM,CAAC,QAAQ;QACb,OAAO,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IACjC,CAAC;IAED
|
|
1
|
+
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../src/lib/log.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAKxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,MAAM,OAAO,GAAG;IACd;;;;;;;;;;;;;;;;;;;OAmBG;IACH,MAAM,CAAC,QAAQ,CAAC,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