@libmedia/avutil 1.1.0 → 1.2.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.
Files changed (91) hide show
  1. package/dist/cjs/struct/audiosample.cjs +113 -111
  2. package/dist/cjs/struct/audiosample.js.map +1 -1
  3. package/dist/cjs/struct/avbuffer.cjs +274 -269
  4. package/dist/cjs/struct/avbuffer.js.map +1 -1
  5. package/dist/cjs/struct/avcodecparameters.cjs +328 -326
  6. package/dist/cjs/struct/avcodecparameters.js.map +1 -1
  7. package/dist/cjs/struct/avdict.cjs +56 -54
  8. package/dist/cjs/struct/avdict.js.map +1 -1
  9. package/dist/cjs/struct/avframe.cjs +630 -625
  10. package/dist/cjs/struct/avframe.js.map +1 -1
  11. package/dist/cjs/struct/avpacket.cjs +232 -228
  12. package/dist/cjs/struct/avpacket.js.map +1 -1
  13. package/dist/cjs/struct/avpcmbuffer.cjs +116 -113
  14. package/dist/cjs/struct/avpcmbuffer.js.map +1 -1
  15. package/dist/cjs/struct/encryption.cjs +214 -211
  16. package/dist/cjs/struct/encryption.js.map +1 -1
  17. package/dist/cjs/struct/rational.cjs +28 -26
  18. package/dist/cjs/struct/rational.js.map +1 -1
  19. package/dist/esm/AVStream.d.ts +4 -4
  20. package/dist/esm/codecs/aac.d.ts +2 -2
  21. package/dist/esm/codecs/av1.d.ts +2 -2
  22. package/dist/esm/codecs/flac.d.ts +2 -2
  23. package/dist/esm/codecs/h264.d.ts +3 -3
  24. package/dist/esm/codecs/hevc.d.ts +3 -3
  25. package/dist/esm/codecs/mp3.d.ts +2 -2
  26. package/dist/esm/codecs/mpeg4.d.ts +1 -1
  27. package/dist/esm/codecs/mpegvideo.d.ts +1 -1
  28. package/dist/esm/codecs/opus.d.ts +2 -2
  29. package/dist/esm/codecs/vp8.d.ts +3 -3
  30. package/dist/esm/codecs/vp9.d.ts +3 -3
  31. package/dist/esm/codecs/vvc.d.ts +3 -3
  32. package/dist/esm/constant.d.ts +1 -1
  33. package/dist/esm/function/analyzeAVFormat.d.ts +1 -1
  34. package/dist/esm/function/analyzeUrlIOLoader.d.ts +1 -1
  35. package/dist/esm/function/audioData2AVFrame.d.ts +1 -1
  36. package/dist/esm/function/avPCMBuffer2AVFrame.d.ts +2 -2
  37. package/dist/esm/function/avframe2AudioData.d.ts +1 -1
  38. package/dist/esm/function/avframe2VideoFrame.d.ts +2 -2
  39. package/dist/esm/function/avpacket2EncodedAudioChunk.d.ts +1 -1
  40. package/dist/esm/function/avpacket2EncodedVideoChunk.d.ts +1 -1
  41. package/dist/esm/function/constant/webcodecs.d.ts +1 -1
  42. package/dist/esm/function/encodedAudioChunk2AVPacket.d.ts +1 -1
  43. package/dist/esm/function/encodedVideoChunk2AVPacket.d.ts +1 -1
  44. package/dist/esm/function/getAudioCodec.d.ts +1 -1
  45. package/dist/esm/function/getAudioMimeType.d.ts +1 -1
  46. package/dist/esm/function/getVideoCodec.d.ts +1 -1
  47. package/dist/esm/function/getVideoMimeType.d.ts +1 -1
  48. package/dist/esm/function/getWasmUrl.d.ts +1 -1
  49. package/dist/esm/function/hasAlphaChannel.d.ts +1 -1
  50. package/dist/esm/function/isHdr.d.ts +1 -1
  51. package/dist/esm/function/videoFrame2AVFrame.d.ts +2 -2
  52. package/dist/esm/implement/AVFramePoolImpl.d.ts +2 -2
  53. package/dist/esm/implement/AVPCMBufferPoolImpl.d.ts +2 -2
  54. package/dist/esm/implement/AVPacketPoolImpl.d.ts +2 -2
  55. package/dist/esm/index.d.ts +54 -54
  56. package/dist/esm/internal.d.ts +26 -26
  57. package/dist/esm/pixelFormatDescriptor.d.ts +1 -1
  58. package/dist/esm/sampleFormatDescriptor.d.ts +1 -1
  59. package/dist/esm/stringEnum.d.ts +5 -5
  60. package/dist/esm/struct/audiosample.d.ts +1 -1
  61. package/dist/esm/struct/audiosample.js +105 -106
  62. package/dist/esm/struct/avbuffer.js +262 -265
  63. package/dist/esm/struct/avbuffer.js.map +1 -1
  64. package/dist/esm/struct/avcodecparameters.d.ts +7 -7
  65. package/dist/esm/struct/avcodecparameters.js +325 -325
  66. package/dist/esm/struct/avdict.js +50 -51
  67. package/dist/esm/struct/avframe.d.ts +6 -6
  68. package/dist/esm/struct/avframe.js +615 -619
  69. package/dist/esm/struct/avframe.js.map +1 -1
  70. package/dist/esm/struct/avpacket.d.ts +3 -3
  71. package/dist/esm/struct/avpacket.js +220 -223
  72. package/dist/esm/struct/avpacket.js.map +1 -1
  73. package/dist/esm/struct/avpcmbuffer.d.ts +1 -1
  74. package/dist/esm/struct/avpcmbuffer.js +110 -111
  75. package/dist/esm/struct/avsubtitle.d.ts +1 -1
  76. package/dist/esm/struct/encryption.js +205 -207
  77. package/dist/esm/struct/encryption.js.map +1 -1
  78. package/dist/esm/struct/rational.js +25 -25
  79. package/dist/esm/util/avbuffer.d.ts +2 -2
  80. package/dist/esm/util/avdict.d.ts +2 -2
  81. package/dist/esm/util/avframe.d.ts +2 -2
  82. package/dist/esm/util/avpacket.d.ts +2 -2
  83. package/dist/esm/util/channel.d.ts +1 -1
  84. package/dist/esm/util/codecparameters.d.ts +3 -3
  85. package/dist/esm/util/encryption.d.ts +1 -1
  86. package/dist/esm/util/pcm.d.ts +1 -1
  87. package/dist/esm/util/pixel.d.ts +1 -1
  88. package/dist/esm/util/rational.d.ts +1 -1
  89. package/dist/esm/util/sample.d.ts +1 -1
  90. package/dist/esm/util/serialize.d.ts +6 -6
  91. package/package.json +3 -3
@@ -8,30 +8,30 @@ export class AVRational {
8
8
  constructor(init) {
9
9
  init && (this.den = init.den, this.num = init.num);
10
10
  }
11
+ static {
12
+ const prototype = this.prototype, map = new Map;
13
+ map.set("num", {
14
+ 0: 15,
15
+ 1: 0,
16
+ 2: 0,
17
+ 3: 0,
18
+ 4: 0,
19
+ 5: 0,
20
+ 6: 0,
21
+ 7: 0,
22
+ 8: 0
23
+ }), map.set("den", {
24
+ 0: 15,
25
+ 1: 0,
26
+ 2: 0,
27
+ 3: 0,
28
+ 4: 0,
29
+ 5: 0,
30
+ 6: 0,
31
+ 7: 4,
32
+ 8: 0
33
+ }), cheap__definedMetaProperty__0(prototype, cheap__symbolStruct__1, !0), cheap__definedMetaProperty__0(prototype, cheap__symbolStructMaxBaseTypeByteLength__2, 4),
34
+ cheap__definedMetaProperty__0(prototype, cheap__symbolStructLength__3, 8), cheap__definedMetaProperty__0(prototype, cheap__symbolStructKeysMeta__4, map);
35
+ }
11
36
  }
12
-
13
- var prototype, map;
14
-
15
- prototype = AVRational.prototype, (map = new Map).set("num", {
16
- 0: 15,
17
- 1: 0,
18
- 2: 0,
19
- 3: 0,
20
- 4: 0,
21
- 5: 0,
22
- 6: 0,
23
- 7: 0,
24
- 8: 0
25
- }), map.set("den", {
26
- 0: 15,
27
- 1: 0,
28
- 2: 0,
29
- 3: 0,
30
- 4: 0,
31
- 5: 0,
32
- 6: 0,
33
- 7: 4,
34
- 8: 0
35
- }), cheap__definedMetaProperty__0(prototype, cheap__symbolStruct__1, !0), cheap__definedMetaProperty__0(prototype, cheap__symbolStructMaxBaseTypeByteLength__2, 4),
36
- cheap__definedMetaProperty__0(prototype, cheap__symbolStructLength__3, 8), cheap__definedMetaProperty__0(prototype, cheap__symbolStructKeysMeta__4, map);
37
37
  //# sourceMappingURL=rational.js.map
@@ -1,5 +1,5 @@
1
- import type { AVBufferPool } from "../struct/avbuffer.d.ts";
2
- import { AVBuffer, AVBufferRef } from "../struct/avbuffer.d.ts";
1
+ import type { AVBufferPool } from "../struct/avbuffer.ts";
2
+ import { AVBuffer, AVBufferRef } from "../struct/avbuffer.ts";
3
3
  export declare function bufferCreate(buf: pointer<AVBuffer>, data: pointer<uint8>, size: size, free?: pointer<(opaque: pointer<void>, data: pointer<uint8>) => void>, opaque?: pointer<void>, flags?: int32): pointer<AVBufferRef>;
4
4
  export declare function avbufferCreate(data: pointer<uint8>, size: size, free?: pointer<(opaque: pointer<void>, data: pointer<uint8>) => void>, opaque?: pointer<void>, flags?: int32): pointer<AVBufferRef>;
5
5
  export declare function avbufferAlloc(size: size): pointer<AVBufferRef>;
@@ -1,5 +1,5 @@
1
- import type { AVDictionary } from "../struct/avdict.d.ts";
2
- import { AVDictionaryEntry } from "../struct/avdict.d.ts";
1
+ import type { AVDictionary } from "../struct/avdict.ts";
2
+ import { AVDictionaryEntry } from "../struct/avdict.ts";
3
3
  export declare function freeAVDict(pm: pointer<pointer<AVDictionary>>): void;
4
4
  export declare function freeAVDict2(m: pointer<AVDictionary>): void;
5
5
  export declare function avDictCount(m: pointer<AVDictionary>): 0 | int32;
@@ -1,5 +1,5 @@
1
- import type { AVFrameSideDataType } from "../struct/avframe.d.ts";
2
- import AVFrame, { AVFrameSideData } from "../struct/avframe.d.ts";
1
+ import type { AVFrameSideDataType } from "../struct/avframe.ts";
2
+ import AVFrame, { AVFrameSideData } from "../struct/avframe.ts";
3
3
  export declare enum AV_FRAME_SIDE_DATA_FLAG {
4
4
  UNIQUE = 1
5
5
  }
@@ -1,5 +1,5 @@
1
- import AVPacket, { AVPacketSideData } from "../struct/avpacket.d.ts";
2
- import type { AVPacketSideDataType } from "../codec.d.ts";
1
+ import AVPacket, { AVPacketSideData } from "../struct/avpacket.ts";
2
+ import type { AVPacketSideDataType } from "../codec.ts";
3
3
  import { type SafeUint8Array } from "@libmedia/cheap";
4
4
  export declare function getAVPacketData(avpacket: pointer<AVPacket>): Uint8Array<ArrayBufferLike>;
5
5
  export declare function getAVPacketData(avpacket: pointer<AVPacket>, safe: boolean): SafeUint8Array;
@@ -1,4 +1,4 @@
1
- import type { AVChannelLayout } from "../struct/audiosample.d.ts";
1
+ import type { AVChannelLayout } from "../struct/audiosample.ts";
2
2
  export declare function getChannelLayoutNBChannels(layout: uint64): number;
3
3
  export declare function unInitChannelLayout(channelLayout: pointer<AVChannelLayout>): void;
4
4
  export declare function setChannelLayoutFromMask(channelLayout: pointer<AVChannelLayout>, mask: uint64): 0 | -3;
@@ -1,6 +1,6 @@
1
- import type AVCodecParameters from "../struct/avcodecparameters.d.ts";
2
- export { default as isHdr } from '../function/isHdr.d.ts';
3
- export { default as hasAlphaChannel } from '../function/hasAlphaChannel.d.ts';
1
+ import type AVCodecParameters from "../struct/avcodecparameters.ts";
2
+ export { default as isHdr } from '../function/isHdr.ts';
3
+ export { default as hasAlphaChannel } from '../function/hasAlphaChannel.ts';
4
4
  export declare function copyCodecParameters(dst: pointer<AVCodecParameters>, src: pointer<AVCodecParameters>): void;
5
5
  export declare function resetCodecParameters(par: pointer<AVCodecParameters>): void;
6
6
  export declare function freeCodecParameters(par: pointer<AVCodecParameters>): void;
@@ -1,4 +1,4 @@
1
- import type { EncryptionInfo, EncryptionInitInfo } from "../struct/encryption.d.ts";
1
+ import type { EncryptionInfo, EncryptionInitInfo } from "../struct/encryption.ts";
2
2
  import { type Uint8ArrayInterface } from "@libmedia/common/io";
3
3
  export declare function encryptionSideData2Info(buffer: Uint8ArrayInterface): EncryptionInfo;
4
4
  export declare function encryptionInfo2SideData(info: EncryptionInfo): Uint8Array;
@@ -1,4 +1,4 @@
1
- import { AVCodecID } from "../codec.d.ts";
1
+ import { AVCodecID } from "../codec.ts";
2
2
  export declare function getPcmCodecId(bps: int32, flt: boolean, be: boolean, flags: int32): AVCodecID.AV_CODEC_ID_NONE | AVCodecID.AV_CODEC_ID_FIRST_AUDIO | AVCodecID.AV_CODEC_ID_PCM_S16BE | AVCodecID.AV_CODEC_ID_PCM_U16LE | AVCodecID.AV_CODEC_ID_PCM_U16BE | AVCodecID.AV_CODEC_ID_PCM_S8 | AVCodecID.AV_CODEC_ID_PCM_U8 | AVCodecID.AV_CODEC_ID_PCM_S32LE | AVCodecID.AV_CODEC_ID_PCM_S32BE | AVCodecID.AV_CODEC_ID_PCM_U32LE | AVCodecID.AV_CODEC_ID_PCM_U32BE | AVCodecID.AV_CODEC_ID_PCM_S24LE | AVCodecID.AV_CODEC_ID_PCM_S24BE | AVCodecID.AV_CODEC_ID_PCM_U24LE | AVCodecID.AV_CODEC_ID_PCM_U24BE | AVCodecID.AV_CODEC_ID_PCM_F32BE | AVCodecID.AV_CODEC_ID_PCM_F32LE | AVCodecID.AV_CODEC_ID_PCM_F64BE | AVCodecID.AV_CODEC_ID_PCM_F64LE | AVCodecID.AV_CODEC_ID_PCM_S64LE | AVCodecID.AV_CODEC_ID_PCM_S64BE;
3
3
  export declare function getExactBitsPerSample(codecId: AVCodecID): 0 | 4 | 8 | 16 | 32 | 64 | 24;
4
4
  export declare function getBitsPerSample(codecId: AVCodecID): 0 | 2 | 3 | 4 | 8 | 16 | 32 | 64 | 24;
@@ -1,4 +1,4 @@
1
- import { AVChromaLocation, AVPixelFormat } from "../pixfmt.d.ts";
1
+ import { AVChromaLocation, AVPixelFormat } from "../pixfmt.ts";
2
2
  export declare function chromaLocation2Pos(pos: AVChromaLocation): {
3
3
  x: number;
4
4
  y: number;
@@ -1,4 +1,4 @@
1
- import type { AVRational } from "../struct/rational.d.ts";
1
+ import type { AVRational } from "../struct/rational.ts";
2
2
  /**
3
3
  * 将一个时间戳由一个时间基转换到另一个时间基
4
4
  *
@@ -1,4 +1,4 @@
1
- import { AVSampleFormat } from "../audiosamplefmt.d.ts";
1
+ import { AVSampleFormat } from "../audiosamplefmt.ts";
2
2
  export declare function getBytesPerSample(format: AVSampleFormat): number;
3
3
  export declare function sampleFormatIsPlanar(format: AVSampleFormat): boolean;
4
4
  export declare function sampleFormatGetLinesize(format: AVSampleFormat, channels: int32, nbSamples: int32, align?: int32): number;
@@ -1,9 +1,9 @@
1
- import type { AVCodecID, AVMediaType, AVPacketSideDataType } from "../codec.d.ts";
2
- import type AVPacket from "../struct/avpacket.d.ts";
3
- import type { AVRational } from "../struct/rational.d.ts";
4
- import type { AVChromaLocation, AVColorPrimaries, AVColorRange, AVColorSpace, AVColorTransferCharacteristic, AVFieldOrder, AVPixelFormat } from "../pixfmt.d.ts";
5
- import type { AVChannelOrder, AVSampleFormat } from "../audiosamplefmt.d.ts";
6
- import AVCodecParameters from "../struct/avcodecparameters.d.ts";
1
+ import type { AVCodecID, AVMediaType, AVPacketSideDataType } from "../codec.ts";
2
+ import type AVPacket from "../struct/avpacket.ts";
3
+ import type { AVRational } from "../struct/rational.ts";
4
+ import type { AVChromaLocation, AVColorPrimaries, AVColorRange, AVColorSpace, AVColorTransferCharacteristic, AVFieldOrder, AVPixelFormat } from "../pixfmt.ts";
5
+ import type { AVChannelOrder, AVSampleFormat } from "../audiosamplefmt.ts";
6
+ import AVCodecParameters from "../struct/avcodecparameters.ts";
7
7
  export interface AVPacketSerialize {
8
8
  pts: int64;
9
9
  dts: int64;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@libmedia/avutil",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "libmedia 工具模块",
5
5
  "sideEffects": false,
6
6
  "repository": {
@@ -18,8 +18,8 @@
18
18
  "author": "Gaoxing Zhao",
19
19
  "license": "LGPL-3.0-or-later",
20
20
  "dependencies": {
21
- "@libmedia/common": "~2.1.0",
22
- "@libmedia/cheap": "~1.1.0"
21
+ "@libmedia/common": "~2.2.0",
22
+ "@libmedia/cheap": "~1.2.0"
23
23
  },
24
24
  "type": "module",
25
25
  "types": "./dist/esm/index.d.ts",