[webkit-changes] [WebKit/WebKit] fc3228: When stopped, a cloned MediaStreamTrack will stop ...

youennf noreply at github.com
Thu Aug 24 14:30:38 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: fc3228ea6a4e97dd4624dfda0c3488d9f19ea666
      https://github.com/WebKit/WebKit/commit/fc3228ea6a4e97dd4624dfda0c3488d9f19ea666
  Author: Youenn Fablet <youennf at gmail.com>
  Date:   2023-08-24 (Thu, 24 Aug 2023)

  Changed paths:
    A LayoutTests/fast/mediastream/stop-clone-when-muted-expected.txt
    A LayoutTests/fast/mediastream/stop-clone-when-muted.html
    M Source/WebCore/platform/mediastream/MediaStreamTrackPrivate.cpp
    M Source/WebCore/platform/mediastream/MediaStreamTrackPrivate.h
    M Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp
    M Source/WebCore/platform/mediastream/RealtimeMediaSource.h
    M Source/WebKit/UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp

  Log Message:
  -----------
  When stopped, a cloned MediaStreamTrack will stop its base MediaStreamTrack if the source is muted
https://bugs.webkit.org/show_bug.cgi?id=260655
rdar://111534033

Reviewed by Eric Carlson.

When we have two track clones, and the tracks are muted, stopping one of the track will end the other one.
This is due to the fact that when stopping a track, we request the source to end.
We then check each observer to know whether they are stopped, which is true when the track is muted.
We are adding a ended flag in UserMediaCaptureManagerProxy::SourceProxy and we rename preventSourceFromStopping in preventSourceFromEnding to clarify what we are doing.

* LayoutTests/fast/mediastream/stop-clone-when-muted-expected.txt: Added.
* LayoutTests/fast/mediastream/stop-clone-when-muted.html: Added.
* Source/WebCore/platform/mediastream/MediaStreamTrackPrivate.cpp:
(WebCore::MediaStreamTrackPrivate::preventSourceFromEnding):
(WebCore::MediaStreamTrackPrivate::preventSourceFromStopping): Deleted.
* Source/WebCore/platform/mediastream/MediaStreamTrackPrivate.h:
* Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::requestToEnd):
* Source/WebCore/platform/mediastream/RealtimeMediaSource.h:
* Source/WebKit/UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
(WebKit::UserMediaCaptureManagerProxy::SourceProxy::end):
(WebKit::UserMediaCaptureManagerProxy::SourceProxy::preventSourceFromEnding):
(WebKit::UserMediaCaptureManagerProxy::SourceProxy::preventSourceFromStopping): Deleted.

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




More information about the webkit-changes mailing list