Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 5f7c29241feb91b1c91d0dea5540926487ddb404
https://github.com/WebKit/WebKit/commit/5f7c29241feb91b1c91d0dea5540926487ddb404
Author: Claudio Saavedra <[email protected]>
Date: 2026-09-29 (Tue, 29 Sep 2026)
Changed paths:
M LayoutTests/platform/glib/TestExpectations
M Source/WebCore/platform/mediarecorder/MediaRecorderPrivateGStreamer.cpp
M Source/WebCore/platform/mediarecorder/MediaRecorderPrivateGStreamer.h
Log Message:
-----------
[GStreamer] MediaRecorder stop blocks the main thread until the pipeline has
drained
https://bugs.webkit.org/show_bug.cgi?id=322814
Reviewed by Philippe Normand and Xabier Rodriguez-Calvar.
MediaRecorderPrivateBackend::stopRecording() flushed the pipeline and then
waited on the main thread, in 200ms steps and for up to two seconds, for the
EOS event to reach the sink. The flush stops and joins the streaming tasks of
the aggregator and of the sources, so on a loaded machine the call can block
the main thread for several seconds, during which no event can be dispatched.
imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-error.html
expects the error event within two seconds of a track change and fails when
that happens.
Send the EOS event and return right away, as the AVFoundation backend does.
Data fetches requested while the EOS event is in flight are deferred until it
reaches the sink, or until the existing two seconds watchdog fires, so the
last fragment written by the muxer is still part of the final dataavailable
event. A pipeline error message now also releases the deferred fetches. The
flush is not needed: the queued samples are encoded before the EOS event
passes, which is what a stop should produce anyway.
* LayoutTests/platform/glib/TestExpectations: Remove the expectation for the
test.
* Source/WebCore/platform/mediarecorder/MediaRecorderPrivateGStreamer.cpp:
(WebCore::MediaRecorderPrivateBackend::MediaRecorderPrivateBackend):
(WebCore::MediaRecorderPrivateBackend::~MediaRecorderPrivateBackend):
(WebCore::MediaRecorderPrivateBackend::stopRecording):
(WebCore::MediaRecorderPrivateBackend::eosTimerFired):
(WebCore::MediaRecorderPrivateBackend::didReachEOS):
(WebCore::MediaRecorderPrivateBackend::fetchData):
(WebCore::MediaRecorderPrivateBackend::preparePipeline):
(WebCore::MediaRecorderPrivateBackend::notifyEOS):
* Source/WebCore/platform/mediarecorder/MediaRecorderPrivateGStreamer.h:
Canonical link: https://commits.webkit.org/322151@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications