[webkit-changes] [WebKit/WebKit] 7526d3: MediaStreamTrackProcessor::Source should not enque...

youennf noreply at github.com
Thu Dec 5 09:31:12 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7526d352bd58750c78a800479573067cc7046e0e
      https://github.com/WebKit/WebKit/commit/7526d352bd58750c78a800479573067cc7046e0e
  Author: Youenn Fablet <youenn at apple.com>
  Date:   2024-12-05 (Thu, 05 Dec 2024)

  Changed paths:
    A LayoutTests/imported/w3c/web-platform-tests/mediacapture-insertable-streams/MediaStreamTrackProcessor-stop.worker-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/mediacapture-insertable-streams/MediaStreamTrackProcessor-stop.worker.html
    A LayoutTests/imported/w3c/web-platform-tests/mediacapture-insertable-streams/MediaStreamTrackProcessor-stop.worker.js
    M Source/WebCore/Modules/mediastream/MediaStreamTrackProcessor.cpp
    M Source/WebCore/Modules/mediastream/MediaStreamTrackProcessor.h

  Log Message:
  -----------
  MediaStreamTrackProcessor::Source should not enqueue once it is closed
rdar://140966032
https://bugs.webkit.org/show_bug.cgi?id=284099

Reviewed by Jean-Yves Avenard.

Stopping a track will close the readable stream of its MediaStreamTrackProcessor.
When the track is VideoTrackGenerator and gets stopped, it will close synchronously the readable stream of the MediaStreamTrackProcessor observing the VideoTrackGenerator track.
But for video frames, we post a task to the worker thread (even though we are already in the worker thread).
We can thus enqueue video frames after stopping the readable stream.

To prevent this, we set m_isCancelled to true in MediaStreamTrackProcessor::Source::close.
As a small refactoring, we also move the m_isCancelled to MediaStreamTrackProcessor::tryEnqueueingVideoFrame to return earlier.
We add an ASSERT(m_isCancelled) in MediaStreamTrackProcessor::Source::enqueue.

* LayoutTests/imported/w3c/web-platform-tests/mediacapture-insertable-streams/MediaStreamTrackProcessor-stop.worker-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/mediacapture-insertable-streams/MediaStreamTrackProcessor-stop.worker.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/mediacapture-insertable-streams/MediaStreamTrackProcessor-stop.worker.js: Added.
(makeVideoFrame):
(promise_test.async t):
* Source/WebCore/Modules/mediastream/MediaStreamTrackProcessor.cpp:
(WebCore::MediaStreamTrackProcessor::tryEnqueueingVideoFrame):
(WebCore::MediaStreamTrackProcessor::Source::close):
(WebCore::MediaStreamTrackProcessor::Source::enqueue):
(WebCore::MediaStreamTrackProcessor::Source::isWaiting const): Deleted.
* Source/WebCore/Modules/mediastream/MediaStreamTrackProcessor.h:

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



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list