@remotion/media-parser 4.0.229 → 4.0.230
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/boxes/iso-base-media/esds/decoder-specific-config.d.ts +3 -2
- package/dist/boxes/iso-base-media/esds/decoder-specific-config.js +7 -8
- package/dist/boxes/iso-base-media/esds/esds-descriptors.d.ts +4 -2
- package/dist/boxes/iso-base-media/esds/esds-descriptors.js +5 -4
- package/dist/boxes/iso-base-media/esds/esds.d.ts +3 -1
- package/dist/boxes/iso-base-media/esds/esds.js +2 -2
- package/dist/boxes/iso-base-media/make-track.js +2 -1
- package/dist/boxes/iso-base-media/mdat/mdat.js +13 -7
- package/dist/boxes/iso-base-media/moov/moov.d.ts +3 -1
- package/dist/boxes/iso-base-media/moov/moov.js +2 -2
- package/dist/boxes/iso-base-media/mvhd.js +11 -9
- package/dist/boxes/iso-base-media/parse-icc-profile.d.ts +36 -0
- package/dist/boxes/iso-base-media/parse-icc-profile.js +115 -0
- package/dist/boxes/iso-base-media/process-box.d.ts +5 -4
- package/dist/boxes/iso-base-media/process-box.js +17 -14
- package/dist/boxes/iso-base-media/stsd/colr.d.ts +14 -4
- package/dist/boxes/iso-base-media/stsd/colr.js +13 -1
- package/dist/boxes/iso-base-media/stsd/mebx.d.ts +1 -2
- package/dist/boxes/iso-base-media/stsd/mebx.js +2 -2
- package/dist/boxes/iso-base-media/stsd/samples.d.ts +5 -2
- package/dist/boxes/iso-base-media/stsd/samples.js +7 -6
- package/dist/boxes/iso-base-media/stsd/stsd.js +1 -0
- package/dist/boxes/iso-base-media/to-date.d.ts +1 -0
- package/dist/boxes/iso-base-media/to-date.js +9 -1
- package/dist/boxes/iso-base-media/trak/trak.d.ts +3 -1
- package/dist/boxes/iso-base-media/trak/trak.js +2 -2
- package/dist/boxes/webm/av1-codec-private.js +1 -1
- package/dist/boxes/webm/ebml.d.ts +1 -1
- package/dist/boxes/webm/get-sample-from-block.d.ts +4 -4
- package/dist/boxes/webm/get-sample-from-block.js +4 -2
- package/dist/boxes/webm/make-track.js +1 -0
- package/dist/buffer-iterator.d.ts +1 -1
- package/dist/buffer-iterator.js +1 -8
- package/dist/create/iso-base-media/codec-specific/avc1.d.ts +2 -0
- package/dist/create/iso-base-media/codec-specific/avc1.js +48 -0
- package/dist/create/iso-base-media/codec-specific/create-codec-specific-data.d.ts +22 -0
- package/dist/create/iso-base-media/codec-specific/create-codec-specific-data.js +36 -0
- package/dist/create/iso-base-media/codec-specific/mp4a.d.ts +2 -0
- package/dist/create/iso-base-media/codec-specific/mp4a.js +90 -0
- package/dist/create/iso-base-media/create-colr.d.ts +6 -0
- package/dist/create/iso-base-media/create-colr.js +26 -0
- package/dist/create/iso-base-media/create-ftyp.d.ts +10 -0
- package/dist/create/iso-base-media/create-ftyp.js +22 -0
- package/dist/create/iso-base-media/create-ilst.d.ts +1 -0
- package/dist/create/iso-base-media/create-ilst.js +14 -0
- package/dist/create/iso-base-media/create-iso-base-media.d.ts +2 -0
- package/dist/create/iso-base-media/create-iso-base-media.js +168 -0
- package/dist/create/iso-base-media/create-mdia.d.ts +5 -0
- package/dist/create/iso-base-media/create-mdia.js +18 -0
- package/dist/create/iso-base-media/create-moov.d.ts +5 -0
- package/dist/create/iso-base-media/create-moov.js +18 -0
- package/dist/create/iso-base-media/create-mvhd.d.ts +10 -0
- package/dist/create/iso-base-media/create-mvhd.js +48 -0
- package/dist/create/iso-base-media/create-trak.d.ts +4 -0
- package/dist/create/iso-base-media/create-trak.js +17 -0
- package/dist/create/iso-base-media/create-udta.d.ts +1 -0
- package/dist/create/iso-base-media/create-udta.js +14 -0
- package/dist/create/iso-base-media/create-url.d.ts +1 -0
- package/dist/create/iso-base-media/create-url.js +16 -0
- package/dist/create/iso-base-media/example-stts.d.ts +3 -0
- package/dist/create/iso-base-media/example-stts.js +2797 -0
- package/dist/create/iso-base-media/ilst/create-cmt.d.ts +1 -0
- package/dist/create/iso-base-media/ilst/create-cmt.js +26 -0
- package/dist/create/iso-base-media/ilst/create-too.d.ts +1 -0
- package/dist/create/iso-base-media/ilst/create-too.js +27 -0
- package/dist/create/iso-base-media/mdia/create-mdhd.d.ts +6 -0
- package/dist/create/iso-base-media/mdia/create-mdhd.js +33 -0
- package/dist/create/iso-base-media/mp4-header.d.ts +6 -0
- package/dist/create/iso-base-media/mp4-header.js +47 -0
- package/dist/create/iso-base-media/primitives.d.ts +15 -0
- package/dist/create/iso-base-media/primitives.js +133 -0
- package/dist/create/iso-base-media/serialize-track.d.ts +9 -0
- package/dist/create/iso-base-media/serialize-track.js +63 -0
- package/dist/create/iso-base-media/trak/create-tkhd.d.ts +27 -0
- package/dist/create/iso-base-media/trak/create-tkhd.js +97 -0
- package/dist/create/iso-base-media/trak/mdia/create-minf.d.ts +4 -0
- package/dist/create/iso-base-media/trak/mdia/create-minf.js +19 -0
- package/dist/create/iso-base-media/trak/mdia/minf/create-dinf.d.ts +1 -0
- package/dist/create/iso-base-media/trak/mdia/minf/create-dinf.js +22 -0
- package/dist/create/iso-base-media/trak/mdia/minf/create-smhd.d.ts +1 -0
- package/dist/create/iso-base-media/trak/mdia/minf/create-smhd.js +20 -0
- package/dist/create/iso-base-media/trak/mdia/minf/create-stbl.d.ts +6 -0
- package/dist/create/iso-base-media/trak/mdia/minf/create-stbl.js +35 -0
- package/dist/create/iso-base-media/trak/mdia/minf/create-vmhd.d.ts +1 -0
- package/dist/create/iso-base-media/trak/mdia/minf/create-vmhd.js +20 -0
- package/dist/create/iso-base-media/trak/mdia/minf/stbl/create-ctts.d.ts +2 -0
- package/dist/create/iso-base-media/trak/mdia/minf/stbl/create-ctts.js +45 -0
- package/dist/create/iso-base-media/trak/mdia/minf/stbl/create-stco.d.ts +2 -0
- package/dist/create/iso-base-media/trak/mdia/minf/stbl/create-stco.js +28 -0
- package/dist/create/iso-base-media/trak/mdia/minf/stbl/create-stsc.d.ts +2 -0
- package/dist/create/iso-base-media/trak/mdia/minf/stbl/create-stsc.js +56 -0
- package/dist/create/iso-base-media/trak/mdia/minf/stbl/create-stss.d.ts +2 -0
- package/dist/create/iso-base-media/trak/mdia/minf/stbl/create-stss.js +23 -0
- package/dist/create/iso-base-media/trak/mdia/minf/stbl/create-stsz.d.ts +2 -0
- package/dist/create/iso-base-media/trak/mdia/minf/stbl/create-stsz.js +25 -0
- package/dist/create/iso-base-media/trak/mdia/minf/stbl/create-stts.d.ts +2 -0
- package/dist/create/iso-base-media/trak/mdia/minf/stbl/create-stts.js +48 -0
- package/dist/create/iso-base-media/trak/mdia/minf/stbl/stsd/create-avc1.d.ts +1 -0
- package/dist/create/iso-base-media/trak/mdia/minf/stbl/stsd/create-avc1.js +20 -0
- package/dist/create/iso-base-media/trak/mdia/minf/stbl/stsd/create-avcc.d.ts +1 -0
- package/dist/create/iso-base-media/trak/mdia/minf/stbl/stsd/create-avcc.js +16 -0
- package/dist/create/iso-base-media/trak/mdia/minf/stbl/stsd/create-pasp.d.ts +1 -0
- package/dist/create/iso-base-media/trak/mdia/minf/stbl/stsd/create-pasp.js +13 -0
- package/dist/create/iso-base-media/udta/create-meta.d.ts +4 -0
- package/dist/create/iso-base-media/udta/create-meta.js +20 -0
- package/dist/create/iso-base-media/udta/meta/create-hdlr.d.ts +1 -0
- package/dist/create/iso-base-media/udta/meta/create-hdlr.js +32 -0
- package/dist/create/make-track-info.d.ts +20 -0
- package/dist/create/make-track-info.js +2 -0
- package/dist/create/{cluster-segment.d.ts → matroska/cluster-segment.d.ts} +1 -1
- package/dist/create/{cluster-segment.js → matroska/cluster-segment.js} +2 -2
- package/dist/create/{cluster.d.ts → matroska/cluster.d.ts} +6 -5
- package/dist/create/{cluster.js → matroska/cluster.js} +16 -16
- package/dist/create/matroska/create-matroska-media.d.ts +2 -0
- package/dist/create/{create-media.js → matroska/create-matroska-media.js} +25 -18
- package/dist/create/matroska/make-duration-with-padding.d.ts +1 -0
- package/dist/create/{make-duration-with-padding.js → matroska/make-duration-with-padding.js} +1 -1
- package/dist/create/{matroska-cues.d.ts → matroska/matroska-cues.d.ts} +1 -1
- package/dist/create/{matroska-cues.js → matroska/matroska-cues.js} +1 -1
- package/dist/create/matroska/matroska-header.d.ts +1 -0
- package/dist/create/{matroska-header.js → matroska/matroska-header.js} +1 -1
- package/dist/create/{matroska-info.d.ts → matroska/matroska-info.d.ts} +1 -1
- package/dist/create/{matroska-info.js → matroska/matroska-info.js} +1 -1
- package/dist/create/matroska/matroska-seek.d.ts +6 -0
- package/dist/create/{matroska-seek.js → matroska/matroska-seek.js} +1 -1
- package/dist/create/{matroska-segment.d.ts → matroska/matroska-segment.d.ts} +1 -1
- package/dist/create/{matroska-segment.js → matroska/matroska-segment.js} +1 -1
- package/dist/create/matroska/matroska-trackentry.d.ts +10 -0
- package/dist/create/{matroska-trackentry.js → matroska/matroska-trackentry.js} +9 -3
- package/dist/create/{create-media.d.ts → media-fn.d.ts} +16 -4
- package/dist/create/media-fn.js +2 -0
- package/dist/create/timescale.d.ts +1 -1
- package/dist/create/timescale.js +2 -2
- package/dist/esm/buffer.mjs +1 -1
- package/dist/esm/index.mjs +1452 -209
- package/dist/get-audio-codec.d.ts +1 -0
- package/dist/get-audio-codec.js +27 -3
- package/dist/get-fps.d.ts +1 -0
- package/dist/get-fps.js +17 -13
- package/dist/get-sample-positions.d.ts +1 -0
- package/dist/get-sample-positions.js +1 -0
- package/dist/get-tracks.d.ts +1 -0
- package/dist/get-video-codec.js +4 -0
- package/dist/index.d.ts +4 -7
- package/dist/index.js +4 -2
- package/dist/options.d.ts +2 -0
- package/dist/parse-media.js +2 -1
- package/dist/parse-video.d.ts +3 -1
- package/dist/parse-video.js +3 -14
- package/dist/parser-state.d.ts +3 -3
- package/dist/samples-from-moof.js +1 -0
- package/dist/webcodec-sample-types.d.ts +7 -20
- package/dist/writers/buffer-implementation/writer.js +1 -1
- package/package.json +3 -3
- package/dist/create/make-duration-with-padding.d.ts +0 -1
- package/dist/create/matroska-header.d.ts +0 -1
- package/dist/create/matroska-seek.d.ts +0 -6
- package/dist/create/matroska-trackentry.d.ts +0 -27
- package/dist/create/polyfill-audio-sample.d.ts +0 -3
- package/dist/create/polyfill-audio-sample.js +0 -15
- package/dist/writers/buffer-implementation/multi-buffer.d.ts +0 -0
- package/dist/writers/buffer-implementation/multi-buffer.js +0 -1
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import type { BufferIterator } from '../../../buffer-iterator';
|
|
2
|
+
import type { LogLevel } from '../../../log';
|
|
2
3
|
type UnknownDecoderSpecificConfig = {
|
|
3
4
|
type: 'unknown-decoder-specific-config';
|
|
4
5
|
};
|
|
5
6
|
type AudioSpecificConfig = {
|
|
6
|
-
type: '
|
|
7
|
+
type: 'mp4a-specific-config';
|
|
7
8
|
audioObjectType: number;
|
|
8
9
|
samplingFrequencyIndex: number;
|
|
9
10
|
channelConfiguration: number;
|
|
10
11
|
asBytes: Uint8Array;
|
|
11
12
|
};
|
|
12
13
|
export type DecoderSpecificConfig = UnknownDecoderSpecificConfig | AudioSpecificConfig;
|
|
13
|
-
export declare const parseDecoderSpecificConfig: (iterator: BufferIterator) => DecoderSpecificConfig;
|
|
14
|
+
export declare const parseDecoderSpecificConfig: (iterator: BufferIterator, logLevel: LogLevel) => DecoderSpecificConfig;
|
|
14
15
|
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.parseDecoderSpecificConfig = void 0;
|
|
4
|
-
const
|
|
4
|
+
const log_1 = require("../../../log");
|
|
5
|
+
const parseDecoderSpecificConfig = (iterator, logLevel) => {
|
|
5
6
|
const layerTag = iterator.getUint8();
|
|
6
7
|
const layerSize = iterator.getPaddedFourByteNumber();
|
|
7
8
|
const start = iterator.counter.getOffset();
|
|
@@ -27,17 +28,15 @@ const parseDecoderSpecificConfig = (iterator) => {
|
|
|
27
28
|
if (read < layerSize) {
|
|
28
29
|
iterator.discard(layerSize - read);
|
|
29
30
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
? new Uint8Array([17, 144])
|
|
34
|
-
: bytes;
|
|
31
|
+
if (bytes.byteLength === 2 && bytes[0] === 17 && bytes[1] === 136) {
|
|
32
|
+
log_1.Log.warn(logLevel, 'Chrome has a bug and might not be able to decode this audio. It will be fixed, see: https://issues.chromium.org/issues/360083330');
|
|
33
|
+
}
|
|
35
34
|
return {
|
|
36
|
-
type: '
|
|
35
|
+
type: 'mp4a-specific-config',
|
|
37
36
|
audioObjectType,
|
|
38
37
|
samplingFrequencyIndex,
|
|
39
38
|
channelConfiguration,
|
|
40
|
-
asBytes:
|
|
39
|
+
asBytes: bytes,
|
|
41
40
|
};
|
|
42
41
|
};
|
|
43
42
|
exports.parseDecoderSpecificConfig = parseDecoderSpecificConfig;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { BufferIterator } from '../../../buffer-iterator';
|
|
2
|
+
import type { LogLevel } from '../../../log';
|
|
2
3
|
import type { DecoderSpecificConfig } from './decoder-specific-config';
|
|
3
4
|
type AudioObjectType = 'aac' | 'mp3' | 'unknown';
|
|
4
5
|
type DecoderConfigDescriptor = {
|
|
@@ -22,8 +23,9 @@ export type Descriptor = DecoderConfigDescriptor | SlConfigDescriptor | UnknownD
|
|
|
22
23
|
type DescriptorAndNext = {
|
|
23
24
|
descriptor: Descriptor | null;
|
|
24
25
|
};
|
|
25
|
-
export declare const processDescriptor: ({ iterator, }: {
|
|
26
|
+
export declare const processDescriptor: ({ iterator, logLevel, }: {
|
|
26
27
|
iterator: BufferIterator;
|
|
28
|
+
logLevel: LogLevel;
|
|
27
29
|
}) => DescriptorAndNext;
|
|
28
|
-
export declare const parseDescriptors: (iterator: BufferIterator, maxBytes: number) => Descriptor[];
|
|
30
|
+
export declare const parseDescriptors: (iterator: BufferIterator, maxBytes: number, logLevel: LogLevel) => Descriptor[];
|
|
29
31
|
export {};
|
|
@@ -14,7 +14,7 @@ const mapToObjectAudioIndicator = (num) => {
|
|
|
14
14
|
}
|
|
15
15
|
return 'unknown';
|
|
16
16
|
};
|
|
17
|
-
const processDescriptor = ({ iterator, }) => {
|
|
17
|
+
const processDescriptor = ({ iterator, logLevel, }) => {
|
|
18
18
|
const tag = iterator.getUint8();
|
|
19
19
|
if (tag === 4) {
|
|
20
20
|
const size = iterator.getPaddedFourByteNumber();
|
|
@@ -30,8 +30,8 @@ const processDescriptor = ({ iterator, }) => {
|
|
|
30
30
|
const maxBitrate = iterator.getUint32();
|
|
31
31
|
const avgBitrate = iterator.getUint32();
|
|
32
32
|
const decoderSpecificConfigs = [];
|
|
33
|
-
while (size - (iterator.counter.getOffset() - initialOffset)
|
|
34
|
-
const decoderSpecificConfig = (0, decoder_specific_config_1.parseDecoderSpecificConfig)(iterator);
|
|
33
|
+
while (size - (iterator.counter.getOffset() - initialOffset) > 0) {
|
|
34
|
+
const decoderSpecificConfig = (0, decoder_specific_config_1.parseDecoderSpecificConfig)(iterator, logLevel);
|
|
35
35
|
decoderSpecificConfigs.push(decoderSpecificConfig);
|
|
36
36
|
}
|
|
37
37
|
return {
|
|
@@ -62,13 +62,14 @@ const processDescriptor = ({ iterator, }) => {
|
|
|
62
62
|
};
|
|
63
63
|
};
|
|
64
64
|
exports.processDescriptor = processDescriptor;
|
|
65
|
-
const parseDescriptors = (iterator, maxBytes) => {
|
|
65
|
+
const parseDescriptors = (iterator, maxBytes, logLevel) => {
|
|
66
66
|
const descriptors = [];
|
|
67
67
|
const initialOffset = iterator.counter.getOffset();
|
|
68
68
|
while (iterator.bytesRemaining() > 0 &&
|
|
69
69
|
iterator.counter.getOffset() - initialOffset < maxBytes) {
|
|
70
70
|
const { descriptor } = (0, exports.processDescriptor)({
|
|
71
71
|
iterator,
|
|
72
|
+
logLevel,
|
|
72
73
|
});
|
|
73
74
|
if (descriptor) {
|
|
74
75
|
descriptors.push(descriptor);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { BufferIterator } from '../../../buffer-iterator';
|
|
2
|
+
import type { LogLevel } from '../../../log';
|
|
2
3
|
import type { Descriptor } from './esds-descriptors';
|
|
3
4
|
export interface EsdsBox {
|
|
4
5
|
type: 'esds-box';
|
|
@@ -8,8 +9,9 @@ export interface EsdsBox {
|
|
|
8
9
|
esId: number;
|
|
9
10
|
descriptors: Descriptor[];
|
|
10
11
|
}
|
|
11
|
-
export declare const parseEsds: ({ data, size, fileOffset, }: {
|
|
12
|
+
export declare const parseEsds: ({ data, size, fileOffset, logLevel, }: {
|
|
12
13
|
data: BufferIterator;
|
|
13
14
|
size: number;
|
|
14
15
|
fileOffset: number;
|
|
16
|
+
logLevel: LogLevel;
|
|
15
17
|
}) => EsdsBox;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.parseEsds = void 0;
|
|
4
4
|
const esds_descriptors_1 = require("./esds-descriptors");
|
|
5
|
-
const parseEsds = ({ data, size, fileOffset, }) => {
|
|
5
|
+
const parseEsds = ({ data, size, fileOffset, logLevel, }) => {
|
|
6
6
|
const version = data.getUint8();
|
|
7
7
|
// Flags, we discard them
|
|
8
8
|
data.discard(3);
|
|
@@ -12,7 +12,7 @@ const parseEsds = ({ data, size, fileOffset, }) => {
|
|
|
12
12
|
// disard 1 byte, currently unknown
|
|
13
13
|
data.discard(1);
|
|
14
14
|
const remaining = size - (data.counter.getOffset() - fileOffset);
|
|
15
|
-
const descriptors = (0, esds_descriptors_1.parseDescriptors)(data, remaining);
|
|
15
|
+
const descriptors = (0, esds_descriptors_1.parseDescriptors)(data, remaining, logLevel);
|
|
16
16
|
const remainingNow = size - (data.counter.getOffset() - fileOffset);
|
|
17
17
|
data.discard(remainingNow);
|
|
18
18
|
return {
|
|
@@ -36,7 +36,7 @@ const makeBaseMediaTrack = (trakBox) => {
|
|
|
36
36
|
sampleRate,
|
|
37
37
|
description,
|
|
38
38
|
trakBox,
|
|
39
|
-
codecPrivate:
|
|
39
|
+
codecPrivate: (0, get_audio_codec_1.getCodecPrivateFromTrak)(trakBox),
|
|
40
40
|
codecWithoutConfig: (0, get_audio_codec_1.getAudioCodecFromTrack)(trakBox),
|
|
41
41
|
};
|
|
42
42
|
}
|
|
@@ -91,6 +91,7 @@ const makeBaseMediaTrack = (trakBox) => {
|
|
|
91
91
|
transferCharacteristics: null,
|
|
92
92
|
},
|
|
93
93
|
codecWithoutConfig: (0, get_video_codec_1.getVideoCodecFromIsoTrak)(trakBox),
|
|
94
|
+
fps: (0, get_fps_1.getFpsFromMp4TrakBox)(trakBox),
|
|
94
95
|
};
|
|
95
96
|
return track;
|
|
96
97
|
};
|
|
@@ -73,17 +73,23 @@ const parseMdat = async ({ data, size, fileOffset, existingBoxes, options, signa
|
|
|
73
73
|
break;
|
|
74
74
|
}
|
|
75
75
|
const bytes = data.getSlice(samplesWithIndex.samplePosition.size);
|
|
76
|
-
const timestamp =
|
|
77
|
-
samplesWithIndex.track.timescale
|
|
78
|
-
const duration =
|
|
79
|
-
samplesWithIndex.track.timescale
|
|
76
|
+
const timestamp = (samplesWithIndex.samplePosition.cts * 1000000) /
|
|
77
|
+
samplesWithIndex.track.timescale;
|
|
78
|
+
const duration = (samplesWithIndex.samplePosition.duration * 1000000) /
|
|
79
|
+
samplesWithIndex.track.timescale;
|
|
80
|
+
const cts = (samplesWithIndex.samplePosition.cts * 1000000) /
|
|
81
|
+
samplesWithIndex.track.timescale;
|
|
82
|
+
const dts = (samplesWithIndex.samplePosition.dts * 1000000) /
|
|
83
|
+
samplesWithIndex.track.timescale;
|
|
80
84
|
if (samplesWithIndex.track.type === 'audio') {
|
|
81
85
|
await options.parserState.onAudioSample(samplesWithIndex.track.trackId, {
|
|
82
86
|
data: bytes,
|
|
83
87
|
timestamp,
|
|
88
|
+
duration,
|
|
89
|
+
cts,
|
|
90
|
+
dts,
|
|
84
91
|
trackId: samplesWithIndex.track.trackId,
|
|
85
92
|
type: samplesWithIndex.samplePosition.isKeyframe ? 'key' : 'delta',
|
|
86
|
-
duration,
|
|
87
93
|
});
|
|
88
94
|
}
|
|
89
95
|
if (samplesWithIndex.track.type === 'video') {
|
|
@@ -91,8 +97,8 @@ const parseMdat = async ({ data, size, fileOffset, existingBoxes, options, signa
|
|
|
91
97
|
data: bytes,
|
|
92
98
|
timestamp,
|
|
93
99
|
duration,
|
|
94
|
-
cts
|
|
95
|
-
dts
|
|
100
|
+
cts,
|
|
101
|
+
dts,
|
|
96
102
|
trackId: samplesWithIndex.track.trackId,
|
|
97
103
|
type: samplesWithIndex.samplePosition.isKeyframe ? 'key' : 'delta',
|
|
98
104
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { BufferIterator } from '../../../buffer-iterator';
|
|
2
|
+
import type { LogLevel } from '../../../log';
|
|
2
3
|
import type { AnySegment } from '../../../parse-result';
|
|
3
4
|
import type { ParserContext } from '../../../parser-context';
|
|
4
5
|
import type { BaseBox } from '../base-type';
|
|
@@ -6,10 +7,11 @@ export interface MoovBox extends BaseBox {
|
|
|
6
7
|
type: 'moov-box';
|
|
7
8
|
children: AnySegment[];
|
|
8
9
|
}
|
|
9
|
-
export declare const parseMoov: ({ iterator, offset, size, options, signal, }: {
|
|
10
|
+
export declare const parseMoov: ({ iterator, offset, size, options, signal, logLevel, }: {
|
|
10
11
|
iterator: BufferIterator;
|
|
11
12
|
offset: number;
|
|
12
13
|
size: number;
|
|
13
14
|
options: ParserContext;
|
|
14
15
|
signal: AbortSignal | null;
|
|
16
|
+
logLevel: LogLevel;
|
|
15
17
|
}) => Promise<MoovBox>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.parseMoov = void 0;
|
|
4
4
|
const process_box_1 = require("../process-box");
|
|
5
|
-
const parseMoov = async ({ iterator, offset, size, options, signal, }) => {
|
|
5
|
+
const parseMoov = async ({ iterator, offset, size, options, signal, logLevel, }) => {
|
|
6
6
|
const children = await (0, process_box_1.parseBoxes)({
|
|
7
7
|
iterator,
|
|
8
8
|
maxBytes: size - (iterator.counter.getOffset() - offset),
|
|
@@ -10,8 +10,8 @@ const parseMoov = async ({ iterator, offset, size, options, signal, }) => {
|
|
|
10
10
|
initialBoxes: [],
|
|
11
11
|
options,
|
|
12
12
|
continueMdat: false,
|
|
13
|
-
littleEndian: false,
|
|
14
13
|
signal,
|
|
14
|
+
logLevel,
|
|
15
15
|
});
|
|
16
16
|
if (children.status === 'incomplete') {
|
|
17
17
|
throw new Error('Incomplete boxes are not allowed');
|
|
@@ -27,15 +27,17 @@ const parseMvhd = ({ iterator, offset, size, }) => {
|
|
|
27
27
|
iterator.discard(4);
|
|
28
28
|
iterator.discard(4);
|
|
29
29
|
// matrix
|
|
30
|
-
const matrix = [
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
30
|
+
const matrix = [
|
|
31
|
+
iterator.getFixedPointSigned1616Number(),
|
|
32
|
+
iterator.getFixedPointSigned1616Number(),
|
|
33
|
+
iterator.getFixedPointSigned230Number(),
|
|
34
|
+
iterator.getFixedPointSigned1616Number(),
|
|
35
|
+
iterator.getFixedPointSigned1616Number(),
|
|
36
|
+
iterator.getFixedPointSigned230Number(),
|
|
37
|
+
iterator.getFixedPointSigned1616Number(),
|
|
38
|
+
iterator.getFixedPointSigned1616Number(),
|
|
39
|
+
iterator.getFixedPointSigned230Number(),
|
|
40
|
+
];
|
|
39
41
|
// pre-defined
|
|
40
42
|
iterator.discard(4 * 6);
|
|
41
43
|
// next track id
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
type Point = {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
z: number;
|
|
5
|
+
};
|
|
6
|
+
export type IccProfile = {
|
|
7
|
+
size: number;
|
|
8
|
+
preferredCMMType: string;
|
|
9
|
+
profileVersion: string;
|
|
10
|
+
profileDeviceClass: string;
|
|
11
|
+
colorSpace: string;
|
|
12
|
+
pcs: string;
|
|
13
|
+
dateTime: Uint8Array;
|
|
14
|
+
signature: string;
|
|
15
|
+
primaryPlatform: string;
|
|
16
|
+
profileFlags: number;
|
|
17
|
+
deviceManufacturer: string;
|
|
18
|
+
deviceModel: string;
|
|
19
|
+
deviceAttributes: bigint;
|
|
20
|
+
renderingIntent: number;
|
|
21
|
+
pcsIlluminant: [number, number, number];
|
|
22
|
+
profileCreator: string;
|
|
23
|
+
profileId: string;
|
|
24
|
+
entries: Entry[];
|
|
25
|
+
rXYZ: Point | null;
|
|
26
|
+
gXYZ: Point | null;
|
|
27
|
+
bXYZ: Point | null;
|
|
28
|
+
whitePoint: Point | null;
|
|
29
|
+
};
|
|
30
|
+
type Entry = {
|
|
31
|
+
tag: string;
|
|
32
|
+
size: number;
|
|
33
|
+
offset: number;
|
|
34
|
+
};
|
|
35
|
+
export declare const parseIccProfile: (data: Uint8Array) => IccProfile;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseIccProfile = void 0;
|
|
4
|
+
const buffer_iterator_1 = require("../../buffer-iterator");
|
|
5
|
+
const parseIccProfile = (data) => {
|
|
6
|
+
const iterator = (0, buffer_iterator_1.getArrayBufferIterator)(data, Infinity);
|
|
7
|
+
const size = iterator.getUint32();
|
|
8
|
+
if (size !== data.length) {
|
|
9
|
+
throw new Error('Invalid ICC profile size');
|
|
10
|
+
}
|
|
11
|
+
const preferredCMMType = iterator.getByteString(4);
|
|
12
|
+
const profileVersion = iterator.getByteString(4);
|
|
13
|
+
const profileDeviceClass = iterator.getByteString(4);
|
|
14
|
+
const colorSpace = iterator.getByteString(4);
|
|
15
|
+
const pcs = iterator.getByteString(4);
|
|
16
|
+
const dateTime = iterator.getSlice(12);
|
|
17
|
+
const signature = iterator.getByteString(4);
|
|
18
|
+
if (signature !== 'acsp') {
|
|
19
|
+
throw new Error('Invalid ICC profile signature');
|
|
20
|
+
}
|
|
21
|
+
const primaryPlatform = iterator.getByteString(4);
|
|
22
|
+
const profileFlags = iterator.getUint32();
|
|
23
|
+
const deviceManufacturer = iterator.getByteString(4);
|
|
24
|
+
const deviceModel = iterator.getByteString(4);
|
|
25
|
+
const deviceAttributes = iterator.getUint64();
|
|
26
|
+
const renderingIntent = iterator.getUint32();
|
|
27
|
+
const pcsIlluminant1 = iterator.getUint32();
|
|
28
|
+
const pcsIlluminant2 = iterator.getUint32();
|
|
29
|
+
const pcsIlluminant3 = iterator.getUint32();
|
|
30
|
+
const profileCreator = iterator.getByteString(4);
|
|
31
|
+
const profileId = iterator.getByteString(16);
|
|
32
|
+
// reserved
|
|
33
|
+
iterator.discard(28);
|
|
34
|
+
const tagCount = iterator.getUint32();
|
|
35
|
+
const entries = [];
|
|
36
|
+
for (let i = 0; i < tagCount; i++) {
|
|
37
|
+
const entry = {
|
|
38
|
+
tag: iterator.getByteString(4),
|
|
39
|
+
offset: iterator.getUint32(),
|
|
40
|
+
size: iterator.getUint32(),
|
|
41
|
+
};
|
|
42
|
+
entries.push(entry);
|
|
43
|
+
}
|
|
44
|
+
let lastOffset = -1;
|
|
45
|
+
let rXYZ = null;
|
|
46
|
+
let gXYZ = null;
|
|
47
|
+
let bXYZ = null;
|
|
48
|
+
let whitePoint = null;
|
|
49
|
+
for (const entry of entries) {
|
|
50
|
+
const found = data.slice(entry.offset, entry.offset + entry.size);
|
|
51
|
+
if (entry.tag === 'rXYZ' ||
|
|
52
|
+
entry.tag === 'gXYZ' ||
|
|
53
|
+
entry.tag === 'bXYZ' ||
|
|
54
|
+
entry.tag === 'wtpt') {
|
|
55
|
+
const it = (0, buffer_iterator_1.getArrayBufferIterator)(found, Infinity);
|
|
56
|
+
it.discard(4);
|
|
57
|
+
const x = it.getInt32() / 65536;
|
|
58
|
+
const y = it.getInt32() / 65536;
|
|
59
|
+
const z = it.getInt32() / 65536;
|
|
60
|
+
it.destroy();
|
|
61
|
+
const point = { x, y, z };
|
|
62
|
+
if (entry.tag === 'rXYZ') {
|
|
63
|
+
rXYZ = point;
|
|
64
|
+
}
|
|
65
|
+
else if (entry.tag === 'gXYZ') {
|
|
66
|
+
gXYZ = point;
|
|
67
|
+
}
|
|
68
|
+
else if (entry.tag === 'bXYZ') {
|
|
69
|
+
bXYZ = point;
|
|
70
|
+
}
|
|
71
|
+
else if (entry.tag === 'wtpt') {
|
|
72
|
+
whitePoint = point;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
if (lastOffset !== -1) {
|
|
76
|
+
const bytesToAdvance = entry.offset - lastOffset;
|
|
77
|
+
const bytesToGoBackwards = entry.size - bytesToAdvance;
|
|
78
|
+
if (bytesToGoBackwards > 0) {
|
|
79
|
+
iterator.counter.decrement(bytesToGoBackwards);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
lastOffset = entry.offset;
|
|
83
|
+
}
|
|
84
|
+
const profile = {
|
|
85
|
+
size,
|
|
86
|
+
preferredCMMType,
|
|
87
|
+
profileVersion,
|
|
88
|
+
profileDeviceClass,
|
|
89
|
+
colorSpace,
|
|
90
|
+
pcs,
|
|
91
|
+
dateTime,
|
|
92
|
+
signature,
|
|
93
|
+
primaryPlatform,
|
|
94
|
+
profileFlags,
|
|
95
|
+
deviceManufacturer,
|
|
96
|
+
deviceModel,
|
|
97
|
+
deviceAttributes,
|
|
98
|
+
renderingIntent,
|
|
99
|
+
pcsIlluminant: [
|
|
100
|
+
pcsIlluminant1 / 65536,
|
|
101
|
+
pcsIlluminant2 / 65536,
|
|
102
|
+
pcsIlluminant3 / 65536,
|
|
103
|
+
],
|
|
104
|
+
profileCreator,
|
|
105
|
+
profileId,
|
|
106
|
+
entries,
|
|
107
|
+
bXYZ,
|
|
108
|
+
gXYZ,
|
|
109
|
+
rXYZ,
|
|
110
|
+
whitePoint,
|
|
111
|
+
};
|
|
112
|
+
iterator.destroy();
|
|
113
|
+
return profile;
|
|
114
|
+
};
|
|
115
|
+
exports.parseIccProfile = parseIccProfile;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { BufferIterator } from '../../buffer-iterator';
|
|
2
|
+
import type { LogLevel } from '../../log';
|
|
2
3
|
import type { AnySegment, IsoBaseMediaBox, ParseResult } from '../../parse-result';
|
|
3
4
|
import type { BoxAndNext, PartialMdatBox } from '../../parse-video';
|
|
4
5
|
import type { ParserContext } from '../../parser-context';
|
|
@@ -10,21 +11,21 @@ export declare const parseMdatPartially: ({ iterator, boxSize, fileOffset, parse
|
|
|
10
11
|
options: ParserContext;
|
|
11
12
|
signal: AbortSignal | null;
|
|
12
13
|
}) => Promise<BoxAndNext>;
|
|
13
|
-
export declare const processBox: ({ iterator, allowIncompleteBoxes, parsedBoxes, options,
|
|
14
|
+
export declare const processBox: ({ iterator, allowIncompleteBoxes, parsedBoxes, options, signal, logLevel, }: {
|
|
14
15
|
iterator: BufferIterator;
|
|
15
16
|
allowIncompleteBoxes: boolean;
|
|
16
17
|
parsedBoxes: AnySegment[];
|
|
17
18
|
options: ParserContext;
|
|
18
|
-
littleEndian: boolean;
|
|
19
19
|
signal: AbortSignal | null;
|
|
20
|
+
logLevel: LogLevel;
|
|
20
21
|
}) => Promise<BoxAndNext>;
|
|
21
|
-
export declare const parseBoxes: ({ iterator, maxBytes, allowIncompleteBoxes, initialBoxes, options, continueMdat,
|
|
22
|
+
export declare const parseBoxes: ({ iterator, maxBytes, allowIncompleteBoxes, initialBoxes, options, continueMdat, signal, logLevel, }: {
|
|
22
23
|
iterator: BufferIterator;
|
|
23
24
|
maxBytes: number;
|
|
24
25
|
allowIncompleteBoxes: boolean;
|
|
25
26
|
initialBoxes: IsoBaseMediaBox[];
|
|
26
27
|
options: ParserContext;
|
|
27
28
|
continueMdat: false | PartialMdatBox;
|
|
28
|
-
littleEndian: boolean;
|
|
29
29
|
signal: AbortSignal | null;
|
|
30
|
+
logLevel: LogLevel;
|
|
30
31
|
}) => Promise<ParseResult>;
|
|
@@ -28,7 +28,7 @@ const tkhd_1 = require("./tkhd");
|
|
|
28
28
|
const trak_1 = require("./trak/trak");
|
|
29
29
|
const traversal_1 = require("./traversal");
|
|
30
30
|
const trun_1 = require("./trun");
|
|
31
|
-
const getChildren = async ({ boxType, iterator, bytesRemainingInBox, options,
|
|
31
|
+
const getChildren = async ({ boxType, iterator, bytesRemainingInBox, options, signal, logLevel, }) => {
|
|
32
32
|
const parseChildren = boxType === 'mdia' ||
|
|
33
33
|
boxType === 'minf' ||
|
|
34
34
|
boxType === 'stbl' ||
|
|
@@ -46,8 +46,8 @@ const getChildren = async ({ boxType, iterator, bytesRemainingInBox, options, li
|
|
|
46
46
|
initialBoxes: [],
|
|
47
47
|
options,
|
|
48
48
|
continueMdat: false,
|
|
49
|
-
littleEndian,
|
|
50
49
|
signal,
|
|
50
|
+
logLevel,
|
|
51
51
|
});
|
|
52
52
|
if (parsed.status === 'incomplete') {
|
|
53
53
|
throw new Error('Incomplete boxes are not allowed');
|
|
@@ -86,11 +86,11 @@ const parseMdatPartially = async ({ iterator, boxSize, fileOffset, parsedBoxes,
|
|
|
86
86
|
};
|
|
87
87
|
};
|
|
88
88
|
exports.parseMdatPartially = parseMdatPartially;
|
|
89
|
-
const processBox = async ({ iterator, allowIncompleteBoxes, parsedBoxes, options,
|
|
89
|
+
const processBox = async ({ iterator, allowIncompleteBoxes, parsedBoxes, options, signal, logLevel, }) => {
|
|
90
90
|
var _a, _b;
|
|
91
91
|
const fileOffset = iterator.counter.getOffset();
|
|
92
92
|
const bytesRemaining = iterator.bytesRemaining();
|
|
93
|
-
const boxSizeRaw = iterator.getFourByteNumber(
|
|
93
|
+
const boxSizeRaw = iterator.getFourByteNumber();
|
|
94
94
|
// If `boxSize === 1`, the 8 bytes after the box type are the size of the box.
|
|
95
95
|
if ((boxSizeRaw === 1 && iterator.bytesRemaining() < 12) ||
|
|
96
96
|
iterator.bytesRemaining() < 4) {
|
|
@@ -114,7 +114,7 @@ const processBox = async ({ iterator, allowIncompleteBoxes, parsedBoxes, options
|
|
|
114
114
|
};
|
|
115
115
|
}
|
|
116
116
|
const boxType = iterator.getByteString(4);
|
|
117
|
-
const boxSize = boxSizeRaw === 1 ? iterator.getEightByteNumber(
|
|
117
|
+
const boxSize = boxSizeRaw === 1 ? iterator.getEightByteNumber() : boxSizeRaw;
|
|
118
118
|
if (bytesRemaining < boxSize) {
|
|
119
119
|
if (boxType === 'mdat') {
|
|
120
120
|
const shouldSkip = (options.canSkipVideoData || !(0, get_tracks_1.hasTracks)(parsedBoxes)) &&
|
|
@@ -168,6 +168,7 @@ const processBox = async ({ iterator, allowIncompleteBoxes, parsedBoxes, options
|
|
|
168
168
|
if (boxType === 'colr') {
|
|
169
169
|
const box = (0, colr_1.parseColorParameterBox)({
|
|
170
170
|
iterator,
|
|
171
|
+
size: boxSize,
|
|
171
172
|
});
|
|
172
173
|
return {
|
|
173
174
|
type: 'complete',
|
|
@@ -312,7 +313,6 @@ const processBox = async ({ iterator, allowIncompleteBoxes, parsedBoxes, options
|
|
|
312
313
|
offset: fileOffset,
|
|
313
314
|
size: boxSize,
|
|
314
315
|
options,
|
|
315
|
-
littleEndian,
|
|
316
316
|
signal,
|
|
317
317
|
});
|
|
318
318
|
return {
|
|
@@ -329,6 +329,7 @@ const processBox = async ({ iterator, allowIncompleteBoxes, parsedBoxes, options
|
|
|
329
329
|
size: boxSize,
|
|
330
330
|
options,
|
|
331
331
|
signal,
|
|
332
|
+
logLevel,
|
|
332
333
|
});
|
|
333
334
|
return {
|
|
334
335
|
type: 'complete',
|
|
@@ -344,6 +345,7 @@ const processBox = async ({ iterator, allowIncompleteBoxes, parsedBoxes, options
|
|
|
344
345
|
offsetAtStart: fileOffset,
|
|
345
346
|
options,
|
|
346
347
|
signal,
|
|
348
|
+
logLevel,
|
|
347
349
|
});
|
|
348
350
|
const transformedTrack = (0, make_track_1.makeBaseMediaTrack)(box);
|
|
349
351
|
if (transformedTrack) {
|
|
@@ -444,6 +446,7 @@ const processBox = async ({ iterator, allowIncompleteBoxes, parsedBoxes, options
|
|
|
444
446
|
data: iterator,
|
|
445
447
|
size: boxSize,
|
|
446
448
|
fileOffset,
|
|
449
|
+
logLevel,
|
|
447
450
|
});
|
|
448
451
|
return {
|
|
449
452
|
type: 'complete',
|
|
@@ -478,8 +481,8 @@ const processBox = async ({ iterator, allowIncompleteBoxes, parsedBoxes, options
|
|
|
478
481
|
iterator,
|
|
479
482
|
bytesRemainingInBox,
|
|
480
483
|
options,
|
|
481
|
-
littleEndian,
|
|
482
484
|
signal,
|
|
485
|
+
logLevel,
|
|
483
486
|
});
|
|
484
487
|
return {
|
|
485
488
|
type: 'complete',
|
|
@@ -495,7 +498,7 @@ const processBox = async ({ iterator, allowIncompleteBoxes, parsedBoxes, options
|
|
|
495
498
|
};
|
|
496
499
|
};
|
|
497
500
|
exports.processBox = processBox;
|
|
498
|
-
const parseBoxes = async ({ iterator, maxBytes, allowIncompleteBoxes, initialBoxes, options, continueMdat,
|
|
501
|
+
const parseBoxes = async ({ iterator, maxBytes, allowIncompleteBoxes, initialBoxes, options, continueMdat, signal, logLevel, }) => {
|
|
499
502
|
let boxes = initialBoxes;
|
|
500
503
|
const initialOffset = iterator.counter.getOffset();
|
|
501
504
|
const alreadyHasMdat = boxes.find((b) => b.type === 'mdat-box');
|
|
@@ -515,8 +518,8 @@ const parseBoxes = async ({ iterator, maxBytes, allowIncompleteBoxes, initialBox
|
|
|
515
518
|
allowIncompleteBoxes,
|
|
516
519
|
parsedBoxes: initialBoxes,
|
|
517
520
|
options,
|
|
518
|
-
littleEndian,
|
|
519
521
|
signal,
|
|
522
|
+
logLevel,
|
|
520
523
|
});
|
|
521
524
|
if (result.type === 'incomplete') {
|
|
522
525
|
if (Number.isFinite(maxBytes)) {
|
|
@@ -533,8 +536,8 @@ const parseBoxes = async ({ iterator, maxBytes, allowIncompleteBoxes, initialBox
|
|
|
533
536
|
initialBoxes: boxes,
|
|
534
537
|
options,
|
|
535
538
|
continueMdat: false,
|
|
536
|
-
littleEndian,
|
|
537
539
|
signal,
|
|
540
|
+
logLevel,
|
|
538
541
|
});
|
|
539
542
|
},
|
|
540
543
|
skipTo: null,
|
|
@@ -552,8 +555,8 @@ const parseBoxes = async ({ iterator, maxBytes, allowIncompleteBoxes, initialBox
|
|
|
552
555
|
initialBoxes: boxes,
|
|
553
556
|
options,
|
|
554
557
|
continueMdat: result,
|
|
555
|
-
littleEndian,
|
|
556
558
|
signal,
|
|
559
|
+
logLevel,
|
|
557
560
|
}));
|
|
558
561
|
},
|
|
559
562
|
skipTo: null,
|
|
@@ -586,8 +589,8 @@ const parseBoxes = async ({ iterator, maxBytes, allowIncompleteBoxes, initialBox
|
|
|
586
589
|
initialBoxes: boxes,
|
|
587
590
|
options,
|
|
588
591
|
continueMdat: false,
|
|
589
|
-
littleEndian,
|
|
590
592
|
signal,
|
|
593
|
+
logLevel,
|
|
591
594
|
});
|
|
592
595
|
},
|
|
593
596
|
skipTo: result.skipTo,
|
|
@@ -605,8 +608,8 @@ const parseBoxes = async ({ iterator, maxBytes, allowIncompleteBoxes, initialBox
|
|
|
605
608
|
initialBoxes: boxes,
|
|
606
609
|
options,
|
|
607
610
|
continueMdat: false,
|
|
608
|
-
littleEndian,
|
|
609
611
|
signal,
|
|
612
|
+
logLevel,
|
|
610
613
|
});
|
|
611
614
|
},
|
|
612
615
|
skipTo: null,
|
|
@@ -634,8 +637,8 @@ const parseBoxes = async ({ iterator, maxBytes, allowIncompleteBoxes, initialBox
|
|
|
634
637
|
initialBoxes: boxes,
|
|
635
638
|
options,
|
|
636
639
|
continueMdat: false,
|
|
637
|
-
littleEndian,
|
|
638
640
|
signal,
|
|
641
|
+
logLevel,
|
|
639
642
|
});
|
|
640
643
|
},
|
|
641
644
|
skipTo: skipped ? mdatState.fileOffset : null,
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
import type { BufferIterator } from '../../../buffer-iterator';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import type { IccProfile } from '../parse-icc-profile';
|
|
3
|
+
type ExtraData = {
|
|
4
|
+
colorType: 'transfer-characteristics';
|
|
4
5
|
primaries: number;
|
|
5
6
|
transfer: number;
|
|
6
7
|
matrixIndex: number;
|
|
7
8
|
fullRangeFlag: boolean;
|
|
8
|
-
}
|
|
9
|
-
|
|
9
|
+
} | {
|
|
10
|
+
colorType: 'icc-profile';
|
|
11
|
+
profile: Uint8Array;
|
|
12
|
+
parsed: IccProfile;
|
|
13
|
+
};
|
|
14
|
+
export type ColorParameterBox = {
|
|
15
|
+
type: 'colr-box';
|
|
16
|
+
} & ExtraData;
|
|
17
|
+
export declare const parseColorParameterBox: ({ iterator, size, }: {
|
|
10
18
|
iterator: BufferIterator;
|
|
19
|
+
size: number;
|
|
11
20
|
}) => ColorParameterBox;
|
|
21
|
+
export {};
|