@napi-rs/webcodecs 1.4.0 → 1.4.2
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/index.d.ts +76 -183
- package/index.js +55 -55
- package/package.json +29 -29
package/index.d.ts
CHANGED
|
@@ -177,6 +177,7 @@ export type TypedArray =
|
|
|
177
177
|
| Float64Array
|
|
178
178
|
| BigInt64Array
|
|
179
179
|
| BigUint64Array
|
|
180
|
+
|
|
180
181
|
/**
|
|
181
182
|
* AudioData - represents uncompressed audio data
|
|
182
183
|
*
|
|
@@ -270,7 +271,7 @@ export declare class AudioDecoder {
|
|
|
270
271
|
*
|
|
271
272
|
* @param init - Init dictionary containing output and error callbacks
|
|
272
273
|
*/
|
|
273
|
-
constructor(init: { output: (data: AudioData) => void; error: (error:
|
|
274
|
+
constructor(init: { output: (data: AudioData) => void; error: (error: DOMException) => void })
|
|
274
275
|
/** Get decoder state */
|
|
275
276
|
get state(): CodecState
|
|
276
277
|
/** Get number of pending decode operations (per WebCodecs spec) */
|
|
@@ -281,9 +282,9 @@ export declare class AudioDecoder {
|
|
|
281
282
|
* The dequeue event fires when decodeQueueSize decreases,
|
|
282
283
|
* allowing backpressure management.
|
|
283
284
|
*/
|
|
284
|
-
set ondequeue(callback: (() => unknown) | undefined | null)
|
|
285
|
+
set ondequeue(callback: ((event: Event) => unknown) | undefined | null)
|
|
285
286
|
/** Get the dequeue event handler (per WebCodecs spec) */
|
|
286
|
-
get ondequeue(): (() => unknown) | null
|
|
287
|
+
get ondequeue(): ((event: Event) => unknown) | null
|
|
287
288
|
/** Configure the decoder */
|
|
288
289
|
configure(config: AudioDecoderConfig): void
|
|
289
290
|
/** Decode an encoded audio chunk */
|
|
@@ -309,16 +310,19 @@ export declare class AudioDecoder {
|
|
|
309
310
|
* returns { supported: false } for valid but unsupported configs.
|
|
310
311
|
*/
|
|
311
312
|
static isConfigSupported(config: AudioDecoderConfig): Promise<AudioDecoderSupport>
|
|
312
|
-
/**
|
|
313
|
+
/**
|
|
314
|
+
* Add an event listener for the specified event type
|
|
315
|
+
* Uses separate RwLock to avoid blocking on decode operations
|
|
316
|
+
*/
|
|
313
317
|
addEventListener(
|
|
314
318
|
eventType: string,
|
|
315
|
-
callback: () => unknown,
|
|
319
|
+
callback: (event: Event) => unknown,
|
|
316
320
|
options?: AudioDecoderAddEventListenerOptions | undefined | null,
|
|
317
321
|
): void
|
|
318
322
|
/** Remove an event listener for the specified event type */
|
|
319
323
|
removeEventListener(
|
|
320
324
|
eventType: string,
|
|
321
|
-
callback: () => unknown,
|
|
325
|
+
callback: (event: Event) => unknown,
|
|
322
326
|
options?: AudioDecoderEventListenerOptions | undefined | null,
|
|
323
327
|
): void
|
|
324
328
|
/** Dispatch an event to all registered listeners */
|
|
@@ -357,7 +361,7 @@ export declare class AudioEncoder {
|
|
|
357
361
|
*/
|
|
358
362
|
constructor(init: {
|
|
359
363
|
output: (chunk: EncodedAudioChunk, metadata?: EncodedAudioChunkMetadata) => void
|
|
360
|
-
error: (error:
|
|
364
|
+
error: (error: DOMException) => void
|
|
361
365
|
})
|
|
362
366
|
/** Get encoder state */
|
|
363
367
|
get state(): CodecState
|
|
@@ -369,9 +373,9 @@ export declare class AudioEncoder {
|
|
|
369
373
|
* The dequeue event fires when encodeQueueSize decreases,
|
|
370
374
|
* allowing backpressure management.
|
|
371
375
|
*/
|
|
372
|
-
set ondequeue(callback: (() => unknown) | undefined | null)
|
|
376
|
+
set ondequeue(callback: ((event: Event) => unknown) | undefined | null)
|
|
373
377
|
/** Get the dequeue event handler (per WebCodecs spec) */
|
|
374
|
-
get ondequeue(): (() => unknown) | null
|
|
378
|
+
get ondequeue(): ((event: Event) => unknown) | null
|
|
375
379
|
/** Configure the encoder */
|
|
376
380
|
configure(config: AudioEncoderConfig): void
|
|
377
381
|
/** Encode audio data */
|
|
@@ -403,13 +407,13 @@ export declare class AudioEncoder {
|
|
|
403
407
|
*/
|
|
404
408
|
addEventListener(
|
|
405
409
|
eventType: string,
|
|
406
|
-
callback: () => unknown,
|
|
410
|
+
callback: (event: Event) => unknown,
|
|
407
411
|
options?: AudioEncoderAddEventListenerOptions | undefined | null,
|
|
408
412
|
): void
|
|
409
413
|
/** Remove an event listener for the specified event type */
|
|
410
414
|
removeEventListener(
|
|
411
415
|
eventType: string,
|
|
412
|
-
callback: () => unknown,
|
|
416
|
+
callback: (event: Event) => unknown,
|
|
413
417
|
options?: AudioEncoderEventListenerOptions | undefined | null,
|
|
414
418
|
): void
|
|
415
419
|
/** Dispatch an event to all registered listeners */
|
|
@@ -894,7 +898,7 @@ export declare class VideoDecoder {
|
|
|
894
898
|
*
|
|
895
899
|
* @param init - Init dictionary containing output and error callbacks
|
|
896
900
|
*/
|
|
897
|
-
constructor(init: { output: (frame: VideoFrame) => void; error: (error:
|
|
901
|
+
constructor(init: { output: (frame: VideoFrame) => void; error: (error: DOMException) => void })
|
|
898
902
|
/** Get decoder state */
|
|
899
903
|
get state(): CodecState
|
|
900
904
|
/** Get number of pending decode operations (per WebCodecs spec) */
|
|
@@ -905,9 +909,9 @@ export declare class VideoDecoder {
|
|
|
905
909
|
* The dequeue event fires when decodeQueueSize decreases,
|
|
906
910
|
* allowing backpressure management.
|
|
907
911
|
*/
|
|
908
|
-
set ondequeue(callback: (() => unknown) | undefined | null)
|
|
912
|
+
set ondequeue(callback: ((event: Event) => unknown) | undefined | null)
|
|
909
913
|
/** Get the dequeue event handler (per WebCodecs spec) */
|
|
910
|
-
get ondequeue(): (() => unknown) | null
|
|
914
|
+
get ondequeue(): ((event: Event) => unknown) | null
|
|
911
915
|
/**
|
|
912
916
|
* Configure the decoder
|
|
913
917
|
*
|
|
@@ -946,13 +950,13 @@ export declare class VideoDecoder {
|
|
|
946
950
|
*/
|
|
947
951
|
addEventListener(
|
|
948
952
|
eventType: string,
|
|
949
|
-
callback: () => unknown,
|
|
953
|
+
callback: (event: Event) => unknown,
|
|
950
954
|
options?: VideoDecoderAddEventListenerOptions | undefined | null,
|
|
951
955
|
): void
|
|
952
956
|
/** Remove an event listener for the specified event type */
|
|
953
957
|
removeEventListener(
|
|
954
958
|
eventType: string,
|
|
955
|
-
callback: () => unknown,
|
|
959
|
+
callback: (event: Event) => unknown,
|
|
956
960
|
options?: VideoDecoderEventListenerOptions | undefined | null,
|
|
957
961
|
): void
|
|
958
962
|
/** Dispatch an event to all registered listeners */
|
|
@@ -992,7 +996,7 @@ export declare class VideoEncoder {
|
|
|
992
996
|
*/
|
|
993
997
|
constructor(init: {
|
|
994
998
|
output: (chunk: EncodedVideoChunk, metadata?: EncodedVideoChunkMetadata) => void
|
|
995
|
-
error: (error:
|
|
999
|
+
error: (error: DOMException) => void
|
|
996
1000
|
})
|
|
997
1001
|
/** Get encoder state */
|
|
998
1002
|
get state(): CodecState
|
|
@@ -1004,9 +1008,9 @@ export declare class VideoEncoder {
|
|
|
1004
1008
|
* The dequeue event fires when encodeQueueSize decreases,
|
|
1005
1009
|
* allowing backpressure management.
|
|
1006
1010
|
*/
|
|
1007
|
-
set ondequeue(callback: (() => unknown) | undefined | null)
|
|
1011
|
+
set ondequeue(callback: ((event: Event) => unknown) | undefined | null)
|
|
1008
1012
|
/** Get the dequeue event handler (per WebCodecs spec) */
|
|
1009
|
-
get ondequeue(): (() => unknown) | null
|
|
1013
|
+
get ondequeue(): ((event: Event) => unknown) | null
|
|
1010
1014
|
/** Configure the encoder */
|
|
1011
1015
|
configure(config: VideoEncoderConfig): void
|
|
1012
1016
|
/** Encode a frame */
|
|
@@ -1030,13 +1034,13 @@ export declare class VideoEncoder {
|
|
|
1030
1034
|
*/
|
|
1031
1035
|
addEventListener(
|
|
1032
1036
|
eventType: string,
|
|
1033
|
-
callback: () => unknown,
|
|
1037
|
+
callback: (event: Event) => unknown,
|
|
1034
1038
|
options?: AddEventListenerOptions | undefined | null,
|
|
1035
1039
|
): void
|
|
1036
1040
|
/** Remove an event listener for the specified event type */
|
|
1037
1041
|
removeEventListener(
|
|
1038
1042
|
eventType: string,
|
|
1039
|
-
callback: () => unknown,
|
|
1043
|
+
callback: (event: Event) => unknown,
|
|
1040
1044
|
options?: EventListenerOptions | undefined | null,
|
|
1041
1045
|
): void
|
|
1042
1046
|
/** Dispatch an event to all registered listeners */
|
|
@@ -1246,10 +1250,7 @@ export declare class WebMMuxer {
|
|
|
1246
1250
|
}
|
|
1247
1251
|
|
|
1248
1252
|
/** AAC bitstream format (W3C WebCodecs AAC Registration) */
|
|
1249
|
-
export type AacBitstreamFormat =
|
|
1250
|
-
| 'aac'
|
|
1251
|
-
/** ADTS frames - metadata in each frame */
|
|
1252
|
-
| 'adts'
|
|
1253
|
+
export type AacBitstreamFormat = 'aac' | 'adts'
|
|
1253
1254
|
|
|
1254
1255
|
/** AAC encoder configuration (W3C WebCodecs AAC Registration) */
|
|
1255
1256
|
export interface AacEncoderConfig {
|
|
@@ -1268,10 +1269,7 @@ export interface AddEventListenerOptions {
|
|
|
1268
1269
|
* Alpha channel handling option (W3C WebCodecs spec)
|
|
1269
1270
|
* Default is "discard" per spec
|
|
1270
1271
|
*/
|
|
1271
|
-
export type AlphaOption =
|
|
1272
|
-
| 'keep'
|
|
1273
|
-
/** Discard alpha channel (default per W3C spec) */
|
|
1274
|
-
| 'discard'
|
|
1272
|
+
export type AlphaOption = 'keep' | 'discard'
|
|
1275
1273
|
|
|
1276
1274
|
/** Options for copyTo operation */
|
|
1277
1275
|
export interface AudioDataCopyToOptions {
|
|
@@ -1353,28 +1351,10 @@ export interface AudioEncoderSupport {
|
|
|
1353
1351
|
}
|
|
1354
1352
|
|
|
1355
1353
|
/** Audio sample format (WebCodecs spec) */
|
|
1356
|
-
export type AudioSampleFormat =
|
|
1357
|
-
| 'u8'
|
|
1358
|
-
/** Signed 16-bit integer samples| interleaved */
|
|
1359
|
-
| 's16'
|
|
1360
|
-
/** Signed 32-bit integer samples| interleaved */
|
|
1361
|
-
| 's32'
|
|
1362
|
-
/** 32-bit float samples| interleaved */
|
|
1363
|
-
| 'f32'
|
|
1364
|
-
/** Unsigned 8-bit integer samples| planar */
|
|
1365
|
-
| 'u8-planar'
|
|
1366
|
-
/** Signed 16-bit integer samples| planar */
|
|
1367
|
-
| 's16-planar'
|
|
1368
|
-
/** Signed 32-bit integer samples| planar */
|
|
1369
|
-
| 's32-planar'
|
|
1370
|
-
/** 32-bit float samples| planar */
|
|
1371
|
-
| 'f32-planar'
|
|
1354
|
+
export type AudioSampleFormat = 'u8' | 's16' | 's32' | 'f32' | 'u8-planar' | 's16-planar' | 's32-planar' | 'f32-planar'
|
|
1372
1355
|
|
|
1373
1356
|
/** AVC (H.264) bitstream format (W3C WebCodecs AVC Registration) */
|
|
1374
|
-
export type AvcBitstreamFormat =
|
|
1375
|
-
| 'avc'
|
|
1376
|
-
/** Annex B format with parameter sets in bitstream */
|
|
1377
|
-
| 'annexb'
|
|
1357
|
+
export type AvcBitstreamFormat = 'avc' | 'annexb'
|
|
1378
1358
|
|
|
1379
1359
|
/** AVC (H.264) encoder configuration (W3C WebCodecs AVC Registration) */
|
|
1380
1360
|
export interface AvcEncoderConfig {
|
|
@@ -1383,24 +1363,13 @@ export interface AvcEncoderConfig {
|
|
|
1383
1363
|
}
|
|
1384
1364
|
|
|
1385
1365
|
/** Bitrate mode for audio encoding (W3C WebCodecs spec) */
|
|
1386
|
-
export type BitrateMode =
|
|
1387
|
-
| 'variable'
|
|
1388
|
-
/** Constant bitrate */
|
|
1389
|
-
| 'constant'
|
|
1366
|
+
export type BitrateMode = 'variable' | 'constant'
|
|
1390
1367
|
|
|
1391
1368
|
/** Encoder state per WebCodecs spec */
|
|
1392
|
-
export type CodecState =
|
|
1393
|
-
| 'unconfigured'
|
|
1394
|
-
/** Encoder configured and ready */
|
|
1395
|
-
| 'configured'
|
|
1396
|
-
/** Encoder closed */
|
|
1397
|
-
| 'closed'
|
|
1369
|
+
export type CodecState = 'unconfigured' | 'configured' | 'closed'
|
|
1398
1370
|
|
|
1399
1371
|
/** ColorSpaceConversion for ImageDecoder (W3C WebCodecs spec) */
|
|
1400
|
-
export type ColorSpaceConversion =
|
|
1401
|
-
| 'default'
|
|
1402
|
-
/** No color space conversion */
|
|
1403
|
-
| 'none'
|
|
1372
|
+
export type ColorSpaceConversion = 'default' | 'none'
|
|
1404
1373
|
|
|
1405
1374
|
/** Audio decoder configuration exposed to JavaScript */
|
|
1406
1375
|
export interface DemuxerAudioDecoderConfig {
|
|
@@ -1467,10 +1436,7 @@ export interface EncodedAudioChunkMetadataJs {
|
|
|
1467
1436
|
}
|
|
1468
1437
|
|
|
1469
1438
|
/** Type of encoded audio chunk */
|
|
1470
|
-
export type EncodedAudioChunkType =
|
|
1471
|
-
| 'key'
|
|
1472
|
-
/** Delta chunk - depends on previous chunks */
|
|
1473
|
-
| 'delta'
|
|
1439
|
+
export type EncodedAudioChunkType = 'key' | 'delta'
|
|
1474
1440
|
|
|
1475
1441
|
/** Output callback metadata per WebCodecs spec */
|
|
1476
1442
|
export interface EncodedVideoChunkMetadata {
|
|
@@ -1497,10 +1463,7 @@ export interface EncodedVideoChunkMetadataJs {
|
|
|
1497
1463
|
}
|
|
1498
1464
|
|
|
1499
1465
|
/** Type of encoded video chunk */
|
|
1500
|
-
export type EncodedVideoChunkType =
|
|
1501
|
-
| 'key'
|
|
1502
|
-
/** Delta frame - depends on previous frames */
|
|
1503
|
-
| 'delta'
|
|
1466
|
+
export type EncodedVideoChunkType = 'key' | 'delta'
|
|
1504
1467
|
|
|
1505
1468
|
/** Options for removeEventListener (W3C DOM spec) */
|
|
1506
1469
|
export interface EventListenerOptions {
|
|
@@ -1525,12 +1488,7 @@ export declare function getHardwareAccelerators(): Array<HardwareAccelerator>
|
|
|
1525
1488
|
export declare function getPreferredHardwareAccelerator(): string | null
|
|
1526
1489
|
|
|
1527
1490
|
/** Hardware acceleration preference (W3C WebCodecs spec) */
|
|
1528
|
-
export type HardwareAcceleration =
|
|
1529
|
-
| 'no-preference'
|
|
1530
|
-
/** Prefer hardware acceleration */
|
|
1531
|
-
| 'prefer-hardware'
|
|
1532
|
-
/** Prefer software implementation */
|
|
1533
|
-
| 'prefer-software'
|
|
1491
|
+
export type HardwareAcceleration = 'no-preference' | 'prefer-hardware' | 'prefer-software'
|
|
1534
1492
|
|
|
1535
1493
|
/** Hardware accelerator information */
|
|
1536
1494
|
export interface HardwareAccelerator {
|
|
@@ -1543,10 +1501,7 @@ export interface HardwareAccelerator {
|
|
|
1543
1501
|
}
|
|
1544
1502
|
|
|
1545
1503
|
/** HEVC (H.265) bitstream format (W3C WebCodecs HEVC Registration) */
|
|
1546
|
-
export type HevcBitstreamFormat =
|
|
1547
|
-
| 'hevc'
|
|
1548
|
-
/** Annex B format with parameter sets in bitstream */
|
|
1549
|
-
| 'annexb'
|
|
1504
|
+
export type HevcBitstreamFormat = 'hevc' | 'annexb'
|
|
1550
1505
|
|
|
1551
1506
|
/** HEVC (H.265) encoder configuration (W3C WebCodecs HEVC Registration) */
|
|
1552
1507
|
export interface HevcEncoderConfig {
|
|
@@ -1554,6 +1509,9 @@ export interface HevcEncoderConfig {
|
|
|
1554
1509
|
format?: HevcBitstreamFormat
|
|
1555
1510
|
}
|
|
1556
1511
|
|
|
1512
|
+
/** HEVC sample-entry override for the MP4 muxer */
|
|
1513
|
+
export type HevcSampleEntryJs = 'hvc1' | 'hev1'
|
|
1514
|
+
|
|
1557
1515
|
/** Image decode options */
|
|
1558
1516
|
export interface ImageDecodeOptions {
|
|
1559
1517
|
/** Frame index to decode (for animated images) */
|
|
@@ -1566,10 +1524,7 @@ export interface ImageDecodeOptions {
|
|
|
1566
1524
|
export declare function isHardwareAcceleratorAvailable(name: string): boolean
|
|
1567
1525
|
|
|
1568
1526
|
/** Latency mode for video encoding (W3C WebCodecs spec) */
|
|
1569
|
-
export type LatencyMode =
|
|
1570
|
-
| 'quality'
|
|
1571
|
-
/** Optimize for low latency */
|
|
1572
|
-
| 'realtime'
|
|
1527
|
+
export type LatencyMode = 'quality' | 'realtime'
|
|
1573
1528
|
|
|
1574
1529
|
/** Audio track configuration for MKV muxer */
|
|
1575
1530
|
export interface MkvAudioTrackConfig {
|
|
@@ -1645,21 +1600,20 @@ export interface Mp4VideoTrackConfig {
|
|
|
1645
1600
|
framerate?: number
|
|
1646
1601
|
/** Codec-specific description data (avcC/hvcC/av1C from encoder metadata) */
|
|
1647
1602
|
description?: Uint8Array
|
|
1603
|
+
/**
|
|
1604
|
+
* HEVC sample-entry override. Default picks "hvc1" when the hvcC
|
|
1605
|
+
* description is well-formed, single-layer, and complete; "hev1" permits
|
|
1606
|
+
* in-band parameter sets (e.g. remuxing hev1 streams with parameter-set
|
|
1607
|
+
* updates); "hvc1" forces the tag and requires a qualifying description.
|
|
1608
|
+
*/
|
|
1609
|
+
sampleEntry?: HevcSampleEntryJs
|
|
1648
1610
|
}
|
|
1649
1611
|
|
|
1650
1612
|
/** Opus application mode (W3C WebCodecs Opus Registration) */
|
|
1651
|
-
export type OpusApplication =
|
|
1652
|
-
| 'voip'
|
|
1653
|
-
/** Optimize for audio fidelity (default) */
|
|
1654
|
-
| 'audio'
|
|
1655
|
-
/** Minimize coding delay */
|
|
1656
|
-
| 'lowdelay'
|
|
1613
|
+
export type OpusApplication = 'voip' | 'audio' | 'lowdelay'
|
|
1657
1614
|
|
|
1658
1615
|
/** Opus bitstream format (W3C WebCodecs Opus Registration) */
|
|
1659
|
-
export type OpusBitstreamFormat =
|
|
1660
|
-
| 'opus'
|
|
1661
|
-
/** Ogg encapsulation (RFC 7845) - metadata in description */
|
|
1662
|
-
| 'ogg'
|
|
1616
|
+
export type OpusBitstreamFormat = 'opus' | 'ogg'
|
|
1663
1617
|
|
|
1664
1618
|
/** Opus encoder configuration (W3C WebCodecs Opus Registration) */
|
|
1665
1619
|
export interface OpusEncoderConfig {
|
|
@@ -1685,12 +1639,7 @@ export interface OpusEncoderConfig {
|
|
|
1685
1639
|
}
|
|
1686
1640
|
|
|
1687
1641
|
/** Opus signal type hint (W3C WebCodecs Opus Registration) */
|
|
1688
|
-
export type OpusSignal =
|
|
1689
|
-
| 'auto'
|
|
1690
|
-
/** Music signal */
|
|
1691
|
-
| 'music'
|
|
1692
|
-
/** Voice/speech signal */
|
|
1693
|
-
| 'voice'
|
|
1642
|
+
export type OpusSignal = 'auto' | 'music' | 'voice'
|
|
1694
1643
|
|
|
1695
1644
|
/** Layout information for a single plane per WebCodecs spec */
|
|
1696
1645
|
export interface PlaneLayout {
|
|
@@ -1733,16 +1682,7 @@ export interface SvcOutputMetadataJs {
|
|
|
1733
1682
|
}
|
|
1734
1683
|
|
|
1735
1684
|
/** Video color primaries (W3C WebCodecs spec) */
|
|
1736
|
-
export type VideoColorPrimaries =
|
|
1737
|
-
| 'bt709'
|
|
1738
|
-
/** BT.470 BG (PAL) */
|
|
1739
|
-
| 'bt470bg'
|
|
1740
|
-
/** SMPTE 170M (NTSC) */
|
|
1741
|
-
| 'smpte170m'
|
|
1742
|
-
/** BT.2020 (UHD) */
|
|
1743
|
-
| 'bt2020'
|
|
1744
|
-
/** SMPTE 432 (DCI-P3) */
|
|
1745
|
-
| 'smpte432'
|
|
1685
|
+
export type VideoColorPrimaries = 'bt709' | 'bt470bg' | 'smpte170m' | 'bt2020' | 'smpte432'
|
|
1746
1686
|
|
|
1747
1687
|
/** Options for addEventListener (W3C DOM spec) */
|
|
1748
1688
|
export interface VideoDecoderAddEventListenerOptions {
|
|
@@ -1799,12 +1739,7 @@ export interface VideoDecoderSupport {
|
|
|
1799
1739
|
}
|
|
1800
1740
|
|
|
1801
1741
|
/** Bitrate mode for video encoding (W3C WebCodecs spec) */
|
|
1802
|
-
export type VideoEncoderBitrateMode =
|
|
1803
|
-
| 'variable'
|
|
1804
|
-
/** Constant bitrate */
|
|
1805
|
-
| 'constant'
|
|
1806
|
-
/** Use quantizer parameter from codec-specific options */
|
|
1807
|
-
| 'quantizer'
|
|
1742
|
+
export type VideoEncoderBitrateMode = 'variable' | 'constant' | 'quantizer'
|
|
1808
1743
|
|
|
1809
1744
|
/** Encode options per WebCodecs spec */
|
|
1810
1745
|
export interface VideoEncoderEncodeOptions {
|
|
@@ -1899,76 +1834,34 @@ export interface VideoFrameRect {
|
|
|
1899
1834
|
}
|
|
1900
1835
|
|
|
1901
1836
|
/** Video matrix coefficients (W3C WebCodecs spec) */
|
|
1902
|
-
export type VideoMatrixCoefficients =
|
|
1903
|
-
| 'rgb'
|
|
1904
|
-
/** BT.709 */
|
|
1905
|
-
| 'bt709'
|
|
1906
|
-
/** BT.470 BG */
|
|
1907
|
-
| 'bt470bg'
|
|
1908
|
-
/** SMPTE 170M */
|
|
1909
|
-
| 'smpte170m'
|
|
1910
|
-
/** BT.2020 non-constant luminance */
|
|
1911
|
-
| 'bt2020-ncl'
|
|
1837
|
+
export type VideoMatrixCoefficients = 'rgb' | 'bt709' | 'bt470bg' | 'smpte170m' | 'bt2020-ncl'
|
|
1912
1838
|
|
|
1913
1839
|
/** Video pixel format (WebCodecs spec) */
|
|
1914
|
-
export type VideoPixelFormat =
|
|
1915
|
-
| 'I420'
|
|
1916
|
-
|
|
1917
|
-
| '
|
|
1918
|
-
|
|
1919
|
-
| '
|
|
1920
|
-
|
|
1921
|
-
| '
|
|
1922
|
-
|
|
1923
|
-
| '
|
|
1924
|
-
|
|
1925
|
-
| '
|
|
1926
|
-
|
|
1927
|
-
| '
|
|
1928
|
-
|
|
1929
|
-
| '
|
|
1930
|
-
|
|
1931
|
-
| '
|
|
1932
|
-
|
|
1933
|
-
| '
|
|
1934
|
-
|
|
1935
|
-
| '
|
|
1936
|
-
/** Planar YUV 4:4:4| 10-bit| with alpha plane */
|
|
1937
|
-
| 'I444AP10'
|
|
1938
|
-
/** Planar YUV 4:2:0| 12-bit */
|
|
1939
|
-
| 'I420P12'
|
|
1940
|
-
/** Planar YUV 4:2:2| 12-bit */
|
|
1941
|
-
| 'I422P12'
|
|
1942
|
-
/** Planar YUV 4:4:4| 12-bit */
|
|
1943
|
-
| 'I444P12'
|
|
1944
|
-
/** Semi-planar YUV 4:2:0| 12bpp (Y plane + interleaved UV) */
|
|
1945
|
-
| 'NV12'
|
|
1946
|
-
/** Semi-planar YUV 4:2:0| 12bpp (Y plane + interleaved VU) - per W3C WebCodecs spec */
|
|
1947
|
-
| 'NV21'
|
|
1948
|
-
/** RGBA 32bpp */
|
|
1949
|
-
| 'RGBA'
|
|
1950
|
-
/** RGBX 32bpp (alpha ignored) */
|
|
1951
|
-
| 'RGBX'
|
|
1952
|
-
/** BGRA 32bpp */
|
|
1953
|
-
| 'BGRA'
|
|
1954
|
-
/** BGRX 32bpp (alpha ignored) */
|
|
1955
|
-
| 'BGRX'
|
|
1840
|
+
export type VideoPixelFormat =
|
|
1841
|
+
| 'I420'
|
|
1842
|
+
| 'I420A'
|
|
1843
|
+
| 'I422'
|
|
1844
|
+
| 'I422A'
|
|
1845
|
+
| 'I444'
|
|
1846
|
+
| 'I444A'
|
|
1847
|
+
| 'I420P10'
|
|
1848
|
+
| 'I420AP10'
|
|
1849
|
+
| 'I422P10'
|
|
1850
|
+
| 'I422AP10'
|
|
1851
|
+
| 'I444P10'
|
|
1852
|
+
| 'I444AP10'
|
|
1853
|
+
| 'I420P12'
|
|
1854
|
+
| 'I422P12'
|
|
1855
|
+
| 'I444P12'
|
|
1856
|
+
| 'NV12'
|
|
1857
|
+
| 'NV21'
|
|
1858
|
+
| 'RGBA'
|
|
1859
|
+
| 'RGBX'
|
|
1860
|
+
| 'BGRA'
|
|
1861
|
+
| 'BGRX'
|
|
1956
1862
|
|
|
1957
1863
|
/** Video transfer characteristics (W3C WebCodecs spec) */
|
|
1958
|
-
export type VideoTransferCharacteristics =
|
|
1959
|
-
| 'bt709'
|
|
1960
|
-
/** SMPTE 170M transfer */
|
|
1961
|
-
| 'smpte170m'
|
|
1962
|
-
/** IEC 61966-2-1 (sRGB) - technical name */
|
|
1963
|
-
| 'iec61966-2-1'
|
|
1964
|
-
/** sRGB transfer (alias for iec61966-2-1) */
|
|
1965
|
-
| 'srgb'
|
|
1966
|
-
/** Linear transfer */
|
|
1967
|
-
| 'linear'
|
|
1968
|
-
/** Perceptual Quantizer (HDR) */
|
|
1969
|
-
| 'pq'
|
|
1970
|
-
/** Hybrid Log-Gamma (HDR) */
|
|
1971
|
-
| 'hlg'
|
|
1864
|
+
export type VideoTransferCharacteristics = 'bt709' | 'smpte170m' | 'iec61966-2-1' | 'srgb' | 'linear' | 'pq' | 'hlg'
|
|
1972
1865
|
|
|
1973
1866
|
/** Audio track configuration for WebM muxer */
|
|
1974
1867
|
export interface WebMAudioTrackConfig {
|
package/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// prettier-ignore
|
|
2
1
|
/* eslint-disable */
|
|
3
2
|
// @ts-nocheck
|
|
4
3
|
/* auto-generated by NAPI-RS */
|
|
@@ -78,12 +77,12 @@ function requireNative() {
|
|
|
78
77
|
const binding = require('@napi-rs/webcodecs-android-arm64')
|
|
79
78
|
const bindingPackageVersion = require('@napi-rs/webcodecs-android-arm64/package.json').version
|
|
80
79
|
if (
|
|
81
|
-
bindingPackageVersion !== '1.4.
|
|
80
|
+
bindingPackageVersion !== '1.4.1' &&
|
|
82
81
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
83
82
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
84
83
|
) {
|
|
85
84
|
throw new Error(
|
|
86
|
-
`Native binding package version mismatch, expected 1.4.
|
|
85
|
+
`Native binding package version mismatch, expected 1.4.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
87
86
|
)
|
|
88
87
|
}
|
|
89
88
|
return binding
|
|
@@ -100,12 +99,12 @@ function requireNative() {
|
|
|
100
99
|
const binding = require('@napi-rs/webcodecs-android-arm-eabi')
|
|
101
100
|
const bindingPackageVersion = require('@napi-rs/webcodecs-android-arm-eabi/package.json').version
|
|
102
101
|
if (
|
|
103
|
-
bindingPackageVersion !== '1.4.
|
|
102
|
+
bindingPackageVersion !== '1.4.1' &&
|
|
104
103
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
105
104
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
106
105
|
) {
|
|
107
106
|
throw new Error(
|
|
108
|
-
`Native binding package version mismatch, expected 1.4.
|
|
107
|
+
`Native binding package version mismatch, expected 1.4.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
109
108
|
)
|
|
110
109
|
}
|
|
111
110
|
return binding
|
|
@@ -130,12 +129,12 @@ function requireNative() {
|
|
|
130
129
|
const binding = require('@napi-rs/webcodecs-win32-x64-gnu')
|
|
131
130
|
const bindingPackageVersion = require('@napi-rs/webcodecs-win32-x64-gnu/package.json').version
|
|
132
131
|
if (
|
|
133
|
-
bindingPackageVersion !== '1.4.
|
|
132
|
+
bindingPackageVersion !== '1.4.1' &&
|
|
134
133
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
135
134
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
136
135
|
) {
|
|
137
136
|
throw new Error(
|
|
138
|
-
`Native binding package version mismatch, expected 1.4.
|
|
137
|
+
`Native binding package version mismatch, expected 1.4.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
139
138
|
)
|
|
140
139
|
}
|
|
141
140
|
return binding
|
|
@@ -152,12 +151,12 @@ function requireNative() {
|
|
|
152
151
|
const binding = require('@napi-rs/webcodecs-win32-x64-msvc')
|
|
153
152
|
const bindingPackageVersion = require('@napi-rs/webcodecs-win32-x64-msvc/package.json').version
|
|
154
153
|
if (
|
|
155
|
-
bindingPackageVersion !== '1.4.
|
|
154
|
+
bindingPackageVersion !== '1.4.1' &&
|
|
156
155
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
157
156
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
158
157
|
) {
|
|
159
158
|
throw new Error(
|
|
160
|
-
`Native binding package version mismatch, expected 1.4.
|
|
159
|
+
`Native binding package version mismatch, expected 1.4.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
161
160
|
)
|
|
162
161
|
}
|
|
163
162
|
return binding
|
|
@@ -175,12 +174,12 @@ function requireNative() {
|
|
|
175
174
|
const binding = require('@napi-rs/webcodecs-win32-ia32-msvc')
|
|
176
175
|
const bindingPackageVersion = require('@napi-rs/webcodecs-win32-ia32-msvc/package.json').version
|
|
177
176
|
if (
|
|
178
|
-
bindingPackageVersion !== '1.4.
|
|
177
|
+
bindingPackageVersion !== '1.4.1' &&
|
|
179
178
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
180
179
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
181
180
|
) {
|
|
182
181
|
throw new Error(
|
|
183
|
-
`Native binding package version mismatch, expected 1.4.
|
|
182
|
+
`Native binding package version mismatch, expected 1.4.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
184
183
|
)
|
|
185
184
|
}
|
|
186
185
|
return binding
|
|
@@ -197,12 +196,12 @@ function requireNative() {
|
|
|
197
196
|
const binding = require('@napi-rs/webcodecs-win32-arm64-msvc')
|
|
198
197
|
const bindingPackageVersion = require('@napi-rs/webcodecs-win32-arm64-msvc/package.json').version
|
|
199
198
|
if (
|
|
200
|
-
bindingPackageVersion !== '1.4.
|
|
199
|
+
bindingPackageVersion !== '1.4.1' &&
|
|
201
200
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
202
201
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
203
202
|
) {
|
|
204
203
|
throw new Error(
|
|
205
|
-
`Native binding package version mismatch, expected 1.4.
|
|
204
|
+
`Native binding package version mismatch, expected 1.4.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
206
205
|
)
|
|
207
206
|
}
|
|
208
207
|
return binding
|
|
@@ -222,12 +221,12 @@ function requireNative() {
|
|
|
222
221
|
const binding = require('@napi-rs/webcodecs-darwin-universal')
|
|
223
222
|
const bindingPackageVersion = require('@napi-rs/webcodecs-darwin-universal/package.json').version
|
|
224
223
|
if (
|
|
225
|
-
bindingPackageVersion !== '1.4.
|
|
224
|
+
bindingPackageVersion !== '1.4.1' &&
|
|
226
225
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
227
226
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
228
227
|
) {
|
|
229
228
|
throw new Error(
|
|
230
|
-
`Native binding package version mismatch, expected 1.4.
|
|
229
|
+
`Native binding package version mismatch, expected 1.4.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
231
230
|
)
|
|
232
231
|
}
|
|
233
232
|
return binding
|
|
@@ -244,12 +243,12 @@ function requireNative() {
|
|
|
244
243
|
const binding = require('@napi-rs/webcodecs-darwin-x64')
|
|
245
244
|
const bindingPackageVersion = require('@napi-rs/webcodecs-darwin-x64/package.json').version
|
|
246
245
|
if (
|
|
247
|
-
bindingPackageVersion !== '1.4.
|
|
246
|
+
bindingPackageVersion !== '1.4.1' &&
|
|
248
247
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
249
248
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
250
249
|
) {
|
|
251
250
|
throw new Error(
|
|
252
|
-
`Native binding package version mismatch, expected 1.4.
|
|
251
|
+
`Native binding package version mismatch, expected 1.4.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
253
252
|
)
|
|
254
253
|
}
|
|
255
254
|
return binding
|
|
@@ -266,12 +265,12 @@ function requireNative() {
|
|
|
266
265
|
const binding = require('@napi-rs/webcodecs-darwin-arm64')
|
|
267
266
|
const bindingPackageVersion = require('@napi-rs/webcodecs-darwin-arm64/package.json').version
|
|
268
267
|
if (
|
|
269
|
-
bindingPackageVersion !== '1.4.
|
|
268
|
+
bindingPackageVersion !== '1.4.1' &&
|
|
270
269
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
271
270
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
272
271
|
) {
|
|
273
272
|
throw new Error(
|
|
274
|
-
`Native binding package version mismatch, expected 1.4.
|
|
273
|
+
`Native binding package version mismatch, expected 1.4.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
275
274
|
)
|
|
276
275
|
}
|
|
277
276
|
return binding
|
|
@@ -292,12 +291,12 @@ function requireNative() {
|
|
|
292
291
|
const binding = require('@napi-rs/webcodecs-freebsd-x64')
|
|
293
292
|
const bindingPackageVersion = require('@napi-rs/webcodecs-freebsd-x64/package.json').version
|
|
294
293
|
if (
|
|
295
|
-
bindingPackageVersion !== '1.4.
|
|
294
|
+
bindingPackageVersion !== '1.4.1' &&
|
|
296
295
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
297
296
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
298
297
|
) {
|
|
299
298
|
throw new Error(
|
|
300
|
-
`Native binding package version mismatch, expected 1.4.
|
|
299
|
+
`Native binding package version mismatch, expected 1.4.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
301
300
|
)
|
|
302
301
|
}
|
|
303
302
|
return binding
|
|
@@ -314,12 +313,12 @@ function requireNative() {
|
|
|
314
313
|
const binding = require('@napi-rs/webcodecs-freebsd-arm64')
|
|
315
314
|
const bindingPackageVersion = require('@napi-rs/webcodecs-freebsd-arm64/package.json').version
|
|
316
315
|
if (
|
|
317
|
-
bindingPackageVersion !== '1.4.
|
|
316
|
+
bindingPackageVersion !== '1.4.1' &&
|
|
318
317
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
319
318
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
320
319
|
) {
|
|
321
320
|
throw new Error(
|
|
322
|
-
`Native binding package version mismatch, expected 1.4.
|
|
321
|
+
`Native binding package version mismatch, expected 1.4.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
323
322
|
)
|
|
324
323
|
}
|
|
325
324
|
return binding
|
|
@@ -341,12 +340,12 @@ function requireNative() {
|
|
|
341
340
|
const binding = require('@napi-rs/webcodecs-linux-x64-musl')
|
|
342
341
|
const bindingPackageVersion = require('@napi-rs/webcodecs-linux-x64-musl/package.json').version
|
|
343
342
|
if (
|
|
344
|
-
bindingPackageVersion !== '1.4.
|
|
343
|
+
bindingPackageVersion !== '1.4.1' &&
|
|
345
344
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
346
345
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
347
346
|
) {
|
|
348
347
|
throw new Error(
|
|
349
|
-
`Native binding package version mismatch, expected 1.4.
|
|
348
|
+
`Native binding package version mismatch, expected 1.4.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
350
349
|
)
|
|
351
350
|
}
|
|
352
351
|
return binding
|
|
@@ -363,12 +362,12 @@ function requireNative() {
|
|
|
363
362
|
const binding = require('@napi-rs/webcodecs-linux-x64-gnu')
|
|
364
363
|
const bindingPackageVersion = require('@napi-rs/webcodecs-linux-x64-gnu/package.json').version
|
|
365
364
|
if (
|
|
366
|
-
bindingPackageVersion !== '1.4.
|
|
365
|
+
bindingPackageVersion !== '1.4.1' &&
|
|
367
366
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
368
367
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
369
368
|
) {
|
|
370
369
|
throw new Error(
|
|
371
|
-
`Native binding package version mismatch, expected 1.4.
|
|
370
|
+
`Native binding package version mismatch, expected 1.4.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
372
371
|
)
|
|
373
372
|
}
|
|
374
373
|
return binding
|
|
@@ -387,12 +386,12 @@ function requireNative() {
|
|
|
387
386
|
const binding = require('@napi-rs/webcodecs-linux-arm64-musl')
|
|
388
387
|
const bindingPackageVersion = require('@napi-rs/webcodecs-linux-arm64-musl/package.json').version
|
|
389
388
|
if (
|
|
390
|
-
bindingPackageVersion !== '1.4.
|
|
389
|
+
bindingPackageVersion !== '1.4.1' &&
|
|
391
390
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
392
391
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
393
392
|
) {
|
|
394
393
|
throw new Error(
|
|
395
|
-
`Native binding package version mismatch, expected 1.4.
|
|
394
|
+
`Native binding package version mismatch, expected 1.4.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
396
395
|
)
|
|
397
396
|
}
|
|
398
397
|
return binding
|
|
@@ -409,12 +408,12 @@ function requireNative() {
|
|
|
409
408
|
const binding = require('@napi-rs/webcodecs-linux-arm64-gnu')
|
|
410
409
|
const bindingPackageVersion = require('@napi-rs/webcodecs-linux-arm64-gnu/package.json').version
|
|
411
410
|
if (
|
|
412
|
-
bindingPackageVersion !== '1.4.
|
|
411
|
+
bindingPackageVersion !== '1.4.1' &&
|
|
413
412
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
414
413
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
415
414
|
) {
|
|
416
415
|
throw new Error(
|
|
417
|
-
`Native binding package version mismatch, expected 1.4.
|
|
416
|
+
`Native binding package version mismatch, expected 1.4.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
418
417
|
)
|
|
419
418
|
}
|
|
420
419
|
return binding
|
|
@@ -433,12 +432,12 @@ function requireNative() {
|
|
|
433
432
|
const binding = require('@napi-rs/webcodecs-linux-arm-musleabihf')
|
|
434
433
|
const bindingPackageVersion = require('@napi-rs/webcodecs-linux-arm-musleabihf/package.json').version
|
|
435
434
|
if (
|
|
436
|
-
bindingPackageVersion !== '1.4.
|
|
435
|
+
bindingPackageVersion !== '1.4.1' &&
|
|
437
436
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
438
437
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
439
438
|
) {
|
|
440
439
|
throw new Error(
|
|
441
|
-
`Native binding package version mismatch, expected 1.4.
|
|
440
|
+
`Native binding package version mismatch, expected 1.4.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
442
441
|
)
|
|
443
442
|
}
|
|
444
443
|
return binding
|
|
@@ -455,12 +454,12 @@ function requireNative() {
|
|
|
455
454
|
const binding = require('@napi-rs/webcodecs-linux-arm-gnueabihf')
|
|
456
455
|
const bindingPackageVersion = require('@napi-rs/webcodecs-linux-arm-gnueabihf/package.json').version
|
|
457
456
|
if (
|
|
458
|
-
bindingPackageVersion !== '1.4.
|
|
457
|
+
bindingPackageVersion !== '1.4.1' &&
|
|
459
458
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
460
459
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
461
460
|
) {
|
|
462
461
|
throw new Error(
|
|
463
|
-
`Native binding package version mismatch, expected 1.4.
|
|
462
|
+
`Native binding package version mismatch, expected 1.4.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
464
463
|
)
|
|
465
464
|
}
|
|
466
465
|
return binding
|
|
@@ -479,12 +478,12 @@ function requireNative() {
|
|
|
479
478
|
const binding = require('@napi-rs/webcodecs-linux-loong64-musl')
|
|
480
479
|
const bindingPackageVersion = require('@napi-rs/webcodecs-linux-loong64-musl/package.json').version
|
|
481
480
|
if (
|
|
482
|
-
bindingPackageVersion !== '1.4.
|
|
481
|
+
bindingPackageVersion !== '1.4.1' &&
|
|
483
482
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
484
483
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
485
484
|
) {
|
|
486
485
|
throw new Error(
|
|
487
|
-
`Native binding package version mismatch, expected 1.4.
|
|
486
|
+
`Native binding package version mismatch, expected 1.4.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
488
487
|
)
|
|
489
488
|
}
|
|
490
489
|
return binding
|
|
@@ -501,12 +500,12 @@ function requireNative() {
|
|
|
501
500
|
const binding = require('@napi-rs/webcodecs-linux-loong64-gnu')
|
|
502
501
|
const bindingPackageVersion = require('@napi-rs/webcodecs-linux-loong64-gnu/package.json').version
|
|
503
502
|
if (
|
|
504
|
-
bindingPackageVersion !== '1.4.
|
|
503
|
+
bindingPackageVersion !== '1.4.1' &&
|
|
505
504
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
506
505
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
507
506
|
) {
|
|
508
507
|
throw new Error(
|
|
509
|
-
`Native binding package version mismatch, expected 1.4.
|
|
508
|
+
`Native binding package version mismatch, expected 1.4.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
510
509
|
)
|
|
511
510
|
}
|
|
512
511
|
return binding
|
|
@@ -525,12 +524,12 @@ function requireNative() {
|
|
|
525
524
|
const binding = require('@napi-rs/webcodecs-linux-riscv64-musl')
|
|
526
525
|
const bindingPackageVersion = require('@napi-rs/webcodecs-linux-riscv64-musl/package.json').version
|
|
527
526
|
if (
|
|
528
|
-
bindingPackageVersion !== '1.4.
|
|
527
|
+
bindingPackageVersion !== '1.4.1' &&
|
|
529
528
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
530
529
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
531
530
|
) {
|
|
532
531
|
throw new Error(
|
|
533
|
-
`Native binding package version mismatch, expected 1.4.
|
|
532
|
+
`Native binding package version mismatch, expected 1.4.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
534
533
|
)
|
|
535
534
|
}
|
|
536
535
|
return binding
|
|
@@ -547,12 +546,12 @@ function requireNative() {
|
|
|
547
546
|
const binding = require('@napi-rs/webcodecs-linux-riscv64-gnu')
|
|
548
547
|
const bindingPackageVersion = require('@napi-rs/webcodecs-linux-riscv64-gnu/package.json').version
|
|
549
548
|
if (
|
|
550
|
-
bindingPackageVersion !== '1.4.
|
|
549
|
+
bindingPackageVersion !== '1.4.1' &&
|
|
551
550
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
552
551
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
553
552
|
) {
|
|
554
553
|
throw new Error(
|
|
555
|
-
`Native binding package version mismatch, expected 1.4.
|
|
554
|
+
`Native binding package version mismatch, expected 1.4.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
556
555
|
)
|
|
557
556
|
}
|
|
558
557
|
return binding
|
|
@@ -570,12 +569,12 @@ function requireNative() {
|
|
|
570
569
|
const binding = require('@napi-rs/webcodecs-linux-ppc64-gnu')
|
|
571
570
|
const bindingPackageVersion = require('@napi-rs/webcodecs-linux-ppc64-gnu/package.json').version
|
|
572
571
|
if (
|
|
573
|
-
bindingPackageVersion !== '1.4.
|
|
572
|
+
bindingPackageVersion !== '1.4.1' &&
|
|
574
573
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
575
574
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
576
575
|
) {
|
|
577
576
|
throw new Error(
|
|
578
|
-
`Native binding package version mismatch, expected 1.4.
|
|
577
|
+
`Native binding package version mismatch, expected 1.4.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
579
578
|
)
|
|
580
579
|
}
|
|
581
580
|
return binding
|
|
@@ -592,12 +591,12 @@ function requireNative() {
|
|
|
592
591
|
const binding = require('@napi-rs/webcodecs-linux-s390x-gnu')
|
|
593
592
|
const bindingPackageVersion = require('@napi-rs/webcodecs-linux-s390x-gnu/package.json').version
|
|
594
593
|
if (
|
|
595
|
-
bindingPackageVersion !== '1.4.
|
|
594
|
+
bindingPackageVersion !== '1.4.1' &&
|
|
596
595
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
597
596
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
598
597
|
) {
|
|
599
598
|
throw new Error(
|
|
600
|
-
`Native binding package version mismatch, expected 1.4.
|
|
599
|
+
`Native binding package version mismatch, expected 1.4.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
601
600
|
)
|
|
602
601
|
}
|
|
603
602
|
return binding
|
|
@@ -618,12 +617,12 @@ function requireNative() {
|
|
|
618
617
|
const binding = require('@napi-rs/webcodecs-openharmony-arm64')
|
|
619
618
|
const bindingPackageVersion = require('@napi-rs/webcodecs-openharmony-arm64/package.json').version
|
|
620
619
|
if (
|
|
621
|
-
bindingPackageVersion !== '1.4.
|
|
620
|
+
bindingPackageVersion !== '1.4.1' &&
|
|
622
621
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
623
622
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
624
623
|
) {
|
|
625
624
|
throw new Error(
|
|
626
|
-
`Native binding package version mismatch, expected 1.4.
|
|
625
|
+
`Native binding package version mismatch, expected 1.4.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
627
626
|
)
|
|
628
627
|
}
|
|
629
628
|
return binding
|
|
@@ -640,12 +639,12 @@ function requireNative() {
|
|
|
640
639
|
const binding = require('@napi-rs/webcodecs-openharmony-x64')
|
|
641
640
|
const bindingPackageVersion = require('@napi-rs/webcodecs-openharmony-x64/package.json').version
|
|
642
641
|
if (
|
|
643
|
-
bindingPackageVersion !== '1.4.
|
|
642
|
+
bindingPackageVersion !== '1.4.1' &&
|
|
644
643
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
645
644
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
646
645
|
) {
|
|
647
646
|
throw new Error(
|
|
648
|
-
`Native binding package version mismatch, expected 1.4.
|
|
647
|
+
`Native binding package version mismatch, expected 1.4.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
649
648
|
)
|
|
650
649
|
}
|
|
651
650
|
return binding
|
|
@@ -662,12 +661,12 @@ function requireNative() {
|
|
|
662
661
|
const binding = require('@napi-rs/webcodecs-openharmony-arm')
|
|
663
662
|
const bindingPackageVersion = require('@napi-rs/webcodecs-openharmony-arm/package.json').version
|
|
664
663
|
if (
|
|
665
|
-
bindingPackageVersion !== '1.4.
|
|
664
|
+
bindingPackageVersion !== '1.4.1' &&
|
|
666
665
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
667
666
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
668
667
|
) {
|
|
669
668
|
throw new Error(
|
|
670
|
-
`Native binding package version mismatch, expected 1.4.
|
|
669
|
+
`Native binding package version mismatch, expected 1.4.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
671
670
|
)
|
|
672
671
|
}
|
|
673
672
|
return binding
|
|
@@ -797,9 +796,9 @@ if (!nativeBinding || forceWasi) {
|
|
|
797
796
|
if (!candidateFailed) {
|
|
798
797
|
if (process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
799
798
|
const bindingPackageVersion = require('@napi-rs/webcodecs-wasm32-wasi/package.json').version
|
|
800
|
-
if (bindingPackageVersion !== '1.4.
|
|
799
|
+
if (bindingPackageVersion !== '1.4.1') {
|
|
801
800
|
throw new Error(
|
|
802
|
-
`WASI binding package version mismatch, expected 1.4.
|
|
801
|
+
`WASI binding package version mismatch, expected 1.4.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
803
802
|
)
|
|
804
803
|
}
|
|
805
804
|
}
|
|
@@ -880,6 +879,7 @@ module.exports.getHardwareAccelerators = nativeBinding.getHardwareAccelerators
|
|
|
880
879
|
module.exports.getPreferredHardwareAccelerator = nativeBinding.getPreferredHardwareAccelerator
|
|
881
880
|
module.exports.HardwareAcceleration = nativeBinding.HardwareAcceleration
|
|
882
881
|
module.exports.HevcBitstreamFormat = nativeBinding.HevcBitstreamFormat
|
|
882
|
+
module.exports.HevcSampleEntryJs = nativeBinding.HevcSampleEntryJs
|
|
883
883
|
module.exports.isHardwareAcceleratorAvailable = nativeBinding.isHardwareAcceleratorAvailable
|
|
884
884
|
module.exports.LatencyMode = nativeBinding.LatencyMode
|
|
885
885
|
module.exports.OpusApplication = nativeBinding.OpusApplication
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@napi-rs/webcodecs",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2",
|
|
4
4
|
"description": "WebCodecs API implementation for Node.js using FFmpeg",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"N-API",
|
|
@@ -62,31 +62,31 @@
|
|
|
62
62
|
]
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@emnapi/core": "^
|
|
66
|
-
"@emnapi/runtime": "^
|
|
67
|
-
"@napi-rs/canvas": "^1.0.
|
|
68
|
-
"@napi-rs/cli": "^3.
|
|
69
|
-
"@napi-rs/wasm-runtime": "^1.2.
|
|
70
|
-
"@oxc-node/cli": "^0.1.
|
|
71
|
-
"@oxc-node/core": "^0.1.
|
|
65
|
+
"@emnapi/core": "^2.0.0-alpha.5",
|
|
66
|
+
"@emnapi/runtime": "^2.0.0-alpha.5",
|
|
67
|
+
"@napi-rs/canvas": "^1.0.9",
|
|
68
|
+
"@napi-rs/cli": "^3.9.1",
|
|
69
|
+
"@napi-rs/wasm-runtime": "^1.2.4",
|
|
70
|
+
"@oxc-node/cli": "^0.1.2",
|
|
71
|
+
"@oxc-node/core": "^0.1.2",
|
|
72
72
|
"@taplo/cli": "^0.7.0",
|
|
73
|
-
"@tybys/wasm-util": "^0.10.
|
|
74
|
-
"@types/node": "^26.
|
|
73
|
+
"@tybys/wasm-util": "^0.10.4",
|
|
74
|
+
"@types/node": "^26.5.1",
|
|
75
75
|
"ava": "^8.0.1",
|
|
76
76
|
"chalk": "^6.0.0",
|
|
77
|
-
"emnapi": "^
|
|
77
|
+
"emnapi": "^2.0.0-alpha.5",
|
|
78
78
|
"husky": "^9.1.7",
|
|
79
|
-
"lint-staged": "^17.
|
|
80
|
-
"mediabunny": "1.
|
|
79
|
+
"lint-staged": "^17.5.1",
|
|
80
|
+
"mediabunny": "1.56.2",
|
|
81
81
|
"npm-run-all2": "^9.0.3",
|
|
82
|
-
"oxfmt": "^0.
|
|
83
|
-
"oxlint": "^1.
|
|
82
|
+
"oxfmt": "^0.68.0",
|
|
83
|
+
"oxlint": "^1.83.0",
|
|
84
84
|
"oxlint-tsgolint": "^7.0.2001",
|
|
85
85
|
"prettier": "^3.9.6",
|
|
86
|
-
"tinybench": "^6.
|
|
86
|
+
"tinybench": "^6.2.0",
|
|
87
87
|
"typescript": "^7.0.2",
|
|
88
|
-
"
|
|
89
|
-
"
|
|
88
|
+
"vite-plugin-mkcert": "^2.1.0",
|
|
89
|
+
"webcodecs-polyfill": "^1.0.1"
|
|
90
90
|
},
|
|
91
91
|
"peerDependencies": {
|
|
92
92
|
"@napi-rs/canvas": ">=0.1.0"
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
"armv7-unknown-linux-gnueabihf"
|
|
113
113
|
]
|
|
114
114
|
},
|
|
115
|
-
"packageManager": "pnpm@
|
|
115
|
+
"packageManager": "pnpm@12.4.1",
|
|
116
116
|
"ava": {
|
|
117
117
|
"environmentVariables": {
|
|
118
118
|
"TS_NODE_PROJECT": "./tsconfig.json"
|
|
@@ -138,14 +138,14 @@
|
|
|
138
138
|
"registry": "https://registry.npmjs.org/"
|
|
139
139
|
},
|
|
140
140
|
"optionalDependencies": {
|
|
141
|
-
"@napi-rs/webcodecs-darwin-x64": "1.4.
|
|
142
|
-
"@napi-rs/webcodecs-darwin-arm64": "1.4.
|
|
143
|
-
"@napi-rs/webcodecs-linux-x64-gnu": "1.4.
|
|
144
|
-
"@napi-rs/webcodecs-linux-x64-musl": "1.4.
|
|
145
|
-
"@napi-rs/webcodecs-win32-x64-msvc": "1.4.
|
|
146
|
-
"@napi-rs/webcodecs-linux-arm64-gnu": "1.4.
|
|
147
|
-
"@napi-rs/webcodecs-linux-arm64-musl": "1.4.
|
|
148
|
-
"@napi-rs/webcodecs-win32-arm64-msvc": "1.4.
|
|
149
|
-
"@napi-rs/webcodecs-linux-arm-gnueabihf": "1.4.
|
|
141
|
+
"@napi-rs/webcodecs-darwin-x64": "1.4.2",
|
|
142
|
+
"@napi-rs/webcodecs-darwin-arm64": "1.4.2",
|
|
143
|
+
"@napi-rs/webcodecs-linux-x64-gnu": "1.4.2",
|
|
144
|
+
"@napi-rs/webcodecs-linux-x64-musl": "1.4.2",
|
|
145
|
+
"@napi-rs/webcodecs-win32-x64-msvc": "1.4.2",
|
|
146
|
+
"@napi-rs/webcodecs-linux-arm64-gnu": "1.4.2",
|
|
147
|
+
"@napi-rs/webcodecs-linux-arm64-musl": "1.4.2",
|
|
148
|
+
"@napi-rs/webcodecs-win32-arm64-msvc": "1.4.2",
|
|
149
|
+
"@napi-rs/webcodecs-linux-arm-gnueabihf": "1.4.2"
|
|
150
150
|
}
|
|
151
|
-
}
|
|
151
|
+
}
|