@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.
- package/dist/cjs/struct/audiosample.cjs +113 -111
- package/dist/cjs/struct/audiosample.js.map +1 -1
- package/dist/cjs/struct/avbuffer.cjs +274 -269
- package/dist/cjs/struct/avbuffer.js.map +1 -1
- package/dist/cjs/struct/avcodecparameters.cjs +328 -326
- package/dist/cjs/struct/avcodecparameters.js.map +1 -1
- package/dist/cjs/struct/avdict.cjs +56 -54
- package/dist/cjs/struct/avdict.js.map +1 -1
- package/dist/cjs/struct/avframe.cjs +630 -625
- package/dist/cjs/struct/avframe.js.map +1 -1
- package/dist/cjs/struct/avpacket.cjs +232 -228
- package/dist/cjs/struct/avpacket.js.map +1 -1
- package/dist/cjs/struct/avpcmbuffer.cjs +116 -113
- package/dist/cjs/struct/avpcmbuffer.js.map +1 -1
- package/dist/cjs/struct/encryption.cjs +214 -211
- package/dist/cjs/struct/encryption.js.map +1 -1
- package/dist/cjs/struct/rational.cjs +28 -26
- package/dist/cjs/struct/rational.js.map +1 -1
- package/dist/esm/AVStream.d.ts +4 -4
- package/dist/esm/codecs/aac.d.ts +2 -2
- package/dist/esm/codecs/av1.d.ts +2 -2
- package/dist/esm/codecs/flac.d.ts +2 -2
- package/dist/esm/codecs/h264.d.ts +3 -3
- package/dist/esm/codecs/hevc.d.ts +3 -3
- package/dist/esm/codecs/mp3.d.ts +2 -2
- package/dist/esm/codecs/mpeg4.d.ts +1 -1
- package/dist/esm/codecs/mpegvideo.d.ts +1 -1
- package/dist/esm/codecs/opus.d.ts +2 -2
- package/dist/esm/codecs/vp8.d.ts +3 -3
- package/dist/esm/codecs/vp9.d.ts +3 -3
- package/dist/esm/codecs/vvc.d.ts +3 -3
- package/dist/esm/constant.d.ts +1 -1
- package/dist/esm/function/analyzeAVFormat.d.ts +1 -1
- package/dist/esm/function/analyzeUrlIOLoader.d.ts +1 -1
- package/dist/esm/function/audioData2AVFrame.d.ts +1 -1
- package/dist/esm/function/avPCMBuffer2AVFrame.d.ts +2 -2
- package/dist/esm/function/avframe2AudioData.d.ts +1 -1
- package/dist/esm/function/avframe2VideoFrame.d.ts +2 -2
- package/dist/esm/function/avpacket2EncodedAudioChunk.d.ts +1 -1
- package/dist/esm/function/avpacket2EncodedVideoChunk.d.ts +1 -1
- package/dist/esm/function/constant/webcodecs.d.ts +1 -1
- package/dist/esm/function/encodedAudioChunk2AVPacket.d.ts +1 -1
- package/dist/esm/function/encodedVideoChunk2AVPacket.d.ts +1 -1
- package/dist/esm/function/getAudioCodec.d.ts +1 -1
- package/dist/esm/function/getAudioMimeType.d.ts +1 -1
- package/dist/esm/function/getVideoCodec.d.ts +1 -1
- package/dist/esm/function/getVideoMimeType.d.ts +1 -1
- package/dist/esm/function/getWasmUrl.d.ts +1 -1
- package/dist/esm/function/hasAlphaChannel.d.ts +1 -1
- package/dist/esm/function/isHdr.d.ts +1 -1
- package/dist/esm/function/videoFrame2AVFrame.d.ts +2 -2
- package/dist/esm/implement/AVFramePoolImpl.d.ts +2 -2
- package/dist/esm/implement/AVPCMBufferPoolImpl.d.ts +2 -2
- package/dist/esm/implement/AVPacketPoolImpl.d.ts +2 -2
- package/dist/esm/index.d.ts +54 -54
- package/dist/esm/internal.d.ts +26 -26
- package/dist/esm/pixelFormatDescriptor.d.ts +1 -1
- package/dist/esm/sampleFormatDescriptor.d.ts +1 -1
- package/dist/esm/stringEnum.d.ts +5 -5
- package/dist/esm/struct/audiosample.d.ts +1 -1
- package/dist/esm/struct/audiosample.js +105 -106
- package/dist/esm/struct/avbuffer.js +262 -265
- package/dist/esm/struct/avbuffer.js.map +1 -1
- package/dist/esm/struct/avcodecparameters.d.ts +7 -7
- package/dist/esm/struct/avcodecparameters.js +325 -325
- package/dist/esm/struct/avdict.js +50 -51
- package/dist/esm/struct/avframe.d.ts +6 -6
- package/dist/esm/struct/avframe.js +615 -619
- package/dist/esm/struct/avframe.js.map +1 -1
- package/dist/esm/struct/avpacket.d.ts +3 -3
- package/dist/esm/struct/avpacket.js +220 -223
- package/dist/esm/struct/avpacket.js.map +1 -1
- package/dist/esm/struct/avpcmbuffer.d.ts +1 -1
- package/dist/esm/struct/avpcmbuffer.js +110 -111
- package/dist/esm/struct/avsubtitle.d.ts +1 -1
- package/dist/esm/struct/encryption.js +205 -207
- package/dist/esm/struct/encryption.js.map +1 -1
- package/dist/esm/struct/rational.js +25 -25
- package/dist/esm/util/avbuffer.d.ts +2 -2
- package/dist/esm/util/avdict.d.ts +2 -2
- package/dist/esm/util/avframe.d.ts +2 -2
- package/dist/esm/util/avpacket.d.ts +2 -2
- package/dist/esm/util/channel.d.ts +1 -1
- package/dist/esm/util/codecparameters.d.ts +3 -3
- package/dist/esm/util/encryption.d.ts +1 -1
- package/dist/esm/util/pcm.d.ts +1 -1
- package/dist/esm/util/pixel.d.ts +1 -1
- package/dist/esm/util/rational.d.ts +1 -1
- package/dist/esm/util/sample.d.ts +1 -1
- package/dist/esm/util/serialize.d.ts +6 -6
- 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.
|
|
2
|
-
import { AVBuffer, AVBufferRef } from "../struct/avbuffer.
|
|
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.
|
|
2
|
-
import { AVDictionaryEntry } from "../struct/avdict.
|
|
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.
|
|
2
|
-
import AVFrame, { AVFrameSideData } from "../struct/avframe.
|
|
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.
|
|
2
|
-
import type { AVPacketSideDataType } from "../codec.
|
|
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.
|
|
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.
|
|
2
|
-
export { default as isHdr } from '../function/isHdr.
|
|
3
|
-
export { default as hasAlphaChannel } from '../function/hasAlphaChannel.
|
|
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.
|
|
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;
|
package/dist/esm/util/pcm.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AVCodecID } from "../codec.
|
|
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;
|
package/dist/esm/util/pixel.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AVSampleFormat } from "../audiosamplefmt.
|
|
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.
|
|
2
|
-
import type AVPacket from "../struct/avpacket.
|
|
3
|
-
import type { AVRational } from "../struct/rational.
|
|
4
|
-
import type { AVChromaLocation, AVColorPrimaries, AVColorRange, AVColorSpace, AVColorTransferCharacteristic, AVFieldOrder, AVPixelFormat } from "../pixfmt.
|
|
5
|
-
import type { AVChannelOrder, AVSampleFormat } from "../audiosamplefmt.
|
|
6
|
-
import AVCodecParameters from "../struct/avcodecparameters.
|
|
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.
|
|
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.
|
|
22
|
-
"@libmedia/cheap": "~1.
|
|
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",
|