[webkit-changes] [WebKit/WebKit] a55b02: Cloned video MediaStreamTrack has another resoluti...

youennf noreply at github.com
Fri Sep 22 04:13:24 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a55b02b30969b388345ad2879313b4877d978120
      https://github.com/WebKit/WebKit/commit/a55b02b30969b388345ad2879313b4877d978120
  Author: Youenn Fablet <youennf at gmail.com>
  Date:   2023-09-22 (Fri, 22 Sep 2023)

  Changed paths:
    M LayoutTests/platform/glib/TestExpectations
    A LayoutTests/webrtc/video-clone-track-expected.txt
    A LayoutTests/webrtc/video-clone-track.html
    M Source/WebKit/UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp

  Log Message:
  -----------
  Cloned video MediaStreamTrack has another resolution than original track
https://bugs.webkit.org/show_bug.cgi?id=261329
rdar://115551680

Reviewed by Jean-Yves Avenard.

When cloning a track, we are adding a new SourceProxy as obserer of the underlying source.
This works fine for video tracks in case the SourceProxy is not resizing/reducing frame rate of the source via addVideoFrameObserver size/frame rate parameters.
This resizing may happen for instance if the application wants a resolution that is not directly supported by the camera.

Before the patch, the clone would register itself via addVideoFrameObserver without parameters, which would trigger no resizing/reducing frame rate.
After the patch, we first copy the settings from the original source to the cloned source.
We then call addVideoFrameObserver with the right parameters.

Covered by added test.

* LayoutTests/webrtc/video-clone-track-expected.txt: Added.
* LayoutTests/webrtc/video-clone-track.html: Added.
* Source/WebKit/UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
(WebKit::UserMediaCaptureManagerProxy::SourceProxy::SourceProxy):
(WebKit::UserMediaCaptureManagerProxy::SourceProxy::~SourceProxy):
(WebKit::UserMediaCaptureManagerProxy::SourceProxy::observeMedia):
(WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
(WebKit::UserMediaCaptureManagerProxy::clone):

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




More information about the webkit-changes mailing list