edith
Clone
https://git.tahinli.com/Tahinli/edith.git
0 watching0 forksRust18.3 MiB8c7bf80Tahinli3 months ago114 commits
| 1 | //! Container demux: pulls the video track out as access units the decoders take |
| 2 | //! -- Annex-B for H.264 and HEVC, the sample bytes untouched for VP9 (an mp4 VP9 |
| 3 | //! sample is a self-contained superframe already) and for AV1, whose Matroska |
| 4 | //! block is one temporal unit in the low-overhead OBU format the decoder reads. |
| 5 | //! |
| 6 | //! Two containers, one interface: mp4 through the `mp4` crate, Matroska |
| 7 | //! (`.mkv`/`.webm`) walked here as EBML. AV1 is why the second one exists -- |
| 8 | //! `mp4 0.14` has no `av01` sample entry at all, and AV1 ships in Matroska in |
| 9 | //! practice. |
| 10 | |
| 11 | use File; |
| 12 | use ; |
| 13 | use Path; |
| 14 | |
| 15 | use ; |
| 16 | |
| 17 | use crate; |
| 18 | |
| 19 | const START_CODE: = ; |
| 20 | |
| 21 | /// What the video track is coded with. Not a decoder choice by itself: only |
| 22 | /// H.264 has a software decoder here, which is what [`Codec::needs_plugin`] |
| 23 | /// says for the others. |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | /// The file, whichever container it came in. Which one is decided by the |
| 65 | /// extension at [`Demuxer::open`] and never again: everything downstream -- |
| 66 | /// playback, export, the plugin -- speaks access units and display frames. |
| 67 | |
| 68 | |
| 69 | |
| 70 | |
| 71 | |
| 72 | |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | |
| 87 | |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | |
| 93 | |
| 94 | |
| 95 | |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | /// Whether a path names a Matroska file, which is where AV1 arrives. Extension |
| 103 | /// only, like [`crate::is_audio`]: the demuxer is what really decides, but the |
| 104 | /// audio path has to know before it opens anything that this file's sound is |
| 105 | /// not one it reads (see [`crate::audio::AudioSession::unsupported`]). |
| 106 | |
| 107 | |
| 108 | |
| 109 | |
| 110 | |
| 111 | |
| 112 | |
| 113 | |
| 114 | |
| 115 | |
| 116 | |
| 117 | |
| 118 | |
| 119 | |
| 120 | |
| 121 | |
| 122 | |
| 123 | |
| 124 | |
| 125 | |
| 126 | |
| 127 | |
| 128 | |
| 129 | |
| 130 | |
| 131 | |
| 132 | |
| 133 | |
| 134 | |
| 135 | |
| 136 | |
| 137 | |
| 138 | |
| 139 | |
| 140 | |
| 141 | |
| 142 | |
| 143 | |
| 144 | |
| 145 | |
| 146 | |
| 147 | |
| 148 | |
| 149 | |
| 150 | |
| 151 | |
| 152 | |
| 153 | |
| 154 | |
| 155 | |
| 156 | |
| 157 | |
| 158 | |
| 159 | |
| 160 | |
| 161 | |
| 162 | |
| 163 | |
| 164 | |
| 165 | |
| 166 | |
| 167 | |
| 168 | |
| 169 | |
| 170 | |
| 171 | |
| 172 | |
| 173 | |
| 174 | |
| 175 | |
| 176 | |
| 177 | |
| 178 | |
| 179 | |
| 180 | |
| 181 | |
| 182 | |
| 183 | |
| 184 | |
| 185 | |
| 186 | |
| 187 | |
| 188 | |
| 189 | |
| 190 | |
| 191 | |
| 192 | |
| 193 | |
| 194 | |
| 195 | |
| 196 | |
| 197 | |
| 198 | |
| 199 | |
| 200 | |
| 201 | |
| 202 | |
| 203 | |
| 204 | |
| 205 | |
| 206 | |
| 207 | |
| 208 | |
| 209 | |
| 210 | |
| 211 | |
| 212 | |
| 213 | |
| 214 | |
| 215 | |
| 216 | |
| 217 | |
| 218 | |
| 219 | |
| 220 | |
| 221 | |
| 222 | |
| 223 | |
| 224 | |
| 225 | |
| 226 | |
| 227 | |
| 228 | |
| 229 | |
| 230 | |
| 231 | |
| 232 | |
| 233 | |
| 234 | |
| 235 | |
| 236 | |
| 237 | |
| 238 | |
| 239 | |
| 240 | |
| 241 | |
| 242 | |
| 243 | |
| 244 | |
| 245 | |
| 246 | |
| 247 | |
| 248 | |
| 249 | |
| 250 | |
| 251 | |
| 252 | |
| 253 | |
| 254 | |
| 255 | |
| 256 | |
| 257 | |
| 258 | |
| 259 | |
| 260 | |
| 261 | |
| 262 | |
| 263 | |
| 264 | |
| 265 | |
| 266 | |
| 267 | |
| 268 | |
| 269 | |
| 270 | |
| 271 | |
| 272 | |
| 273 | |
| 274 | |
| 275 | |
| 276 | |
| 277 | |
| 278 | |
| 279 | |
| 280 | |
| 281 | |
| 282 | |
| 283 | /// One Matroska block of the video track: where its bytes are and whether a |
| 284 | /// decoder may start on it. 16 bytes an entry, so an hour of 30 fps costs ~1.7 |
| 285 | /// MB of index -- the price of knowing the frame count and the sync points of a |
| 286 | /// container that indexes neither. |
| 287 | |
| 288 | |
| 289 | |
| 290 | |
| 291 | |
| 292 | |
| 293 | |
| 294 | /// AV1 out of a Matroska file (`.mkv`/`.webm`). |
| 295 | /// |
| 296 | /// The whole segment is walked once at open -- element *headers* only, the block |
| 297 | /// payloads are seeked over -- because Matroska carries no sample table: the |
| 298 | /// frame count and the sync points exist nowhere else, and Cues index only some |
| 299 | /// keyframes and only when a muxer bothered to write them. |
| 300 | |
| 301 | |
| 302 | |
| 303 | |
| 304 | |
| 305 | |
| 306 | |
| 307 | |
| 308 | |
| 309 | |
| 310 | |
| 311 | |
| 312 | |
| 313 | |
| 314 | |
| 315 | |
| 316 | |
| 317 | |
| 318 | |
| 319 | |
| 320 | |
| 321 | |
| 322 | |
| 323 | |
| 324 | |
| 325 | |
| 326 | |
| 327 | |
| 328 | |
| 329 | |
| 330 | |
| 331 | |
| 332 | |
| 333 | |
| 334 | |
| 335 | |
| 336 | |
| 337 | |
| 338 | |
| 339 | |
| 340 | |
| 341 | |
| 342 | |
| 343 | |
| 344 | |
| 345 | |
| 346 | |
| 347 | |
| 348 | |
| 349 | |
| 350 | |
| 351 | |
| 352 | |
| 353 | |
| 354 | |
| 355 | |
| 356 | |
| 357 | |
| 358 | |
| 359 | |
| 360 | |
| 361 | |
| 362 | |
| 363 | |
| 364 | |
| 365 | |
| 366 | |
| 367 | |
| 368 | |
| 369 | |
| 370 | |
| 371 | |
| 372 | |
| 373 | |
| 374 | |
| 375 | |
| 376 | |
| 377 | |
| 378 | |
| 379 | |
| 380 | |
| 381 | |
| 382 | |
| 383 | |
| 384 | |
| 385 | |
| 386 | |
| 387 | |
| 388 | |
| 389 | |
| 390 | |
| 391 | |
| 392 | |
| 393 | /// The codec id of `path`'s first audio track (`A_AAC`, `A_OPUS`, ...), or |
| 394 | /// `None` for a Matroska file with no sound at all. Header only, and only worth |
| 395 | /// calling once a session has come up silent: no audio track of a Matroska file |
| 396 | /// is decoded yet, so this exists to say which one is being left out. |
| 397 | |
| 398 | |
| 399 | |
| 400 | |
| 401 | |
| 402 | |
| 403 | |
| 404 | /// What the `Tracks` element says about the AV1 track. |
| 405 | |
| 406 | |
| 407 | |
| 408 | |
| 409 | |
| 410 | |
| 411 | |
| 412 | |
| 413 | |
| 414 | // Matroska element IDs, written with the leading length marker they carry in |
| 415 | // the file, which is what `ebml_element` reads them back as. |
| 416 | const SEGMENT: u32 = 0x1853_8067; |
| 417 | const INFO: u32 = 0x1549_A966; |
| 418 | const TIMESTAMP_SCALE: u32 = 0x2AD7B1; |
| 419 | const TRACKS: u32 = 0x1654_AE6B; |
| 420 | const TRACK_ENTRY: u32 = 0xAE; |
| 421 | const TRACK_NUMBER: u32 = 0xD7; |
| 422 | const TRACK_TYPE: u32 = 0x83; |
| 423 | const CODEC_ID: u32 = 0x86; |
| 424 | const CODEC_PRIVATE: u32 = 0x63A2; |
| 425 | const DEFAULT_DURATION: u32 = 0x23E383; |
| 426 | const VIDEO: u32 = 0xE0; |
| 427 | const PIXEL_WIDTH: u32 = 0xB0; |
| 428 | const PIXEL_HEIGHT: u32 = 0xBA; |
| 429 | const CLUSTER: u32 = 0x1F43_B675; |
| 430 | const CLUSTER_TIMESTAMP: u32 = 0xE7; |
| 431 | const SIMPLE_BLOCK: u32 = 0xA3; |
| 432 | const BLOCK_GROUP: u32 = 0xA0; |
| 433 | const BLOCK: u32 = 0xA1; |
| 434 | const REFERENCE_BLOCK: u32 = 0xFB; |
| 435 | |
| 436 | /// Body range of the file's `Segment` element, which everything else lives in. |
| 437 | |
| 438 | |
| 439 | |
| 440 | |
| 441 | |
| 442 | |
| 443 | |
| 444 | |
| 445 | |
| 446 | |
| 447 | |
| 448 | /// The AV1 video track of `segment`, and how a *non*-AV1 audio track would be |
| 449 | /// named -- the second is what tells a user why a file with sound plays silent |
| 450 | /// ([`crate::audio::AudioSession::unsupported`]). |
| 451 | /// |
| 452 | /// Header only: the walk stops at the first `Cluster`, so this costs a handful |
| 453 | /// of seeks whatever the file weighs. |
| 454 | |
| 455 | |
| 456 | |
| 457 | |
| 458 | |
| 459 | |
| 460 | |
| 461 | |
| 462 | |
| 463 | |
| 464 | |
| 465 | |
| 466 | |
| 467 | |
| 468 | |
| 469 | |
| 470 | |
| 471 | |
| 472 | |
| 473 | |
| 474 | |
| 475 | |
| 476 | |
| 477 | |
| 478 | |
| 479 | |
| 480 | |
| 481 | |
| 482 | |
| 483 | |
| 484 | |
| 485 | |
| 486 | |
| 487 | |
| 488 | |
| 489 | |
| 490 | |
| 491 | |
| 492 | |
| 493 | /// One `TrackEntry`: `Some` video only for an 8-bit AV1 track, and the codec id |
| 494 | /// of an audio track otherwise. |
| 495 | |
| 496 | |
| 497 | |
| 498 | |
| 499 | |
| 500 | |
| 501 | |
| 502 | |
| 503 | |
| 504 | |
| 505 | |
| 506 | |
| 507 | |
| 508 | |
| 509 | |
| 510 | |
| 511 | |
| 512 | |
| 513 | |
| 514 | |
| 515 | |
| 516 | |
| 517 | |
| 518 | |
| 519 | |
| 520 | |
| 521 | |
| 522 | |
| 523 | |
| 524 | |
| 525 | |
| 526 | |
| 527 | |
| 528 | |
| 529 | |
| 530 | |
| 531 | |
| 532 | |
| 533 | |
| 534 | |
| 535 | |
| 536 | |
| 537 | |
| 538 | |
| 539 | |
| 540 | |
| 541 | |
| 542 | |
| 543 | |
| 544 | |
| 545 | |
| 546 | |
| 547 | |
| 548 | /// The configuration OBUs of an `AV1CodecConfigurationRecord` (AV1-ISOBMFF |
| 549 | /// §2.3.3): four fixed bytes, then the sequence header OBU in the same |
| 550 | /// low-overhead format the blocks are in, so it needs no reframing. |
| 551 | /// |
| 552 | /// An empty record is not an error -- an encoder that repeats its sequence |
| 553 | /// header in-band needs none -- but a 10- or 12-bit one is refused by name, for |
| 554 | /// the same reason HEVC Main 10 is: the plugin's NV12 pool and its `vaGetImage` |
| 555 | /// read-back are 8-bit, and the upgrade path is a P010 pool. |
| 556 | |
| 557 | |
| 558 | |
| 559 | |
| 560 | |
| 561 | |
| 562 | |
| 563 | |
| 564 | |
| 565 | |
| 566 | |
| 567 | |
| 568 | |
| 569 | |
| 570 | |
| 571 | |
| 572 | |
| 573 | /// Every block of track `number`, in storage order, with the presentation span |
| 574 | /// (first and last timestamp in `TimestampScale` ticks) the frame-rate fallback |
| 575 | /// needs. |
| 576 | /// |
| 577 | /// Only element headers are read: a block's payload is seeked over and fetched |
| 578 | /// later by [`MkvDemuxer::next_access_unit`], which is what keeps this an index |
| 579 | /// pass rather than a read of the whole file. |
| 580 | |
| 581 | |
| 582 | |
| 583 | |
| 584 | |
| 585 | |
| 586 | |
| 587 | |
| 588 | |
| 589 | |
| 590 | |
| 591 | |
| 592 | |
| 593 | |
| 594 | |
| 595 | |
| 596 | |
| 597 | |
| 598 | |
| 599 | |
| 600 | |
| 601 | |
| 602 | |
| 603 | |
| 604 | |
| 605 | |
| 606 | |
| 607 | |
| 608 | |
| 609 | |
| 610 | |
| 611 | |
| 612 | |
| 613 | |
| 614 | |
| 615 | |
| 616 | |
| 617 | |
| 618 | |
| 619 | |
| 620 | |
| 621 | |
| 622 | |
| 623 | |
| 624 | |
| 625 | |
| 626 | |
| 627 | |
| 628 | |
| 629 | |
| 630 | |
| 631 | |
| 632 | |
| 633 | |
| 634 | |
| 635 | |
| 636 | |
| 637 | |
| 638 | |
| 639 | |
| 640 | |
| 641 | |
| 642 | |
| 643 | |
| 644 | |
| 645 | |
| 646 | |
| 647 | |
| 648 | |
| 649 | |
| 650 | |
| 651 | |
| 652 | /// A `SimpleBlock`/`Block` header: track number, timestamp relative to the |
| 653 | /// cluster's, flags, and where the frame's own bytes start. |
| 654 | |
| 655 | |
| 656 | |
| 657 | |
| 658 | |
| 659 | |
| 660 | |
| 661 | |
| 662 | |
| 663 | |
| 664 | |
| 665 | |
| 666 | |
| 667 | |
| 668 | |
| 669 | |
| 670 | |
| 671 | |
| 672 | |
| 673 | |
| 674 | |
| 675 | |
| 676 | |
| 677 | |
| 678 | |
| 679 | |
| 680 | /// The EBML element at `at`: its id (marker bit and all), where its payload |
| 681 | /// starts, and where it ends. `None` once `end` is reached. An element of |
| 682 | /// unknown length -- what a muxer writes while it is still recording -- runs to |
| 683 | /// the end of its parent, which is exactly how a reader is told to take it. |
| 684 | |
| 685 | |
| 686 | |
| 687 | |
| 688 | |
| 689 | |
| 690 | |
| 691 | |
| 692 | |
| 693 | |
| 694 | |
| 695 | |
| 696 | |
| 697 | |
| 698 | |
| 699 | |
| 700 | |
| 701 | |
| 702 | |
| 703 | /// EBML variable-length integer: the leading zeros of the first byte say how |
| 704 | /// many bytes it takes. `strip` clears the marker bit, which is what a *size* |
| 705 | /// wants and an *id* does not -- an id is written and compared with it. An |
| 706 | /// all-ones size means unknown length, and comes back as [`u64::MAX`]. |
| 707 | |
| 708 | |
| 709 | |
| 710 | |
| 711 | |
| 712 | |
| 713 | |
| 714 | |
| 715 | |
| 716 | |
| 717 | |
| 718 | |
| 719 | |
| 720 | |
| 721 | |
| 722 | |
| 723 | |
| 724 | |
| 725 | |
| 726 | |
| 727 | |
| 728 | |
| 729 | |
| 730 | |
| 731 | /// An EBML unsigned integer element: big-endian, as many bytes as it was |
| 732 | /// written with, and an absent one is a zero by the spec's own default. |
| 733 | |
| 734 | |
| 735 | |
| 736 | |
| 737 | |
| 738 | |
| 739 | /// The payload of an element, which is only ever a header field here -- 8 bytes |
| 740 | /// for an integer, a few hundred for a `CodecPrivate`. |
| 741 | |
| 742 | |
| 743 | |
| 744 | |
| 745 | |
| 746 | |
| 747 | |
| 748 | |
| 749 | |
| 750 | |
| 751 | /// Positioned reads, so the walk never has to keep a cursor in step with itself. |
| 752 | |
| 753 | |
| 754 | |
| 755 | |
| 756 | |
| 757 | |
| 758 | |
| 759 | |
| 760 | /// Frames per second off the sample table. `mp4 0.14`'s own |
| 761 | /// [`Mp4Track::frame_rate`] divides the sample count by whole *milliseconds* |
| 762 | /// before the float cast (`track.rs:166`), so 24000/1001 reads back as a flat |
| 763 | /// 23.0 -- with the audio clock as master that is 4 % of drift, five minutes of |
| 764 | /// it by the end of a two-hour film. |
| 765 | |
| 766 | |
| 767 | |
| 768 | |
| 769 | /// Whole track over whole track: constant-delta tables (the common case) come |
| 770 | /// out as exactly `timescale / delta`, and a table that spreads 3753/3754 ticks |
| 771 | /// to average 3753.75 averages instead of truncating. All of it in `f64`, which |
| 772 | /// is the bug the caller above exists to avoid. |
| 773 | |
| 774 | |
| 775 | |
| 776 | |
| 777 | |
| 778 | |
| 779 | |
| 780 | |
| 781 | |
| 782 | |
| 783 | |
| 784 | |
| 785 | |
| 786 | |
| 787 | |
| 788 | |
| 789 | |
| 790 | /// What the edit list really trims off the front, in media ticks: its |
| 791 | /// `media_time` less the first sample's own composition offset. A stream with |
| 792 | /// B-frames carries a `ctts` delay, and every muxer writes `media_time` equal to |
| 793 | /// exactly that delay -- which is not a trim at all, it is the container saying |
| 794 | /// "sample 1 is still the first picture". Reading it as one drops real frames |
| 795 | /// (`test_high.mp4` loses two, and so did the film this bug came from). What is |
| 796 | /// left over after the delay is the genuine trim. |
| 797 | /// |
| 798 | /// ponytail: empty edits are ignored and `media_time` is otherwise taken at face |
| 799 | /// value, which is exactly what [`crate::audio::edit_media_time`] gives the audio |
| 800 | /// track -- symmetry between the two is the point, not a full edit-list engine. |
| 801 | /// Their *empty* edits can differ (83 ms of video against 62 ms of audio in that |
| 802 | /// film, so the picture stays 21 ms -- half a frame -- early); honouring those is |
| 803 | /// the upgrade path, and it belongs to both tracks at once. |
| 804 | |
| 805 | |
| 806 | |
| 807 | |
| 808 | |
| 809 | |
| 810 | |
| 811 | |
| 812 | |
| 813 | |
| 814 | |
| 815 | |
| 816 | |
| 817 | /// 1-based id of the sample the presentation starts on, for a track trimmed by |
| 818 | /// `trim` media ticks ([`trim_ticks`]). `None` (no edit list) and zero are both |
| 819 | /// "no trim", i.e. the first sample. |
| 820 | |
| 821 | |
| 822 | |
| 823 | |
| 824 | /// Largest entry of the ascending sync table that is `<= sample_id`. An empty |
| 825 | /// table means every sample is a sync sample. When `sample_id` sits before the |
| 826 | /// first sync sample there is nothing decodable earlier, so that one wins. |
| 827 | |
| 828 | |
| 829 | |
| 830 | |
| 831 | |
| 832 | |
| 833 | |
| 834 | |
| 835 | |
| 836 | |
| 837 | /// Length-prefixed NALs (`avcC` or `hvcC` framing) -> Annex-B. `n` is the |
| 838 | /// prefix width the sample entry declares, 1..=4; a wrong one misparses |
| 839 | /// immediately, hence the check. |
| 840 | |
| 841 | |
| 842 | |
| 843 | |
| 844 | |
| 845 | |
| 846 | |
| 847 | |
| 848 | |
| 849 | |
| 850 | |
| 851 | |
| 852 | |
| 853 | |
| 854 | |
| 855 | |
| 856 | |
| 857 | |
| 858 | |
| 859 | |
| 860 | |
| 861 | |
| 862 | /// The `hvcC` payload of `track_id`'s sample entry, read straight out of the |
| 863 | /// file: `mp4 0.14`'s `HvcCBox` keeps the configuration version and skips |
| 864 | /// everything after it (`hev1.rs:193`), so the VPS/SPS/PPS an HEVC decoder |
| 865 | /// cannot start without are unreachable through the crate. |
| 866 | |
| 867 | |
| 868 | |
| 869 | |
| 870 | |
| 871 | |
| 872 | |
| 873 | |
| 874 | |
| 875 | /// The four-character code of `track_id`'s first `stsd` sample entry and that |
| 876 | /// entry's payload. Read by hand for the same reason the record above is: the |
| 877 | /// crate keeps no fourcc for a sample entry it does not recognise, so this is |
| 878 | /// the only thing that can tell an `hvc1` track from a track in a codec nothing |
| 879 | /// here reads. Shared with `audio`, which asks it the same question of a `soun` |
| 880 | /// track: `mp4a` or the `ac-3` the crate drops on the floor. |
| 881 | pub |
| 882 | |
| 883 | |
| 884 | |
| 885 | |
| 886 | |
| 887 | |
| 888 | |
| 889 | |
| 890 | |
| 891 | |
| 892 | |
| 893 | |
| 894 | |
| 895 | |
| 896 | |
| 897 | |
| 898 | |
| 899 | |
| 900 | /// HEVCDecoderConfigurationRecord (ISO 14496-15 §8.3.3.1) -> the NAL length |
| 901 | /// prefix width and the VPS/SPS/PPS arrays as one Annex-B blob. |
| 902 | |
| 903 | |
| 904 | |
| 905 | |
| 906 | |
| 907 | |
| 908 | |
| 909 | |
| 910 | |
| 911 | |
| 912 | |
| 913 | |
| 914 | |
| 915 | |
| 916 | |
| 917 | |
| 918 | |
| 919 | |
| 920 | |
| 921 | |
| 922 | |
| 923 | |
| 924 | |
| 925 | |
| 926 | |
| 927 | |
| 928 | |
| 929 | |
| 930 | |
| 931 | |
| 932 | |
| 933 | |
| 934 | |
| 935 | |
| 936 | |
| 937 | |
| 938 | |
| 939 | |
| 940 | |
| 941 | |
| 942 | |
| 943 | |
| 944 | |
| 945 | |
| 946 | |
| 947 | |
| 948 | |
| 949 | |
| 950 | |
| 951 | |
| 952 | |
| 953 | /// Payload of the first top-level box of type `want`, or `None` if the file has |
| 954 | /// none. Only the box wanted is read; the rest is seeked over, so a `moov` at |
| 955 | /// the end of a two-hour film costs one seek and not a copy of the file. |
| 956 | |
| 957 | |
| 958 | |
| 959 | |
| 960 | |
| 961 | |
| 962 | |
| 963 | |
| 964 | |
| 965 | |
| 966 | |
| 967 | |
| 968 | |
| 969 | |
| 970 | |
| 971 | |
| 972 | |
| 973 | |
| 974 | |
| 975 | |
| 976 | |
| 977 | |
| 978 | |
| 979 | |
| 980 | |
| 981 | |
| 982 | |
| 983 | |
| 984 | |
| 985 | |
| 986 | |
| 987 | /// The ISO-BMFF boxes in `buf`, as (type, payload). Stops at the first |
| 988 | /// malformed header rather than erroring: every caller is looking for one box |
| 989 | /// and reports its own absence. |
| 990 | |
| 991 | |
| 992 | |
| 993 | |
| 994 | |
| 995 | |
| 996 | |
| 997 | |
| 998 | |
| 999 | |
| 1000 | |
| 1001 | |
| 1002 | |
| 1003 | |
| 1004 | |
| 1005 | |
| 1006 | |
| 1007 | |
| 1008 | |
| 1009 | |
| 1010 | |
| 1011 | /// Payload of the first child box of type `want`. |
| 1012 | |
| 1013 | |
| 1014 | |
| 1015 | |
| 1016 | /// `track_id` out of a `tkhd` payload: a FullBox whose creation and |
| 1017 | /// modification times are 32-bit in version 0 and 64-bit in version 1. |
| 1018 | |
| 1019 | |
| 1020 | |
| 1021 | |
| 1022 | |
| 1023 | |
| 1024 | |
| 1025 | |
| 1026 | |
| 1027 | |
| 1028 | |
| 1029 | |
| 1030 | |
| 1031 | |
| 1032 | |
| 1033 | |
| 1034 | |
| 1035 | |
| 1036 | |
| 1037 | |
| 1038 | |
| 1039 | |
| 1040 | |
| 1041 | |
| 1042 | |
| 1043 | |
| 1044 | |
| 1045 | |
| 1046 | |
| 1047 | |
| 1048 | |
| 1049 | |
| 1050 | |
| 1051 | |
| 1052 | |
| 1053 | |
| 1054 | |
| 1055 | |
| 1056 | |
| 1057 | |
| 1058 | |
| 1059 | |
| 1060 | |
| 1061 | |
| 1062 | |
| 1063 | |
| 1064 | |
| 1065 | |
| 1066 | |
| 1067 | |
| 1068 | |
| 1069 | |
| 1070 | |
| 1071 | |
| 1072 | |
| 1073 | |
| 1074 | |
| 1075 | |
| 1076 | |
| 1077 | |
| 1078 | |
| 1079 | |
| 1080 | |
| 1081 | |
| 1082 | |
| 1083 | |
| 1084 | |
| 1085 | |
| 1086 | |
| 1087 | |
| 1088 | |
| 1089 | |
| 1090 | |
| 1091 | |
| 1092 | |
| 1093 | |
| 1094 | |
| 1095 | |
| 1096 | |
| 1097 | |
| 1098 | |
| 1099 | |
| 1100 | |
| 1101 | |
| 1102 | |
| 1103 | |
| 1104 | |
| 1105 | |
| 1106 | |
| 1107 | |
| 1108 | |
| 1109 | |
| 1110 | |
| 1111 | |
| 1112 | |
| 1113 | |
| 1114 | |
| 1115 | |
| 1116 | |
| 1117 | |
| 1118 | |
| 1119 | |
| 1120 | |
| 1121 | |
| 1122 | |
| 1123 | |
| 1124 | |
| 1125 | |
| 1126 | |
| 1127 | |
| 1128 | |
| 1129 | |
| 1130 | |
| 1131 | |
| 1132 | |
| 1133 | |
| 1134 | |
| 1135 | |
| 1136 | |
| 1137 | |
| 1138 | |
| 1139 | |
| 1140 | |
| 1141 | |
| 1142 | |
| 1143 | |
| 1144 | |
| 1145 | |
| 1146 | |
| 1147 | |
| 1148 | |
| 1149 | |
| 1150 | |
| 1151 | |
| 1152 | |
| 1153 | |
| 1154 | |
| 1155 | |
| 1156 | |
| 1157 | |
| 1158 | |
| 1159 | |
| 1160 | |
| 1161 | |
| 1162 | |
| 1163 | |
| 1164 | |
| 1165 | |
| 1166 | |
| 1167 | |
| 1168 | |
| 1169 | |
| 1170 | |
| 1171 | |
| 1172 | |
| 1173 | |
| 1174 | |
| 1175 | |
| 1176 | |
| 1177 | |
| 1178 | |
| 1179 | |
| 1180 | |
| 1181 | |
| 1182 | |
| 1183 | |
| 1184 | |
| 1185 | |
| 1186 | |
| 1187 | |
| 1188 | |
| 1189 | |
| 1190 | |
| 1191 | |
| 1192 | |
| 1193 | |
| 1194 |