Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WebCodecs] schedule dequeue event when encoder queue size decreases #5750

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
PASS Test VideoEncoder construction
PASS Test VideoEncoder.configure()
FAIL Test successful configure(), encode(), and flush() promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'decoderConfig.colorSpace.primaries')"
FAIL encodeQueueSize test assert_equals: expected 0 but got Infinity
PASS encodeQueueSize test
PASS Test successful reset() and re-confiugre()
PASS Test successful encode() after re-configure().
PASS Verify closed VideoEncoder operations
Expand Down
1 change: 1 addition & 0 deletions Source/WebCore/Modules/webcodecs/WebCodecsVideoEncoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ ExceptionOr<void> WebCodecsVideoEncoder::encode(Ref<WebCodecsVideoFrame>&& frame
++m_encodeQueueSize;
queueControlMessageAndProcess([this, internalFrame = internalFrame.releaseNonNull(), timestamp = frame->timestamp(), duration = frame->duration(), options = WTFMove(options)]() mutable {
--m_encodeQueueSize;
scheduleDequeueEvent();
m_internalEncoder->encode({ WTFMove(internalFrame), timestamp, duration }, options.keyFrame, [this, weakedThis = WeakPtr { *this }](auto&& result) {
if (!weakedThis)
return;
Expand Down