Commit 93d6788
committed
Source/WebCore:
[WebAudio] webm; properly trim frames according to the codec delay information
https://bugs.webkit.org/show_bug.cgi?id=228140
rdar://problem/80883882
Reviewed by Eric Carlson.
Add frame-perfect decoding for Opus and Vorbis in WebM container.
Unfortunately, due to a vorbis decoder bug, it is not possible to test that
vorbis decoding returns the right number of frames.
Amend Opus test to ensure the right amount of frames are returned.
* platform/audio/cocoa/AudioFileReaderCocoa.cpp:
(WebCore::AudioFileReader::demuxWebMData const):
(WebCore::passthroughInputDataCallback): AudioToolbox internal logging could overflow
if we used packet descriptions with offsets, so we take the most commonly used scenario
where we have a single packet to decode at a time.
(WebCore::AudioFileReader::decodeWebMData const):
* platform/graphics/cocoa/AudioTrackPrivateWebM.cpp:
(WebCore::AudioTrackPrivateWebM::codecDelay const):
(WebCore::AudioTrackPrivateWebM::setDiscardPadding):
(WebCore::AudioTrackPrivateWebM::discardPadding const):
* platform/graphics/cocoa/AudioTrackPrivateWebM.h:
* platform/graphics/cocoa/SourceBufferParserWebM.cpp:
(WebCore::SourceBufferParserWebM::OnElementEnd): Fly-by, ensure m_didParseInitializationDataCallback
only ever accessed on client thread.
(WebCore::SourceBufferParserWebM::OnBlockGroupEnd):
* platform/graphics/cocoa/SourceBufferParserWebM.h: Add trimming data callback.
Only mark WEBCORE_EXPORT the methods that need it.
(WebCore::SourceBufferParserWebM::appendData):
(WebCore::SourceBufferParserWebM::setDidParseTrimmingDataCallback):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::canPlayType const): Make canPlayType(webm/audio; codecs=vorbis)
returns maybe if feature flag set.
LayoutTests:
https://bugs.webkit.org/show_bug.cgi?id=228140
rdar://problem/80883882
Reviewed by Eric Carlson.
https://bugs.webkit.org/show_bug.cgi?id=228140
* webaudio/decode-audio-data-webm-opus-expected.txt:
* webaudio/decode-audio-data-webm-opus.html:
Canonical link: https://commits.webkit.org/240206@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280584 268f45cc-cd09-0410-ab3c-d52691b4dbfc1 parent 29f96b6 commit 93d6788
10 files changed
Lines changed: 159 additions & 33 deletions
File tree
- LayoutTests
- webaudio
- Source/WebCore
- html
- platform
- audio/cocoa
- graphics/cocoa
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
1 | 13 | | |
2 | 14 | | |
3 | 15 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
21 | 26 | | |
22 | 27 | | |
23 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
1 | 38 | | |
2 | 39 | | |
3 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1070 | 1070 | | |
1071 | 1071 | | |
1072 | 1072 | | |
1073 | | - | |
| 1073 | + | |
1074 | 1074 | | |
1075 | 1075 | | |
1076 | 1076 | | |
| |||
Lines changed: 47 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
| 133 | + | |
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
187 | | - | |
| 187 | + | |
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
197 | | - | |
| 197 | + | |
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
| |||
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
210 | 215 | | |
211 | 216 | | |
212 | | - | |
| 217 | + | |
213 | 218 | | |
214 | 219 | | |
215 | | - | |
| 220 | + | |
216 | 221 | | |
217 | 222 | | |
218 | 223 | | |
219 | | - | |
220 | | - | |
221 | | - | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
222 | 229 | | |
223 | | - | |
| 230 | + | |
224 | 231 | | |
225 | 232 | | |
226 | 233 | | |
| |||
236 | 243 | | |
237 | 244 | | |
238 | 245 | | |
239 | | - | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
240 | 252 | | |
241 | 253 | | |
242 | 254 | | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
248 | 258 | | |
249 | 259 | | |
250 | 260 | | |
251 | | - | |
252 | | - | |
| 261 | + | |
| 262 | + | |
253 | 263 | | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
254 | 269 | | |
255 | 270 | | |
256 | 271 | | |
| |||
303 | 318 | | |
304 | 319 | | |
305 | 320 | | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
306 | 327 | | |
307 | 328 | | |
308 | 329 | | |
| |||
311 | 332 | | |
312 | 333 | | |
313 | 334 | | |
314 | | - | |
| 335 | + | |
| 336 | + | |
315 | 337 | | |
316 | 338 | | |
317 | 339 | | |
| |||
331 | 353 | | |
332 | 354 | | |
333 | 355 | | |
334 | | - | |
| 356 | + | |
335 | 357 | | |
336 | 358 | | |
337 | 359 | | |
| |||
353 | 375 | | |
354 | 376 | | |
355 | 377 | | |
356 | | - | |
| 378 | + | |
357 | 379 | | |
358 | | - | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
359 | 384 | | |
360 | 385 | | |
361 | 386 | | |
| |||
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
89 | 109 | | |
90 | 110 | | |
91 | 111 | | |
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
46 | 49 | | |
47 | 50 | | |
48 | 51 | | |
49 | 52 | | |
| 53 | + | |
50 | 54 | | |
51 | 55 | | |
52 | 56 | | |
| |||
Lines changed: 21 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
| 267 | + | |
| 268 | + | |
267 | 269 | | |
268 | 270 | | |
269 | 271 | | |
| |||
779 | 781 | | |
780 | 782 | | |
781 | 783 | | |
782 | | - | |
| 784 | + | |
783 | 785 | | |
784 | | - | |
| 786 | + | |
| 787 | + | |
785 | 788 | | |
786 | 789 | | |
787 | 790 | | |
| |||
847 | 850 | | |
848 | 851 | | |
849 | 852 | | |
850 | | - | |
| 853 | + | |
851 | 854 | | |
852 | 855 | | |
853 | 856 | | |
| |||
1023 | 1026 | | |
1024 | 1027 | | |
1025 | 1028 | | |
1026 | | - | |
1027 | 1029 | | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
1028 | 1044 | | |
1029 | 1045 | | |
1030 | 1046 | | |
| |||
1212 | 1228 | | |
1213 | 1229 | | |
1214 | 1230 | | |
1215 | | - | |
| 1231 | + | |
1216 | 1232 | | |
1217 | 1233 | | |
1218 | 1234 | | |
| |||
0 commit comments