Skip to content

SourceBuffer will always perform a sync call to GPU process when there's a need to evict content.#31153

Merged
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
jyavenard:eng/SourceBuffer-can-throw-QuotaExceededError-even-when-theres-evictable-content-
Jul 25, 2024
Merged

SourceBuffer will always perform a sync call to GPU process when there's a need to evict content.#31153
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
jyavenard:eng/SourceBuffer-can-throw-QuotaExceededError-even-when-theres-evictable-content-

Conversation

@jyavenard
Copy link
Copy Markdown
Member

@jyavenard jyavenard commented Jul 24, 2024

082067e

SourceBuffer will always perform a sync call to GPU process when there's a need to evict content.
https://bugs.webkit.org/show_bug.cgi?id=276999
rdar://132402500

Reviewed by Youenn Fablet.

Prior 275380@main, eviction was performed synchronously and the eviction data algorithm would evict 3s of data at a time
until there was sufficient buffer space available for the appendBuffer operation to complete.
In 275380@main, we pre-calculated how much data could be removed in total. However, the calculation incorrectly
looked at the initial 3s of removable data only. Which would make the SourceBuffer always consider that no data was evictable
preventing an asynchronous eviction to occur and instead generating a sync call to SourceBufferPrivate::evictData.

Added tests.

* LayoutTests/media/media-source/media-managedmse-seek-and-evictable-expected.txt: Added.
* LayoutTests/media/media-source/media-managedmse-seek-and-evictable.html: Added.
* Source/WebCore/Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::evictableSize const):
* Source/WebCore/Modules/mediasource/SourceBuffer.h:
* Source/WebCore/platform/graphics/SourceBufferPrivate.cpp:
(WebCore::SourceBufferPrivate::seekToTime):
(WebCore::SourceBufferPrivate::computeEvictionData):
* Source/WebCore/testing/Internals.cpp:
(WebCore::Internals::evictableSize):
* Source/WebCore/testing/Internals.h:
* Source/WebCore/testing/Internals.idl:

Canonical link: https://commits.webkit.org/281326@main

a23f2e4

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 wincairo
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug 🧪 wpe-wk2 ✅ 🧪 wincairo-tests
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe
✅ 🧪 ios-wk2-wpt ✅ 🧪 mac-wk1 ✅ 🛠 wpe-cairo
🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk
✅ 🛠 vision 🧪 mac-AS-debug-wk2 🧪 gtk-wk2
✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🧪 api-gtk
✅ 🛠 🧪 merge ✅ 🧪 vision-wk2
✅ 🛠 tv
🛠 tv-sim
✅ 🛠 watch
🛠 watch-sim

@jyavenard jyavenard self-assigned this Jul 24, 2024
@jyavenard jyavenard added the Media Bugs related to the HTML 5 Media elements. label Jul 24, 2024
@jyavenard jyavenard changed the title SourceBuffer can throw QuotaExceededError even when there's evictable content. SourceBuffer will always perform a sync call to GPU process when there's a need to evict content. Jul 24, 2024
@jyavenard jyavenard force-pushed the eng/SourceBuffer-can-throw-QuotaExceededError-even-when-theres-evictable-content- branch from 7992193 to b42051c Compare July 24, 2024 14:30
@jyavenard jyavenard force-pushed the eng/SourceBuffer-can-throw-QuotaExceededError-even-when-theres-evictable-content- branch from b42051c to fceda02 Compare July 24, 2024 14:48
@jyavenard jyavenard added the safe-merge-queue Applied to automatically send a pull-request to merge-queue after passing EWS checks label Jul 24, 2024
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The title could be more descriptive

@webkit-ews-buildbot
Copy link
Copy Markdown
Collaborator

Failed mac-wk2-stress checks. Please resolve failures and re-apply safe-merge-queue label.

Rejecting #31153 from merge queue.

@webkit-ews-buildbot webkit-ews-buildbot added merging-blocked Applied to prevent a change from being merged and removed safe-merge-queue Applied to automatically send a pull-request to merge-queue after passing EWS checks labels Jul 24, 2024
@webkit-ews-buildbot
Copy link
Copy Markdown
Collaborator

Safe-Merge-Queue: Build #27611.

@jyavenard jyavenard removed the merging-blocked Applied to prevent a change from being merged label Jul 24, 2024
@jyavenard jyavenard force-pushed the eng/SourceBuffer-can-throw-QuotaExceededError-even-when-theres-evictable-content- branch from fceda02 to a23f2e4 Compare July 24, 2024 23:11
@jyavenard jyavenard added the merge-queue Applied to send a pull request to merge-queue label Jul 24, 2024
…e's a need to evict content.

https://bugs.webkit.org/show_bug.cgi?id=276999
rdar://132402500

Reviewed by Youenn Fablet.

Prior 275380@main, eviction was performed synchronously and the eviction data algorithm would evict 3s of data at a time
until there was sufficient buffer space available for the appendBuffer operation to complete.
In 275380@main, we pre-calculated how much data could be removed in total. However, the calculation incorrectly
looked at the initial 3s of removable data only. Which would make the SourceBuffer always consider that no data was evictable
preventing an asynchronous eviction to occur and instead generating a sync call to SourceBufferPrivate::evictData.

Added tests.

* LayoutTests/media/media-source/media-managedmse-seek-and-evictable-expected.txt: Added.
* LayoutTests/media/media-source/media-managedmse-seek-and-evictable.html: Added.
* Source/WebCore/Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::evictableSize const):
* Source/WebCore/Modules/mediasource/SourceBuffer.h:
* Source/WebCore/platform/graphics/SourceBufferPrivate.cpp:
(WebCore::SourceBufferPrivate::seekToTime):
(WebCore::SourceBufferPrivate::computeEvictionData):
* Source/WebCore/testing/Internals.cpp:
(WebCore::Internals::evictableSize):
* Source/WebCore/testing/Internals.h:
* Source/WebCore/testing/Internals.idl:

Canonical link: https://commits.webkit.org/281326@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/SourceBuffer-can-throw-QuotaExceededError-even-when-theres-evictable-content- branch from a23f2e4 to 082067e Compare July 25, 2024 02:19
@webkit-commit-queue
Copy link
Copy Markdown
Collaborator

Committed 281326@main (082067e): https://commits.webkit.org/281326@main

Reviewed commits have been landed. Closing PR #31153 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 082067e into WebKit:main Jul 25, 2024
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Jul 25, 2024
@jyavenard jyavenard deleted the eng/SourceBuffer-can-throw-QuotaExceededError-even-when-theres-evictable-content- branch November 27, 2024 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Media Bugs related to the HTML 5 Media elements.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants