@@ -424,15 +424,25 @@ impl Mp4 {
424
424
}
425
425
426
426
pub struct Track {
427
+ /// Internal field used when decoding a fragmented MP4 file.
427
428
first_traf_merged : bool ,
428
429
429
430
pub width : u16 ,
430
431
pub height : u16 ,
431
432
432
433
pub track_id : u32 ,
434
+
435
+ /// Timescale of the sample.
436
+ ///
437
+ /// One time unit is equal to `1.0 / timescale` seconds.
433
438
pub timescale : u64 ,
439
+
440
+ /// Duration of the track in time units.
434
441
pub duration : u64 ,
442
+
435
443
pub kind : Option < TrackKind > ,
444
+
445
+ /// List of samples in the track.
436
446
pub samples : Vec < Sample > ,
437
447
}
438
448
@@ -475,7 +485,11 @@ impl Track {
475
485
476
486
#[ derive( Default , Clone , Copy ) ]
477
487
pub struct Sample {
488
+ /// Sample number.
478
489
pub id : u32 ,
490
+
491
+ /// Whether or not an entire frame can be decoded from this one sample,
492
+ /// or if it needs the context of other samples.
479
493
pub is_sync : bool ,
480
494
481
495
/// Size of the sample in bytes.
@@ -484,9 +498,20 @@ pub struct Sample {
484
498
/// Offset of the sample in bytes from the start of the MP4 file.
485
499
pub offset : u64 ,
486
500
501
+ /// Timescale of the sample.
502
+ ///
503
+ /// One time unit is equal to `1.0 / timescale` seconds.
487
504
pub timescale : u64 ,
505
+
506
+ /// Timestamp of the sample at which it should be decoded,
507
+ /// in time units.
488
508
pub decode_timestamp : u64 ,
509
+
510
+ /// Timestamp of the sample at which the sample should be displayed,
511
+ /// in time units.
489
512
pub composition_timestamp : u64 ,
513
+
514
+ /// Duration of the sample in time units.
490
515
pub duration : u64 ,
491
516
}
492
517
0 commit comments