@svta/cml-iso-bmff 0.23.2 → 1.0.0-alpha.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/dist/index.d.ts CHANGED
@@ -1,20 +1,27 @@
1
- //#region src/boxes/Fields.d.ts
1
+ //#region src/boxes/AdditionalMetadataContainerBox.d.ts
2
2
  /**
3
- * Utility type to get just the fields of a box
3
+ * Child boxes of Additional Metadata Container Box
4
4
  *
5
+ * @public
6
+ */
7
+ type AdditionalMetadataContainerBoxChild = any;
8
+ /**
9
+ * Additional Metadata Container Box - 'meta' - Container
5
10
  *
6
- * @beta
11
+ * @public
7
12
  */
8
- type Fields<T$1> = Omit<T$1, Exclude<keyof Box, "data"> | "boxes">;
13
+ type AdditionalMetadataContainerBox = {
14
+ type: "meta";
15
+ boxes: AdditionalMetadataContainerBoxChild[];
16
+ };
9
17
  //#endregion
10
18
  //#region src/boxes/FullBox.d.ts
11
19
  /**
12
20
  * Full Box Type (has version and flags)
13
21
  *
14
- *
15
- * @beta
22
+ * @public
16
23
  */
17
- type FullBox = Box & {
24
+ type FullBox = {
18
25
  version: number;
19
26
  flags: number;
20
27
  };
@@ -23,8 +30,7 @@ type FullBox = Box & {
23
30
  /**
24
31
  * ISO/IEC 14496-12:202x - 12.2.8 Audio rendering indication box
25
32
  *
26
- *
27
- * @beta
33
+ * @public
28
34
  */
29
35
  type AudioRenderingIndicationBox = FullBox & {
30
36
  type: "ardi";
@@ -35,10 +41,9 @@ type AudioRenderingIndicationBox = FullBox & {
35
41
  /**
36
42
  * ISO/IEC 14496-12:2015 - 8.5.2.2 Sample Entry
37
43
  *
38
- *
39
- * @beta
44
+ * @public
40
45
  */
41
- type SampleEntryBox = Box & {
46
+ type SampleEntryBox = {
42
47
  reserved1: number[];
43
48
  dataReferenceIndex: number;
44
49
  };
@@ -47,8 +52,7 @@ type SampleEntryBox = Box & {
47
52
  /**
48
53
  * ISO/IEC 14496-12:2012 - 8.5.2.2 mp4a box (use AudioSampleEntry definition and naming)
49
54
  *
50
- *
51
- * @beta
55
+ * @public
52
56
  */
53
57
  type AudioSampleEntryBox<T$1 extends "mp4a" | "enca" = "mp4a" | "enca"> = SampleEntryBox & {
54
58
  type: T$1;
@@ -65,21 +69,24 @@ type AudioSampleEntryBox<T$1 extends "mp4a" | "enca" = "mp4a" | "enca"> = Sample
65
69
  /**
66
70
  * Chunk Large Offset Box - 'co64'
67
71
  *
68
- *
69
- * @beta
72
+ * @public
70
73
  */
71
74
  type ChunkLargeOffsetBox = FullBox & {
72
75
  type: "co64";
73
76
  entryCount: number;
74
77
  chunkOffset: number[];
75
78
  };
79
+ /**
80
+ * @public
81
+ */
82
+ type co64 = ChunkLargeOffsetBox;
76
83
  //#endregion
77
84
  //#region src/boxes/ChunkOffsetBox.d.ts
78
85
  /**
79
86
  * Chunk Offset Box - 'stco'
80
87
  *
81
88
  *
82
- * @beta
89
+ * @public
83
90
  */
84
91
  type ChunkOffsetBox = FullBox & {
85
92
  type: "stco";
@@ -91,8 +98,7 @@ type ChunkOffsetBox = FullBox & {
91
98
  /**
92
99
  * Compact Sample Size Box - 'stz2'
93
100
  *
94
- *
95
- * @beta
101
+ * @public
96
102
  */
97
103
  type CompactSampleSizeBox = FullBox & {
98
104
  type: "stz2";
@@ -100,13 +106,16 @@ type CompactSampleSizeBox = FullBox & {
100
106
  sampleCount: number;
101
107
  entrySize: number[];
102
108
  };
109
+ /**
110
+ * @public
111
+ */
112
+ type stz2 = CompactSampleSizeBox;
103
113
  //#endregion
104
114
  //#region src/boxes/CompositionTimeToSampleEntry.d.ts
105
115
  /**
106
116
  * A Composition Time To Sample Entry
107
117
  *
108
- *
109
- * @beta
118
+ * @public
110
119
  */
111
120
  type CompositionTimeToSampleEntry = {
112
121
  sampleCount: number;
@@ -117,8 +126,7 @@ type CompositionTimeToSampleEntry = {
117
126
  /**
118
127
  * ISO/IEC 14496-12:2012 - 8.6.1.3 Composition Time To Sample Box
119
128
  *
120
- *
121
- * @beta
129
+ * @public
122
130
  */
123
131
  type CompositionTimeToSampleBox = FullBox & {
124
132
  type: "ctts";
@@ -130,33 +138,38 @@ type CompositionTimeToSampleBox = FullBox & {
130
138
  /**
131
139
  * Data Entry Url Box - 'url '
132
140
  *
133
- *
134
- * @beta
141
+ * @public
135
142
  */
136
143
  type DataEntryUrlBox = FullBox & {
137
144
  type: "url ";
138
- location?: string;
145
+ location: string;
139
146
  };
147
+ /**
148
+ * @public
149
+ */
150
+ type url = DataEntryUrlBox;
140
151
  //#endregion
141
152
  //#region src/boxes/DataEntryUrnBox.d.ts
142
153
  /**
143
154
  * Data Entry Urn Box - 'urn '
144
155
  *
145
- *
146
- * @beta
156
+ * @public
147
157
  */
148
158
  type DataEntryUrnBox = FullBox & {
149
159
  type: "urn ";
150
- name?: string;
151
- location?: string;
160
+ name: string;
161
+ location: string;
152
162
  };
163
+ /**
164
+ * @public
165
+ */
166
+ type urn = DataEntryUrnBox;
153
167
  //#endregion
154
168
  //#region src/boxes/DataReferenceBox.d.ts
155
169
  /**
156
170
  * ISO/IEC 14496-12:2012 - 8.7.2 Data Reference Box
157
171
  *
158
- *
159
- * @beta
172
+ * @public
160
173
  */
161
174
  type DataReferenceBox = FullBox & {
162
175
  type: "dref";
@@ -164,12 +177,28 @@ type DataReferenceBox = FullBox & {
164
177
  entries: (DataEntryUrlBox | DataEntryUrnBox)[];
165
178
  };
166
179
  //#endregion
180
+ //#region src/boxes/DataInformationBox.d.ts
181
+ /**
182
+ * Child boxes of Data Information Box
183
+ *
184
+ * @public
185
+ */
186
+ type DataInformationBoxChild = DataReferenceBox;
187
+ /**
188
+ * Data Information Box - 'dinf' - Container
189
+ *
190
+ * @public
191
+ */
192
+ type DataInformationBox = {
193
+ type: "dinf";
194
+ boxes: DataInformationBoxChild[];
195
+ };
196
+ //#endregion
167
197
  //#region src/boxes/DecodingTimeSample.d.ts
168
198
  /**
169
199
  * Decoding time sample
170
200
  *
171
- *
172
- * @beta
201
+ * @public
173
202
  */
174
203
  type DecodingTimeSample = {
175
204
  /** A 32-bit integer that specifies the number of consecutive samples that have the same decoding time delta. */
@@ -182,8 +211,7 @@ type DecodingTimeSample = {
182
211
  /**
183
212
  * ISO/IEC 14496-12:2012 - 8.6.1.2 Decoding Time To Sample Box
184
213
  *
185
- *
186
- * @beta
214
+ * @public
187
215
  */
188
216
  type DecodingTimeToSampleBox = FullBox & {
189
217
  type: "stts";
@@ -197,8 +225,7 @@ type DecodingTimeToSampleBox = FullBox & {
197
225
  /**
198
226
  * Degradation Priority Box - 'stdp'
199
227
  *
200
- *
201
- * @beta
228
+ * @public
202
229
  */
203
230
  type DegradationPriorityBox = FullBox & {
204
231
  type: "stdp";
@@ -209,8 +236,7 @@ type DegradationPriorityBox = FullBox & {
209
236
  /**
210
237
  * An edit list entry.
211
238
  *
212
- *
213
- * @beta
239
+ * @public
214
240
  */
215
241
  type EditListEntry = {
216
242
  segmentDuration: number;
@@ -223,8 +249,7 @@ type EditListEntry = {
223
249
  /**
224
250
  * ISO/IEC 14496-12:2012 - 8.6.6 Edit List Box
225
251
  *
226
- *
227
- * @beta
252
+ * @public
228
253
  */
229
254
  type EditListBox = FullBox & {
230
255
  type: "elst";
@@ -232,12 +257,28 @@ type EditListBox = FullBox & {
232
257
  entries: EditListEntry[];
233
258
  };
234
259
  //#endregion
260
+ //#region src/boxes/EditBox.d.ts
261
+ /**
262
+ * Child boxes of Edit Box
263
+ *
264
+ * @public
265
+ */
266
+ type EditBoxChild = EditListBox;
267
+ /**
268
+ * Edit Box - 'edts' - Container
269
+ *
270
+ * @public
271
+ */
272
+ type EditBox = {
273
+ type: "edts";
274
+ boxes: EditBoxChild[];
275
+ };
276
+ //#endregion
235
277
  //#region src/boxes/EventMessageBox.d.ts
236
278
  /**
237
279
  * ISO/IEC 23009-1:2014 - 5.10.3.3 Event Message Box
238
280
  *
239
- *
240
- * @beta
281
+ * @public
241
282
  */
242
283
  type EventMessageBox = FullBox & {
243
284
  type: "emsg";
@@ -255,20 +296,31 @@ type EventMessageBox = FullBox & {
255
296
  /**
256
297
  * ISO/IEC 14496-12:202x - 8.4.6 Extended language tag
257
298
  *
258
- *
259
- * @beta
299
+ * @public
260
300
  */
261
301
  type ExtendedLanguageBox = FullBox & {
262
302
  type: "elng";
263
303
  extendedLanguage: string;
264
304
  };
265
305
  //#endregion
306
+ //#region src/boxes/TypeBox.d.ts
307
+ /**
308
+ * Utility TypeBox
309
+ *
310
+ * @public
311
+ */
312
+ type TypeBox<T$1> = {
313
+ type: T$1;
314
+ majorBrand: string;
315
+ minorVersion: number;
316
+ compatibleBrands: string[];
317
+ };
318
+ //#endregion
266
319
  //#region src/boxes/FileTypeBox.d.ts
267
320
  /**
268
321
  * ISO/IEC 14496-12:2012 - 4.3 File Type Box
269
322
  *
270
- *
271
- * @beta
323
+ * @public
272
324
  */
273
325
  type FileTypeBox = TypeBox<"ftyp">;
274
326
  //#endregion
@@ -276,20 +328,35 @@ type FileTypeBox = TypeBox<"ftyp">;
276
328
  /**
277
329
  * ISO/IEC 14496-12:2012 - 8.1.2 Free Space Box
278
330
  *
279
- *
280
- * @beta
331
+ * @public
281
332
  */
282
- type FreeSpaceBox<T$1 extends "free" | "skip" = "free"> = Box & {
333
+ type FreeSpaceBox<T$1 extends "free" | "skip" = "free"> = {
283
334
  type: T$1;
284
335
  data: Uint8Array;
285
336
  };
286
337
  //#endregion
338
+ //#region src/boxes/GroupsListBox.d.ts
339
+ /**
340
+ * Child boxes of Groups List Box
341
+ *
342
+ * @public
343
+ */
344
+ type GroupsListBoxChild = any;
345
+ /**
346
+ * Groups List Box - 'grpl' - Container
347
+ *
348
+ * @public
349
+ */
350
+ type GroupsListBox = {
351
+ type: "grpl";
352
+ boxes: GroupsListBoxChild[];
353
+ };
354
+ //#endregion
287
355
  //#region src/boxes/HandlerReferenceBox.d.ts
288
356
  /**
289
357
  * ISO/IEC 14496-12:2012 - 8.4.3 Handler Reference Box
290
358
  *
291
- *
292
- * @beta
359
+ * @public
293
360
  */
294
361
  type HandlerReferenceBox = FullBox & {
295
362
  type: "hdlr";
@@ -303,8 +370,7 @@ type HandlerReferenceBox = FullBox & {
303
370
  /**
304
371
  * Hint Media Header Box - 'hmhd'
305
372
  *
306
- *
307
- * @beta
373
+ * @public
308
374
  */
309
375
  type HintMediaHeaderBox = FullBox & {
310
376
  type: "hmhd";
@@ -318,10 +384,9 @@ type HintMediaHeaderBox = FullBox & {
318
384
  /**
319
385
  * ISO/IEC 14496-12:2012 - 9.1.4.1 Identified media data box
320
386
  *
321
- *
322
- * @beta
387
+ * @public
323
388
  */
324
- type IdentifiedMediaDataBox = Box & {
389
+ type IdentifiedMediaDataBox = {
325
390
  type: "imda";
326
391
  imdaIdentifier: number;
327
392
  data: Uint8Array;
@@ -331,8 +396,7 @@ type IdentifiedMediaDataBox = Box & {
331
396
  /**
332
397
  * IPMP Info Box - 'imif'
333
398
  *
334
- *
335
- * @beta
399
+ * @public
336
400
  */
337
401
  type IpmpInfoBox = FullBox & {
338
402
  type: "imif";
@@ -343,8 +407,7 @@ type IpmpInfoBox = FullBox & {
343
407
  /**
344
408
  * Item Info Entry - 'infe'
345
409
  *
346
- *
347
- * @beta
410
+ * @public
348
411
  */
349
412
  type ItemInfoEntry = FullBox & {
350
413
  type: "infe";
@@ -356,12 +419,29 @@ type ItemInfoEntry = FullBox & {
356
419
  extensionType?: string;
357
420
  };
358
421
  //#endregion
422
+ //#region src/boxes/ItemInfoBox.d.ts
423
+ /**
424
+ * Child boxes of Item Info Box
425
+ *
426
+ * @public
427
+ */
428
+ type ItemInfoBoxChild = ItemInfoEntry;
429
+ /**
430
+ * Item Info Box - 'iinf' - Container
431
+ *
432
+ * @public
433
+ */
434
+ type ItemInfoBox = {
435
+ type: "iinf";
436
+ boxes: ItemInfoBoxChild[];
437
+ entryCount: number;
438
+ };
439
+ //#endregion
359
440
  //#region src/boxes/ItemExtent.d.ts
360
441
  /**
361
442
  * Item Extent
362
443
  *
363
- *
364
- * @beta
444
+ * @public
365
445
  */
366
446
  type ItemExtent = {
367
447
  extentIndex?: number;
@@ -373,8 +453,7 @@ type ItemExtent = {
373
453
  /**
374
454
  * Item Location
375
455
  *
376
- *
377
- * @beta
456
+ * @public
378
457
  */
379
458
  type ItemLocation = {
380
459
  itemId: number;
@@ -388,8 +467,7 @@ type ItemLocation = {
388
467
  /**
389
468
  * Item Location Box - 'iloc'
390
469
  *
391
- *
392
- * @beta
470
+ * @public
393
471
  */
394
472
  type ItemLocationBox = FullBox & {
395
473
  type: "iloc";
@@ -401,311 +479,229 @@ type ItemLocationBox = FullBox & {
401
479
  items: ItemLocation[];
402
480
  };
403
481
  //#endregion
404
- //#region src/boxes/LabelBox.d.ts
482
+ //#region src/boxes/OriginalFormatBox.d.ts
405
483
  /**
406
- * ISO/IEC 14496-12:202x - 8.10.5 Label box
484
+ * ISO/IEC 14496-12:2012 - 8.12.2 Original Format Box
407
485
  *
486
+ * @public
487
+ */
488
+ type OriginalFormatBox = {
489
+ type: "frma";
490
+ dataFormat: number;
491
+ };
492
+ //#endregion
493
+ //#region src/boxes/TrackEncryptionBox.d.ts
494
+ /**
495
+ * ISO/IEC 23001-7:2011 - 8.2 Track Encryption Box
408
496
  *
409
- * @beta
497
+ * @public
410
498
  */
411
- type LabelBox = FullBox & {
412
- type: "labl";
413
- isGroupLabel: boolean;
414
- labelId: number;
415
- language: string;
416
- label: string;
499
+ type TrackEncryptionBox = FullBox & {
500
+ type: "tenc";
501
+ defaultIsEncrypted: number;
502
+ defaultIvSize: number;
503
+ defaultKid: number[];
417
504
  };
418
505
  //#endregion
419
- //#region src/boxes/MediaDataBox.d.ts
506
+ //#region src/boxes/SchemeInformationBox.d.ts
420
507
  /**
421
- * ISO/IEC 14496-12:2012 - 8.1.1 Media Data Box
508
+ * Child boxes of Scheme Information Box
422
509
  *
510
+ * @public
511
+ */
512
+ type SchemeInformationBoxChild = TrackEncryptionBox;
513
+ /**
514
+ * Scheme Information Box - 'schi' - Container
423
515
  *
424
- * @beta
516
+ * @public
425
517
  */
426
- type MediaDataBox = Box & {
427
- type: "mdat";
428
- data: Uint8Array<ArrayBuffer>;
518
+ type SchemeInformationBox = {
519
+ type: "schi";
520
+ boxes: SchemeInformationBoxChild[];
429
521
  };
430
522
  //#endregion
431
- //#region src/boxes/MediaHeaderBox.d.ts
523
+ //#region src/boxes/SchemeTypeBox.d.ts
432
524
  /**
433
- * ISO/IEC 14496-12:2012 - 8.4.2 Media Header Box
434
- *
525
+ * ISO/IEC 14496-12:2012 - 8.12.5 Scheme Type Box
435
526
  *
436
- * @beta
527
+ * @public
437
528
  */
438
- type MediaHeaderBox = FullBox & {
439
- type: "mdhd";
440
- /** A 32-bit integer that specifies the creation time of the media in this track. */
441
- creationTime: number;
442
- /** A 32-bit integer that specifies the most recent time the media in this track was modified. */
443
- modificationTime: number;
444
- /** A time value that indicates the time-scale for this media; this is the number of time units that pass in one second. */
445
- timescale: number;
446
- /** A time value that indicates the duration of this media. */
447
- duration: number;
448
- /** A 16-bit integer that specifies the language code for this media. */
449
- language: string;
450
- /** A 16-bit value that is reserved for use in other specifications. */
451
- preDefined: number;
529
+ type SchemeTypeBox = FullBox & {
530
+ type: "schm";
531
+ schemeType: number;
532
+ schemeVersion: number;
533
+ schemeUri?: string;
452
534
  };
453
535
  //#endregion
454
- //#region src/boxes/MovieExtendsHeaderBox.d.ts
536
+ //#region src/boxes/ProtectionSchemeInformationBox.d.ts
455
537
  /**
456
- * ISO/IEC 14496-12:2012 - 8.8.2 Movie Extends Header Box
538
+ * Child boxes of Protection Scheme Information Box
457
539
  *
540
+ * @public
541
+ */
542
+ type ProtectionSchemeInformationBoxChild = OriginalFormatBox | IpmpInfoBox | SchemeTypeBox | SchemeInformationBox;
543
+ /**
544
+ * Protection Scheme Information Box - 'sinf' - Container
458
545
  *
459
- * @beta
546
+ * @public
460
547
  */
461
- type MovieExtendsHeaderBox = FullBox & {
462
- type: "mehd";
463
- fragmentDuration: number;
548
+ type ProtectionSchemeInformationBox = {
549
+ type: "sinf";
550
+ boxes: ProtectionSchemeInformationBoxChild[];
464
551
  };
465
552
  //#endregion
466
- //#region src/boxes/MovieFragmentHeaderBox.d.ts
553
+ //#region src/boxes/ItemProtectionBox.d.ts
467
554
  /**
468
- * ISO/IEC 14496-12:2012 - 8.8.5 Movie Fragment Header Box
555
+ * Child boxes of Item Protection Box
469
556
  *
557
+ * @public
558
+ */
559
+ type ItemProtectionBoxChild = ProtectionSchemeInformationBox;
560
+ /**
561
+ * Item Protection Box - 'ipro' - Container
470
562
  *
471
- * @beta
563
+ * @public
472
564
  */
473
- type MovieFragmentHeaderBox = FullBox & {
474
- type: "mfhd";
475
- sequenceNumber: number;
565
+ type ItemProtectionBox = {
566
+ type: "ipro";
567
+ boxes: ItemProtectionBoxChild[];
568
+ protectionCount: number;
476
569
  };
477
570
  //#endregion
478
- //#region src/boxes/MovieFragmentRandomAccessOffsetBox.d.ts
571
+ //#region src/boxes/SingleItemTypeReferenceBox.d.ts
479
572
  /**
480
- * ISO/IEC 14496-12:2012 - 8.8.11 Movie Fragment Random Access Box
573
+ * Single Item Type Reference Box
574
+ *
575
+ * @public
576
+ */
577
+ type SingleItemTypeReferenceBox = {
578
+ fromItemId: number;
579
+ referenceCount: number;
580
+ toItemId: number[];
581
+ };
582
+ //#endregion
583
+ //#region src/boxes/ItemReferenceBox.d.ts
584
+ /**
585
+ * Child boxes of Item Reference Box
481
586
  *
587
+ * @public
588
+ */
589
+ type ItemReferenceBoxChild = SingleItemTypeReferenceBox;
590
+ /**
591
+ * Item Reference Box - 'iref' - Container
482
592
  *
483
- * @beta
593
+ * @public
484
594
  */
485
- type MovieFragmentRandomAccessOffsetBox = FullBox & {
486
- type: "mfro";
487
- mfraSize: number;
595
+ type ItemReferenceBox = {
596
+ type: "iref";
597
+ boxes: ItemReferenceBoxChild[];
488
598
  };
489
599
  //#endregion
490
- //#region src/boxes/MovieHeaderBox.d.ts
600
+ //#region src/boxes/LabelBox.d.ts
491
601
  /**
492
- * ISO/IEC 14496-12:2012 - 8.2.2 Movie Header Box
602
+ * ISO/IEC 14496-12:202x - 8.10.5 Label box
493
603
  *
604
+ * @public
605
+ */
606
+ type LabelBox = FullBox & {
607
+ type: "labl";
608
+ isGroupLabel: boolean;
609
+ labelId: number;
610
+ language: string;
611
+ label: string;
612
+ };
613
+ //#endregion
614
+ //#region src/boxes/MediaHeaderBox.d.ts
615
+ /**
616
+ * ISO/IEC 14496-12:2012 - 8.4.2 Media Header Box
494
617
  *
495
- * @beta
618
+ * @public
496
619
  */
497
- type MovieHeaderBox = FullBox & {
498
- type: "mvhd";
620
+ type MediaHeaderBox = FullBox & {
621
+ type: "mdhd";
622
+ /** A 32-bit integer that specifies the creation time of the media in this track. */
499
623
  creationTime: number;
624
+ /** A 32-bit integer that specifies the most recent time the media in this track was modified. */
500
625
  modificationTime: number;
626
+ /** A time value that indicates the time-scale for this media; this is the number of time units that pass in one second. */
501
627
  timescale: number;
628
+ /** A time value that indicates the duration of this media. */
502
629
  duration: number;
503
- rate: number;
504
- volume: number;
505
- reserved1: number;
506
- reserved2: number[];
507
- matrix: number[];
508
- preDefined: number[];
509
- nextTrackId: number;
630
+ /** A 16-bit integer that specifies the language code for this media. */
631
+ language: string;
632
+ /** A 16-bit value that is reserved for use in other specifications. */
633
+ preDefined: number;
510
634
  };
511
635
  //#endregion
512
636
  //#region src/boxes/NullMediaHeaderBox.d.ts
513
637
  /**
514
638
  * Null Media Header Box - 'nmhd'
515
639
  *
516
- *
517
- * @beta
640
+ * @public
518
641
  */
519
642
  type NullMediaHeaderBox = FullBox & {
520
643
  type: "nmhd";
521
644
  };
522
645
  //#endregion
523
- //#region src/boxes/OriginalFormatBox.d.ts
646
+ //#region src/boxes/SampleDependencyTypeBox.d.ts
524
647
  /**
525
- * ISO/IEC 14496-12:2012 - 8.12.2 Original Format Box
526
- *
648
+ * ISO/IEC 14496-12:2012 - 8.6.4.1 Sample Dependency Type box
527
649
  *
528
- * @beta
650
+ * @public
529
651
  */
530
- type OriginalFormatBox = Box & {
531
- type: "frma";
532
- dataFormat: number;
652
+ type SampleDependencyTypeBox = FullBox & {
653
+ type: "sdtp";
654
+ sampleDependencyTable: number[];
533
655
  };
534
656
  //#endregion
535
- //#region src/boxes/Entity.d.ts
657
+ //#region src/boxes/VisualSampleEntryType.d.ts
536
658
  /**
537
- * Entity
538
- *
659
+ * The type of visual sample entry box.
539
660
  *
540
- * @beta
661
+ * @public
541
662
  */
542
- type Entity = {
543
- /** Entity ID */
544
- entityId: number;
545
- };
663
+ type VisualSampleEntryType = "avc1" | "avc2" | "avc3" | "avc4" | "hev1" | "hvc1" | "encv";
546
664
  //#endregion
547
- //#region src/boxes/PreselectionGroupBox.d.ts
665
+ //#region src/boxes/VisualSampleEntryBox.d.ts
548
666
  /**
549
- * ISO/IEC 14496-12:202x - 8.18.4.1 Preselection group box
550
- *
667
+ * ISO/IEC 14496-15:2014 - 12.1.3.1 avc1/2/3/4, hev1, hvc1, encv
551
668
  *
552
- * @beta
669
+ * @public
553
670
  */
554
- type PreselectionGroupBox = FullBox & {
555
- type: "prsl";
556
- /** Group ID */
557
- groupId: number;
558
- /** Number of entities in group */
559
- numEntitiesInGroup: number;
560
- /** Entities */
561
- entities: Entity[];
562
- preselectionTag?: string;
563
- selectionPriority?: number;
564
- interleavingTag?: string;
565
- };
566
- //#endregion
567
- //#region src/boxes/PrimaryItemBox.d.ts
568
- /**
569
- * Primary Item Box - 'pitm'
570
- *
571
- *
572
- * @beta
573
- */
574
- type PrimaryItemBox = FullBox & {
575
- type: "pitm";
576
- itemId: number;
577
- };
578
- //#endregion
579
- //#region src/boxes/ProducerReferenceTimeBox.d.ts
580
- /**
581
- * ISO/IEC 14496-12:2012 - 8.16.5 Producer Reference Time
582
- *
583
- *
584
- * @beta
585
- */
586
- type ProducerReferenceTimeBox = FullBox & {
587
- type: "prft";
588
- referenceTrackId: number;
589
- ntpTimestampSec: number;
590
- ntpTimestampFrac: number;
591
- mediaTime: number;
592
- };
593
- //#endregion
594
- //#region src/boxes/ProtectionSystemSpecificHeaderBox.d.ts
595
- /**
596
- * ISO/IEC 23001-7:2011 - 8.1 Protection System Specific Header Box
597
- *
598
- *
599
- * @beta
600
- */
601
- type ProtectionSystemSpecificHeaderBox = FullBox & {
602
- type: "pssh";
603
- systemId: number[];
604
- kidCount: number;
605
- kid: number[];
606
- dataSize: number;
607
- data: number[];
608
- };
609
- //#endregion
610
- //#region src/boxes/SampleAuxiliaryInformationOffsetsBox.d.ts
611
- /**
612
- * Sample Auxiliary Information Offsets Box - 'saio'
613
- *
614
- *
615
- * @beta
616
- */
617
- type SampleAuxiliaryInformationOffsetsBox = FullBox & {
618
- type: "saio";
619
- auxInfoType?: number;
620
- auxInfoTypeParameter?: number;
621
- entryCount: number;
622
- offset: number[];
623
- };
624
- //#endregion
625
- //#region src/boxes/SampleAuxiliaryInformationSizesBox.d.ts
626
- /**
627
- * Sample Auxiliary Information Sizes Box - 'saiz'
628
- *
629
- *
630
- * @beta
631
- */
632
- type SampleAuxiliaryInformationSizesBox = FullBox & {
633
- type: "saiz";
634
- auxInfoType?: number;
635
- auxInfoTypeParameter?: number;
636
- defaultSampleInfoSize: number;
637
- sampleCount: number;
638
- sampleInfoSize?: number[];
639
- };
640
- //#endregion
641
- //#region src/boxes/SampleDependencyTypeBox.d.ts
642
- /**
643
- * ISO/IEC 14496-12:2012 - 8.6.4.1 Sample Dependency Type box
644
- *
645
- *
646
- * @beta
647
- */
648
- type SampleDependencyTypeBox = FullBox & {
649
- type: "sdtp";
650
- sampleDependencyTable: number[];
671
+ type VisualSampleEntryBox<T$1 extends VisualSampleEntryType = VisualSampleEntryType> = SampleEntryBox & {
672
+ type: T$1;
673
+ preDefined1: number;
674
+ reserved2: number;
675
+ preDefined2: number[];
676
+ width: number;
677
+ height: number;
678
+ horizresolution: number;
679
+ vertresolution: number;
680
+ reserved3: number;
681
+ frameCount: number;
682
+ compressorName: number[];
683
+ depth: number;
684
+ preDefined3: number;
685
+ config: Uint8Array;
651
686
  };
652
687
  //#endregion
653
688
  //#region src/boxes/SampleDescriptionBox.d.ts
654
689
  /**
655
690
  * ISO/IEC 14496-12:2012 - 8.5.2 Sample Description Box
656
691
  *
657
- *
658
- * @beta
692
+ * @public
659
693
  */
660
- type SampleDescriptionBox<E extends SampleEntryBox = SampleEntryBox> = FullBox & {
694
+ type SampleDescriptionBox<E extends SampleEntryBox = AudioSampleEntryBox | VisualSampleEntryBox> = FullBox & {
661
695
  type: "stsd";
662
696
  entryCount: number;
663
697
  entries: E[];
664
698
  };
665
699
  //#endregion
666
- //#region src/boxes/SubsampleEncryption.d.ts
667
- /**
668
- * Subsample Encryption
669
- *
670
- *
671
- * @beta
672
- */
673
- type SubsampleEncryption = {
674
- bytesOfClearData: number;
675
- bytesOfProtectedData: number;
676
- };
677
- //#endregion
678
- //#region src/boxes/EncryptedSample.d.ts
679
- /**
680
- * Encrypted Sample
681
- *
682
- *
683
- * @beta
684
- */
685
- type EncryptedSample = {
686
- initializationVector?: Uint8Array;
687
- subsampleEncryption?: SubsampleEncryption[];
688
- };
689
- //#endregion
690
- //#region src/boxes/SampleEncryptionBox.d.ts
691
- /**
692
- * Sample Encryption Box - 'senc'
693
- *
694
- *
695
- * @beta
696
- */
697
- type SampleEncryptionBox = FullBox & {
698
- type: "senc";
699
- sampleCount: number;
700
- samples: EncryptedSample[];
701
- };
702
- //#endregion
703
700
  //#region src/boxes/SampleGroupDescriptionBox.d.ts
704
701
  /**
705
702
  * Sample Group Description Box - 'sgpd'
706
703
  *
707
- *
708
- * @beta
704
+ * @public
709
705
  */
710
706
  type SampleGroupDescriptionBox = FullBox & {
711
707
  type: "sgpd";
@@ -719,8 +715,7 @@ type SampleGroupDescriptionBox = FullBox & {
719
715
  /**
720
716
  * Sample Size Box - 'stsz'
721
717
  *
722
- *
723
- * @beta
718
+ * @public
724
719
  */
725
720
  type SampleSizeBox = FullBox & {
726
721
  type: "stsz";
@@ -733,8 +728,7 @@ type SampleSizeBox = FullBox & {
733
728
  /**
734
729
  * Sample to Chunk Entry
735
730
  *
736
- *
737
- * @beta
731
+ * @public
738
732
  */
739
733
  type SampleToChunkEntry = {
740
734
  firstChunk: number;
@@ -746,8 +740,7 @@ type SampleToChunkEntry = {
746
740
  /**
747
741
  * Sample to Chunk Box - 'stsc'
748
742
  *
749
- *
750
- * @beta
743
+ * @public
751
744
  */
752
745
  type SampleToChunkBox = FullBox & {
753
746
  type: "stsc";
@@ -759,8 +752,7 @@ type SampleToChunkBox = FullBox & {
759
752
  /**
760
753
  * Sample to Group Entry
761
754
  *
762
- *
763
- * @beta
755
+ * @public
764
756
  */
765
757
  type SampleToGroupEntry = {
766
758
  sampleCount: number;
@@ -771,8 +763,7 @@ type SampleToGroupEntry = {
771
763
  /**
772
764
  * Sample to Group Box - 'sbgp'
773
765
  *
774
- *
775
- * @beta
766
+ * @public
776
767
  */
777
768
  type SampleToGroupBox = FullBox & {
778
769
  type: "sbgp";
@@ -782,108 +773,73 @@ type SampleToGroupBox = FullBox & {
782
773
  entries: SampleToGroupEntry[];
783
774
  };
784
775
  //#endregion
785
- //#region src/boxes/SchemeTypeBox.d.ts
776
+ //#region src/boxes/ShadowSyncEntry.d.ts
786
777
  /**
787
- * ISO/IEC 14496-12:2012 - 8.12.5 Scheme Type Box
788
- *
778
+ * Shadow Sync Entry
789
779
  *
790
- * @beta
780
+ * @public
791
781
  */
792
- type SchemeTypeBox = FullBox & {
793
- type: "schm";
794
- schemeType: number;
795
- schemeVersion: number;
796
- schemeUri?: string;
782
+ type ShadowSyncEntry = {
783
+ shadowedSampleNumber: number;
784
+ syncSampleNumber: number;
797
785
  };
798
786
  //#endregion
799
- //#region src/boxes/SegmentIndexReference.d.ts
787
+ //#region src/boxes/ShadowSyncSampleBox.d.ts
800
788
  /**
801
- * Segment index reference
802
- *
789
+ * Shadow Sync Sample Box - 'stsh'
803
790
  *
804
- * @beta
791
+ * @public
805
792
  */
806
- type SegmentIndexReference = {
807
- reference: number;
808
- subsegmentDuration: number;
809
- sap: number;
810
- referenceType: number;
811
- referencedSize: number;
812
- startsWithSap: number;
813
- sapType: number;
814
- sapDeltaTime: number;
793
+ type ShadowSyncSampleBox = FullBox & {
794
+ type: "stsh";
795
+ entryCount: number;
796
+ entries: ShadowSyncEntry[];
815
797
  };
816
798
  //#endregion
817
- //#region src/boxes/SegmentIndexBox.d.ts
799
+ //#region src/boxes/SyncSample.d.ts
818
800
  /**
819
- * ISO/IEC 14496-12:2012 - 8.16.3 Segment Index Box
820
- *
801
+ * Sync sample
821
802
  *
822
- * @beta
803
+ * @public
823
804
  */
824
- type SegmentIndexBox = FullBox & {
825
- type: "sidx";
826
- referenceId: number;
827
- timescale: number;
828
- earliestPresentationTime: number;
829
- firstOffset: number;
830
- reserved: number;
831
- references: SegmentIndexReference[];
805
+ type SyncSample = {
806
+ sampleNumber: number;
832
807
  };
833
808
  //#endregion
834
- //#region src/boxes/SegmentTypeBox.d.ts
835
- /**
836
- * ISO/IEC 14496-12:2012 - 8.16.2 Segment Type Box
837
- *
838
- *
839
- * @beta
840
- */
841
- type SegmentTypeBox = TypeBox<"styp">;
842
- //#endregion
843
- //#region src/boxes/ShadowSyncEntry.d.ts
809
+ //#region src/boxes/SyncSampleBox.d.ts
844
810
  /**
845
- * Shadow Sync Entry
846
- *
811
+ * ISO/IEC 14496-12:2015 - 8.6.2 Sync Sample Box
847
812
  *
848
- * @beta
813
+ * @public
849
814
  */
850
- type ShadowSyncEntry = {
851
- shadowedSampleNumber: number;
852
- syncSampleNumber: number;
815
+ type SyncSampleBox = FullBox & {
816
+ type: "stss";
817
+ entryCount: number;
818
+ entries: SyncSample[];
853
819
  };
854
820
  //#endregion
855
- //#region src/boxes/ShadowSyncSampleBox.d.ts
821
+ //#region src/boxes/SampleTableBox.d.ts
856
822
  /**
857
- * Shadow Sync Sample Box - 'stsh'
823
+ * Child boxes of Sample Table Box
858
824
  *
859
- *
860
- * @beta
825
+ * @public
861
826
  */
862
- type ShadowSyncSampleBox = FullBox & {
863
- type: "stsh";
864
- entryCount: number;
865
- entries: ShadowSyncEntry[];
866
- };
867
- //#endregion
868
- //#region src/boxes/SingleItemTypeReferenceBox.d.ts
827
+ type SampleTableBoxChild = SampleDescriptionBox | DecodingTimeToSampleBox | CompositionTimeToSampleBox | SampleToChunkBox | SampleSizeBox | ChunkOffsetBox | SyncSampleBox | ShadowSyncSampleBox | DegradationPriorityBox | SampleDependencyTypeBox | SampleToGroupBox | SampleGroupDescriptionBox;
869
828
  /**
870
- * Single Item Type Reference Box
871
- *
829
+ * Sample Table Box - 'stbl' - Container
872
830
  *
873
- * @beta
831
+ * @public
874
832
  */
875
- type SingleItemTypeReferenceBox = Box & {
876
- fromItemId: number;
877
- referenceCount: number;
878
- toItemId: number[];
833
+ type SampleTableBox = {
834
+ type: "stbl";
835
+ boxes: SampleTableBoxChild[];
879
836
  };
880
837
  //#endregion
881
838
  //#region src/boxes/SoundMediaHeaderBox.d.ts
882
839
  /**
883
840
  * ISO/IEC 14496-12:2012 - 8.4.5.3 Sound Media Header Box
884
841
  *
885
- *
886
- * @beta
842
+ * @public
887
843
  */
888
844
  type SoundMediaHeaderBox = FullBox & {
889
845
  type: "smhd";
@@ -891,138 +847,117 @@ type SoundMediaHeaderBox = FullBox & {
891
847
  reserved: number;
892
848
  };
893
849
  //#endregion
894
- //#region src/boxes/Subsample.d.ts
850
+ //#region src/boxes/SubtitleMediaHeaderBox.d.ts
895
851
  /**
896
- * Sub sample
897
- *
852
+ * ISO/IEC 14496-12:2015 - 12.6.2 Subtitle media header Box
898
853
  *
899
- * @beta
854
+ * @public
900
855
  */
901
- type Subsample = {
902
- subsampleSize: number;
903
- subsamplePriority: number;
904
- discardable: number;
905
- codecSpecificParameters: number;
856
+ type SubtitleMediaHeaderBox = FullBox & {
857
+ type: "sthd";
906
858
  };
907
859
  //#endregion
908
- //#region src/boxes/SubsampleEntry.d.ts
860
+ //#region src/boxes/VideoMediaHeaderBox.d.ts
909
861
  /**
910
- * Sub sample entry
911
- *
862
+ * ISO/IEC 14496-12:2012 - 8.4.5.2 Video Media Header Box
912
863
  *
913
- * @beta
864
+ * @public
914
865
  */
915
- type SubsampleEntry = {
916
- sampleDelta: number;
917
- subsampleCount: number;
918
- subsamples: Subsample[];
866
+ type VideoMediaHeaderBox = FullBox & {
867
+ type: "vmhd";
868
+ graphicsmode: number;
869
+ opcolor: number[];
919
870
  };
920
871
  //#endregion
921
- //#region src/boxes/SubsampleInformationBox.d.ts
872
+ //#region src/boxes/MediaInformationBox.d.ts
922
873
  /**
923
- * ISO/IEC 14496-12:2015 - 8.7.7 Sub-Sample Information Box
874
+ * Child boxes of Media Information Box
924
875
  *
925
- *
926
- * @beta
876
+ * @public
927
877
  */
928
- type SubsampleInformationBox = FullBox & {
929
- type: "subs";
930
- entryCount: number;
931
- entries: SubsampleEntry[];
932
- };
933
- //#endregion
934
- //#region src/boxes/SubsegmentRange.d.ts
878
+ type MediaInformationBoxChild = VideoMediaHeaderBox | SoundMediaHeaderBox | HintMediaHeaderBox | NullMediaHeaderBox | DataInformationBox | SampleTableBox | SubtitleMediaHeaderBox;
935
879
  /**
936
- * Subsegment range
937
- *
880
+ * Media Information Box - 'minf' - Container
938
881
  *
939
- * @beta
882
+ * @public
940
883
  */
941
- type SubsegmentRange = {
942
- level: number;
943
- rangeSize: number;
884
+ type MediaInformationBox = {
885
+ type: "minf";
886
+ boxes: MediaInformationBoxChild[];
944
887
  };
945
888
  //#endregion
946
- //#region src/boxes/Subsegment.d.ts
889
+ //#region src/boxes/MediaBox.d.ts
947
890
  /**
948
- * Subsegment
891
+ * Child boxes of Media Box
949
892
  *
950
- *
951
- * @beta
893
+ * @public
952
894
  */
953
- type Subsegment = {
954
- rangesCount: number;
955
- ranges: SubsegmentRange[];
956
- };
957
- //#endregion
958
- //#region src/boxes/SubsegmentIndexBox.d.ts
895
+ type MediaBoxChild = MediaHeaderBox | HandlerReferenceBox | MediaInformationBox;
959
896
  /**
960
- * ISO/IEC 14496-12:2012 - 8.16.4 Subsegment Index Box
961
- *
897
+ * Media Box - 'mdia' - Container
962
898
  *
963
- * @beta
899
+ * @public
964
900
  */
965
- type SubsegmentIndexBox = FullBox & {
966
- type: "ssix";
967
- subsegmentCount: number;
968
- subsegments: Subsegment[];
901
+ type MediaBox = {
902
+ type: "mdia";
903
+ boxes: MediaBoxChild[];
969
904
  };
970
905
  //#endregion
971
- //#region src/boxes/SubtitleMediaHeaderBox.d.ts
906
+ //#region src/boxes/MediaDataBox.d.ts
972
907
  /**
973
- * ISO/IEC 14496-12:2015 - 12.6.2 Subtitle media header Box
974
- *
908
+ * ISO/IEC 14496-12:2012 - 8.1.1 Media Data Box
975
909
  *
976
- * @beta
910
+ * @public
977
911
  */
978
- type SubtitleMediaHeaderBox = FullBox & {
979
- type: "sthd";
912
+ type MediaDataBox = {
913
+ type: "mdat";
914
+ data: Uint8Array<ArrayBuffer>;
980
915
  };
981
916
  //#endregion
982
- //#region src/boxes/SyncSample.d.ts
917
+ //#region src/boxes/PrimaryItemBox.d.ts
983
918
  /**
984
- * Sync sample
985
- *
919
+ * Primary Item Box - 'pitm'
986
920
  *
987
- * @beta
921
+ * @public
988
922
  */
989
- type SyncSample = {
990
- sampleNumber: number;
923
+ type PrimaryItemBox = FullBox & {
924
+ type: "pitm";
925
+ itemId: number;
991
926
  };
992
927
  //#endregion
993
- //#region src/boxes/SyncSampleBox.d.ts
928
+ //#region src/boxes/MetaBox.d.ts
994
929
  /**
995
- * ISO/IEC 14496-12:2015 - 8.6.2 Sync Sample Box
930
+ * Child boxes of Meta Box
996
931
  *
932
+ * @public
933
+ */
934
+ type MetaBoxChild = HandlerReferenceBox | PrimaryItemBox | DataInformationBox | ItemLocationBox | ItemProtectionBox | ItemInfoBox | ItemReferenceBox | GroupsListBox;
935
+ /**
936
+ * ISO/IEC 14496-12:202x - 8.11.1 Meta box
997
937
  *
998
- * @beta
938
+ * @public
999
939
  */
1000
- type SyncSampleBox = FullBox & {
1001
- type: "stss";
1002
- entryCount: number;
1003
- entries: SyncSample[];
940
+ type MetaBox = FullBox & {
941
+ type: "meta";
942
+ boxes: MetaBoxChild[];
1004
943
  };
1005
944
  //#endregion
1006
- //#region src/boxes/TrackEncryptionBox.d.ts
945
+ //#region src/boxes/MovieExtendsHeaderBox.d.ts
1007
946
  /**
1008
- * ISO/IEC 23001-7:2011 - 8.2 Track Encryption Box
1009
- *
947
+ * ISO/IEC 14496-12:2012 - 8.8.2 Movie Extends Header Box
1010
948
  *
1011
- * @beta
949
+ * @public
1012
950
  */
1013
- type TrackEncryptionBox = FullBox & {
1014
- type: "tenc";
1015
- defaultIsEncrypted: number;
1016
- defaultIvSize: number;
1017
- defaultKid: number[];
951
+ type MovieExtendsHeaderBox = FullBox & {
952
+ type: "mehd";
953
+ fragmentDuration: number;
1018
954
  };
1019
955
  //#endregion
1020
956
  //#region src/boxes/TrackExtendsBox.d.ts
1021
957
  /**
1022
958
  * ISO/IEC 14496-12:2012 - 8.8.3 Track Extends Box
1023
959
  *
1024
- *
1025
- * @beta
960
+ * @public
1026
961
  */
1027
962
  type TrackExtendsBox = FullBox & {
1028
963
  type: "trex";
@@ -1033,74 +968,49 @@ type TrackExtendsBox = FullBox & {
1033
968
  defaultSampleFlags: number;
1034
969
  };
1035
970
  //#endregion
1036
- //#region src/boxes/TrackFragmentBaseMediaDecodeTimeBox.d.ts
1037
- /**
1038
- * ISO/IEC 14496-12:2012 - 8.8.12 Track Fragment Decode Time
1039
- *
1040
- *
1041
- * @beta
1042
- */
1043
- type TrackFragmentBaseMediaDecodeTimeBox = FullBox & {
1044
- type: "tfdt";
1045
- baseMediaDecodeTime: number;
1046
- };
1047
- //#endregion
1048
- //#region src/boxes/TrackFragmentHeaderBox.d.ts
971
+ //#region src/boxes/MovieExtendsBox.d.ts
1049
972
  /**
1050
- * ISO/IEC 14496-12:2012 - 8.8.7 Track Fragment Header Box
1051
- *
973
+ * Child boxes of Movie Extends Box
1052
974
  *
1053
- * @beta
975
+ * @public
1054
976
  */
1055
- type TrackFragmentHeaderBox = FullBox & {
1056
- type: "tfhd";
1057
- trackId: number;
1058
- baseDataOffset?: number;
1059
- sampleDescriptionIndex?: number;
1060
- defaultSampleDuration?: number;
1061
- defaultSampleSize?: number;
1062
- defaultSampleFlags?: number;
1063
- };
1064
- //#endregion
1065
- //#region src/boxes/TrackFragmentRandomAccessEntry.d.ts
977
+ type MovieExtendsBoxChild = MovieExtendsHeaderBox | TrackExtendsBox;
1066
978
  /**
1067
- * Track fragment random access entry
1068
- *
979
+ * Movie Extends Box - 'mvex' - Container
1069
980
  *
1070
- * @beta
981
+ * @public
1071
982
  */
1072
- type TrackFragmentRandomAccessEntry = {
1073
- time: number;
1074
- moofOffset: number;
1075
- trafNumber: number;
1076
- trunNumber: number;
1077
- sampleNumber: number;
983
+ type MovieExtendsBox = {
984
+ type: "mvex";
985
+ boxes: MovieExtendsBoxChild[];
1078
986
  };
1079
987
  //#endregion
1080
- //#region src/boxes/TrackFragmentRandomAccessBox.d.ts
988
+ //#region src/boxes/MovieHeaderBox.d.ts
1081
989
  /**
1082
- * ISO/IEC 14496-12:2012 - 8.8.10 Track Fragment Random Access Box
1083
- *
990
+ * ISO/IEC 14496-12:2012 - 8.2.2 Movie Header Box
1084
991
  *
1085
- * @beta
992
+ * @public
1086
993
  */
1087
- type TrackFragmentRandomAccessBox = FullBox & {
1088
- type: "tfra";
1089
- trackId: number;
1090
- reserved: number;
1091
- numberOfEntry: number;
1092
- lengthSizeOfTrafNum: number;
1093
- lengthSizeOfTrunNum: number;
1094
- lengthSizeOfSampleNum: number;
1095
- entries: TrackFragmentRandomAccessEntry[];
994
+ type MovieHeaderBox = FullBox & {
995
+ type: "mvhd";
996
+ creationTime: number;
997
+ modificationTime: number;
998
+ timescale: number;
999
+ duration: number;
1000
+ rate: number;
1001
+ volume: number;
1002
+ reserved1: number;
1003
+ reserved2: number[];
1004
+ matrix: number[];
1005
+ preDefined: number[];
1006
+ nextTrackId: number;
1096
1007
  };
1097
1008
  //#endregion
1098
1009
  //#region src/boxes/TrackHeaderBox.d.ts
1099
1010
  /**
1100
1011
  * ISO/IEC 14496-12:2012 - 8.3.2 Track Header Box
1101
1012
  *
1102
- *
1103
- * @beta
1013
+ * @public
1104
1014
  */
1105
1015
  type TrackHeaderBox = FullBox & {
1106
1016
  type: "tkhd";
@@ -1119,487 +1029,742 @@ type TrackHeaderBox = FullBox & {
1119
1029
  height: number;
1120
1030
  };
1121
1031
  //#endregion
1122
- //#region src/boxes/TrackKindBox.d.ts
1032
+ //#region src/boxes/TrackReferenceTypeBox.d.ts
1123
1033
  /**
1124
- * ISO/IEC 14496-12:202x - 8.10.4 Track kind box
1125
- *
1034
+ * Track Reference Type Box
1126
1035
  *
1127
- * @beta
1036
+ * @public
1128
1037
  */
1129
- type TrackKindBox = FullBox & {
1130
- type: "kind";
1131
- schemeUri: string;
1132
- value: string;
1038
+ type TrackReferenceTypeBox = {
1039
+ type: "tref";
1040
+ trackIds: number[];
1133
1041
  };
1134
1042
  //#endregion
1135
- //#region src/boxes/TrackRunSample.d.ts
1043
+ //#region src/boxes/TrackReferenceBox.d.ts
1136
1044
  /**
1137
- * Track run sample
1045
+ * Child boxes of Track Reference Box
1138
1046
  *
1047
+ * @public
1048
+ */
1049
+ type TrackReferenceBoxChild = TrackReferenceTypeBox;
1050
+ /**
1051
+ * Track Reference Box - 'tref' - Container
1139
1052
  *
1140
- * @beta
1053
+ * @public
1141
1054
  */
1142
- type TrackRunSample = {
1143
- sampleDuration?: number;
1144
- sampleSize?: number;
1145
- sampleFlags?: number;
1146
- sampleCompositionTimeOffset?: number;
1055
+ type TrackReferenceBox = {
1056
+ type: "tref";
1057
+ boxes: TrackReferenceBoxChild[];
1147
1058
  };
1148
1059
  //#endregion
1149
- //#region src/boxes/TrackRunBox.d.ts
1060
+ //#region src/boxes/UserDataBox.d.ts
1150
1061
  /**
1151
- * ISO/IEC 14496-12:2012 - 8.8.8 Track Run Box
1152
- *
1153
- * Note: the 'trun' box has a direct relation to the 'tfhd' box for defaults.
1154
- * These defaults are not set explicitly here, but are left to resolve for the user.
1062
+ * Child boxes of User Data Box
1155
1063
  *
1064
+ * @public
1065
+ */
1066
+ type UserDataBoxChild = any;
1067
+ /**
1068
+ * User Data Box - 'udta' - Container
1156
1069
  *
1157
- * @beta
1070
+ * @public
1158
1071
  */
1159
- type TrackRunBox = FullBox & {
1160
- type: "trun";
1161
- sampleCount: number;
1162
- dataOffset?: number;
1163
- firstSampleFlags?: number;
1164
- samples: TrackRunSample[];
1072
+ type UserDataBox = {
1073
+ type: "udta";
1074
+ boxes: UserDataBoxChild[];
1165
1075
  };
1166
1076
  //#endregion
1167
- //#region src/boxes/UrlBox.d.ts
1077
+ //#region src/boxes/TrackBox.d.ts
1168
1078
  /**
1169
- * ISO/IEC 14496-12:2012 - 8.7.2 Data Reference Box
1079
+ * Child boxes of Track Box
1170
1080
  *
1081
+ * @public
1082
+ */
1083
+ type TrackBoxChild = TrackHeaderBox | TrackReferenceBox | EditBox | MediaBox | UserDataBox;
1084
+ /**
1085
+ * Track Box - 'trak' - Container
1171
1086
  *
1172
- * @beta
1087
+ * @public
1173
1088
  */
1174
- type UrlBox = FullBox & {
1175
- type: "url";
1176
- location: string;
1089
+ type TrackBox = {
1090
+ type: "trak";
1091
+ boxes: TrackBoxChild[];
1177
1092
  };
1178
1093
  //#endregion
1179
- //#region src/boxes/UrnBox.d.ts
1094
+ //#region src/boxes/MovieBox.d.ts
1180
1095
  /**
1181
- * ISO/IEC 14496-12:2012 - 8.7.2 Data Reference Box
1096
+ * Child boxes of Movie Box
1182
1097
  *
1098
+ * @public
1099
+ */
1100
+ type MovieBoxChild = MovieHeaderBox | TrackBox | MovieExtendsBox | UserDataBox;
1101
+ /**
1102
+ * Movie Box - 'moov' - Container
1183
1103
  *
1184
- * @beta
1104
+ * @public
1185
1105
  */
1186
- type UrnBox = FullBox & {
1187
- type: "urn";
1188
- name: string;
1189
- location: string;
1106
+ type MovieBox = {
1107
+ type: "moov";
1108
+ boxes: MovieBoxChild[];
1190
1109
  };
1191
1110
  //#endregion
1192
- //#region src/boxes/VideoMediaHeaderBox.d.ts
1111
+ //#region src/boxes/MovieFragmentHeaderBox.d.ts
1193
1112
  /**
1194
- * ISO/IEC 14496-12:2012 - 8.4.5.2 Video Media Header Box
1195
- *
1113
+ * ISO/IEC 14496-12:2012 - 8.8.5 Movie Fragment Header Box
1196
1114
  *
1197
- * @beta
1115
+ * @public
1198
1116
  */
1199
- type VideoMediaHeaderBox = FullBox & {
1200
- type: "vmhd";
1201
- graphicsmode: number;
1202
- opcolor: number[];
1117
+ type MovieFragmentHeaderBox = FullBox & {
1118
+ type: "mfhd";
1119
+ sequenceNumber: number;
1203
1120
  };
1204
1121
  //#endregion
1205
- //#region src/boxes/VisualSampleEntryBox.d.ts
1122
+ //#region src/boxes/SampleAuxiliaryInformationOffsetsBox.d.ts
1206
1123
  /**
1207
- * ISO/IEC 14496-15:2014 - 12.1.3.1 avc1/2/3/4, hev1, hvc1, encv
1208
- *
1124
+ * Sample Auxiliary Information Offsets Box - 'saio'
1209
1125
  *
1210
- * @beta
1126
+ * @public
1211
1127
  */
1212
- type VisualSampleEntryBox<T$1 extends "avc1" | "avc2" | "avc3" | "avc4" | "hev1" | "hvc1" | "encv" = "avc1" | "avc2" | "avc3" | "avc4" | "hev1" | "hvc1" | "encv"> = SampleEntryBox & {
1213
- type: T$1;
1214
- preDefined1: number;
1215
- reserved2: number;
1216
- preDefined2: number[];
1217
- width: number;
1218
- height: number;
1219
- horizresolution: number;
1220
- vertresolution: number;
1221
- reserved3: number;
1222
- frameCount: number;
1223
- compressorName: number[];
1224
- depth: number;
1225
- preDefined3: number;
1226
- config: Uint8Array;
1128
+ type SampleAuxiliaryInformationOffsetsBox = FullBox & {
1129
+ type: "saio";
1130
+ auxInfoType?: number;
1131
+ auxInfoTypeParameter?: number;
1132
+ entryCount: number;
1133
+ offset: number[];
1227
1134
  };
1228
1135
  //#endregion
1229
- //#region src/boxes/WebVttConfigurationBox.d.ts
1136
+ //#region src/boxes/SampleAuxiliaryInformationSizesBox.d.ts
1230
1137
  /**
1231
- * ISO/IEC 14496-30:2014 - WebVTT Configuration Box
1232
- *
1138
+ * Sample Auxiliary Information Sizes Box - 'saiz'
1233
1139
  *
1234
- * @beta
1140
+ * @public
1235
1141
  */
1236
- type WebVttConfigurationBox = Box & {
1237
- type: "vttC";
1238
- config: string;
1142
+ type SampleAuxiliaryInformationSizesBox = FullBox & {
1143
+ type: "saiz";
1144
+ auxInfoType?: number;
1145
+ auxInfoTypeParameter?: number;
1146
+ defaultSampleInfoSize: number;
1147
+ sampleCount: number;
1148
+ sampleInfoSize?: number[];
1239
1149
  };
1240
1150
  //#endregion
1241
- //#region src/boxes/WebVttCueIdBox.d.ts
1151
+ //#region src/boxes/SubsampleEncryption.d.ts
1242
1152
  /**
1243
- * ISO/IEC 14496-30:2014 - WebVTT Cue Id Box.
1244
- *
1153
+ * Subsample Encryption
1245
1154
  *
1246
- * @beta
1155
+ * @public
1247
1156
  */
1248
- type WebVttCueIdBox = Box & {
1249
- type: "iden";
1250
- cueId: string;
1157
+ type SubsampleEncryption = {
1158
+ bytesOfClearData: number;
1159
+ bytesOfProtectedData: number;
1251
1160
  };
1252
1161
  //#endregion
1253
- //#region src/boxes/WebVttCuePayloadBox.d.ts
1162
+ //#region src/boxes/EncryptedSample.d.ts
1254
1163
  /**
1255
- * ISO/IEC 14496-30:2014 - WebVTT Cue Payload Box.
1256
- *
1164
+ * Encrypted Sample
1257
1165
  *
1258
- * @beta
1166
+ * @public
1259
1167
  */
1260
- type WebVttCuePayloadBox = Box & {
1261
- type: "payl";
1262
- cueText: string;
1168
+ type EncryptedSample = {
1169
+ initializationVector?: Uint8Array;
1170
+ subsampleEncryption?: SubsampleEncryption[];
1263
1171
  };
1264
1172
  //#endregion
1265
- //#region src/boxes/WebVttEmptySampleBox.d.ts
1173
+ //#region src/boxes/SampleEncryptionBox.d.ts
1266
1174
  /**
1267
- * ISO/IEC 14496-30:2014 - WebVTT Empty Sample Box
1268
- *
1175
+ * Sample Encryption Box - 'senc'
1269
1176
  *
1270
- * @beta
1177
+ * @public
1271
1178
  */
1272
- type WebVttEmptySampleBox = Box & {
1273
- type: "vtte";
1179
+ type SampleEncryptionBox = FullBox & {
1180
+ type: "senc";
1181
+ sampleCount: number;
1182
+ samples: EncryptedSample[];
1274
1183
  };
1275
1184
  //#endregion
1276
- //#region src/boxes/WebVttSettingsBox.d.ts
1185
+ //#region src/boxes/Subsample.d.ts
1277
1186
  /**
1278
- * ISO/IEC 14496-30:2014 - WebVTT Cue Settings Box.
1279
- *
1187
+ * Sub sample
1280
1188
  *
1281
- * @beta
1189
+ * @public
1282
1190
  */
1283
- type WebVttSettingsBox = Box & {
1284
- type: "sttg";
1285
- settings: string;
1191
+ type Subsample = {
1192
+ subsampleSize: number;
1193
+ subsamplePriority: number;
1194
+ discardable: number;
1195
+ codecSpecificParameters: number;
1286
1196
  };
1287
1197
  //#endregion
1288
- //#region src/boxes/WebVttSourceLabelBox.d.ts
1198
+ //#region src/boxes/SubsampleEntry.d.ts
1289
1199
  /**
1290
- * ISO/IEC 14496-30:2014 - WebVTT Source Label Box
1291
- *
1200
+ * Sub sample entry
1292
1201
  *
1293
- * @beta
1202
+ * @public
1294
1203
  */
1295
- type WebVttSourceLabelBox = Box & {
1296
- type: "vlab";
1297
- sourceLabel: string;
1204
+ type SubsampleEntry = {
1205
+ sampleDelta: number;
1206
+ subsampleCount: number;
1207
+ subsamples: Subsample[];
1298
1208
  };
1299
1209
  //#endregion
1300
- //#region src/boxes/IsoBox.d.ts
1210
+ //#region src/boxes/SubsampleInformationBox.d.ts
1301
1211
  /**
1302
- * Non-container Box types
1303
- *
1212
+ * ISO/IEC 14496-12:2015 - 8.7.7 Sub-Sample Information Box
1304
1213
  *
1305
- * @beta
1214
+ * @public
1306
1215
  */
1307
- type IsoBox = AudioRenderingIndicationBox | AudioSampleEntryBox<"enca"> | AudioSampleEntryBox<"mp4a"> | ChunkLargeOffsetBox | ChunkOffsetBox | CompactSampleSizeBox | CompositionTimeToSampleBox | DataEntryUrlBox | DataEntryUrnBox | DataReferenceBox | DecodingTimeToSampleBox | DegradationPriorityBox | EditListBox | EventMessageBox | ExtendedLanguageBox | FileTypeBox | FreeSpaceBox<"free"> | FreeSpaceBox<"skip"> | HandlerReferenceBox | HintMediaHeaderBox | IdentifiedMediaDataBox | IpmpInfoBox | ItemInfoEntry | ItemLocationBox | LabelBox | MediaDataBox | MediaHeaderBox | MovieExtendsHeaderBox | MovieFragmentHeaderBox | MovieFragmentRandomAccessOffsetBox | MovieHeaderBox | NullMediaHeaderBox | OriginalFormatBox | PrimaryItemBox | PreselectionGroupBox | ProducerReferenceTimeBox | ProtectionSystemSpecificHeaderBox | SampleAuxiliaryInformationOffsetsBox | SampleAuxiliaryInformationSizesBox | SampleDependencyTypeBox | SampleDescriptionBox | SampleEncryptionBox | SampleGroupDescriptionBox | SampleSizeBox | SampleToChunkBox | SampleToGroupBox | SchemeTypeBox | SegmentIndexBox | SegmentTypeBox | ShadowSyncSampleBox | SingleItemTypeReferenceBox | SoundMediaHeaderBox | SubsampleInformationBox | SubsegmentIndexBox | SubtitleMediaHeaderBox | SyncSampleBox | TrackEncryptionBox | TrackExtendsBox | TrackFragmentBaseMediaDecodeTimeBox | TrackFragmentHeaderBox | TrackFragmentRandomAccessBox | TrackHeaderBox | TrackKindBox | TrackRunBox | UrlBox | UrnBox | VideoMediaHeaderBox | VisualSampleEntryBox<"avc1"> | VisualSampleEntryBox<"avc2"> | VisualSampleEntryBox<"avc3"> | VisualSampleEntryBox<"avc4"> | VisualSampleEntryBox<"encv"> | VisualSampleEntryBox<"hev1"> | VisualSampleEntryBox<"hvc1"> | WebVttConfigurationBox | WebVttCueIdBox | WebVttCuePayloadBox | WebVttEmptySampleBox | WebVttSettingsBox | WebVttSourceLabelBox;
1216
+ type SubsampleInformationBox = FullBox & {
1217
+ type: "subs";
1218
+ entryCount: number;
1219
+ entries: SubsampleEntry[];
1220
+ };
1308
1221
  //#endregion
1309
- //#region src/boxes/ContainerBox.d.ts
1222
+ //#region src/boxes/TrackFragmentBaseMediaDecodeTimeBox.d.ts
1310
1223
  /**
1311
- * Container Box
1312
- *
1224
+ * ISO/IEC 14496-12:2012 - 8.8.12 Track Fragment Decode Time
1313
1225
  *
1314
- * @beta
1226
+ * @public
1315
1227
  */
1316
- type ContainerBox<T$1> = Box & {
1317
- boxes: T$1[];
1228
+ type TrackFragmentBaseMediaDecodeTimeBox = FullBox & {
1229
+ type: "tfdt";
1230
+ baseMediaDecodeTime: number;
1318
1231
  };
1319
1232
  //#endregion
1320
- //#region src/boxes/DataInformationBox.d.ts
1233
+ //#region src/boxes/TrackFragmentHeaderBox.d.ts
1321
1234
  /**
1322
- * Data Information Box - 'dinf' - Container
1323
- *
1235
+ * ISO/IEC 14496-12:2012 - 8.8.7 Track Fragment Header Box
1324
1236
  *
1325
- * @beta
1237
+ * @public
1326
1238
  */
1327
- type DataInformationBox = ContainerBox<DataReferenceBox> & {
1328
- type: "dinf";
1239
+ type TrackFragmentHeaderBox = FullBox & {
1240
+ type: "tfhd";
1241
+ trackId: number;
1242
+ baseDataOffset?: number;
1243
+ sampleDescriptionIndex?: number;
1244
+ defaultSampleDuration?: number;
1245
+ defaultSampleSize?: number;
1246
+ defaultSampleFlags?: number;
1329
1247
  };
1330
1248
  //#endregion
1331
- //#region src/boxes/EditBox.d.ts
1249
+ //#region src/boxes/TrackRunSample.d.ts
1332
1250
  /**
1333
- * Edit Box - 'edts' - Container
1334
- *
1251
+ * Track run sample
1335
1252
  *
1336
- * @beta
1253
+ * @public
1337
1254
  */
1338
- type EditBox = ContainerBox<EditListBox> & {
1339
- type: "edts";
1255
+ type TrackRunSample = {
1256
+ sampleDuration?: number;
1257
+ sampleSize?: number;
1258
+ sampleFlags?: number;
1259
+ sampleCompositionTimeOffset?: number;
1340
1260
  };
1341
1261
  //#endregion
1342
- //#region src/boxes/ItemInfoBox.d.ts
1262
+ //#region src/boxes/TrackRunBox.d.ts
1343
1263
  /**
1344
- * Item Info Box - 'iinf' - Container
1264
+ * ISO/IEC 14496-12:2012 - 8.8.8 Track Run Box
1345
1265
  *
1266
+ * Note: the 'trun' box has a direct relation to the 'tfhd' box for defaults.
1267
+ * These defaults are not set explicitly here, but are left to resolve for the user.
1346
1268
  *
1347
- * @beta
1269
+ * @public
1348
1270
  */
1349
- type ItemInfoBox = ContainerBox<ItemInfoEntry> & {
1350
- type: "iinf";
1351
- entryCount: number;
1271
+ type TrackRunBox = FullBox & {
1272
+ type: "trun";
1273
+ sampleCount: number;
1274
+ dataOffset?: number;
1275
+ firstSampleFlags?: number;
1276
+ samples: TrackRunSample[];
1352
1277
  };
1353
1278
  //#endregion
1354
- //#region src/boxes/SchemeInformationBox.d.ts
1279
+ //#region src/boxes/TrackFragmentBox.d.ts
1355
1280
  /**
1356
- * Scheme Information Box - 'schi' - Container
1281
+ * Child boxes of Track Fragment Box
1357
1282
  *
1283
+ * @public
1284
+ */
1285
+ type TrackFragmentBoxChild = TrackFragmentHeaderBox | TrackFragmentBaseMediaDecodeTimeBox | TrackRunBox | SampleAuxiliaryInformationSizesBox | SampleAuxiliaryInformationOffsetsBox | SampleEncryptionBox | SubsampleInformationBox;
1286
+ /**
1287
+ * Track Fragment Box - 'traf' - Container
1358
1288
  *
1359
- * @beta
1289
+ * @public
1360
1290
  */
1361
- type SchemeInformationBox = ContainerBox<TrackEncryptionBox | Box> & {
1362
- type: "schi";
1291
+ type TrackFragmentBox = {
1292
+ type: "traf";
1293
+ boxes: TrackFragmentBoxChild[];
1363
1294
  };
1364
1295
  //#endregion
1365
- //#region src/boxes/ProtectionSchemeInformationBox.d.ts
1296
+ //#region src/boxes/MovieFragmentBox.d.ts
1366
1297
  /**
1367
- * Protection Scheme Information Box - 'sinf' - Container
1298
+ * Child boxes of Movie Fragment Box
1368
1299
  *
1300
+ * @public
1301
+ */
1302
+ type MovieFragmentBoxChild = MovieFragmentHeaderBox | TrackFragmentBox;
1303
+ /**
1304
+ * Movie Fragment Box - 'moof' - Container
1369
1305
  *
1370
- * @beta
1306
+ * @public
1371
1307
  */
1372
- type ProtectionSchemeInformationBox = ContainerBox<OriginalFormatBox | IpmpInfoBox | SchemeTypeBox | SchemeInformationBox> & {
1373
- type: "sinf";
1308
+ type MovieFragmentBox = {
1309
+ type: "moof";
1310
+ boxes: MovieFragmentBoxChild[];
1374
1311
  };
1375
1312
  //#endregion
1376
- //#region src/boxes/ItemProtectionBox.d.ts
1313
+ //#region src/boxes/MovieFragmentRandomAccessOffsetBox.d.ts
1377
1314
  /**
1378
- * Item Protection Box - 'ipro' - Container
1379
- *
1315
+ * ISO/IEC 14496-12:2012 - 8.8.11 Movie Fragment Random Access Box
1380
1316
  *
1381
- * @beta
1317
+ * @public
1382
1318
  */
1383
- type ItemProtectionBox = ContainerBox<ProtectionSchemeInformationBox> & {
1384
- type: "ipro";
1385
- protectionCount: number;
1319
+ type MovieFragmentRandomAccessOffsetBox = FullBox & {
1320
+ type: "mfro";
1321
+ mfraSize: number;
1386
1322
  };
1387
1323
  //#endregion
1388
- //#region src/boxes/ItemReferenceBox.d.ts
1324
+ //#region src/boxes/TrackFragmentRandomAccessEntry.d.ts
1389
1325
  /**
1390
- * Item Reference Box - 'iref' - Container
1391
- *
1326
+ * Track fragment random access entry
1392
1327
  *
1393
- * @beta
1328
+ * @public
1394
1329
  */
1395
- type ItemReferenceBox = ContainerBox<SingleItemTypeReferenceBox> & {
1396
- type: "iref";
1330
+ type TrackFragmentRandomAccessEntry = {
1331
+ time: number;
1332
+ moofOffset: number;
1333
+ trafNumber: number;
1334
+ trunNumber: number;
1335
+ sampleNumber: number;
1397
1336
  };
1398
1337
  //#endregion
1399
- //#region src/boxes/SampleTableBox.d.ts
1338
+ //#region src/boxes/TrackFragmentRandomAccessBox.d.ts
1400
1339
  /**
1401
- * Sample Table Box - 'stbl' - Container
1402
- *
1340
+ * ISO/IEC 14496-12:2012 - 8.8.10 Track Fragment Random Access Box
1403
1341
  *
1404
- * @beta
1342
+ * @public
1405
1343
  */
1406
- type SampleTableBox = ContainerBox<SampleDescriptionBox | DecodingTimeToSampleBox | CompositionTimeToSampleBox | SampleToChunkBox | SampleSizeBox | ChunkOffsetBox | SyncSampleBox | ShadowSyncSampleBox | DegradationPriorityBox | SampleDependencyTypeBox | SampleToGroupBox | SampleGroupDescriptionBox> & {
1407
- type: "stbl";
1344
+ type TrackFragmentRandomAccessBox = FullBox & {
1345
+ type: "tfra";
1346
+ trackId: number;
1347
+ reserved: number;
1348
+ numberOfEntry: number;
1349
+ lengthSizeOfTrafNum: number;
1350
+ lengthSizeOfTrunNum: number;
1351
+ lengthSizeOfSampleNum: number;
1352
+ entries: TrackFragmentRandomAccessEntry[];
1408
1353
  };
1409
1354
  //#endregion
1410
- //#region src/boxes/MediaInformationBox.d.ts
1355
+ //#region src/boxes/MovieFragmentRandomAccessBox.d.ts
1411
1356
  /**
1412
- * Media Information Box - 'minf' - Container
1357
+ * Child boxes of Movie Fragment Random Access Box
1413
1358
  *
1359
+ * @public
1360
+ */
1361
+ type MovieFragmentRandomAccessBoxChild = TrackFragmentRandomAccessBox | MovieFragmentRandomAccessOffsetBox;
1362
+ /**
1363
+ * Movie Fragment Random Access Box - 'mfra' - Container
1414
1364
  *
1415
- * @beta
1365
+ * @public
1416
1366
  */
1417
- type MediaInformationBox = ContainerBox<VideoMediaHeaderBox | SoundMediaHeaderBox | HintMediaHeaderBox | NullMediaHeaderBox | DataInformationBox | SampleTableBox> & {
1418
- type: "minf";
1367
+ type MovieFragmentRandomAccessBox = {
1368
+ type: "mfra";
1369
+ boxes: MovieFragmentRandomAccessBoxChild[];
1419
1370
  };
1420
1371
  //#endregion
1421
- //#region src/boxes/MediaBox.d.ts
1372
+ //#region src/boxes/Entity.d.ts
1422
1373
  /**
1423
- * Media Box - 'mdia' - Container
1424
- *
1374
+ * Entity
1425
1375
  *
1426
- * @beta
1376
+ * @public
1427
1377
  */
1428
- type MediaBox = ContainerBox<MediaHeaderBox | HandlerReferenceBox | MediaInformationBox> & {
1429
- type: "mdia";
1378
+ type Entity = {
1379
+ /** Entity ID */
1380
+ entityId: number;
1430
1381
  };
1431
1382
  //#endregion
1432
- //#region src/boxes/MetaBox.d.ts
1383
+ //#region src/boxes/PreselectionGroupBox.d.ts
1433
1384
  /**
1434
- * ISO/IEC 14496-12:202x - 8.11.1 Meta box
1435
- *
1385
+ * ISO/IEC 14496-12:202x - 8.18.4.1 Preselection group box
1436
1386
  *
1437
- * @beta
1387
+ * @public
1438
1388
  */
1439
- type MetaBox = FullBox & ContainerBox<HandlerReferenceBox | PrimaryItemBox | DataInformationBox | ItemLocationBox | ItemProtectionBox | ItemInfoBox | ItemReferenceBox> & {
1440
- type: "meta";
1389
+ type PreselectionGroupBox = FullBox & {
1390
+ type: "prsl";
1391
+ /** Group ID */
1392
+ groupId: number;
1393
+ /** Number of entities in group */
1394
+ numEntitiesInGroup: number;
1395
+ /** Entities */
1396
+ entities: Entity[];
1397
+ preselectionTag?: string;
1398
+ selectionPriority?: number;
1399
+ interleavingTag?: string;
1441
1400
  };
1442
1401
  //#endregion
1443
- //#region src/boxes/MovieExtendsBox.d.ts
1402
+ //#region src/boxes/ProducerReferenceTimeBox.d.ts
1444
1403
  /**
1445
- * Movie Extends Box - 'mvex' - Container
1446
- *
1404
+ * ISO/IEC 14496-12:2012 - 8.16.5 Producer Reference Time
1447
1405
  *
1448
- * @beta
1406
+ * @public
1449
1407
  */
1450
- type MovieExtendsBox = ContainerBox<MovieExtendsHeaderBox | TrackExtendsBox> & {
1451
- type: "mvex";
1408
+ type ProducerReferenceTimeBox = FullBox & {
1409
+ type: "prft";
1410
+ referenceTrackId: number;
1411
+ ntpTimestampSec: number;
1412
+ ntpTimestampFrac: number;
1413
+ mediaTime: number;
1452
1414
  };
1453
1415
  //#endregion
1454
- //#region src/boxes/TrackReferenceTypeBox.d.ts
1416
+ //#region src/boxes/ProtectionSystemSpecificHeaderBox.d.ts
1455
1417
  /**
1456
- * Track Reference Type Box
1457
- *
1418
+ * ISO/IEC 23001-7:2011 - 8.1 Protection System Specific Header Box
1458
1419
  *
1459
- * @beta
1420
+ * @public
1460
1421
  */
1461
- type TrackReferenceTypeBox = Box & {
1462
- type: "tref";
1463
- trackIds: number[];
1422
+ type ProtectionSystemSpecificHeaderBox = FullBox & {
1423
+ type: "pssh";
1424
+ systemId: number[];
1425
+ kidCount: number;
1426
+ kid: number[];
1427
+ dataSize: number;
1428
+ data: number[];
1464
1429
  };
1465
1430
  //#endregion
1466
- //#region src/boxes/TrackReferenceBox.d.ts
1431
+ //#region src/boxes/SegmentIndexReference.d.ts
1467
1432
  /**
1468
- * Track Reference Box - 'tref' - Container
1469
- *
1433
+ * Segment index reference
1470
1434
  *
1471
- * @beta
1435
+ * @public
1472
1436
  */
1473
- type TrackReferenceBox = ContainerBox<TrackReferenceTypeBox> & {
1474
- type: "tref";
1437
+ type SegmentIndexReference = {
1438
+ reference: number;
1439
+ subsegmentDuration: number;
1440
+ sap: number;
1441
+ referenceType: number;
1442
+ referencedSize: number;
1443
+ startsWithSap: number;
1444
+ sapType: number;
1445
+ sapDeltaTime: number;
1475
1446
  };
1476
1447
  //#endregion
1477
- //#region src/boxes/UserDataBox.d.ts
1448
+ //#region src/boxes/SegmentIndexBox.d.ts
1478
1449
  /**
1479
- * User Data Box - 'udta' - Container
1480
- *
1450
+ * ISO/IEC 14496-12:2012 - 8.16.3 Segment Index Box
1481
1451
  *
1482
- * @beta
1452
+ * @public
1483
1453
  */
1484
- type UserDataBox = ContainerBox<Box> & {
1485
- type: "udta";
1454
+ type SegmentIndexBox = FullBox & {
1455
+ type: "sidx";
1456
+ referenceId: number;
1457
+ timescale: number;
1458
+ earliestPresentationTime: number;
1459
+ firstOffset: number;
1460
+ reserved: number;
1461
+ references: SegmentIndexReference[];
1486
1462
  };
1487
1463
  //#endregion
1488
- //#region src/boxes/TrackBox.d.ts
1464
+ //#region src/boxes/SegmentTypeBox.d.ts
1489
1465
  /**
1490
- * Track Box - 'trak' - Container
1491
- *
1466
+ * ISO/IEC 14496-12:2012 - 8.16.2 Segment Type Box
1492
1467
  *
1493
- * @beta
1468
+ * @public
1494
1469
  */
1495
- type TrackBox = ContainerBox<TrackHeaderBox | TrackReferenceBox | EditBox | MediaBox | UserDataBox> & {
1496
- type: "trak";
1497
- };
1470
+ type SegmentTypeBox = TypeBox<"styp">;
1498
1471
  //#endregion
1499
- //#region src/boxes/MovieBox.d.ts
1472
+ //#region src/boxes/SubsegmentRange.d.ts
1500
1473
  /**
1501
- * Movie Box - 'moov' - Container
1502
- *
1474
+ * Subsegment range
1503
1475
  *
1504
- * @beta
1476
+ * @public
1505
1477
  */
1506
- type MovieBox = ContainerBox<MovieHeaderBox | TrackBox | MovieExtendsBox | UserDataBox> & {
1507
- type: "moov";
1478
+ type SubsegmentRange = {
1479
+ level: number;
1480
+ rangeSize: number;
1508
1481
  };
1509
1482
  //#endregion
1510
- //#region src/boxes/TrackFragmentBox.d.ts
1483
+ //#region src/boxes/Subsegment.d.ts
1511
1484
  /**
1512
- * Track Fragment Box - 'traf' - Container
1485
+ * Subsegment
1513
1486
  *
1487
+ * @public
1488
+ */
1489
+ type Subsegment = {
1490
+ rangesCount: number;
1491
+ ranges: SubsegmentRange[];
1492
+ };
1493
+ //#endregion
1494
+ //#region src/boxes/SubsegmentIndexBox.d.ts
1495
+ /**
1496
+ * ISO/IEC 14496-12:2012 - 8.16.4 Subsegment Index Box
1514
1497
  *
1515
- * @beta
1498
+ * @public
1516
1499
  */
1517
- type TrackFragmentBox = ContainerBox<TrackFragmentHeaderBox | TrackFragmentBaseMediaDecodeTimeBox | TrackRunBox | SampleAuxiliaryInformationSizesBox | SampleAuxiliaryInformationOffsetsBox | SampleEncryptionBox> & {
1518
- type: "traf";
1500
+ type SubsegmentIndexBox = FullBox & {
1501
+ type: "ssix";
1502
+ subsegmentCount: number;
1503
+ subsegments: Subsegment[];
1519
1504
  };
1520
1505
  //#endregion
1521
- //#region src/boxes/MovieFragmentBox.d.ts
1506
+ //#region src/boxes/SubTrackBox.d.ts
1522
1507
  /**
1523
- * Movie Fragment Box - 'moof' - Container
1508
+ * Child boxes of Sub Track Box
1524
1509
  *
1510
+ * @public
1511
+ */
1512
+ type SubTrackBoxChild = any;
1513
+ /**
1514
+ * Sub track box - 'strk'
1525
1515
  *
1526
- * @beta
1516
+ * @public
1527
1517
  */
1528
- type MovieFragmentBox = ContainerBox<MovieFragmentHeaderBox | TrackFragmentBox> & {
1529
- type: "moof";
1518
+ type SubTrackBox = {
1519
+ type: "strk";
1520
+ boxes: SubTrackBoxChild[];
1530
1521
  };
1531
1522
  //#endregion
1532
- //#region src/boxes/MovieFragmentRandomAccessBox.d.ts
1523
+ //#region src/boxes/TrackKindBox.d.ts
1533
1524
  /**
1534
- * Movie Fragment Random Access Box - 'mfra' - Container
1525
+ * ISO/IEC 14496-12:202x - 8.10.4 Track kind box
1535
1526
  *
1527
+ * @public
1528
+ */
1529
+ type TrackKindBox = FullBox & {
1530
+ type: "kind";
1531
+ schemeUri: string;
1532
+ value: string;
1533
+ };
1534
+ //#endregion
1535
+ //#region src/boxes/WebVttConfigurationBox.d.ts
1536
+ /**
1537
+ * ISO/IEC 14496-30:2014 - WebVTT Configuration Box
1536
1538
  *
1537
- * @beta
1539
+ * @public
1538
1540
  */
1539
- type MovieFragmentRandomAccessBox = ContainerBox<TrackFragmentRandomAccessBox | MovieFragmentRandomAccessOffsetBox> & {
1540
- type: "mfra";
1541
+ type WebVttConfigurationBox = {
1542
+ type: "vttC";
1543
+ config: string;
1541
1544
  };
1542
1545
  //#endregion
1543
- //#region src/boxes/IsoContainerBox.d.ts
1546
+ //#region src/boxes/WebVttCueIdBox.d.ts
1544
1547
  /**
1545
- * Container boxes that can contain other boxes
1548
+ * ISO/IEC 14496-30:2014 - WebVTT Cue Id Box.
1546
1549
  *
1550
+ * @public
1551
+ */
1552
+ type WebVttCueIdBox = {
1553
+ type: "iden";
1554
+ cueId: string;
1555
+ };
1556
+ //#endregion
1557
+ //#region src/boxes/WebVttCuePayloadBox.d.ts
1558
+ /**
1559
+ * ISO/IEC 14496-30:2014 - WebVTT Cue Payload Box.
1547
1560
  *
1548
- * @beta
1561
+ * @public
1549
1562
  */
1550
- type IsoContainerBox = DataInformationBox | EditBox | ItemInfoBox | ItemProtectionBox | ItemReferenceBox | MediaBox | MediaInformationBox | MetaBox | MovieBox | MovieExtendsBox | MovieFragmentBox | MovieFragmentRandomAccessBox | ProtectionSchemeInformationBox | SampleTableBox | SchemeInformationBox | TrackBox | TrackFragmentBox | TrackReferenceBox | UserDataBox;
1563
+ type WebVttCuePayloadBox = {
1564
+ type: "payl";
1565
+ cueText: string;
1566
+ };
1551
1567
  //#endregion
1552
- //#region src/boxes/IsoBmffBox.d.ts
1568
+ //#region src/boxes/WebVttCueBox.d.ts
1553
1569
  /**
1554
- * Utility type for all ISO BMFF boxes
1570
+ * Child boxes of WebVttCueBox
1571
+ *
1572
+ * @public
1573
+ */
1574
+ type WebVttCueChild = WebVttCueIdBox | WebVttCuePayloadBox;
1575
+ /**
1576
+ * WebVttCueBox - 'vttc' - Container
1555
1577
  *
1578
+ * @public
1579
+ */
1580
+ type WebVttCueBox = {
1581
+ type: "vttc";
1582
+ boxes: WebVttCueChild[];
1583
+ };
1584
+ //#endregion
1585
+ //#region src/boxes/WebVttEmptySampleBox.d.ts
1586
+ /**
1587
+ * ISO/IEC 14496-30:2014 - WebVTT Empty Sample Box
1556
1588
  *
1557
- * @beta
1589
+ * @public
1558
1590
  */
1559
- type IsoBmffBox = IsoBox | IsoContainerBox;
1591
+ type WebVttEmptySampleBox = {
1592
+ type: "vtte";
1593
+ };
1560
1594
  //#endregion
1561
- //#region src/BoxParser.d.ts
1595
+ //#region src/boxes/WebVttSettingsBox.d.ts
1562
1596
  /**
1563
- * Box parser
1597
+ * ISO/IEC 14496-30:2014 - WebVTT Cue Settings Box.
1564
1598
  *
1599
+ * @public
1600
+ */
1601
+ type WebVttSettingsBox = {
1602
+ type: "sttg";
1603
+ settings: string;
1604
+ };
1605
+ //#endregion
1606
+ //#region src/boxes/WebVttSourceLabelBox.d.ts
1607
+ /**
1608
+ * ISO/IEC 14496-30:2014 - WebVTT Source Label Box
1565
1609
  *
1566
- * @beta
1610
+ * @public
1567
1611
  */
1568
- type BoxParser<V = IsoBox> = (view: IsoView, config?: IsoViewConfig) => Fields<V>;
1612
+ type WebVttSourceLabelBox = {
1613
+ type: "vlab";
1614
+ sourceLabel: string;
1615
+ };
1569
1616
  //#endregion
1570
- //#region src/BoxParserMap.d.ts
1617
+ //#region src/IsoBoxMap.d.ts
1571
1618
  /**
1572
- * A map of box parsers to their box types
1619
+ * Comprehensive mapping from box type strings to their corresponding TypeScript interfaces
1620
+ *
1621
+ * @public
1622
+ */
1623
+ type IsoBoxMap = {
1624
+ ardi: AudioRenderingIndicationBox;
1625
+ avc1: VisualSampleEntryBox<"avc1">;
1626
+ avc2: VisualSampleEntryBox<"avc2">;
1627
+ avc3: VisualSampleEntryBox<"avc3">;
1628
+ avc4: VisualSampleEntryBox<"avc4">;
1629
+ co64: ChunkLargeOffsetBox;
1630
+ ctts: CompositionTimeToSampleBox;
1631
+ dinf: DataInformationBox;
1632
+ dref: DataReferenceBox;
1633
+ edts: EditBox;
1634
+ elng: ExtendedLanguageBox;
1635
+ elst: EditListBox;
1636
+ emsg: EventMessageBox;
1637
+ enca: AudioSampleEntryBox<"enca">;
1638
+ encv: VisualSampleEntryBox<"encv">;
1639
+ free: FreeSpaceBox<"free">;
1640
+ frma: OriginalFormatBox;
1641
+ ftyp: FileTypeBox;
1642
+ grpl: GroupsListBox;
1643
+ hdlr: HandlerReferenceBox;
1644
+ hev1: VisualSampleEntryBox<"hev1">;
1645
+ hmhd: HintMediaHeaderBox;
1646
+ hvc1: VisualSampleEntryBox<"hvc1">;
1647
+ iden: WebVttCueIdBox;
1648
+ iinf: ItemInfoBox;
1649
+ iloc: ItemLocationBox;
1650
+ imda: IdentifiedMediaDataBox;
1651
+ imif: IpmpInfoBox;
1652
+ infe: ItemInfoEntry;
1653
+ ipro: ItemProtectionBox;
1654
+ iref: ItemReferenceBox;
1655
+ kind: TrackKindBox;
1656
+ labl: LabelBox;
1657
+ mdat: MediaDataBox;
1658
+ mdhd: MediaHeaderBox;
1659
+ mdia: MediaBox;
1660
+ meco: AdditionalMetadataContainerBox;
1661
+ mehd: MovieExtendsHeaderBox;
1662
+ meta: MetaBox;
1663
+ mfhd: MovieFragmentHeaderBox;
1664
+ mfra: MovieFragmentRandomAccessBox;
1665
+ mfro: MovieFragmentRandomAccessOffsetBox;
1666
+ minf: MediaInformationBox;
1667
+ moof: MovieFragmentBox;
1668
+ moov: MovieBox;
1669
+ mp4a: AudioSampleEntryBox<"mp4a">;
1670
+ mvex: MovieExtendsBox;
1671
+ mvhd: MovieHeaderBox;
1672
+ nmhd: NullMediaHeaderBox;
1673
+ payl: WebVttCuePayloadBox;
1674
+ pitm: PrimaryItemBox;
1675
+ prft: ProducerReferenceTimeBox;
1676
+ prsl: PreselectionGroupBox;
1677
+ pssh: ProtectionSystemSpecificHeaderBox;
1678
+ saio: SampleAuxiliaryInformationOffsetsBox;
1679
+ saiz: SampleAuxiliaryInformationSizesBox;
1680
+ sbgp: SampleToGroupBox;
1681
+ schi: SchemeInformationBox;
1682
+ schm: SchemeTypeBox;
1683
+ sdtp: SampleDependencyTypeBox;
1684
+ senc: SampleEncryptionBox;
1685
+ sgpd: SampleGroupDescriptionBox;
1686
+ sidx: SegmentIndexBox;
1687
+ sinf: ProtectionSchemeInformationBox;
1688
+ skip: FreeSpaceBox<"skip">;
1689
+ smhd: SoundMediaHeaderBox;
1690
+ ssix: SubsegmentIndexBox;
1691
+ stbl: SampleTableBox;
1692
+ stco: ChunkOffsetBox;
1693
+ stdp: DegradationPriorityBox;
1694
+ sthd: SubtitleMediaHeaderBox;
1695
+ strk: SubTrackBox;
1696
+ stsc: SampleToChunkBox;
1697
+ stsd: SampleDescriptionBox;
1698
+ stsh: ShadowSyncSampleBox;
1699
+ stss: SyncSampleBox;
1700
+ stsz: SampleSizeBox;
1701
+ sttg: WebVttSettingsBox;
1702
+ stts: DecodingTimeToSampleBox;
1703
+ styp: SegmentTypeBox;
1704
+ subs: SubsampleInformationBox;
1705
+ stz2: CompactSampleSizeBox;
1706
+ tenc: TrackEncryptionBox;
1707
+ tfdt: TrackFragmentBaseMediaDecodeTimeBox;
1708
+ tfhd: TrackFragmentHeaderBox;
1709
+ tfra: TrackFragmentRandomAccessBox;
1710
+ tkhd: TrackHeaderBox;
1711
+ traf: TrackFragmentBox;
1712
+ trak: TrackBox;
1713
+ tref: TrackReferenceBox;
1714
+ trex: TrackExtendsBox;
1715
+ trun: TrackRunBox;
1716
+ udta: UserDataBox;
1717
+ "url ": DataEntryUrlBox;
1718
+ "urn ": DataEntryUrnBox;
1719
+ vlab: WebVttSourceLabelBox;
1720
+ vmhd: VideoMediaHeaderBox;
1721
+ vttc: WebVttCueBox;
1722
+ vttC: WebVttConfigurationBox;
1723
+ vtte: WebVttEmptySampleBox;
1724
+ };
1725
+ //#endregion
1726
+ //#region src/IsoBox.d.ts
1727
+ /**
1728
+ * Utility type for all ISO BMFF boxes
1573
1729
  *
1730
+ * @public
1731
+ */
1732
+ type IsoBox = IsoBoxMap[keyof IsoBoxMap];
1733
+ //#endregion
1734
+ //#region src/IsoBoxReader.d.ts
1735
+ /**
1736
+ * ISO BMFF box reader
1574
1737
  *
1575
- * @beta
1738
+ * @public
1576
1739
  */
1577
- type BoxParserMap = Record<string, BoxParser>;
1740
+ type IsoBoxReader<B$1 extends IsoBox> = (view: IsoBoxReadView) => B$1;
1578
1741
  //#endregion
1579
- //#region src/IsoViewConfig.d.ts
1742
+ //#region src/IsoBoxReaderMap.d.ts
1580
1743
  /**
1581
- * ISO View configuration
1744
+ * A map of box parsers to their box types
1582
1745
  *
1746
+ * @public
1747
+ */
1748
+ type IsoBoxReaderMap = Partial<{ [P in IsoBox["type"]]: IsoBoxReader<Extract<IsoBox, Record<"type", P>>> }>;
1749
+ //#endregion
1750
+ //#region src/IsoBoxReadViewConfig.d.ts
1751
+ /**
1752
+ * ISO Box Read View configuration
1583
1753
  *
1584
- * @beta
1754
+ * @public
1585
1755
  */
1586
- type IsoViewConfig = {
1756
+ type IsoBoxReadViewConfig<R extends IsoBoxReaderMap = IsoBoxReaderMap> = {
1587
1757
  /**
1588
1758
  * A map of box parsers to their box types
1589
1759
  */
1590
- parsers?: BoxParserMap;
1591
- /**
1592
- * Whether to parse boxes recursively
1593
- */
1594
- recursive?: boolean;
1760
+ readers?: R;
1595
1761
  };
1596
1762
  //#endregion
1597
- //#region src/readers/IsoFieldTypeMap.d.ts
1763
+ //#region src/IsoFieldTypeMap.d.ts
1598
1764
  /**
1599
1765
  * IsoFieldTypeMap is a map of ISO BMFF field types to their corresponding JavaScript types.
1600
1766
  *
1601
- *
1602
- * @beta
1767
+ * @public
1603
1768
  */
1604
1769
  type IsoFieldTypeMap = {
1605
1770
  uint: number;
@@ -1611,28 +1776,30 @@ type IsoFieldTypeMap = {
1611
1776
  utf8string: string;
1612
1777
  };
1613
1778
  //#endregion
1614
- //#region src/IsoView.d.ts
1779
+ //#region src/IsoParsedBox.d.ts
1615
1780
  /**
1616
- * Raw ISO BMFF data box.
1781
+ * Iso Parsed Box Type
1617
1782
  *
1783
+ * @public
1784
+ */
1785
+ type IsoParsedBox<T$1 extends IsoBox = IsoBox> = T$1 & Omit<Box, "type">;
1786
+ //#endregion
1787
+ //#region src/ParsedBox.d.ts
1788
+ /**
1789
+ * Parsed Box Type
1618
1790
  *
1619
- * @beta
1791
+ * @public
1620
1792
  */
1621
- type RawBox = {
1622
- type: string;
1623
- size: number;
1624
- largesize?: number;
1625
- usertype?: number[];
1626
- data: IsoView;
1627
- };
1793
+ type ParsedBox = IsoParsedBox | Box;
1794
+ //#endregion
1795
+ //#region src/IsoBoxReadView.d.ts
1628
1796
  /**
1629
1797
  * ISO BMFF data view. Similar to DataView, but with additional methods for reading ISO BMFF data.
1630
1798
  * It implements the iterator protocol, so it can be used in a for...of loop.
1631
1799
  *
1632
- *
1633
- * @beta
1800
+ * @public
1634
1801
  */
1635
- declare class IsoView {
1802
+ declare class IsoBoxReadView<R extends IsoBoxReaderMap = IsoBoxReaderMap> {
1636
1803
  private dataView;
1637
1804
  private offset;
1638
1805
  private config;
@@ -1645,7 +1812,19 @@ declare class IsoView {
1645
1812
  * @param raw - The raw data to view.
1646
1813
  * @param config - The configuration for the IsoView.
1647
1814
  */
1648
- constructor(raw: ArrayBuffer | DataView<ArrayBuffer> | Uint8Array<ArrayBuffer>, config?: IsoViewConfig);
1815
+ constructor(raw: ArrayBuffer | ArrayBufferView<ArrayBuffer>, config?: IsoBoxReadViewConfig<R>);
1816
+ /**
1817
+ * The buffer of the data view.
1818
+ */
1819
+ get buffer(): ArrayBuffer;
1820
+ /**
1821
+ * The byte offset of the data view.
1822
+ */
1823
+ get byteOffset(): number;
1824
+ /**
1825
+ * The byte length of the data view.
1826
+ */
1827
+ get byteLength(): number;
1649
1828
  /**
1650
1829
  * The current byteoffset in the data view.
1651
1830
  */
@@ -1664,7 +1843,7 @@ declare class IsoView {
1664
1843
  * @param size - The size of the slice.
1665
1844
  * @returns A new IsoView instance.
1666
1845
  */
1667
- slice: (size: number) => IsoView;
1846
+ slice: (offset: number, size: number) => IsoBoxReadView<R>;
1668
1847
  private read;
1669
1848
  /**
1670
1849
  * Reads a unsigned integer from the data view.
@@ -1713,7 +1892,7 @@ declare class IsoView {
1713
1892
  *
1714
1893
  * @returns The full box.
1715
1894
  */
1716
- readFullBox: () => Fields<FullBox>;
1895
+ readFullBox: () => FullBox;
1717
1896
  /**
1718
1897
  * Reads an array of values from the data view.
1719
1898
  *
@@ -1724,18 +1903,24 @@ declare class IsoView {
1724
1903
  */
1725
1904
  readArray: <T extends keyof IsoFieldTypeMap>(type: T, size: number, length: number) => IsoFieldTypeMap[T][];
1726
1905
  /**
1906
+ * Skips a number of bytes in the view.
1907
+ *
1908
+ * @param size - The number of bytes to skip.
1909
+ */
1910
+ jump: (size: number) => void;
1911
+ /**
1727
1912
  * Reads a raw box from the data view.
1728
1913
  *
1729
1914
  * @returns The box.
1730
1915
  */
1731
- readBox: () => RawBox;
1916
+ readBox: () => Box;
1732
1917
  /**
1733
1918
  * Reads a number of boxes from the data view.
1734
1919
  *
1735
1920
  * @param length - The number of boxes to read.
1736
1921
  * @returns The boxes.
1737
1922
  */
1738
- readBoxes: <T = IsoBmffBox>(length: number) => T[];
1923
+ readBoxes: <T = IsoBox>(length?: number) => T[];
1739
1924
  /**
1740
1925
  * Reads a number of entries from the data view.
1741
1926
  *
@@ -1749,76 +1934,28 @@ declare class IsoView {
1749
1934
  *
1750
1935
  * @returns A generator of boxes.
1751
1936
  */
1752
- [Symbol.iterator](): Generator<IsoBmffBox>;
1937
+ [Symbol.iterator](): Generator<ParsedBox>;
1753
1938
  }
1754
1939
  //#endregion
1755
1940
  //#region src/boxes/Box.d.ts
1756
1941
  /**
1757
1942
  * Base Box Type
1758
1943
  *
1759
- *
1760
- * @beta
1944
+ * @public
1761
1945
  */
1762
1946
  type Box = {
1763
- type: string;
1947
+ type: "";
1764
1948
  size: number;
1765
- view: IsoView;
1949
+ view: IsoBoxReadView;
1766
1950
  largesize?: number;
1767
1951
  usertype?: number[];
1768
1952
  };
1769
1953
  //#endregion
1770
- //#region src/boxes/TypeBox.d.ts
1771
- /**
1772
- * Utility TypeBox
1773
- *
1774
- *
1775
- * @beta
1776
- */
1777
- type TypeBox<T$1> = Box & {
1778
- type: T$1;
1779
- majorBrand: string;
1780
- minorVersion: number;
1781
- compatibleBrands: string[];
1782
- };
1783
- //#endregion
1784
- //#region src/BoxFilter.d.ts
1785
- /**
1786
- * Box filter function
1787
- *
1788
- *
1789
- * @beta
1790
- */
1791
- type BoxFilter<T$1 extends IsoBmffBox> = ((box: IsoBmffBox) => boolean) | ((box: IsoBmffBox) => box is T$1);
1792
- //#endregion
1793
- //#region src/IsoData.d.ts
1794
- /**
1795
- * ISO data
1796
- *
1797
- *
1798
- * @beta
1799
- */
1800
- type IsoData = ArrayBuffer | DataView<ArrayBuffer> | Uint8Array<ArrayBuffer>;
1801
- //#endregion
1802
- //#region src/createIsoView.d.ts
1803
- /**
1804
- * Create an IsoView from a raw ISO data.
1805
- *
1806
- * @param raw - The raw ISO data
1807
- * @param config - The configuration for the IsoView
1808
- *
1809
- * @returns The created IsoView
1810
- *
1811
- *
1812
- * @beta
1813
- */
1814
- declare function createIsoView(raw: IsoData, config?: IsoViewConfig): IsoView;
1815
- //#endregion
1816
1954
  //#region src/fields/DATA.d.ts
1817
1955
  /**
1818
1956
  * The data field type
1819
1957
  *
1820
- *
1821
- * @beta
1958
+ * @public
1822
1959
  */
1823
1960
  declare const DATA = "data";
1824
1961
  //#endregion
@@ -1826,8 +1963,7 @@ declare const DATA = "data";
1826
1963
  /**
1827
1964
  * The integer field type
1828
1965
  *
1829
- *
1830
- * @beta
1966
+ * @public
1831
1967
  */
1832
1968
  declare const INT = "int";
1833
1969
  //#endregion
@@ -1835,8 +1971,7 @@ declare const INT = "int";
1835
1971
  /**
1836
1972
  * The string field type
1837
1973
  *
1838
- *
1839
- * @beta
1974
+ * @public
1840
1975
  */
1841
1976
  declare const STRING = "string";
1842
1977
  //#endregion
@@ -1844,8 +1979,7 @@ declare const STRING = "string";
1844
1979
  /**
1845
1980
  * The template field type
1846
1981
  *
1847
- *
1848
- * @beta
1982
+ * @public
1849
1983
  */
1850
1984
  declare const TEMPLATE = "template";
1851
1985
  //#endregion
@@ -1853,8 +1987,7 @@ declare const TEMPLATE = "template";
1853
1987
  /**
1854
1988
  * The unsigned integer field type
1855
1989
  *
1856
- *
1857
- * @beta
1990
+ * @public
1858
1991
  */
1859
1992
  declare const UINT = "uint";
1860
1993
  //#endregion
@@ -1862,966 +1995,1863 @@ declare const UINT = "uint";
1862
1995
  /**
1863
1996
  * The UTF8 field type
1864
1997
  *
1865
- *
1866
- * @beta
1998
+ * @public
1867
1999
  */
1868
2000
  declare const UTF8 = "utf8";
1869
2001
  //#endregion
1870
- //#region src/filterBoxes.d.ts
1871
- /**
1872
- * Filters boxes based on the given filter function.
1873
- *
1874
- * @param raw - The raw boxes to filter.
1875
- * @param config - The box parser configuration.
1876
- * @param fn - The filter function.
1877
- * @returns The filtered boxes.
1878
- *
1879
- * @beta
1880
- */
1881
- declare function filterBoxes<T$1 extends IsoBmffBox = IsoBmffBox>(raw: IsoData | Iterable<IsoBmffBox>, fn: BoxFilter<T$1>, config?: IsoViewConfig): T$1[];
1882
- //#endregion
1883
- //#region src/boxes/IsoBmffBoxMap.d.ts
2002
+ //#region src/IsoBoxContainerMap.d.ts
1884
2003
  /**
1885
- * Comprehensive mapping from box type strings to their corresponding TypeScript interfaces
2004
+ * Map of container box types to their allowed child box types
1886
2005
  *
1887
- *
1888
- * @beta
2006
+ * @public
1889
2007
  */
1890
- type IsoBmffBoxMap = {
1891
- ardi: AudioRenderingIndicationBox;
1892
- avc1: VisualSampleEntryBox<"avc1">;
1893
- avc2: VisualSampleEntryBox<"avc2">;
1894
- avc3: VisualSampleEntryBox<"avc3">;
1895
- avc4: VisualSampleEntryBox<"avc4">;
1896
- co64: ChunkLargeOffsetBox;
1897
- ctts: CompositionTimeToSampleBox;
2008
+ type IsoBoxContainerMap = {
1898
2009
  dinf: DataInformationBox;
1899
- dref: DataReferenceBox;
1900
2010
  edts: EditBox;
1901
- elng: ExtendedLanguageBox;
1902
- elst: EditListBox;
1903
- emsg: EventMessageBox;
1904
- enca: AudioSampleEntryBox<"enca">;
1905
- encv: VisualSampleEntryBox<"encv">;
1906
- free: FreeSpaceBox<"free">;
1907
- frma: OriginalFormatBox;
1908
- ftyp: FileTypeBox;
1909
- hdlr: HandlerReferenceBox;
1910
- hev1: VisualSampleEntryBox<"hev1">;
1911
- hmhd: HintMediaHeaderBox;
1912
- hvc1: VisualSampleEntryBox<"hvc1">;
1913
- iden: WebVttCueIdBox;
1914
- iinf: ItemInfoBox;
1915
- iloc: ItemLocationBox;
1916
- imda: IdentifiedMediaDataBox;
1917
- imif: IpmpInfoBox;
1918
- infe: ItemInfoEntry;
1919
- ipro: ItemProtectionBox;
1920
- iref: ItemReferenceBox;
1921
- kind: TrackKindBox;
1922
- labl: LabelBox;
1923
- mdat: MediaDataBox;
1924
- mdhd: MediaHeaderBox;
2011
+ grpl: GroupsListBox;
1925
2012
  mdia: MediaBox;
1926
- mehd: MovieExtendsHeaderBox;
2013
+ meco: AdditionalMetadataContainerBox;
1927
2014
  meta: MetaBox;
1928
- mfhd: MovieFragmentHeaderBox;
1929
2015
  mfra: MovieFragmentRandomAccessBox;
1930
- mfro: MovieFragmentRandomAccessOffsetBox;
1931
2016
  minf: MediaInformationBox;
1932
2017
  moof: MovieFragmentBox;
1933
2018
  moov: MovieBox;
1934
- mp4a: AudioSampleEntryBox<"mp4a">;
1935
2019
  mvex: MovieExtendsBox;
1936
- mvhd: MovieHeaderBox;
1937
- nmhd: NullMediaHeaderBox;
1938
- payl: WebVttCuePayloadBox;
1939
- pitm: PrimaryItemBox;
1940
- prft: ProducerReferenceTimeBox;
1941
- prsl: PreselectionGroupBox;
1942
- pssh: ProtectionSystemSpecificHeaderBox;
1943
- saio: SampleAuxiliaryInformationOffsetsBox;
1944
- saiz: SampleAuxiliaryInformationSizesBox;
1945
- sbgp: SampleToGroupBox;
1946
2020
  schi: SchemeInformationBox;
1947
- schm: SchemeTypeBox;
1948
- sdtp: SampleDependencyTypeBox;
1949
- senc: SampleEncryptionBox;
1950
- sgpd: SampleGroupDescriptionBox;
1951
- sidx: SegmentIndexBox;
1952
2021
  sinf: ProtectionSchemeInformationBox;
1953
- skip: FreeSpaceBox<"skip">;
1954
- smhd: SoundMediaHeaderBox;
1955
- ssix: SubsegmentIndexBox;
1956
2022
  stbl: SampleTableBox;
1957
- stco: ChunkOffsetBox;
1958
- stdp: DegradationPriorityBox;
1959
- sthd: SubtitleMediaHeaderBox;
1960
- stsc: SampleToChunkBox;
1961
- stsd: SampleDescriptionBox;
1962
- stsh: ShadowSyncSampleBox;
1963
- stss: SyncSampleBox;
1964
- stsz: SampleSizeBox;
1965
- sttg: WebVttSettingsBox;
1966
- stts: DecodingTimeToSampleBox;
1967
- styp: SegmentTypeBox;
1968
- subs: SubsampleInformationBox;
1969
- stz2: CompactSampleSizeBox;
1970
- tenc: TrackEncryptionBox;
1971
- tfdt: TrackFragmentBaseMediaDecodeTimeBox;
1972
- tfhd: TrackFragmentHeaderBox;
1973
- tfra: TrackFragmentRandomAccessBox;
1974
- tkhd: TrackHeaderBox;
2023
+ strk: SubTrackBox;
1975
2024
  traf: TrackFragmentBox;
1976
2025
  trak: TrackBox;
1977
2026
  tref: TrackReferenceBox;
1978
- trex: TrackExtendsBox;
1979
- trun: TrackRunBox;
1980
2027
  udta: UserDataBox;
1981
- url: DataEntryUrlBox;
1982
- urn: DataEntryUrnBox;
1983
- vlab: WebVttSourceLabelBox;
1984
- vmhd: VideoMediaHeaderBox;
1985
- vttC: WebVttConfigurationBox;
1986
- vtte: WebVttEmptySampleBox;
2028
+ vttc: WebVttCueBox;
2029
+ };
2030
+ //#endregion
2031
+ //#region src/IsoBoxContainer.d.ts
2032
+ /**
2033
+ * Iso Box Container Type
2034
+ *
2035
+ * @public
2036
+ */
2037
+ type IsoBoxContainer = IsoBoxContainerMap[keyof IsoBoxContainerMap];
2038
+ //#endregion
2039
+ //#region src/IsoBoxData.d.ts
2040
+ /**
2041
+ * ISO data
2042
+ *
2043
+ * @public
2044
+ */
2045
+ type IsoBoxData = ArrayBuffer | DataView<ArrayBuffer> | Uint8Array<ArrayBuffer>;
2046
+ //#endregion
2047
+ //#region src/IsoBoxReaderReturn.d.ts
2048
+ /**
2049
+ * Return type for a box reader.
2050
+ *
2051
+ * @public
2052
+ */
2053
+ type BoxReturn<T$1 extends IsoBoxReaderMap> = IsoParsedBox<{ [K in keyof T$1]: T$1[K] extends IsoBoxReader<infer B> ? B : never }[keyof T$1]>;
2054
+ /**
2055
+ * Return type for a container reader
2056
+ *
2057
+ * @public
2058
+ */
2059
+ type ContainerReturn = IsoParsedBox<IsoBoxContainer>;
2060
+ /**
2061
+ * Return type for the ISO box reader
2062
+ *
2063
+ * @public
2064
+ */
2065
+ type IsoBoxReaderReturn<T$1 extends IsoBoxReaderMap> = BoxReturn<T$1> | ContainerReturn | ParsedBox;
2066
+ //#endregion
2067
+ //#region src/IsoBoxStreamable.d.ts
2068
+ /**
2069
+ * A type that represents a streamable ISO BMFF box or array buffer view.
2070
+ *
2071
+ * @public
2072
+ */
2073
+ type IsoBoxStreamable = IsoBox | Box | ArrayBufferView;
2074
+ //#endregion
2075
+ //#region src/IsoBoxWriterMap.d.ts
2076
+ /**
2077
+ * A map of box writers to their box types
2078
+ *
2079
+ * @public
2080
+ */
2081
+ type IsoBoxWriterMap = Partial<{ [P in IsoBox["type"]]: IsoBoxWriter<Extract<IsoBox, Record<"type", P>>> }>;
2082
+ //#endregion
2083
+ //#region src/IsoBoxWriteViewConfig.d.ts
2084
+ /**
2085
+ * Configuration for the IsoBoxReadableStream.
2086
+ *
2087
+ * @public
2088
+ */
2089
+ type IsoBoxWriteViewConfig = {
2090
+ /**
2091
+ * A map of box writers to their box types
2092
+ */
2093
+ writers?: IsoBoxWriterMap;
1987
2094
  };
1988
2095
  //#endregion
1989
- //#region src/filterBoxesByType.d.ts
2096
+ //#region src/IsoBoxWriter.d.ts
2097
+ /**
2098
+ * ISO box writer.
2099
+ *
2100
+ * @public
2101
+ */
2102
+ type IsoBoxWriter<B$1> = (box: B$1, config: Required<IsoBoxWriteViewConfig>) => ArrayBufferView;
2103
+ //#endregion
2104
+ //#region src/IsoBoxWriteView.d.ts
2105
+ /**
2106
+ * A view for writing ISO BMFF data.
2107
+ *
2108
+ * @public
2109
+ */
2110
+ declare class IsoBoxWriteView {
2111
+ private dataView;
2112
+ private cursor;
2113
+ /**
2114
+ * Constructs a new IsoBoxWriteView.
2115
+ *
2116
+ * @param size - The size of the data view.
2117
+ */
2118
+ constructor(type: string, size: number);
2119
+ /**
2120
+ * The buffer of the data view.
2121
+ *
2122
+ * @returns The buffer of the data view.
2123
+ */
2124
+ get buffer(): ArrayBuffer;
2125
+ /**
2126
+ * The length of the data view.
2127
+ *
2128
+ * @returns The length of the data view.
2129
+ */
2130
+ get byteLength(): number;
2131
+ /**
2132
+ * The offset of the data view.
2133
+ *
2134
+ * @returns The offset of the data view.
2135
+ */
2136
+ get byteOffset(): number;
2137
+ /**
2138
+ * Writes a uint to the data view.
2139
+ *
2140
+ * @param value - The value to write.
2141
+ * @param size - The size, in bytes, of the value.
2142
+ */
2143
+ writeUint: (value: number, size: number) => void;
2144
+ /**
2145
+ * Writes an int to the data view.
2146
+ *
2147
+ * @param value - The value to write.
2148
+ * @param size - The size, in bytes, of the value.
2149
+ */
2150
+ writeInt: (value: number, size: number) => void;
2151
+ /**
2152
+ * Writes a string to the data view.
2153
+ *
2154
+ * @param value - The value to write.
2155
+ */
2156
+ writeString: (value: string) => void;
2157
+ /**
2158
+ * Writes a null terminated string to the data view.
2159
+ *
2160
+ * @param value - The value to write.
2161
+ */
2162
+ writeTerminatedString: (value: string) => void;
2163
+ /**
2164
+ * Writes a UTF-8 null terminated string to the data view.
2165
+ *
2166
+ * @param value - The value to write.
2167
+ */
2168
+ writeUtf8TerminatedString: (value: string) => void;
2169
+ /**
2170
+ * Writes a Uint8Array to the data view.
2171
+ *
2172
+ * @param data - The data to write.
2173
+ */
2174
+ writeBytes: (data: Uint8Array) => void;
2175
+ /**
2176
+ * Writes an array of numbers to the data view.
2177
+ *
2178
+ * @param data - The data to write.
2179
+ * @param type - The type of the data.
2180
+ * @param size - The size, in bytes, of each data value.
2181
+ * @param length - The number of values to write. (optional)
2182
+ */
2183
+ writeArray: <T extends keyof IsoFieldTypeMap>(data: number[], type: T, size: number, length: number) => void;
2184
+ /**
2185
+ * Writes a template to the data view.
2186
+ *
2187
+ * @param value - The value to write.
2188
+ * @param size - The size, in bytes, of the template.
2189
+ */
2190
+ writeTemplate: (value: number, size: number) => void;
2191
+ /**
2192
+ * Writes a box header to the data view.
2193
+ *
2194
+ * @param type - The type of the box.
2195
+ * @param size - The size, in bytes, of the box.
2196
+ */
2197
+ writeBoxHeader: (type: string, size: number) => void;
2198
+ /**
2199
+ * Writes a full box header to the data view.
2200
+ *
2201
+ * @param version - The version of the full box.
2202
+ * @param flags - The flags of the full box.
2203
+ */
2204
+ writeFullBox(version: number, flags: number): void;
2205
+ }
2206
+ //#endregion
2207
+ //#region src/IsoTypedParsedBox.d.ts
2208
+ /**
2209
+ * Typed Parsed Box Type
2210
+ *
2211
+ * @public
2212
+ */
2213
+ type IsoTypedParsedBox<T$1 extends keyof IsoBoxMap> = IsoBoxMap[T$1] & Omit<Box, "type">;
2214
+ //#endregion
2215
+ //#region src/createIsoBoxReadableStream.d.ts
2216
+ /**
2217
+ * Creates a ReadableStream of ISO BMFF boxes as Uint8Arrays.
2218
+ *
2219
+ * @param boxes - The boxes to stream.
2220
+ * @param config - The configuration for the stream.
2221
+ *
2222
+ * @returns A new IsoBoxReadableStream.
2223
+ *
2224
+ * @example
2225
+ * {@includeCode ../test/createIsoBoxReadableStream.test.ts#example}
2226
+ *
2227
+ * @public
2228
+ */
2229
+ declare function createIsoBoxReadableStream(boxes: Iterable<IsoBoxStreamable>, config?: IsoBoxWriteViewConfig): ReadableStream<Uint8Array>;
2230
+ //#endregion
2231
+ //#region src/IsoBoxReadableStream.d.ts
2232
+ /**
2233
+ * A readable stream of ISO BMFF boxes as Uint8Arrays.
2234
+ *
2235
+ * @public
2236
+ */
2237
+ declare class IsoBoxReadableStream extends ReadableStream<Uint8Array> {
2238
+ /**
2239
+ * Constructs a new IsoBoxReadableStream.
2240
+ *
2241
+ * @param boxes - The boxes to stream.
2242
+ * @param config - The configuration for the stream.
2243
+ */
2244
+ constructor(boxes: Iterable<IsoBoxStreamable>, config?: IsoBoxWriteViewConfig);
2245
+ }
2246
+ //#endregion
2247
+ //#region src/readers/readArdi.d.ts
2248
+ /**
2249
+ * Parse a AudioRenderingIndicationBox from an IsoView
2250
+ *
2251
+ * @param view - The IsoView to read data from
2252
+ *
2253
+ * @returns A parsed AudioRenderingIndicationBox
2254
+ *
2255
+ * @public
2256
+ */
2257
+ declare function readArdi(view: IsoBoxReadView): AudioRenderingIndicationBox;
2258
+ //#endregion
2259
+ //#region src/readers/readAvc1.d.ts
2260
+ /**
2261
+ * Parse a VisualSampleEntryBox from an IsoView
2262
+ *
2263
+ * @param view - The IsoView to read data from
2264
+ *
2265
+ * @returns A parsed VisualSampleEntryBox
2266
+ *
2267
+ * @public
2268
+ */
2269
+ declare function readAvc1(view: IsoBoxReadView): VisualSampleEntryBox<"avc1">;
2270
+ //#endregion
2271
+ //#region src/readers/readAvc2.d.ts
2272
+ /**
2273
+ * Parse a VisualSampleEntryBox from an IsoView
2274
+ *
2275
+ * @param view - The IsoView to read data from
2276
+ *
2277
+ * @returns A parsed VisualSampleEntryBox
2278
+ *
2279
+ * @public
2280
+ */
2281
+ declare function readAvc2(view: IsoBoxReadView): VisualSampleEntryBox<"avc2">;
2282
+ //#endregion
2283
+ //#region src/readers/readAvc3.d.ts
2284
+ /**
2285
+ * Parse a VisualSampleEntryBox from an IsoView
2286
+ *
2287
+ * @param view - The IsoView to read data from
2288
+ *
2289
+ * @returns A parsed VisualSampleEntryBox
2290
+ *
2291
+ * @public
2292
+ */
2293
+ declare function readAvc3(view: IsoBoxReadView): VisualSampleEntryBox<"avc3">;
2294
+ //#endregion
2295
+ //#region src/readers/readAvc4.d.ts
2296
+ /**
2297
+ * Parse a VisualSampleEntryBox from an IsoView
2298
+ *
2299
+ * @param view - The IsoView to read data from
2300
+ *
2301
+ * @returns A parsed VisualSampleEntryBox
2302
+ *
2303
+ * @public
2304
+ */
2305
+ declare function readAvc4(view: IsoBoxReadView): VisualSampleEntryBox<"avc4">;
2306
+ //#endregion
2307
+ //#region src/readers/readCtts.d.ts
2308
+ /**
2309
+ * Parse a CompositionTimeToSampleBox from an IsoView
2310
+ *
2311
+ * @param view - The IsoView to read data from
2312
+ *
2313
+ * @returns A parsed CompositionTimeToSampleBox
2314
+ *
2315
+ * @public
2316
+ */
2317
+ declare function readCtts(view: IsoBoxReadView): CompositionTimeToSampleBox;
2318
+ //#endregion
2319
+ //#region src/readers/readDref.d.ts
2320
+ /**
2321
+ * Parse a DataReferenceBox from an IsoView
2322
+ *
2323
+ * @param view - The IsoView to read data from
2324
+ *
2325
+ * @returns A parsed DataReferenceBox
2326
+ *
2327
+ * @public
2328
+ */
2329
+ declare function readDref(view: IsoBoxReadView): DataReferenceBox;
2330
+ //#endregion
2331
+ //#region src/readers/readElng.d.ts
2332
+ /**
2333
+ * Parse a ExtendedLanguageBox from an IsoView
2334
+ *
2335
+ * @param view - The IsoView to read data from
2336
+ *
2337
+ * @returns A parsed ExtendedLanguageBox
2338
+ *
2339
+ * @public
2340
+ */
2341
+ declare function readElng(view: IsoBoxReadView): ExtendedLanguageBox;
2342
+ //#endregion
2343
+ //#region src/readers/readElst.d.ts
2344
+ /**
2345
+ * Parse a Box from an IsoView
2346
+ *
2347
+ * @param view - The IsoView to read data from
2348
+ *
2349
+ * @returns A parsed Box
2350
+ *
2351
+ * @public
2352
+ */
2353
+ declare function readElst(view: IsoBoxReadView): EditListBox;
2354
+ //#endregion
2355
+ //#region src/readers/readEmsg.d.ts
2356
+ /**
2357
+ * Parse an EventMessageBox from an IsoView
2358
+ *
2359
+ * @param view - The IsoView to read data from
2360
+ *
2361
+ * @returns A parsed EventMessageBox
2362
+ *
2363
+ * @public
2364
+ */
2365
+ declare function readEmsg(view: IsoBoxReadView): EventMessageBox;
2366
+ //#endregion
2367
+ //#region src/readers/readEnca.d.ts
2368
+ /**
2369
+ * Parse an AudioSampleEntry from an IsoView
2370
+ *
2371
+ * @param view - The IsoView to read data from
2372
+ *
2373
+ * @returns A parsed AudioSampleEntry
2374
+ *
2375
+ * @public
2376
+ */
2377
+ declare function readEnca(view: IsoBoxReadView): AudioSampleEntryBox<"enca">;
2378
+ //#endregion
2379
+ //#region src/readers/readEncv.d.ts
2380
+ /**
2381
+ * Parse a VisualSampleEntryBox from an IsoView
2382
+ *
2383
+ * @param view - The IsoView to read data from
2384
+ *
2385
+ * @returns A parsed VisualSampleEntryBox
2386
+ *
2387
+ * @public
2388
+ */
2389
+ declare function readEncv(view: IsoBoxReadView): VisualSampleEntryBox<"encv">;
2390
+ //#endregion
2391
+ //#region src/readers/readFree.d.ts
2392
+ /**
2393
+ * Parse a Box from an IsoView
2394
+ *
2395
+ * @param view - The IsoView to read data from
2396
+ *
2397
+ * @returns A parsed Box
2398
+ *
2399
+ * @public
2400
+ */
2401
+ declare function readFree(view: IsoBoxReadView): FreeSpaceBox;
2402
+ //#endregion
2403
+ //#region src/readers/readFrma.d.ts
2404
+ /**
2405
+ * Parse an OriginalFormatBox from an IsoView
2406
+ *
2407
+ * @param view - The IsoView to read data from
2408
+ *
2409
+ * @returns A parsed OriginalFormatBox
2410
+ *
2411
+ * @public
2412
+ */
2413
+ declare function readFrma(view: IsoBoxReadView): OriginalFormatBox;
2414
+ //#endregion
2415
+ //#region src/readers/readFtyp.d.ts
2416
+ /**
2417
+ * Parse a FileTypeBox from an IsoView
2418
+ *
2419
+ * @param view - The IsoView to read data from
2420
+ *
2421
+ * @returns A parsed FileTypeBox
2422
+ *
2423
+ * @public
2424
+ */
2425
+ declare function readFtyp(view: IsoBoxReadView): FileTypeBox;
2426
+ //#endregion
2427
+ //#region src/readers/readHdlr.d.ts
2428
+ /**
2429
+ * Parse a HandlerReferenceBox from an IsoView
2430
+ *
2431
+ * @param view - The IsoView to read data from
2432
+ *
2433
+ * @returns A parsed HandlerReferenceBox
2434
+ *
2435
+ * @public
2436
+ */
2437
+ declare function readHdlr(view: IsoBoxReadView): HandlerReferenceBox;
2438
+ //#endregion
2439
+ //#region src/readers/readHev1.d.ts
2440
+ /**
2441
+ * Parse a VisualSampleEntryBox from an IsoView
2442
+ *
2443
+ * @param view - The IsoView to read data from
2444
+ *
2445
+ * @returns A parsed VisualSampleEntryBox
2446
+ *
2447
+ * @public
2448
+ */
2449
+ declare function readHev1(view: IsoBoxReadView): VisualSampleEntryBox<"hev1">;
2450
+ //#endregion
2451
+ //#region src/readers/readHvc1.d.ts
2452
+ /**
2453
+ * Parse a VisualSampleEntryBox from an IsoView
2454
+ *
2455
+ * @param view - The IsoView to read data from
2456
+ *
2457
+ * @returns A parsed VisualSampleEntryBox
2458
+ *
2459
+ * @public
2460
+ */
2461
+ declare function readHvc1(view: IsoBoxReadView): VisualSampleEntryBox<"hvc1">;
2462
+ //#endregion
2463
+ //#region src/readers/readIden.d.ts
2464
+ /**
2465
+ * Parse a WebVTTCueIdBox from an IsoView
2466
+ *
2467
+ * @param view - The IsoView to read data from
2468
+ *
2469
+ * @returns A parsed WebVTTCueIdBox
2470
+ *
2471
+ * @public
2472
+ */
2473
+ declare function readIden(view: IsoBoxReadView): WebVttCueIdBox;
2474
+ //#endregion
2475
+ //#region src/readers/readImda.d.ts
2476
+ /**
2477
+ * Parse a IdentifiedMediaDataBox from an IsoView
2478
+ *
2479
+ * @param view - The IsoView to read data from
2480
+ *
2481
+ * @returns A parsed IdentifiedMediaDataBox
2482
+ *
2483
+ * @public
2484
+ */
2485
+ declare function readImda(view: IsoBoxReadView): IdentifiedMediaDataBox;
2486
+ //#endregion
2487
+ //#region src/readers/readKind.d.ts
2488
+ /**
2489
+ * Parse a TrackKinBox from an IsoView
2490
+ *
2491
+ * @param view - The IsoView to read data from
2492
+ *
2493
+ * @returns A parsed TrackKindBox
2494
+ *
2495
+ * @public
2496
+ */
2497
+ declare function readKind(view: IsoBoxReadView): TrackKindBox;
2498
+ //#endregion
2499
+ //#region src/readers/readLabl.d.ts
2500
+ /**
2501
+ * Parse a LabelBox from an IsoView
2502
+ *
2503
+ * @param view - The IsoView to read data from
2504
+ *
2505
+ * @returns A parsed LabelBox
2506
+ *
2507
+ * @public
2508
+ */
2509
+ declare function readLabl(view: IsoBoxReadView): LabelBox;
2510
+ //#endregion
2511
+ //#region src/readers/readMdat.d.ts
2512
+ /**
2513
+ * Parse a MediaDataBox from an IsoView
2514
+ *
2515
+ * @param view - The IsoView to read data from
2516
+ *
2517
+ * @returns A parsed MediaDataBox
2518
+ *
2519
+ * @public
2520
+ */
2521
+ declare function readMdat(view: IsoBoxReadView): MediaDataBox;
2522
+ //#endregion
2523
+ //#region src/readers/readMdhd.d.ts
2524
+ /**
2525
+ * Parse a MediaHeaderBox from an IsoView
2526
+ *
2527
+ * @param view - The IsoView to read data from
2528
+ *
2529
+ * @returns A parsed MediaHeaderBox
2530
+ *
2531
+ * @public
2532
+ */
2533
+ declare function readMdhd(view: IsoBoxReadView): MediaHeaderBox;
2534
+ //#endregion
2535
+ //#region src/readers/readMehd.d.ts
2536
+ /**
2537
+ * Parse a MovieExtendsHeaderBox from an IsoView
2538
+ *
2539
+ * @param view - The IsoView to read data from
2540
+ *
2541
+ * @returns A parsed MovieExtendsHeaderBox
2542
+ *
2543
+ * @public
2544
+ */
2545
+ declare function readMehd(view: IsoBoxReadView): MovieExtendsHeaderBox;
2546
+ //#endregion
2547
+ //#region src/readers/readMeta.d.ts
2548
+ /**
2549
+ * Parse a MetaBox from an IsoView
2550
+ *
2551
+ * @param view - The IsoView to read data from
2552
+ *
2553
+ * @returns A parsed MetaBox
2554
+ *
2555
+ * @public
2556
+ */
2557
+ declare function readMeta(view: IsoBoxReadView): MetaBox;
2558
+ //#endregion
2559
+ //#region src/readers/readMfhd.d.ts
2560
+ /**
2561
+ * Parse a MovieFragmentHeaderBox from an IsoView
2562
+ *
2563
+ * @param view - The IsoView to read data from
2564
+ *
2565
+ * @returns A parsed MovieFragmentHeaderBox
2566
+ *
2567
+ * @public
2568
+ */
2569
+ declare function readMfhd(view: IsoBoxReadView): MovieFragmentHeaderBox;
2570
+ //#endregion
2571
+ //#region src/readers/readMfro.d.ts
2572
+ /**
2573
+ * Parse a MovieFragmentRandomAccessBox from an IsoView
2574
+ *
2575
+ * @param view - The IsoView to read data from
2576
+ *
2577
+ * @returns A parsed MovieFragmentRandomAccessBox
2578
+ *
2579
+ * @public
2580
+ */
2581
+ declare function readMfro(view: IsoBoxReadView): MovieFragmentRandomAccessOffsetBox;
2582
+ //#endregion
2583
+ //#region src/readers/readMp4a.d.ts
2584
+ /**
2585
+ * Parse an AudioSampleEntry from an IsoView
2586
+ *
2587
+ * @param view - The IsoView to read data from
2588
+ *
2589
+ * @returns A parsed AudioSampleEntry
2590
+ *
2591
+ * @public
2592
+ */
2593
+ declare function readMp4a(view: IsoBoxReadView): AudioSampleEntryBox<"mp4a">;
2594
+ //#endregion
2595
+ //#region src/readers/readMvhd.d.ts
2596
+ /**
2597
+ * Parse a Box from an IsoView
2598
+ *
2599
+ * @param view - The IsoView to read data from
2600
+ *
2601
+ * @returns A parsed Box
2602
+ *
2603
+ * @public
2604
+ */
2605
+ declare function readMvhd(view: IsoBoxReadView): MovieHeaderBox;
2606
+ //#endregion
2607
+ //#region src/readers/readPayl.d.ts
2608
+ /**
2609
+ * Parse a WebVTTCuePayloadBox from an IsoView
2610
+ *
2611
+ * @param view - The IsoView to read data from
2612
+ *
2613
+ * @returns A parsed WebVTTCuePayloadBox
2614
+ *
2615
+ * @public
2616
+ */
2617
+ declare function readPayl(view: IsoBoxReadView): WebVttCuePayloadBox;
2618
+ //#endregion
2619
+ //#region src/readers/readPrft.d.ts
2620
+ /**
2621
+ * Parse a ProducerReferenceTimeBox from an IsoView
2622
+ *
2623
+ * @param view - The IsoView to read data from
2624
+ *
2625
+ * @returns A parsed ProducerReferenceTimeBox
2626
+ *
2627
+ * @public
2628
+ */
2629
+ declare function readPrft(view: IsoBoxReadView): ProducerReferenceTimeBox;
2630
+ //#endregion
2631
+ //#region src/readers/readPrsl.d.ts
2632
+ /**
2633
+ * Parse a PreselectionGroupBox from an IsoView
2634
+ *
2635
+ * @param view - The IsoView to read data from
2636
+ *
2637
+ * @returns A parsed PreselectionGroupBox
2638
+ *
2639
+ * @public
2640
+ */
2641
+ declare function readPrsl(view: IsoBoxReadView): PreselectionGroupBox;
2642
+ //#endregion
2643
+ //#region src/readers/readPssh.d.ts
2644
+ /**
2645
+ * Parse a ProtectionSystemSpecificHeaderBox from an IsoView
2646
+ *
2647
+ * @param view - The IsoView to read data from
2648
+ *
2649
+ * @returns A parsed ProtectionSystemSpecificHeaderBox
2650
+ *
2651
+ * @public
2652
+ */
2653
+ declare function readPssh(view: IsoBoxReadView): ProtectionSystemSpecificHeaderBox;
2654
+ //#endregion
2655
+ //#region src/readers/readSchm.d.ts
2656
+ /**
2657
+ * Parse a SchemeTypeBox from an IsoView
2658
+ *
2659
+ * @param view - The IsoView to read data from
2660
+ *
2661
+ * @returns A parsed SchemeTypeBox
2662
+ *
2663
+ * @public
2664
+ */
2665
+ declare function readSchm(view: IsoBoxReadView): SchemeTypeBox;
2666
+ //#endregion
2667
+ //#region src/readers/readSdtp.d.ts
2668
+ /**
2669
+ * Parse a SampleDependencyTypeBox from an IsoView
2670
+ *
2671
+ * @param view - The IsoView to read data from
2672
+ *
2673
+ * @returns A parsed SampleDependencyTypeBox
2674
+ *
2675
+ * @public
2676
+ */
2677
+ declare function readSdtp(view: IsoBoxReadView): SampleDependencyTypeBox;
2678
+ //#endregion
2679
+ //#region src/readers/readSidx.d.ts
2680
+ /**
2681
+ * Parse a SegmentIndexBox from an IsoView
2682
+ *
2683
+ * @param view - The IsoView to read data from
2684
+ *
2685
+ * @returns A parsed SegmentIndexBox
2686
+ *
2687
+ * @public
2688
+ */
2689
+ declare function readSidx(view: IsoBoxReadView): SegmentIndexBox;
2690
+ //#endregion
2691
+ //#region src/readers/readSkip.d.ts
2692
+ /**
2693
+ * Parse a FreeSpaceBox from an IsoView
2694
+ *
2695
+ * @param view - The IsoView to read data from
2696
+ *
2697
+ * @returns A parsed FreeSpaceBox
2698
+ *
2699
+ * @public
2700
+ */
2701
+ declare function readSkip(view: IsoBoxReadView): FreeSpaceBox<"skip">;
2702
+ //#endregion
2703
+ //#region src/readers/readSmhd.d.ts
2704
+ /**
2705
+ * Parse a SoundMediaHeaderBox from an IsoView
2706
+ *
2707
+ * @param view - The IsoView to read data from
2708
+ *
2709
+ * @returns A parsed SoundMediaHeaderBox
2710
+ *
2711
+ * @public
2712
+ */
2713
+ declare function readSmhd(view: IsoBoxReadView): SoundMediaHeaderBox;
2714
+ //#endregion
2715
+ //#region src/readers/readSsix.d.ts
2716
+ /**
2717
+ * Parse a SubsegmentIndexBox from an IsoView
2718
+ *
2719
+ * @param view - The IsoView to read data from
2720
+ *
2721
+ * @returns A parsed SubsegmentIndexBox
2722
+ *
2723
+ * @public
2724
+ */
2725
+ declare function readSsix(view: IsoBoxReadView): SubsegmentIndexBox;
2726
+ //#endregion
2727
+ //#region src/readers/readSthd.d.ts
2728
+ /**
2729
+ * Parse a SubtitleMediaHeaderBox from an IsoView
2730
+ *
2731
+ * @param view - The IsoView to read data from
2732
+ *
2733
+ * @returns A parsed SubtitleMediaHeaderBox
2734
+ *
2735
+ * @public
2736
+ */
2737
+ declare function readSthd(view: IsoBoxReadView): SubtitleMediaHeaderBox;
2738
+ //#endregion
2739
+ //#region src/readers/readStsd.d.ts
2740
+ /**
2741
+ * Parse a SampleDescriptionBox from an IsoView
2742
+ *
2743
+ * @param view - The IsoView to read data from
2744
+ *
2745
+ * @returns A parsed SampleDescriptionBox
2746
+ *
2747
+ * @public
2748
+ */
2749
+ declare function readStsd<E extends SampleEntryBox = SampleEntryBox>(view: IsoBoxReadView): SampleDescriptionBox<E>;
2750
+ //#endregion
2751
+ //#region src/readers/readStss.d.ts
2752
+ /**
2753
+ * Parse a SyncSampleBox from an IsoView
2754
+ *
2755
+ * @param view - The IsoView to read data from
2756
+ *
2757
+ * @returns A parsed SyncSampleBox
2758
+ *
2759
+ * @public
2760
+ */
2761
+ declare function readStss(view: IsoBoxReadView): SyncSampleBox;
2762
+ //#endregion
2763
+ //#region src/readers/readSttg.d.ts
2764
+ /**
2765
+ * Parse a WebVTTSettingsBox from an IsoView
2766
+ *
2767
+ * @param view - The IsoView to read data from
2768
+ *
2769
+ * @returns A parsed WebVTTSettingsBox
2770
+ *
2771
+ * @public
2772
+ */
2773
+ declare function readSttg(view: IsoBoxReadView): WebVttSettingsBox;
2774
+ //#endregion
2775
+ //#region src/readers/readStts.d.ts
2776
+ /**
2777
+ * Parse a DecodingTimeToSampleBox from an IsoView
2778
+ *
2779
+ * @param view - The IsoView to read data from
2780
+ *
2781
+ * @returns A parsed DecodingTimeToSampleBox
2782
+ *
2783
+ * @public
2784
+ */
2785
+ declare function readStts(view: IsoBoxReadView): DecodingTimeToSampleBox;
2786
+ //#endregion
2787
+ //#region src/readers/readStyp.d.ts
2788
+ /**
2789
+ * Parse a SegmentTypeBox from an IsoView
2790
+ *
2791
+ * @param view - The IsoView to read data from
2792
+ *
2793
+ * @returns A parsed SegmentTypeBox
2794
+ *
2795
+ * @public
2796
+ */
2797
+ declare function readStyp(view: IsoBoxReadView): SegmentTypeBox;
2798
+ //#endregion
2799
+ //#region src/readers/readSubs.d.ts
2800
+ /**
2801
+ * Parse a SubSampleInformationBox from an IsoView
2802
+ *
2803
+ * @param view - The IsoView to read data from
2804
+ *
2805
+ * @returns A parsed SubSampleInformationBox
2806
+ *
2807
+ * @public
2808
+ */
2809
+ declare function readSubs(view: IsoBoxReadView): SubsampleInformationBox;
2810
+ //#endregion
2811
+ //#region src/readers/readTenc.d.ts
2812
+ /**
2813
+ * Parse a TrackEncryptionBox from an IsoView
2814
+ *
2815
+ * @param view - The IsoView to read data from
2816
+ *
2817
+ * @returns A parsed TrackEncryptionBox
2818
+ *
2819
+ * @public
2820
+ */
2821
+ declare function readTenc(view: IsoBoxReadView): TrackEncryptionBox;
2822
+ //#endregion
2823
+ //#region src/readers/readTfdt.d.ts
2824
+ /**
2825
+ * Parse a TrackFragmentDecodeTimeBox from an IsoView
2826
+ *
2827
+ * @param view - The IsoView to read data from
2828
+ *
2829
+ * @returns A parsed TrackFragmentDecodeTimeBox
2830
+ *
2831
+ * @public
2832
+ */
2833
+ declare function readTfdt(view: IsoBoxReadView): TrackFragmentBaseMediaDecodeTimeBox;
2834
+ //#endregion
2835
+ //#region src/readers/readTfhd.d.ts
2836
+ /**
2837
+ * Parse a TrackFragmentHeaderBox from an IsoView
2838
+ *
2839
+ * @param view - The IsoView to read data from
2840
+ *
2841
+ * @returns A parsed TrackFragmentHeaderBox
2842
+ *
2843
+ * @public
2844
+ */
2845
+ declare function readTfhd(view: IsoBoxReadView): TrackFragmentHeaderBox;
2846
+ //#endregion
2847
+ //#region src/readers/readTfra.d.ts
2848
+ /**
2849
+ * Parse a TrackFragmentRandomAccessBox from an IsoView
2850
+ *
2851
+ * @param view - The IsoView to read data from
2852
+ *
2853
+ * @returns A parsed TrackFragmentRandomAccessBox
2854
+ *
2855
+ * @public
2856
+ */
2857
+ declare function readTfra(view: IsoBoxReadView): TrackFragmentRandomAccessBox;
2858
+ //#endregion
2859
+ //#region src/readers/readTkhd.d.ts
2860
+ /**
2861
+ * Parse a TrackHeaderBox from an IsoView
2862
+ *
2863
+ * @param view - The IsoView to read data from
2864
+ *
2865
+ * @returns A parsed TrackHeaderBox
2866
+ *
2867
+ * @public
2868
+ */
2869
+ declare function readTkhd(view: IsoBoxReadView): TrackHeaderBox;
2870
+ //#endregion
2871
+ //#region src/readers/readTrex.d.ts
2872
+ /**
2873
+ * Parse a TrackExtendsBox from an IsoView
2874
+ *
2875
+ * @param view - The IsoView to read data from
2876
+ *
2877
+ * @returns A parsed TrackExtendsBox
2878
+ *
2879
+ * @public
2880
+ */
2881
+ declare function readTrex(view: IsoBoxReadView): TrackExtendsBox;
2882
+ //#endregion
2883
+ //#region src/readers/readTrun.d.ts
2884
+ /**
2885
+ * Parse a TrackRunBox from an IsoView
2886
+ *
2887
+ * @param view - The IsoView to read data from
2888
+ *
2889
+ * @returns A parsed TrackRunBox
2890
+ *
2891
+ * @public
2892
+ */
2893
+ declare function readTrun(view: IsoBoxReadView): TrackRunBox;
2894
+ //#endregion
2895
+ //#region src/readers/readUrl.d.ts
2896
+ /**
2897
+ * Parse a UrlBox from an IsoView
2898
+ *
2899
+ * @param view - The IsoView to read data from
2900
+ *
2901
+ * @returns A parsed UrlBox
2902
+ *
2903
+ * @public
2904
+ */
2905
+ declare function readUrl(view: IsoBoxReadView): DataEntryUrlBox;
2906
+ //#endregion
2907
+ //#region src/readers/readUrn.d.ts
2908
+ /**
2909
+ * Parse a UrnBox from an IsoView
2910
+ *
2911
+ * @param view - The IsoView to read data from
2912
+ *
2913
+ * @returns A parsed UrnBox
2914
+ *
2915
+ * @public
2916
+ */
2917
+ declare function readUrn(view: IsoBoxReadView): DataEntryUrnBox;
2918
+ //#endregion
2919
+ //#region src/readers/readVlab.d.ts
2920
+ /**
2921
+ * Parse a WebVTTSourceLabelBox from an IsoView
2922
+ *
2923
+ * @param view - The IsoView to read data from
2924
+ *
2925
+ * @returns A parsed WebVTTSourceLabelBox
2926
+ *
2927
+ * @public
2928
+ */
2929
+ declare function readVlab(view: IsoBoxReadView): WebVttSourceLabelBox;
2930
+ //#endregion
2931
+ //#region src/readers/readVmhd.d.ts
2932
+ /**
2933
+ * Parse a VideoMediaHeaderBox from an IsoView
2934
+ *
2935
+ * @param view - The IsoView to read data from
2936
+ *
2937
+ * @returns A parsed VideoMediaHeaderBox
2938
+ *
2939
+ * @public
2940
+ */
2941
+ declare function readVmhd(view: IsoBoxReadView): VideoMediaHeaderBox;
2942
+ //#endregion
2943
+ //#region src/readers/readVttC.d.ts
1990
2944
  /**
1991
- * Filter boxes by type from an IsoView
2945
+ * Parse a WebVTTConfigurationBox from an IsoView
1992
2946
  *
1993
- * @param type - The type(s) of boxes to filter
1994
- * @param raw - The raw ISO data
1995
- * @param config - The configuration for the IsoView
2947
+ * @param view - The IsoView to read data from
2948
+ *
2949
+ * @returns A parsed WebVttConfigurationBox
1996
2950
  *
1997
- * @returns The filtered boxes
2951
+ * @public
2952
+ */
2953
+ declare function readVttC(view: IsoBoxReadView): WebVttConfigurationBox;
2954
+ //#endregion
2955
+ //#region src/readers/readVtte.d.ts
2956
+ /**
2957
+ * Parse a WebVTT Empty Sample Box from an IsoView
1998
2958
  *
2959
+ * @returns A parsed WebVTT Empty Sample Box
1999
2960
  *
2000
- * @beta
2961
+ * @public
2001
2962
  */
2002
- declare function filterBoxesByType<T$1 extends keyof IsoBmffBoxMap>(raw: IsoData, type: T$1 | T$1[], config?: IsoViewConfig): IsoBmffBoxMap[T$1][];
2963
+ declare function readVtte(_: IsoBoxReadView): WebVttEmptySampleBox;
2003
2964
  //#endregion
2004
- //#region src/findBox.d.ts
2965
+ //#region src/readIsoBoxes.d.ts
2005
2966
  /**
2006
- * Find a box from an IsoView that matches a filter function
2967
+ * Reads ISO boxes from a data source.
2007
2968
  *
2008
2969
  * @param raw - The raw ISO data
2009
2970
  * @param config - The configuration for the IsoView
2010
- * @param fn - The filter function
2011
2971
  *
2012
- * @returns The first box that matches the filter function
2972
+ * @returns The parsed boxes
2013
2973
  *
2974
+ * @example
2975
+ * {@includeCode ../test/readIsoBoxes.test.ts#example}
2014
2976
  *
2015
- * @beta
2977
+ * @public
2016
2978
  */
2017
- declare function findBox<T$1 extends IsoBmffBox = IsoBmffBox>(raw: IsoData | Iterable<IsoBmffBox>, fn: BoxFilter<T$1>, config?: IsoViewConfig): T$1 | null;
2979
+ declare function readIsoBoxes<R extends IsoBoxReaderMap>(raw: IsoBoxData, config?: IsoBoxReadViewConfig<R>): IsoBoxReaderReturn<R>[];
2018
2980
  //#endregion
2019
- //#region src/findBoxByType.d.ts
2981
+ //#region src/traverseIsoBoxes.d.ts
2020
2982
  /**
2021
- * Find a box from an IsoView that matches a given type
2983
+ * Traverse ISO boxes
2022
2984
  *
2023
- * @param type - The type of box to find
2024
- * @param raw - The raw ISO data
2025
- * @param config - The configuration for the IsoView
2985
+ * @param boxes - The boxes to traverse
2986
+ * @param depthFirst - Whether to traverse the boxes depth-first or breadth-first
2987
+ * @param maxDepth - The maximum depth to traverse. A value of 0 will only traverse the root boxes.
2026
2988
  *
2027
- * @returns The first box that matches the type
2989
+ * @returns A generator of boxes
2028
2990
  *
2991
+ * @example
2992
+ * {@includeCode ../test/traverseIsoBoxes.test.ts#example}
2029
2993
  *
2030
- * @beta
2994
+ * @public
2031
2995
  */
2032
- declare function findBoxByType<T$1 extends keyof IsoBmffBoxMap>(raw: IsoData, type: T$1, config?: IsoViewConfig): IsoBmffBoxMap[T$1] | null;
2996
+ declare function traverseIsoBoxes(boxes: Iterable<ParsedBox>, depthFirst?: boolean, maxDepth?: number): Generator<ParsedBox>;
2033
2997
  //#endregion
2034
- //#region src/parseBoxes.d.ts
2998
+ //#region src/utils/CONTAINERS.d.ts
2035
2999
  /**
2036
- * Parse boxes from an IsoView
3000
+ * List of container box types
2037
3001
  *
2038
- * @param raw - The raw ISO data
2039
- * @param config - The configuration for the IsoView
3002
+ * @public
3003
+ */
3004
+ declare const CONTAINERS: string[];
3005
+ //#endregion
3006
+ //#region src/utils/isContainer.d.ts
3007
+ /**
3008
+ * Check if a box is a container
2040
3009
  *
2041
- * @returns The parsed boxes
3010
+ * @param box - The box to check
2042
3011
  *
3012
+ * @returns `true` if the box is a container, `false` otherwise
2043
3013
  *
2044
- * @beta
3014
+ * @public
2045
3015
  */
2046
- declare function parseBoxes(raw: IsoData, config?: IsoViewConfig): IsoBmffBox[];
3016
+ declare function isContainer(box: IsoBox | Box): box is IsoBoxContainer;
2047
3017
  //#endregion
2048
- //#region src/parsers/ardi.d.ts
3018
+ //#region src/utils/isFullBox.d.ts
2049
3019
  /**
2050
- * Parse a AudioRenderingIndicationBox from an IsoView
3020
+ * Check if a box is a full box
2051
3021
  *
2052
- * @param view - The IsoView to read data from
3022
+ * @param box - The box to check
2053
3023
  *
2054
- * @returns A parsed AudioRenderingIndicationBox
3024
+ * @returns `true` if the box is a full box, `false` otherwise
3025
+ *
3026
+ * @public
3027
+ */
3028
+ declare function isFullBox(box: any): box is FullBox;
3029
+ //#endregion
3030
+ //#region src/writeIsoBox.d.ts
3031
+ /**
3032
+ * Write an ISO box to a Uint8Array.
2055
3033
  *
3034
+ * @param box - The box to write
3035
+ * @param writers - The writers to use
3036
+ * @returns The written box
2056
3037
  *
2057
- * @beta
3038
+ * @public
2058
3039
  */
2059
- declare function ardi(view: IsoView): Fields<AudioRenderingIndicationBox>;
3040
+ declare function writeIsoBox(box: IsoBoxStreamable, config?: IsoBoxWriteViewConfig): Uint8Array;
2060
3041
  //#endregion
2061
- //#region src/parsers/avc1.d.ts
3042
+ //#region src/writeIsoBoxes.d.ts
2062
3043
  /**
2063
- * Parse a VisualSampleEntryBox from an IsoView
3044
+ * Writes ISO boxes to a readable stream.
2064
3045
  *
2065
- * @param view - The IsoView to read data from
3046
+ * @param boxes - The boxes to write
3047
+ * @param config - The configuration for the readable stream
2066
3048
  *
2067
- * @returns A parsed VisualSampleEntryBox
3049
+ * @returns A readable stream of the written boxes
2068
3050
  *
3051
+ * @example
3052
+ * {@includeCode ../test/writeIsoBoxes.test.ts#example}
2069
3053
  *
2070
- * @beta
3054
+ * @public
2071
3055
  */
2072
- declare function avc1(view: IsoView): Fields<VisualSampleEntryBox<"avc1">>;
3056
+ declare function writeIsoBoxes(boxes: Iterable<IsoBoxStreamable>, config?: IsoBoxWriteViewConfig): Uint8Array[];
2073
3057
  //#endregion
2074
- //#region src/parsers/avc2.d.ts
3058
+ //#region src/writers/writeArdi.d.ts
2075
3059
  /**
2076
- * Parse a VisualSampleEntryBox from an IsoView
3060
+ * Write an AudioRenderingIndicationBox to an IsoDataWriter.
2077
3061
  *
2078
- * @param view - The IsoView to read data from
2079
- *
2080
- * @returns A parsed VisualSampleEntryBox
3062
+ * @param box - The AudioRenderingIndicationBox fields to write
2081
3063
  *
3064
+ * @returns An IsoDataWriter containing the encoded box
2082
3065
  *
2083
- * @beta
3066
+ * @public
2084
3067
  */
2085
- declare function avc2(view: IsoView): Fields<VisualSampleEntryBox<"avc2">>;
3068
+ declare function writeArdi(box: AudioRenderingIndicationBox): IsoBoxWriteView;
2086
3069
  //#endregion
2087
- //#region src/parsers/avc3.d.ts
3070
+ //#region src/writers/writeAvc1.d.ts
2088
3071
  /**
2089
- * Parse a VisualSampleEntryBox from an IsoView
3072
+ * Write a VisualSampleEntryBox to an IsoDataWriter.
2090
3073
  *
2091
- * @param view - The IsoView to read data from
3074
+ * ISO/IEC 14496-12:2012 - 12.1.3 Visual Sample Entry
2092
3075
  *
2093
- * @returns A parsed VisualSampleEntryBox
3076
+ * @param box - The VisualSampleEntryBox fields to write
2094
3077
  *
3078
+ * @returns An IsoDataWriter containing the encoded box
2095
3079
  *
2096
- * @beta
3080
+ * @public
2097
3081
  */
2098
- declare function avc3(view: IsoView): Fields<VisualSampleEntryBox<"avc3">>;
3082
+ declare function writeAvc1(box: VisualSampleEntryBox<"avc1">): IsoBoxWriteView;
2099
3083
  //#endregion
2100
- //#region src/parsers/avc4.d.ts
3084
+ //#region src/writers/writeAvc2.d.ts
2101
3085
  /**
2102
- * Parse a VisualSampleEntryBox from an IsoView
2103
- *
2104
- * @param view - The IsoView to read data from
3086
+ * Write a VisualSampleEntryBox (avc2) to an IsoDataWriter.
2105
3087
  *
2106
- * @returns A parsed VisualSampleEntryBox
3088
+ * @param box - The VisualSampleEntryBox fields to write
2107
3089
  *
3090
+ * @returns An IsoDataWriter containing the encoded box
2108
3091
  *
2109
- * @beta
3092
+ * @public
2110
3093
  */
2111
- declare function avc4(view: IsoView): Fields<VisualSampleEntryBox<"avc4">>;
3094
+ declare function writeAvc2(box: VisualSampleEntryBox<"avc2">): IsoBoxWriteView;
2112
3095
  //#endregion
2113
- //#region src/parsers/ctts.d.ts
3096
+ //#region src/writers/writeAvc3.d.ts
2114
3097
  /**
2115
- * Parse a CompositionTimeToSampleBox from an IsoView
2116
- *
2117
- * @param view - The IsoView to read data from
3098
+ * Write a VisualSampleEntryBox (avc3) to an IsoDataWriter.
2118
3099
  *
2119
- * @returns A parsed CompositionTimeToSampleBox
3100
+ * @param box - The VisualSampleEntryBox fields to write
2120
3101
  *
3102
+ * @returns An IsoDataWriter containing the encoded box
2121
3103
  *
2122
- * @beta
3104
+ * @public
2123
3105
  */
2124
- declare function ctts(view: IsoView): Fields<CompositionTimeToSampleBox>;
3106
+ declare function writeAvc3(box: VisualSampleEntryBox<"avc3">): IsoBoxWriteView;
2125
3107
  //#endregion
2126
- //#region src/parsers/dref.d.ts
3108
+ //#region src/writers/writeAvc4.d.ts
2127
3109
  /**
2128
- * Parse a DataReferenceBox from an IsoView
2129
- *
2130
- * @param view - The IsoView to read data from
3110
+ * Write a VisualSampleEntryBox (avc4) to an IsoDataWriter.
2131
3111
  *
2132
- * @returns A parsed DataReferenceBox
3112
+ * @param box - The VisualSampleEntryBox fields to write
2133
3113
  *
3114
+ * @returns An IsoDataWriter containing the encoded box
2134
3115
  *
2135
- * @beta
3116
+ * @public
2136
3117
  */
2137
- declare function dref(view: IsoView): Fields<DataReferenceBox>;
3118
+ declare function writeAvc4(box: VisualSampleEntryBox<"avc4">): IsoBoxWriteView;
2138
3119
  //#endregion
2139
- //#region src/parsers/elng.d.ts
3120
+ //#region src/writers/writeCtts.d.ts
2140
3121
  /**
2141
- * Parse a ExtendedLanguageBox from an IsoView
3122
+ * Write a CompositionTimeToSampleBox to an IsoDataWriter.
2142
3123
  *
2143
- * @param view - The IsoView to read data from
3124
+ * ISO/IEC 14496-12:2012 - 8.6.1.3 Composition Time to Sample Box
2144
3125
  *
2145
- * @returns A parsed ExtendedLanguageBox
3126
+ * @param box - The CompositionTimeToSampleBox fields to write
2146
3127
  *
3128
+ * @returns An IsoDataWriter containing the encoded box
2147
3129
  *
2148
- * @beta
3130
+ * @public
2149
3131
  */
2150
- declare function elng(view: IsoView): Fields<ExtendedLanguageBox>;
3132
+ declare function writeCtts(box: CompositionTimeToSampleBox): IsoBoxWriteView;
2151
3133
  //#endregion
2152
- //#region src/parsers/elst.d.ts
3134
+ //#region src/writers/writeDref.d.ts
2153
3135
  /**
2154
- * Parse a Box from an IsoView
2155
- *
2156
- * @param view - The IsoView to read data from
3136
+ * Write a DataReferenceBox to an IsoDataWriter.
2157
3137
  *
2158
- * @returns A parsed Box
3138
+ * @param box - The DataReferenceBox fields to write
2159
3139
  *
3140
+ * @returns An IsoDataWriter containing the encoded box
2160
3141
  *
2161
- * @beta
3142
+ * @public
2162
3143
  */
2163
- declare function elst(view: IsoView): Fields<EditListBox>;
3144
+ declare function writeDref(box: DataReferenceBox, config: IsoBoxWriteViewConfig): IsoBoxWriteView;
2164
3145
  //#endregion
2165
- //#region src/parsers/emsg.d.ts
3146
+ //#region src/writers/writeElng.d.ts
2166
3147
  /**
2167
- * Parse an EventMessageBox from an IsoView
3148
+ * Write an ExtendedLanguageBox to an IsoDataWriter.
2168
3149
  *
2169
- * @param view - The IsoView to read data from
3150
+ * ISO/IEC 14496-12:2012 - 8.4.6 Extended Language Tag
2170
3151
  *
2171
- * @returns A parsed EventMessageBox
3152
+ * @param box - The ExtendedLanguageBox fields to write
2172
3153
  *
3154
+ * @returns An IsoDataWriter containing the encoded box
2173
3155
  *
2174
- * @beta
3156
+ * @public
2175
3157
  */
2176
- declare function emsg(view: IsoView): Fields<EventMessageBox>;
3158
+ declare function writeElng(box: ExtendedLanguageBox): IsoBoxWriteView;
2177
3159
  //#endregion
2178
- //#region src/parsers/enca.d.ts
3160
+ //#region src/writers/writeElst.d.ts
2179
3161
  /**
2180
- * Parse an AudioSampleEntry from an IsoView
3162
+ * Write an EditListBox to an IsoDataWriter.
2181
3163
  *
2182
- * @param view - The IsoView to read data from
3164
+ * ISO/IEC 14496-12:2012 - 8.6.6 Edit List Box
2183
3165
  *
2184
- * @returns A parsed AudioSampleEntry
3166
+ * @param box - The EditListBox fields to write
2185
3167
  *
3168
+ * @returns An IsoDataWriter containing the encoded box
2186
3169
  *
2187
- * @beta
3170
+ * @public
2188
3171
  */
2189
- declare function enca(view: IsoView): Fields<AudioSampleEntryBox<"enca">>;
3172
+ declare function writeElst(box: EditListBox): IsoBoxWriteView;
2190
3173
  //#endregion
2191
- //#region src/parsers/encv.d.ts
3174
+ //#region src/writers/writeEmsg.d.ts
2192
3175
  /**
2193
- * Parse a VisualSampleEntryBox from an IsoView
3176
+ * Write an EventMessageBox to an IsoDataWriter.
2194
3177
  *
2195
- * @param view - The IsoView to read data from
3178
+ * ISO/IEC 23009-1 - 5.10.3.3 Event Message Box
2196
3179
  *
2197
- * @returns A parsed VisualSampleEntryBox
3180
+ * @param box - The EventMessageBox fields to write
2198
3181
  *
3182
+ * @returns An IsoDataWriter containing the encoded box
2199
3183
  *
2200
- * @beta
3184
+ * @public
2201
3185
  */
2202
- declare function encv(view: IsoView): Fields<VisualSampleEntryBox<"encv">>;
3186
+ declare function writeEmsg(box: EventMessageBox): IsoBoxWriteView;
2203
3187
  //#endregion
2204
- //#region src/parsers/free.d.ts
3188
+ //#region src/writers/writeEnca.d.ts
2205
3189
  /**
2206
- * Parse a Box from an IsoView
3190
+ * Write an AudioSampleEntryBox (enca) to an IsoDataWriter.
2207
3191
  *
2208
- * @param view - The IsoView to read data from
2209
- *
2210
- * @returns A parsed Box
3192
+ * @param box - The AudioSampleEntryBox fields to write
2211
3193
  *
3194
+ * @returns An IsoDataWriter containing the encoded box
2212
3195
  *
2213
- * @beta
3196
+ * @public
2214
3197
  */
2215
- declare function free(view: IsoView): Fields<FreeSpaceBox>;
3198
+ declare function writeEnca(box: AudioSampleEntryBox<"enca">): IsoBoxWriteView;
2216
3199
  //#endregion
2217
- //#region src/parsers/frma.d.ts
3200
+ //#region src/writers/writeEncv.d.ts
2218
3201
  /**
2219
- * Parse an OriginalFormatBox from an IsoView
3202
+ * Write a VisualSampleEntryBox (encv) to an IsoDataWriter.
2220
3203
  *
2221
- * @param view - The IsoView to read data from
2222
- *
2223
- * @returns A parsed OriginalFormatBox
3204
+ * @param box - The VisualSampleEntryBox fields to write
2224
3205
  *
3206
+ * @returns An IsoDataWriter containing the encoded box
2225
3207
  *
2226
- * @beta
3208
+ * @public
2227
3209
  */
2228
- declare function frma(view: IsoView): Fields<OriginalFormatBox>;
3210
+ declare function writeEncv(box: VisualSampleEntryBox<"encv">): IsoBoxWriteView;
2229
3211
  //#endregion
2230
- //#region src/parsers/ftyp.d.ts
3212
+ //#region src/writers/writeFree.d.ts
2231
3213
  /**
2232
- * Parse a FileTypeBox from an IsoView
3214
+ * Write a FreeSpaceBox to an IsoDataWriter.
2233
3215
  *
2234
- * @param view - The IsoView to read data from
3216
+ * ISO/IEC 14496-12:2012 - 8.1.2 Free Space Box
2235
3217
  *
2236
- * @returns A parsed FileTypeBox
3218
+ * @param box - The FreeSpaceBox fields to write
2237
3219
  *
3220
+ * @returns An IsoDataWriter containing the encoded box
2238
3221
  *
2239
- * @beta
3222
+ * @public
2240
3223
  */
2241
- declare function ftyp(view: IsoView): Fields<FileTypeBox>;
3224
+ declare function writeFree(box: FreeSpaceBox<"free">): IsoBoxWriteView;
2242
3225
  //#endregion
2243
- //#region src/parsers/hdlr.d.ts
3226
+ //#region src/writers/writeFrma.d.ts
2244
3227
  /**
2245
- * Parse a HandlerReferenceBox from an IsoView
3228
+ * Write an OriginalFormatBox to an IsoDataWriter.
2246
3229
  *
2247
- * @param view - The IsoView to read data from
3230
+ * ISO/IEC 14496-12:2012 - 8.12.2 Original Format Box
2248
3231
  *
2249
- * @returns A parsed HandlerReferenceBox
3232
+ * @param box - The OriginalFormatBox fields to write
2250
3233
  *
3234
+ * @returns An IsoDataWriter containing the encoded box
2251
3235
  *
2252
- * @beta
3236
+ * @public
2253
3237
  */
2254
- declare function hdlr(view: IsoView): Fields<HandlerReferenceBox>;
3238
+ declare function writeFrma(box: OriginalFormatBox): IsoBoxWriteView;
2255
3239
  //#endregion
2256
- //#region src/parsers/hev1.d.ts
3240
+ //#region src/writers/writeFtyp.d.ts
2257
3241
  /**
2258
- * Parse a VisualSampleEntryBox from an IsoView
3242
+ * Write a FileTypeBox to an IsoDataWriter.
2259
3243
  *
2260
- * @param view - The IsoView to read data from
3244
+ * ISO/IEC 14496-12:2012 - 4.3 File Type Box
2261
3245
  *
2262
- * @returns A parsed VisualSampleEntryBox
3246
+ * @param box - The FileTypeBox fields to write
2263
3247
  *
3248
+ * @returns An IsoDataWriter containing the encoded box
2264
3249
  *
2265
- * @beta
3250
+ * @public
2266
3251
  */
2267
- declare function hev1(view: IsoView): Fields<VisualSampleEntryBox<"hev1">>;
3252
+ declare function writeFtyp(box: FileTypeBox): IsoBoxWriteView;
2268
3253
  //#endregion
2269
- //#region src/parsers/hvc1.d.ts
3254
+ //#region src/writers/writeHdlr.d.ts
2270
3255
  /**
2271
- * Parse a VisualSampleEntryBox from an IsoView
3256
+ * Write a HandlerReferenceBox to an IsoDataWriter.
2272
3257
  *
2273
- * @param view - The IsoView to read data from
3258
+ * ISO/IEC 14496-12:2012 - 8.4.3 Handler Reference Box
2274
3259
  *
2275
- * @returns A parsed VisualSampleEntryBox
3260
+ * @param box - The HandlerReferenceBox fields to write
2276
3261
  *
3262
+ * @returns An IsoDataWriter containing the encoded box
2277
3263
  *
2278
- * @beta
3264
+ * @public
2279
3265
  */
2280
- declare function hvc1(view: IsoView): Fields<VisualSampleEntryBox<"avc1">>;
3266
+ declare function writeHdlr(box: HandlerReferenceBox): IsoBoxWriteView;
2281
3267
  //#endregion
2282
- //#region src/parsers/iden.d.ts
3268
+ //#region src/writers/writeHev1.d.ts
2283
3269
  /**
2284
- * Parse a WebVTTCueIdBox from an IsoView
3270
+ * Write a VisualSampleEntryBox (hev1) to an IsoDataWriter.
2285
3271
  *
2286
- * @param view - The IsoView to read data from
2287
- *
2288
- * @returns A parsed WebVTTCueIdBox
3272
+ * @param box - The VisualSampleEntryBox fields to write
2289
3273
  *
3274
+ * @returns An IsoDataWriter containing the encoded box
2290
3275
  *
2291
- * @beta
3276
+ * @public
2292
3277
  */
2293
- declare function iden(view: IsoView): Fields<WebVttCueIdBox>;
3278
+ declare function writeHev1(box: VisualSampleEntryBox<"hev1">): IsoBoxWriteView;
2294
3279
  //#endregion
2295
- //#region src/parsers/imda.d.ts
3280
+ //#region src/writers/writeHvc1.d.ts
2296
3281
  /**
2297
- * Parse a IdentifiedMediaDataBox from an IsoView
3282
+ * Write a VisualSampleEntryBox (hvc1) to an IsoDataWriter.
2298
3283
  *
2299
- * @param view - The IsoView to read data from
2300
- *
2301
- * @returns A parsed IdentifiedMediaDataBox
3284
+ * @param box - The VisualSampleEntryBox fields to write
2302
3285
  *
3286
+ * @returns An IsoDataWriter containing the encoded box
2303
3287
  *
2304
- * @beta
3288
+ * @public
2305
3289
  */
2306
- declare function imda(view: IsoView): Fields<IdentifiedMediaDataBox>;
3290
+ declare function writeHvc1(box: VisualSampleEntryBox<"hvc1">): IsoBoxWriteView;
2307
3291
  //#endregion
2308
- //#region src/parsers/kind.d.ts
3292
+ //#region src/writers/writeIden.d.ts
2309
3293
  /**
2310
- * Parse a TrackKinBox from an IsoView
3294
+ * Write a WebVttCueIdBox to an IsoDataWriter.
2311
3295
  *
2312
- * @param view - The IsoView to read data from
2313
- *
2314
- * @returns A parsed TrackKindBox
3296
+ * @param box - The WebVttCueIdBox fields to write
2315
3297
  *
3298
+ * @returns An IsoDataWriter containing the encoded box
2316
3299
  *
2317
- * @beta
3300
+ * @public
2318
3301
  */
2319
- declare function kind(view: IsoView): Fields<TrackKindBox>;
3302
+ declare function writeIden(box: WebVttCueIdBox): IsoBoxWriteView;
2320
3303
  //#endregion
2321
- //#region src/parsers/labl.d.ts
3304
+ //#region src/writers/writeImda.d.ts
2322
3305
  /**
2323
- * Parse a LabelBox from an IsoView
3306
+ * Write an IdentifiedMediaDataBox to an IsoDataWriter.
2324
3307
  *
2325
- * @param view - The IsoView to read data from
2326
- *
2327
- * @returns A parsed LabelBox
3308
+ * @param box - The IdentifiedMediaDataBox fields to write
2328
3309
  *
3310
+ * @returns An IsoDataWriter containing the encoded box
2329
3311
  *
2330
- * @beta
3312
+ * @public
2331
3313
  */
2332
- declare function labl(view: IsoView): Fields<LabelBox>;
3314
+ declare function writeImda(box: IdentifiedMediaDataBox): IsoBoxWriteView;
2333
3315
  //#endregion
2334
- //#region src/parsers/mdat.d.ts
3316
+ //#region src/writers/writeKind.d.ts
2335
3317
  /**
2336
- * Parse a MediaDataBox from an IsoView
3318
+ * Write a TrackKindBox to an IsoDataWriter.
2337
3319
  *
2338
- * @param view - The IsoView to read data from
3320
+ * @param box - The TrackKindBox fields to write
2339
3321
  *
2340
- * @returns A parsed MediaDataBox
3322
+ * @returns An IsoDataWriter containing the encoded box
3323
+ *
3324
+ * @public
3325
+ */
3326
+ declare function writeKind(box: TrackKindBox): IsoBoxWriteView;
3327
+ //#endregion
3328
+ //#region src/writers/writeLabl.d.ts
3329
+ /**
3330
+ * Write a LabelBox to an IsoDataWriter.
2341
3331
  *
3332
+ * @param box - The LabelBox fields to write
2342
3333
  *
2343
- * @beta
3334
+ * @returns An IsoDataWriter containing the encoded box
3335
+ *
3336
+ * @public
2344
3337
  */
2345
- declare function mdat(view: IsoView): Fields<MediaDataBox>;
3338
+ declare function writeLabl(box: LabelBox): IsoBoxWriteView;
2346
3339
  //#endregion
2347
- //#region src/parsers/mdhd.d.ts
3340
+ //#region src/writers/writeMdat.d.ts
2348
3341
  /**
2349
- * Parse a MediaHeaderBox from an IsoView
3342
+ * Write a MediaDataBox to an IsoDataWriter.
2350
3343
  *
2351
- * @param view - The IsoView to read data from
3344
+ * ISO/IEC 14496-12:2012 - 8.1.1 Media Data Box
2352
3345
  *
2353
- * @returns A parsed MediaHeaderBox
3346
+ * @param box - The MediaDataBox fields to write
2354
3347
  *
3348
+ * @returns An IsoDataWriter containing the encoded box
2355
3349
  *
2356
- * @beta
3350
+ * @public
2357
3351
  */
2358
- declare function mdhd(view: IsoView): Fields<MediaHeaderBox>;
3352
+ declare function writeMdat(box: MediaDataBox): IsoBoxWriteView;
2359
3353
  //#endregion
2360
- //#region src/parsers/mehd.d.ts
3354
+ //#region src/writers/writeMdhd.d.ts
2361
3355
  /**
2362
- * Parse a MovieExtendsHeaderBox from an IsoView
3356
+ * Write a MediaHeaderBox to an IsoDataWriter.
2363
3357
  *
2364
- * @param view - The IsoView to read data from
3358
+ * ISO/IEC 14496-12:2012 - 8.4.2 Media Header Box
2365
3359
  *
2366
- * @returns A parsed MovieExtendsHeaderBox
3360
+ * @param box - The MediaHeaderBox fields to write
2367
3361
  *
3362
+ * @returns An IsoDataWriter containing the encoded box
2368
3363
  *
2369
- * @beta
3364
+ * @public
2370
3365
  */
2371
- declare function mehd(view: IsoView): Fields<MovieExtendsHeaderBox>;
3366
+ declare function writeMdhd(box: MediaHeaderBox): IsoBoxWriteView;
2372
3367
  //#endregion
2373
- //#region src/parsers/meta.d.ts
3368
+ //#region src/writers/writeMehd.d.ts
2374
3369
  /**
2375
- * Parse a MetaBox from an IsoView
3370
+ * Write a MovieExtendsHeaderBox to an IsoDataWriter.
2376
3371
  *
2377
- * @param view - The IsoView to read data from
3372
+ * ISO/IEC 14496-12:2012 - 8.8.2 Movie Extends Header Box
2378
3373
  *
2379
- * @returns A parsed MetaBox
3374
+ * @param box - The MovieExtendsHeaderBox fields to write
2380
3375
  *
3376
+ * @returns An IsoDataWriter containing the encoded box
2381
3377
  *
2382
- * @beta
3378
+ * @public
2383
3379
  */
2384
- declare function meta(view: IsoView): Fields<MetaBox>;
3380
+ declare function writeMehd(box: MovieExtendsHeaderBox): IsoBoxWriteView;
2385
3381
  //#endregion
2386
- //#region src/parsers/mfhd.d.ts
3382
+ //#region src/writers/writeMeta.d.ts
2387
3383
  /**
2388
- * Parse a MovieFragmentHeaderBox from an IsoView
3384
+ * Write a MetaBox to an IsoDataWriter.
2389
3385
  *
2390
- * @param view - The IsoView to read data from
3386
+ * ISO/IEC 14496-12:2012 - 8.11.1 Meta Box
2391
3387
  *
2392
- * @returns A parsed MovieFragmentHeaderBox
3388
+ * @param box - The MetaBox fields to write
2393
3389
  *
3390
+ * @returns An IsoDataWriter containing the encoded box
2394
3391
  *
2395
- * @beta
3392
+ * @public
2396
3393
  */
2397
- declare function mfhd(view: IsoView): Fields<MovieFragmentHeaderBox>;
3394
+ declare function writeMeta(box: MetaBox): IsoBoxWriteView;
2398
3395
  //#endregion
2399
- //#region src/parsers/mfro.d.ts
3396
+ //#region src/writers/writeMfhd.d.ts
2400
3397
  /**
2401
- * Parse a MovieFragmentRandomAccessBox from an IsoView
3398
+ * Write a MovieFragmentHeaderBox to an IsoDataWriter.
2402
3399
  *
2403
- * @param view - The IsoView to read data from
3400
+ * ISO/IEC 14496-12:2012 - 8.8.5 Movie Fragment Header Box
2404
3401
  *
2405
- * @returns A parsed MovieFragmentRandomAccessBox
3402
+ * @param box - The MovieFragmentHeaderBox fields to write
2406
3403
  *
3404
+ * @returns An IsoDataWriter containing the encoded box
2407
3405
  *
2408
- * @beta
3406
+ * @public
2409
3407
  */
2410
- declare function mfro(view: IsoView): Fields<MovieFragmentRandomAccessOffsetBox>;
3408
+ declare function writeMfhd(box: MovieFragmentHeaderBox): IsoBoxWriteView;
2411
3409
  //#endregion
2412
- //#region src/parsers/mp4a.d.ts
3410
+ //#region src/writers/writeMfro.d.ts
2413
3411
  /**
2414
- * Parse an AudioSampleEntry from an IsoView
3412
+ * Write a MovieFragmentRandomAccessOffsetBox to an IsoDataWriter.
2415
3413
  *
2416
- * @param view - The IsoView to read data from
3414
+ * ISO/IEC 14496-12:2012 - 8.8.11 Movie Fragment Random Access Offset Box
2417
3415
  *
2418
- * @returns A parsed AudioSampleEntry
3416
+ * @param box - The MovieFragmentRandomAccessOffsetBox fields to write
2419
3417
  *
3418
+ * @returns An IsoDataWriter containing the encoded box
2420
3419
  *
2421
- * @beta
3420
+ * @public
2422
3421
  */
2423
- declare function mp4a(view: IsoView): Fields<AudioSampleEntryBox<"mp4a">>;
3422
+ declare function writeMfro(box: MovieFragmentRandomAccessOffsetBox): IsoBoxWriteView;
2424
3423
  //#endregion
2425
- //#region src/parsers/mvhd.d.ts
3424
+ //#region src/writers/writeMp4a.d.ts
2426
3425
  /**
2427
- * Parse a Box from an IsoView
3426
+ * Write an AudioSampleEntryBox to an IsoDataWriter.
2428
3427
  *
2429
- * @param view - The IsoView to read data from
3428
+ * ISO/IEC 14496-12:2012 - 12.2.3 Audio Sample Entry
2430
3429
  *
2431
- * @returns A parsed Box
3430
+ * @param box - The AudioSampleEntryBox fields to write
2432
3431
  *
3432
+ * @returns An IsoDataWriter containing the encoded box
2433
3433
  *
2434
- * @beta
3434
+ * @public
2435
3435
  */
2436
- declare function mvhd(view: IsoView): Fields<MovieHeaderBox>;
3436
+ declare function writeMp4a(box: AudioSampleEntryBox<"mp4a">): IsoBoxWriteView;
2437
3437
  //#endregion
2438
- //#region src/parsers/payl.d.ts
3438
+ //#region src/writers/writeMvhd.d.ts
2439
3439
  /**
2440
- * Parse a WebVTTCuePayloadBox from an IsoView
3440
+ * Write a MovieHeaderBox to an IsoDataWriter.
2441
3441
  *
2442
- * @param view - The IsoView to read data from
3442
+ * ISO/IEC 14496-12:2012 - 8.2.2 Movie Header Box
2443
3443
  *
2444
- * @returns A parsed WebVTTCuePayloadBox
3444
+ * @param box - The MovieHeaderBox fields to write
2445
3445
  *
3446
+ * @returns An IsoDataWriter containing the encoded box
2446
3447
  *
2447
- * @beta
3448
+ * @public
2448
3449
  */
2449
- declare function payl(view: IsoView): Fields<WebVttCuePayloadBox>;
3450
+ declare function writeMvhd(box: MovieHeaderBox): IsoBoxWriteView;
2450
3451
  //#endregion
2451
- //#region src/parsers/prft.d.ts
3452
+ //#region src/writers/writePayl.d.ts
2452
3453
  /**
2453
- * Parse a ProducerReferenceTimeBox from an IsoView
2454
- *
2455
- * @param view - The IsoView to read data from
3454
+ * Write a WebVttCuePayloadBox to an IsoDataWriter.
2456
3455
  *
2457
- * @returns A parsed ProducerReferenceTimeBox
3456
+ * @param box - The WebVttCuePayloadBox fields to write
2458
3457
  *
3458
+ * @returns An IsoDataWriter containing the encoded box
2459
3459
  *
2460
- * @beta
3460
+ * @public
2461
3461
  */
2462
- declare function prft(view: IsoView): Fields<ProducerReferenceTimeBox>;
3462
+ declare function writePayl(box: WebVttCuePayloadBox): IsoBoxWriteView;
2463
3463
  //#endregion
2464
- //#region src/parsers/prsl.d.ts
3464
+ //#region src/writers/writePrft.d.ts
2465
3465
  /**
2466
- * Parse a PreselectionGroupBox from an IsoView
3466
+ * Write a ProducerReferenceTimeBox to an IsoDataWriter.
2467
3467
  *
2468
- * @param view - The IsoView to read data from
3468
+ * ISO/IEC 14496-12:2012 - 8.16.5 Producer Reference Time Box
2469
3469
  *
2470
- * @returns A parsed PreselectionGroupBox
3470
+ * @param box - The ProducerReferenceTimeBox fields to write
2471
3471
  *
3472
+ * @returns An IsoDataWriter containing the encoded box
2472
3473
  *
2473
- * @beta
3474
+ * @public
2474
3475
  */
2475
- declare function prsl(view: IsoView): Fields<PreselectionGroupBox>;
3476
+ declare function writePrft(box: ProducerReferenceTimeBox): IsoBoxWriteView;
2476
3477
  //#endregion
2477
- //#region src/parsers/pssh.d.ts
3478
+ //#region src/writers/writePrsl.d.ts
2478
3479
  /**
2479
- * Parse a ProtectionSystemSpecificHeaderBox from an IsoView
3480
+ * Write a PreselectionGroupBox to an IsoDataWriter.
2480
3481
  *
2481
- * @param view - The IsoView to read data from
2482
- *
2483
- * @returns A parsed ProtectionSystemSpecificHeaderBox
3482
+ * @param box - The PreselectionGroupBox fields to write
2484
3483
  *
3484
+ * @returns An IsoDataWriter containing the encoded box
2485
3485
  *
2486
- * @beta
3486
+ * @public
2487
3487
  */
2488
- declare function pssh(view: IsoView): Fields<ProtectionSystemSpecificHeaderBox>;
3488
+ declare function writePrsl(box: PreselectionGroupBox): IsoBoxWriteView;
2489
3489
  //#endregion
2490
- //#region src/parsers/schm.d.ts
3490
+ //#region src/writers/writePssh.d.ts
2491
3491
  /**
2492
- * Parse a SchemeTypeBox from an IsoView
3492
+ * Write a ProtectionSystemSpecificHeaderBox to an IsoDataWriter.
2493
3493
  *
2494
- * @param view - The IsoView to read data from
3494
+ * ISO/IEC 23001-7 - 8.1 Protection System Specific Header Box
2495
3495
  *
2496
- * @returns A parsed SchemeTypeBox
3496
+ * @param box - The ProtectionSystemSpecificHeaderBox fields to write
2497
3497
  *
3498
+ * @returns An IsoDataWriter containing the encoded box
2498
3499
  *
2499
- * @beta
3500
+ * @public
2500
3501
  */
2501
- declare function schm(view: IsoView): Fields<SchemeTypeBox>;
3502
+ declare function writePssh(box: ProtectionSystemSpecificHeaderBox): IsoBoxWriteView;
2502
3503
  //#endregion
2503
- //#region src/parsers/sdtp.d.ts
3504
+ //#region src/writers/writeSchm.d.ts
2504
3505
  /**
2505
- * Parse a SampleDependencyTypeBox from an IsoView
3506
+ * Write a SchemeTypeBox to an IsoDataWriter.
2506
3507
  *
2507
- * @param view - The IsoView to read data from
3508
+ * ISO/IEC 14496-12:2012 - 8.12.5 Scheme Type Box
2508
3509
  *
2509
- * @returns A parsed SampleDependencyTypeBox
3510
+ * @param box - The SchemeTypeBox fields to write
2510
3511
  *
3512
+ * @returns An IsoDataWriter containing the encoded box
2511
3513
  *
2512
- * @beta
3514
+ * @public
2513
3515
  */
2514
- declare function sdtp(view: IsoView): Fields<SampleDependencyTypeBox>;
3516
+ declare function writeSchm(box: SchemeTypeBox): IsoBoxWriteView;
2515
3517
  //#endregion
2516
- //#region src/parsers/sidx.d.ts
3518
+ //#region src/writers/writeSdtp.d.ts
2517
3519
  /**
2518
- * Parse a SegmentIndexBox from an IsoView
3520
+ * Write a SampleDependencyTypeBox to an IsoDataWriter.
2519
3521
  *
2520
- * @param view - The IsoView to read data from
3522
+ * ISO/IEC 14496-12:2012 - 8.6.4 Independent and Disposable Samples Box
2521
3523
  *
2522
- * @returns A parsed SegmentIndexBox
3524
+ * @param box - The SampleDependencyTypeBox fields to write
2523
3525
  *
3526
+ * @returns An IsoDataWriter containing the encoded box
2524
3527
  *
2525
- * @beta
3528
+ * @public
2526
3529
  */
2527
- declare function sidx(view: IsoView): Fields<SegmentIndexBox>;
3530
+ declare function writeSdtp(box: SampleDependencyTypeBox): IsoBoxWriteView;
2528
3531
  //#endregion
2529
- //#region src/parsers/skip.d.ts
3532
+ //#region src/writers/writeSidx.d.ts
2530
3533
  /**
2531
- * Parse a FreeSpaceBox from an IsoView
3534
+ * Write a SegmentIndexBox to an IsoDataWriter.
2532
3535
  *
2533
- * @param view - The IsoView to read data from
3536
+ * ISO/IEC 14496-12:2012 - 8.16.3 Segment Index Box
2534
3537
  *
2535
- * @returns A parsed FreeSpaceBox
3538
+ * @param box - The SegmentIndexBox fields to write
2536
3539
  *
3540
+ * @returns An IsoDataWriter containing the encoded box
2537
3541
  *
2538
- * @beta
3542
+ * @public
2539
3543
  */
2540
- declare function skip(view: IsoView): Fields<FreeSpaceBox<"skip">>;
3544
+ declare function writeSidx(box: SegmentIndexBox): IsoBoxWriteView;
2541
3545
  //#endregion
2542
- //#region src/parsers/smhd.d.ts
3546
+ //#region src/writers/writeSkip.d.ts
2543
3547
  /**
2544
- * Parse a SoundMediaHeaderBox from an IsoView
3548
+ * Write a FreeSpaceBox (skip variant) to an IsoDataWriter.
2545
3549
  *
2546
- * @param view - The IsoView to read data from
3550
+ * ISO/IEC 14496-12:2012 - 8.1.2 Free Space Box
2547
3551
  *
2548
- * @returns A parsed SoundMediaHeaderBox
3552
+ * @param box - The FreeSpaceBox fields to write
2549
3553
  *
3554
+ * @returns An IsoDataWriter containing the encoded box
2550
3555
  *
2551
- * @beta
3556
+ * @public
2552
3557
  */
2553
- declare function smhd(view: IsoView): Fields<SoundMediaHeaderBox>;
3558
+ declare function writeSkip(box: FreeSpaceBox<"skip">): IsoBoxWriteView;
2554
3559
  //#endregion
2555
- //#region src/parsers/ssix.d.ts
3560
+ //#region src/writers/writeSmhd.d.ts
2556
3561
  /**
2557
- * Parse a SubsegmentIndexBox from an IsoView
3562
+ * Write a SoundMediaHeaderBox to an IsoDataWriter.
2558
3563
  *
2559
- * @param view - The IsoView to read data from
3564
+ * ISO/IEC 14496-12:2012 - 12.2.2 Sound Media Header Box
2560
3565
  *
2561
- * @returns A parsed SubsegmentIndexBox
3566
+ * @param box - The SoundMediaHeaderBox fields to write
2562
3567
  *
3568
+ * @returns An IsoDataWriter containing the encoded box
2563
3569
  *
2564
- * @beta
3570
+ * @public
2565
3571
  */
2566
- declare function ssix(view: IsoView): Fields<SubsegmentIndexBox>;
3572
+ declare function writeSmhd(box: SoundMediaHeaderBox): IsoBoxWriteView;
2567
3573
  //#endregion
2568
- //#region src/parsers/sthd.d.ts
3574
+ //#region src/writers/writeSsix.d.ts
2569
3575
  /**
2570
- * Parse a SubtitleMediaHeaderBox from an IsoView
3576
+ * Write a SubsegmentIndexBox to an IsoDataWriter.
2571
3577
  *
2572
- * @param view - The IsoView to read data from
3578
+ * ISO/IEC 14496-12:2012 - 8.16.4 Subsegment Index Box
2573
3579
  *
2574
- * @returns A parsed SubtitleMediaHeaderBox
3580
+ * @param box - The SubsegmentIndexBox fields to write
2575
3581
  *
3582
+ * @returns An IsoDataWriter containing the encoded box
2576
3583
  *
2577
- * @beta
3584
+ * @public
2578
3585
  */
2579
- declare function sthd(view: IsoView): Fields<SubtitleMediaHeaderBox>;
3586
+ declare function writeSsix(box: SubsegmentIndexBox): IsoBoxWriteView;
2580
3587
  //#endregion
2581
- //#region src/parsers/stsd.d.ts
3588
+ //#region src/writers/writeSthd.d.ts
2582
3589
  /**
2583
- * Parse a SampleDescriptionBox from an IsoView
3590
+ * Write a SubtitleMediaHeaderBox to an IsoDataWriter.
2584
3591
  *
2585
- * @param view - The IsoView to read data from
3592
+ * ISO/IEC 14496-12:2012 - 12.6.2 Subtitle Media Header Box
2586
3593
  *
2587
- * @returns A parsed SampleDescriptionBox
3594
+ * @param box - The SubtitleMediaHeaderBox fields to write
2588
3595
  *
3596
+ * @returns An IsoDataWriter containing the encoded box
2589
3597
  *
2590
- * @beta
3598
+ * @public
2591
3599
  */
2592
- declare function stsd<E extends SampleEntryBox = SampleEntryBox>(view: IsoView): Fields<SampleDescriptionBox<E>>;
3600
+ declare function writeSthd(box: SubtitleMediaHeaderBox): IsoBoxWriteView;
2593
3601
  //#endregion
2594
- //#region src/parsers/stss.d.ts
3602
+ //#region src/writers/writeStsd.d.ts
2595
3603
  /**
2596
- * Parse a SyncSampleBox from an IsoView
3604
+ * Write a SampleDescriptionBox to an IsoDataWriter.
2597
3605
  *
2598
- * @param view - The IsoView to read data from
2599
- *
2600
- * @returns A parsed SyncSampleBox
3606
+ * @param box - The SampleDescriptionBox fields to write
2601
3607
  *
3608
+ * @returns An IsoDataWriter containing the encoded box
2602
3609
  *
2603
- * @beta
3610
+ * @public
2604
3611
  */
2605
- declare function stss(view: IsoView): Fields<SyncSampleBox>;
3612
+ declare function writeStsd(box: SampleDescriptionBox, config: IsoBoxWriteViewConfig): IsoBoxWriteView;
2606
3613
  //#endregion
2607
- //#region src/parsers/sttg.d.ts
3614
+ //#region src/writers/writeStss.d.ts
2608
3615
  /**
2609
- * Parse a WebVTTSettingsBox from an IsoView
3616
+ * Write a SyncSampleBox to an IsoDataWriter.
2610
3617
  *
2611
- * @param view - The IsoView to read data from
3618
+ * ISO/IEC 14496-12:2012 - 8.6.2 Sync Sample Box
2612
3619
  *
2613
- * @returns A parsed WebVTTSettingsBox
3620
+ * @param box - The SyncSampleBox fields to write
2614
3621
  *
3622
+ * @returns An IsoDataWriter containing the encoded box
2615
3623
  *
2616
- * @beta
3624
+ * @public
2617
3625
  */
2618
- declare function sttg(view: IsoView): Fields<WebVttSettingsBox>;
3626
+ declare function writeStss(box: SyncSampleBox): IsoBoxWriteView;
2619
3627
  //#endregion
2620
- //#region src/parsers/stts.d.ts
3628
+ //#region src/writers/writeSttg.d.ts
2621
3629
  /**
2622
- * Parse a DecodingTimeToSampleBox from an IsoView
2623
- *
2624
- * @param view - The IsoView to read data from
3630
+ * Write a WebVttSettingsBox to an IsoDataWriter.
2625
3631
  *
2626
- * @returns A parsed DecodingTimeToSampleBox
3632
+ * @param box - The WebVttSettingsBox fields to write
2627
3633
  *
3634
+ * @returns An IsoDataWriter containing the encoded box
2628
3635
  *
2629
- * @beta
3636
+ * @public
2630
3637
  */
2631
- declare function stts(view: IsoView): Fields<DecodingTimeToSampleBox>;
3638
+ declare function writeSttg(box: WebVttSettingsBox): IsoBoxWriteView;
2632
3639
  //#endregion
2633
- //#region src/parsers/styp.d.ts
3640
+ //#region src/writers/writeStts.d.ts
2634
3641
  /**
2635
- * Parse a SegmentTypeBox from an IsoView
3642
+ * Write a DecodingTimeToSampleBox to an IsoDataWriter.
2636
3643
  *
2637
- * @param view - The IsoView to read data from
3644
+ * ISO/IEC 14496-12:2012 - 8.6.1.2 Decoding Time to Sample Box
2638
3645
  *
2639
- * @returns A parsed SegmentTypeBox
3646
+ * @param box - The DecodingTimeToSampleBox fields to write
2640
3647
  *
3648
+ * @returns An IsoDataWriter containing the encoded box
2641
3649
  *
2642
- * @beta
3650
+ * @public
2643
3651
  */
2644
- declare function styp(view: IsoView): Fields<SegmentTypeBox>;
3652
+ declare function writeStts(box: DecodingTimeToSampleBox): IsoBoxWriteView;
2645
3653
  //#endregion
2646
- //#region src/parsers/subs.d.ts
3654
+ //#region src/writers/writeStyp.d.ts
2647
3655
  /**
2648
- * Parse a SubSampleInformationBox from an IsoView
3656
+ * Write a SegmentTypeBox to an IsoDataWriter.
2649
3657
  *
2650
- * @param view - The IsoView to read data from
3658
+ * ISO/IEC 14496-12:2012 - 8.16.2 Segment Type Box
2651
3659
  *
2652
- * @returns A parsed SubSampleInformationBox
3660
+ * @param box - The SegmentTypeBox fields to write
2653
3661
  *
3662
+ * @returns An IsoDataWriter containing the encoded box
2654
3663
  *
2655
- * @beta
3664
+ * @public
2656
3665
  */
2657
- declare function subs(view: IsoView): Fields<SubsampleInformationBox>;
3666
+ declare function writeStyp(box: SegmentTypeBox): IsoBoxWriteView;
2658
3667
  //#endregion
2659
- //#region src/parsers/tenc.d.ts
3668
+ //#region src/writers/writeSubs.d.ts
2660
3669
  /**
2661
- * Parse a TrackEncryptionBox from an IsoView
3670
+ * Write a SubsampleInformationBox to an IsoDataWriter.
2662
3671
  *
2663
- * @param view - The IsoView to read data from
3672
+ * ISO/IEC 14496-12:2012 - 8.7.7 Sub-Sample Information Box
2664
3673
  *
2665
- * @returns A parsed TrackEncryptionBox
3674
+ * @param box - The SubsampleInformationBox fields to write
2666
3675
  *
3676
+ * @returns An IsoDataWriter containing the encoded box
2667
3677
  *
2668
- * @beta
3678
+ * @public
2669
3679
  */
2670
- declare function tenc(view: IsoView): Fields<TrackEncryptionBox>;
3680
+ declare function writeSubs(box: SubsampleInformationBox): IsoBoxWriteView;
2671
3681
  //#endregion
2672
- //#region src/parsers/tfdt.d.ts
3682
+ //#region src/writers/writeTenc.d.ts
2673
3683
  /**
2674
- * Parse a TrackFragmentDecodeTimeBox from an IsoView
3684
+ * Write a TrackEncryptionBox to an IsoDataWriter.
2675
3685
  *
2676
- * @param view - The IsoView to read data from
3686
+ * ISO/IEC 23001-7 - 8.2 Track Encryption Box
2677
3687
  *
2678
- * @returns A parsed TrackFragmentDecodeTimeBox
3688
+ * @param box - The TrackEncryptionBox fields to write
2679
3689
  *
3690
+ * @returns An IsoDataWriter containing the encoded box
2680
3691
  *
2681
- * @beta
3692
+ * @public
2682
3693
  */
2683
- declare function tfdt(view: IsoView): Fields<TrackFragmentBaseMediaDecodeTimeBox>;
3694
+ declare function writeTenc(box: TrackEncryptionBox): IsoBoxWriteView;
2684
3695
  //#endregion
2685
- //#region src/parsers/tfhd.d.ts
3696
+ //#region src/writers/writeTfdt.d.ts
2686
3697
  /**
2687
- * Parse a TrackFragmentHeaderBox from an IsoView
3698
+ * Write a TrackFragmentBaseMediaDecodeTimeBox to an IsoDataWriter.
2688
3699
  *
2689
- * @param view - The IsoView to read data from
3700
+ * ISO/IEC 14496-12:2012 - 8.8.12 Track Fragment Base Media Decode Time Box
2690
3701
  *
2691
- * @returns A parsed TrackFragmentHeaderBox
3702
+ * @param box - The TrackFragmentBaseMediaDecodeTimeBox fields to write
2692
3703
  *
3704
+ * @returns An IsoDataWriter containing the encoded box
2693
3705
  *
2694
- * @beta
3706
+ * @public
2695
3707
  */
2696
- declare function tfhd(view: IsoView): Fields<TrackFragmentHeaderBox>;
3708
+ declare function writeTfdt(box: TrackFragmentBaseMediaDecodeTimeBox): IsoBoxWriteView;
2697
3709
  //#endregion
2698
- //#region src/parsers/tfra.d.ts
3710
+ //#region src/writers/writeTfhd.d.ts
2699
3711
  /**
2700
- * Parse a TrackFragmentRandomAccessBox from an IsoView
3712
+ * Write a TrackFragmentHeaderBox to an IsoDataWriter.
2701
3713
  *
2702
- * @param view - The IsoView to read data from
3714
+ * ISO/IEC 14496-12:2012 - 8.8.7 Track Fragment Header Box
2703
3715
  *
2704
- * @returns A parsed TrackFragmentRandomAccessBox
3716
+ * @param box - The TrackFragmentHeaderBox fields to write
2705
3717
  *
3718
+ * @returns An IsoDataWriter containing the encoded box
2706
3719
  *
2707
- * @beta
3720
+ * @public
2708
3721
  */
2709
- declare function tfra(view: IsoView): Fields<TrackFragmentRandomAccessBox>;
3722
+ declare function writeTfhd(box: TrackFragmentHeaderBox): IsoBoxWriteView;
2710
3723
  //#endregion
2711
- //#region src/parsers/tkhd.d.ts
3724
+ //#region src/writers/writeTfra.d.ts
2712
3725
  /**
2713
- * Parse a TrackHeaderBox from an IsoView
3726
+ * Write a TrackFragmentRandomAccessBox to an IsoDataWriter.
2714
3727
  *
2715
- * @param view - The IsoView to read data from
3728
+ * ISO/IEC 14496-12:2012 - 8.8.10 Track Fragment Random Access Box
2716
3729
  *
2717
- * @returns A parsed TrackHeaderBox
3730
+ * @param box - The TrackFragmentRandomAccessBox fields to write
2718
3731
  *
3732
+ * @returns An IsoDataWriter containing the encoded box
2719
3733
  *
2720
- * @beta
3734
+ * @public
2721
3735
  */
2722
- declare function tkhd(view: IsoView): Fields<TrackHeaderBox>;
3736
+ declare function writeTfra(box: TrackFragmentRandomAccessBox): IsoBoxWriteView;
2723
3737
  //#endregion
2724
- //#region src/parsers/trex.d.ts
3738
+ //#region src/writers/writeTkhd.d.ts
2725
3739
  /**
2726
- * Parse a TrackExtendsBox from an IsoView
3740
+ * Write a TrackHeaderBox to an IsoDataWriter.
2727
3741
  *
2728
- * @param view - The IsoView to read data from
3742
+ * ISO/IEC 14496-12:2012 - 8.3.2 Track Header Box
2729
3743
  *
2730
- * @returns A parsed TrackExtendsBox
3744
+ * @param box - The TrackHeaderBox fields to write
2731
3745
  *
3746
+ * @returns An IsoDataWriter containing the encoded box
2732
3747
  *
2733
- * @beta
3748
+ * @public
2734
3749
  */
2735
- declare function trex(view: IsoView): Fields<TrackExtendsBox>;
3750
+ declare function writeTkhd(box: TrackHeaderBox): IsoBoxWriteView;
2736
3751
  //#endregion
2737
- //#region src/parsers/trun.d.ts
3752
+ //#region src/writers/writeTrex.d.ts
2738
3753
  /**
2739
- * Parse a TrackRunBox from an IsoView
3754
+ * Write a TrackExtendsBox to an IsoDataWriter.
2740
3755
  *
2741
- * @param view - The IsoView to read data from
3756
+ * ISO/IEC 14496-12:2012 - 8.8.3 Track Extends Box
2742
3757
  *
2743
- * @returns A parsed TrackRunBox
3758
+ * @param box - The TrackExtendsBox fields to write
2744
3759
  *
3760
+ * @returns An IsoDataWriter containing the encoded box
2745
3761
  *
2746
- * @beta
3762
+ * @public
2747
3763
  */
2748
- declare function trun(view: IsoView): Fields<TrackRunBox>;
3764
+ declare function writeTrex(box: TrackExtendsBox): IsoBoxWriteView;
2749
3765
  //#endregion
2750
- //#region src/parsers/url.d.ts
3766
+ //#region src/writers/writeTrun.d.ts
2751
3767
  /**
2752
- * Parse a UrlBox from an IsoView
3768
+ * Write a TrackRunBox to an IsoDataWriter.
2753
3769
  *
2754
- * @param view - The IsoView to read data from
3770
+ * ISO/IEC 14496-12:2012 - 8.8.8 Track Run Box
2755
3771
  *
2756
- * @returns A parsed UrlBox
3772
+ * @param box - The TrackRunBox fields to write
2757
3773
  *
3774
+ * @returns An IsoDataWriter containing the encoded box
2758
3775
  *
2759
- * @beta
3776
+ * @public
2760
3777
  */
2761
- declare function url(view: IsoView): Fields<UrlBox>;
3778
+ declare function writeTrun(box: TrackRunBox): IsoBoxWriteView;
2762
3779
  //#endregion
2763
- //#region src/parsers/urn.d.ts
3780
+ //#region src/writers/writeUrl.d.ts
2764
3781
  /**
2765
- * Parse a UrnBox from an IsoView
3782
+ * Write a UrlBox to an IsoDataWriter.
2766
3783
  *
2767
- * @param view - The IsoView to read data from
3784
+ * ISO/IEC 14496-12:2012 - 8.7.2 Data Reference Box
2768
3785
  *
2769
- * @returns A parsed UrnBox
3786
+ * @param box - The UrlBox fields to write
2770
3787
  *
3788
+ * @returns An IsoDataWriter containing the encoded box
2771
3789
  *
2772
- * @beta
3790
+ * @public
2773
3791
  */
2774
- declare function urn(view: IsoView): Fields<UrnBox>;
3792
+ declare function writeUrl(box: DataEntryUrlBox): IsoBoxWriteView;
2775
3793
  //#endregion
2776
- //#region src/parsers/vlab.d.ts
3794
+ //#region src/writers/writeUrn.d.ts
2777
3795
  /**
2778
- * Parse a WebVTTSourceLabelBox from an IsoView
3796
+ * Write a UrnBox to an IsoDataWriter.
2779
3797
  *
2780
- * @param view - The IsoView to read data from
3798
+ * ISO/IEC 14496-12:2012 - 8.7.2 Data Reference Box
2781
3799
  *
2782
- * @returns A parsed WebVTTSourceLabelBox
3800
+ * @param box - The UrnBox fields to write
2783
3801
  *
3802
+ * @returns An IsoDataWriter containing the encoded box
2784
3803
  *
2785
- * @beta
3804
+ * @public
2786
3805
  */
2787
- declare function vlab(view: IsoView): Fields<WebVttSourceLabelBox>;
3806
+ declare function writeUrn(box: DataEntryUrnBox): IsoBoxWriteView;
2788
3807
  //#endregion
2789
- //#region src/parsers/vmhd.d.ts
3808
+ //#region src/writers/writeVlab.d.ts
2790
3809
  /**
2791
- * Parse a VideoMediaHeaderBox from an IsoView
2792
- *
2793
- * @param view - The IsoView to read data from
3810
+ * Write a WebVttSourceLabelBox to an IsoDataWriter.
2794
3811
  *
2795
- * @returns A parsed VideoMediaHeaderBox
3812
+ * @param box - The WebVttSourceLabelBox fields to write
2796
3813
  *
3814
+ * @returns An IsoDataWriter containing the encoded box
2797
3815
  *
2798
- * @beta
3816
+ * @public
2799
3817
  */
2800
- declare function vmhd(view: IsoView): Fields<VideoMediaHeaderBox>;
3818
+ declare function writeVlab(box: WebVttSourceLabelBox): IsoBoxWriteView;
2801
3819
  //#endregion
2802
- //#region src/parsers/vttC.d.ts
3820
+ //#region src/writers/writeVmhd.d.ts
2803
3821
  /**
2804
- * Parse a WebVTTConfigurationBox from an IsoView
3822
+ * Write a VideoMediaHeaderBox to an IsoDataWriter.
2805
3823
  *
2806
- * @param view - The IsoView to read data from
3824
+ * ISO/IEC 14496-12:2012 - 12.1.2 Video Media Header Box
2807
3825
  *
2808
- * @returns A parsed WebVttConfigurationBox
3826
+ * @param box - The VideoMediaHeaderBox fields to write
2809
3827
  *
3828
+ * @returns An IsoDataWriter containing the encoded box
2810
3829
  *
2811
- * @beta
3830
+ * @public
2812
3831
  */
2813
- declare function vttC(view: IsoView): Fields<WebVttConfigurationBox>;
3832
+ declare function writeVmhd(box: VideoMediaHeaderBox): IsoBoxWriteView;
2814
3833
  //#endregion
2815
- //#region src/parsers/vtte.d.ts
3834
+ //#region src/writers/writeVttC.d.ts
2816
3835
  /**
2817
- * Parse a WebVTT Empty Sample Box from an IsoView
3836
+ * Write a WebVttConfigurationBox to an IsoDataWriter.
2818
3837
  *
2819
- * @returns A parsed WebVTT Empty Sample Box
3838
+ * @param box - The WebVttConfigurationBox fields to write
3839
+ *
3840
+ * @returns An IsoDataWriter containing the encoded box
3841
+ *
3842
+ * @public
3843
+ */
3844
+ declare function writeVttC(box: WebVttConfigurationBox): IsoBoxWriteView;
3845
+ //#endregion
3846
+ //#region src/writers/writeVtte.d.ts
3847
+ /**
3848
+ * Write a WebVttEmptySampleBox to an IsoDataWriter.
2820
3849
  *
3850
+ * @returns An IsoDataWriter containing the encoded box
2821
3851
  *
2822
- * @beta
3852
+ * @public
2823
3853
  */
2824
- declare function vtte(): Fields<WebVttEmptySampleBox>;
3854
+ declare function writeVtte(_: WebVttEmptySampleBox): IsoBoxWriteView;
2825
3855
  //#endregion
2826
- export { AudioRenderingIndicationBox, AudioSampleEntryBox, Box, BoxFilter, BoxParser, BoxParserMap, ChunkLargeOffsetBox, ChunkOffsetBox, CompactSampleSizeBox, CompositionTimeToSampleBox, CompositionTimeToSampleEntry, ContainerBox, DATA, DataEntryUrlBox, DataEntryUrnBox, DataInformationBox, DataReferenceBox, DecodingTimeSample, DecodingTimeToSampleBox, DegradationPriorityBox, EditBox, EditListBox, EditListEntry, EncryptedSample, Entity, EventMessageBox, ExtendedLanguageBox, Fields, FileTypeBox, FreeSpaceBox, FullBox, HandlerReferenceBox, HintMediaHeaderBox, INT, IdentifiedMediaDataBox, IpmpInfoBox, IsoBmffBox, IsoBmffBoxMap, IsoBox, IsoContainerBox, IsoData, IsoFieldTypeMap, IsoView, IsoViewConfig, ItemExtent, ItemInfoBox, ItemInfoEntry, ItemLocation, ItemLocationBox, ItemProtectionBox, ItemReferenceBox, LabelBox, MediaBox, MediaDataBox, MediaHeaderBox, MediaInformationBox, MetaBox, MovieBox, MovieExtendsBox, MovieExtendsHeaderBox, MovieFragmentBox, MovieFragmentHeaderBox, MovieFragmentRandomAccessBox, MovieFragmentRandomAccessOffsetBox, MovieHeaderBox, NullMediaHeaderBox, OriginalFormatBox, PreselectionGroupBox, PrimaryItemBox, ProducerReferenceTimeBox, ProtectionSchemeInformationBox, ProtectionSystemSpecificHeaderBox, RawBox, STRING, SampleAuxiliaryInformationOffsetsBox, SampleAuxiliaryInformationSizesBox, SampleDependencyTypeBox, SampleDescriptionBox, SampleEncryptionBox, SampleEntryBox, SampleGroupDescriptionBox, SampleSizeBox, SampleTableBox, SampleToChunkBox, SampleToChunkEntry, SampleToGroupBox, SampleToGroupEntry, SchemeInformationBox, SchemeTypeBox, SegmentIndexBox, SegmentIndexReference, SegmentTypeBox, ShadowSyncEntry, ShadowSyncSampleBox, SingleItemTypeReferenceBox, SoundMediaHeaderBox, Subsample, SubsampleEncryption, SubsampleEntry, SubsampleInformationBox, Subsegment, SubsegmentIndexBox, SubsegmentRange, SubtitleMediaHeaderBox, SyncSample, SyncSampleBox, TEMPLATE, TrackBox, TrackEncryptionBox, TrackExtendsBox, TrackFragmentBaseMediaDecodeTimeBox, TrackFragmentBox, TrackFragmentHeaderBox, TrackFragmentRandomAccessBox, TrackFragmentRandomAccessEntry, TrackHeaderBox, TrackKindBox, TrackReferenceBox, TrackReferenceTypeBox, TrackRunBox, TrackRunSample, TypeBox, UINT, UTF8, UrlBox, UrnBox, UserDataBox, VideoMediaHeaderBox, VisualSampleEntryBox, WebVttConfigurationBox, WebVttCueIdBox, WebVttCuePayloadBox, WebVttEmptySampleBox, WebVttSettingsBox, WebVttSourceLabelBox, ardi, avc1, avc2, avc3, avc4, createIsoView, ctts, dref, elng, elst, emsg, enca, encv, filterBoxes, filterBoxesByType, findBox, findBoxByType, free, frma, ftyp, hdlr, hev1, hvc1, iden, imda, kind, labl, mdat, mdhd, mehd, meta, mfhd, mfro, mp4a, mvhd, parseBoxes, payl, prft, prsl, pssh, schm, sdtp, sidx, skip, smhd, ssix, sthd, stsd, stss, sttg, stts, styp, subs, tenc, tfdt, tfhd, tfra, tkhd, trex, trun, url, urn, vlab, vmhd, vttC, vtte };
3856
+ export { AdditionalMetadataContainerBox, AdditionalMetadataContainerBoxChild, AudioRenderingIndicationBox, AudioSampleEntryBox, Box, BoxReturn, CONTAINERS, ChunkLargeOffsetBox, ChunkOffsetBox, CompactSampleSizeBox, CompositionTimeToSampleBox, CompositionTimeToSampleEntry, ContainerReturn, DATA, DataEntryUrlBox, DataEntryUrnBox, DataInformationBox, DataInformationBoxChild, DataReferenceBox, DecodingTimeSample, DecodingTimeToSampleBox, DegradationPriorityBox, EditBox, EditBoxChild, EditListBox, EditListEntry, EncryptedSample, Entity, EventMessageBox, ExtendedLanguageBox, FileTypeBox, FreeSpaceBox, FullBox, GroupsListBox, GroupsListBoxChild, HandlerReferenceBox, HintMediaHeaderBox, INT, IdentifiedMediaDataBox, IpmpInfoBox, IsoBox, IsoBoxContainer, IsoBoxContainerMap, IsoBoxData, IsoBoxMap, IsoBoxReadView, IsoBoxReadViewConfig, IsoBoxReadableStream, IsoBoxReader, IsoBoxReaderMap, IsoBoxReaderReturn, IsoBoxStreamable, IsoBoxWriteView, IsoBoxWriteViewConfig, IsoBoxWriter, IsoBoxWriterMap, IsoFieldTypeMap, IsoParsedBox, IsoTypedParsedBox, ItemExtent, ItemInfoBox, ItemInfoBoxChild, ItemInfoEntry, ItemLocation, ItemLocationBox, ItemProtectionBox, ItemProtectionBoxChild, ItemReferenceBox, ItemReferenceBoxChild, LabelBox, MediaBox, MediaBoxChild, MediaDataBox, MediaHeaderBox, MediaInformationBox, MediaInformationBoxChild, MetaBox, MetaBoxChild, MovieBox, MovieBoxChild, MovieExtendsBox, MovieExtendsBoxChild, MovieExtendsHeaderBox, MovieFragmentBox, MovieFragmentBoxChild, MovieFragmentHeaderBox, MovieFragmentRandomAccessBox, MovieFragmentRandomAccessBoxChild, MovieFragmentRandomAccessOffsetBox, MovieHeaderBox, NullMediaHeaderBox, OriginalFormatBox, ParsedBox, PreselectionGroupBox, PrimaryItemBox, ProducerReferenceTimeBox, ProtectionSchemeInformationBox, ProtectionSchemeInformationBoxChild, ProtectionSystemSpecificHeaderBox, STRING, SampleAuxiliaryInformationOffsetsBox, SampleAuxiliaryInformationSizesBox, SampleDependencyTypeBox, SampleDescriptionBox, SampleEncryptionBox, SampleEntryBox, SampleGroupDescriptionBox, SampleSizeBox, SampleTableBox, SampleTableBoxChild, SampleToChunkBox, SampleToChunkEntry, SampleToGroupBox, SampleToGroupEntry, SchemeInformationBox, SchemeInformationBoxChild, SchemeTypeBox, SegmentIndexBox, SegmentIndexReference, SegmentTypeBox, ShadowSyncEntry, ShadowSyncSampleBox, SingleItemTypeReferenceBox, SoundMediaHeaderBox, SubTrackBox, SubTrackBoxChild, Subsample, SubsampleEncryption, SubsampleEntry, SubsampleInformationBox, Subsegment, SubsegmentIndexBox, SubsegmentRange, SubtitleMediaHeaderBox, SyncSample, SyncSampleBox, TEMPLATE, TrackBox, TrackBoxChild, TrackEncryptionBox, TrackExtendsBox, TrackFragmentBaseMediaDecodeTimeBox, TrackFragmentBox, TrackFragmentBoxChild, TrackFragmentHeaderBox, TrackFragmentRandomAccessBox, TrackFragmentRandomAccessEntry, TrackHeaderBox, TrackKindBox, TrackReferenceBox, TrackReferenceBoxChild, TrackReferenceTypeBox, TrackRunBox, TrackRunSample, TypeBox, UINT, UTF8, UserDataBox, UserDataBoxChild, VideoMediaHeaderBox, VisualSampleEntryBox, VisualSampleEntryType, WebVttConfigurationBox, WebVttCueBox, WebVttCueChild, WebVttCueIdBox, WebVttCuePayloadBox, WebVttEmptySampleBox, WebVttSettingsBox, WebVttSourceLabelBox, co64, createIsoBoxReadableStream, isContainer, isFullBox, readArdi, readAvc1, readAvc2, readAvc3, readAvc4, readCtts, readDref, readElng, readElst, readEmsg, readEnca, readEncv, readFree, readFrma, readFtyp, readHdlr, readHev1, readHvc1, readIden, readImda, readIsoBoxes, readKind, readLabl, readMdat, readMdhd, readMehd, readMeta, readMfhd, readMfro, readMp4a, readMvhd, readPayl, readPrft, readPrsl, readPssh, readSchm, readSdtp, readSidx, readSkip, readSmhd, readSsix, readSthd, readStsd, readStss, readSttg, readStts, readStyp, readSubs, readTenc, readTfdt, readTfhd, readTfra, readTkhd, readTrex, readTrun, readUrl, readUrn, readVlab, readVmhd, readVttC, readVtte, stz2, traverseIsoBoxes, url, urn, writeArdi, writeAvc1, writeAvc2, writeAvc3, writeAvc4, writeCtts, writeDref, writeElng, writeElst, writeEmsg, writeEnca, writeEncv, writeFree, writeFrma, writeFtyp, writeHdlr, writeHev1, writeHvc1, writeIden, writeImda, writeIsoBox, writeIsoBoxes, writeKind, writeLabl, writeMdat, writeMdhd, writeMehd, writeMeta, writeMfhd, writeMfro, writeMp4a, writeMvhd, writePayl, writePrft, writePrsl, writePssh, writeSchm, writeSdtp, writeSidx, writeSkip, writeSmhd, writeSsix, writeSthd, writeStsd, writeStss, writeSttg, writeStts, writeStyp, writeSubs, writeTenc, writeTfdt, writeTfhd, writeTfra, writeTkhd, writeTrex, writeTrun, writeUrl, writeUrn, writeVlab, writeVmhd, writeVttC, writeVtte };
2827
3857
  //# sourceMappingURL=index.d.ts.map