-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Overlapping VTTCues carried by InbandTextTrack (LegibleOutput) does n…
…ot handle correctly https://bugs.webkit.org/show_bug.cgi?id=251771 rdar://105372930 Reviewed by Jer Noble. Parse every cue in each CMSampleBuffer provided the the AVPlayerItemLegibleOutput delegate, not just the first one. * LayoutTests/http/tests/media/hls/track-in-band-multiple-cues-expected.txt: Added. * LayoutTests/http/tests/media/hls/track-in-band-multiple-cues.html: Added. * LayoutTests/http/tests/media/resources/hls/multiple-cues-per-sample/master.m3u8: Added. * LayoutTests/http/tests/media/resources/hls/multiple-cues-per-sample/multiple0.vtt: Added. * LayoutTests/http/tests/media/resources/hls/multiple-cues-per-sample/multiple1.vtt: Added. * LayoutTests/http/tests/media/resources/hls/multiple-cues-per-sample/test-0.ts: Added. * LayoutTests/http/tests/media/resources/hls/multiple-cues-per-sample/test-1.ts: Added. * LayoutTests/http/tests/media/resources/hls/multiple-cues-per-sample/video.m3u8: Added. * LayoutTests/http/tests/media/resources/hls/multiple-cues-per-sample/vtt.m3u8: Added. * Source/WebCore/html/track/InbandGenericTextTrack.cpp: (WebCore::InbandGenericTextTrack::cueToExtend): Look for an existing cue with the same contents and start time and duration within the allowed delta. (WebCore::InbandGenericTextTrack::newCuesParsed): Use cueToExtend. * Source/WebCore/html/track/InbandGenericTextTrack.h: * Source/WebCore/html/track/InbandTextTrack.h: * Source/WebCore/html/track/TextTrackCue.h: * Source/WebCore/platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: (WebCore::InbandTextTrackPrivateAVF::processNativeSamples): There may be more than one cue in each CMSampleBuffer. Canonical link: https://commits.webkit.org/266260@main
- Loading branch information
1 parent
90608fd
commit 6f89f78
Showing
14 changed files
with
181 additions
and
46 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
LayoutTests/http/tests/media/hls/track-in-band-multiple-cues-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
Test that multiple cues in a sample buffer are parsed correctly. | ||
|
||
EVENT(addtrack) | ||
EVENT(playing) | ||
EVENT(cuechange) | ||
EXPECTED (track.cues.length === '5') OK | ||
|
||
END OF TEST | ||
|
40 changes: 40 additions & 0 deletions
40
LayoutTests/http/tests/media/hls/track-in-band-multiple-cues.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
|
||
<script src=../../../media-resources/video-test.js></script> | ||
<script src=../../../media-resources/media-file.js></script> | ||
|
||
<script> | ||
async function test() | ||
{ | ||
findMediaElement(); | ||
|
||
waitForAndFail(video, 'error') | ||
video.src = "http://127.0.0.1:8000/media/resources/hls/multiple-cues-per-sample/master.m3u8"; | ||
|
||
await waitFor(video.textTracks, 'addtrack') | ||
track = video.textTracks[0]; | ||
track.mode = 'showing'; | ||
|
||
await Promise.all([ | ||
waitFor(video, 'playing'), | ||
waitFor(track, 'cuechange') | ||
]); | ||
await testExpectedEventually('track.cues.length', 5, '===', 4000); | ||
|
||
consoleWrite(''); | ||
} | ||
|
||
window.addEventListener('load', async (event) => { | ||
await test(); | ||
endTest(); | ||
}); | ||
</script> | ||
</head> | ||
<body> | ||
<video controls muted autoplay></video> | ||
<p>Test that multiple cues in a sample buffer are parsed correctly.</p> | ||
</body> | ||
</html> |
5 changes: 5 additions & 0 deletions
5
LayoutTests/http/tests/media/resources/hls/multiple-cues-per-sample/master.m3u8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#EXTM3U | ||
#EXT-X-VERSION:3 | ||
#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subtitle",NAME="subtitle",DEFAULT=YES,URI="vtt.m3u8" | ||
#EXT-X-STREAM-INF:BANDWIDTH=140800,CODECS="avc1.64001f,mp4a.40.2",SUBTITLES="subtitle" | ||
video.m3u8 |
10 changes: 10 additions & 0 deletions
10
LayoutTests/http/tests/media/resources/hls/multiple-cues-per-sample/multiple0.vtt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
WEBVTT | ||
X-TIMESTAMP-MAP=MPEGTS:127920,LOCAL:00:00:00.000 | ||
Cue-1 | ||
00:00.000 --> 00:01.900 line:1 | ||
sample 1, line 1 | ||
|
||
Cue-2 | ||
00:00.000 --> 00:01.900 line:2 | ||
sample 1, line 2 |
13 changes: 13 additions & 0 deletions
13
LayoutTests/http/tests/media/resources/hls/multiple-cues-per-sample/multiple1.vtt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
WEBVTT | ||
Cue-3 | ||
00:00:02.000 --> 00:00:04.000 line:1 | ||
sample 2, line 1 | ||
|
||
Cue-4 | ||
00:00:02.000 --> 00:00:04.000 line:2 | ||
sample 2, line 2 | ||
|
||
Cue-5 | ||
00:00:02.000 --> 00:00:04.000 line:3 | ||
sample 2, line 3 |
Binary file added
BIN
+240 KB
LayoutTests/http/tests/media/resources/hls/multiple-cues-per-sample/test-0.ts
Binary file not shown.
Binary file added
BIN
+229 KB
LayoutTests/http/tests/media/resources/hls/multiple-cues-per-sample/test-1.ts
Binary file not shown.
10 changes: 10 additions & 0 deletions
10
LayoutTests/http/tests/media/resources/hls/multiple-cues-per-sample/video.m3u8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#EXTM3U | ||
#EXT-X-VERSION:3 | ||
#EXT-X-TARGETDURATION:2 | ||
#EXT-X-MEDIA-SEQUENCE:0 | ||
#EXT-X-PLAYLIST-TYPE:VOD | ||
#EXTINF:2.000000, | ||
test-0.ts | ||
#EXTINF:2.000000, | ||
test-1.ts | ||
#EXT-X-ENDLIST |
10 changes: 10 additions & 0 deletions
10
LayoutTests/http/tests/media/resources/hls/multiple-cues-per-sample/vtt.m3u8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#EXTM3U | ||
#EXT-X-VERSION:3 | ||
#EXT-X-TARGETDURATION:2 | ||
#EXT-X-MEDIA-SEQUENCE:0 | ||
#EXT-X-PLAYLIST-TYPE:VOD | ||
#EXTINF:2.000000, | ||
multiple0.vtt | ||
#EXTINF:2.000000, | ||
multiple1.vtt | ||
#EXT-X-ENDLIST |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters