mirror of
https://github.com/samsonjs/media.git
synced 2026-04-02 10:45:51 +00:00
This change introduces two new types of method to `SubtitleParser`: 1. `parse()` methods that take a `Consumer<CuesWithTiming>` and return `void` 2. `parseToLegacySubtitle` method that returns `Subtitle` (1) ensures that in the new 'parse before SampleQueue' world we can write cues to the `SampleQueue` as soon as they're ready - this is especially important when parsing monolithic text files, e.g. for a whole movie. (2) ensures that during the transition, the legacy 'parse after SampleQueue' behaviour doesn't see any regressions in 'time to first cue being shown'. Previously we had a single implementation to convert from `List<CuesWithTiming>` to `Subtitle`, but this relies on the complete list of cues being available, which can take a long time for large files in some formats (with ExoPlayer's current parsing logic). By allowing implementations to customise the way they create a `Subtitle`, we can directly re-use the existing logic, so that the 'time to first cue being shown' should stay the same. This change migrates all **usages** to the new methods, but doesn't migrate any **implementations**. I will migrate the implementations in follow-up CLs before deleting the old list-returning `parse()` methods. PiperOrigin-RevId: 565057945 |
||
|---|---|---|
| .. | ||
| src | ||
| build.gradle | ||
| proguard-rules.txt | ||
| README.md | ||