Bug 224489

Summary: Allow text tracks to purge cues outside of the buffered range
Product: WebKit Reporter: Eric Carlson <eric.carlson>
Component: MediaAssignee: Eric Carlson <eric.carlson>
Status: RESOLVED FIXED    
Severity: Normal CC: calvaris, cdumez, changseok, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, jer.noble, philipj, sergio, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch for landing
none
Patch for landing
none
Patch for landing ews-feeder: commit-queue-

Description Eric Carlson 2021-04-13 09:56:38 PDT
TextTrackCues associated in-band tracks live "forever" - until the video element is deleted or reloaded. This is fine for relatively short files, but not so good for long lived files (eg. a very long live stream), or for timed metadata where the "cue" size can be much larger than a text sample. 

Allow text tracks to opt in to purging cues who's time range does not intersect with the `buffered` range, where audio and video data is also not available. Only AVFoundation backed in-band tracks opt in at this time, because AVFoundation will redeliver cues if a time range is played again.
Comment 1 Eric Carlson 2021-04-13 10:30:26 PDT
Created attachment 425882 [details]
Patch
Comment 2 Eric Carlson 2021-04-13 10:31:18 PDT
rdar://14913419
Comment 3 Jer Noble 2021-04-13 11:03:20 PDT
Comment on attachment 425882 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=425882&action=review

r=me with nit:

> Source/WebCore/html/track/InbandDataTextTrack.h:48
> +    bool purgesCuesFromUnbufferedRanges() const final { return true; }

Nit: This confused me on initial reading, which I parsed as "purge cues from unbuffered ranges". Maybe "shouldPurgeCuesFromUnbufferedRanges()"?
Comment 4 Eric Carlson 2021-04-13 12:15:29 PDT
Created attachment 425895 [details]
Patch for landing
Comment 5 Eric Carlson 2021-04-13 15:02:57 PDT
Created attachment 425921 [details]
Patch for landing
Comment 6 Eric Carlson 2021-04-14 08:20:08 PDT
Created attachment 425982 [details]
Patch for landing
Comment 7 EWS 2021-04-14 09:53:35 PDT
Committed r275949 (236509@main): <https://commits.webkit.org/236509@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 425982 [details].