[webkit-changes] [WebKit/WebKit] 63db44: Do not delay getUserMedia promise resolution on VP...

youennf noreply at github.com
Thu May 16 00:33:46 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 63db44388a491904569503778ea0c7a18b55acb0
      https://github.com/WebKit/WebKit/commit/63db44388a491904569503778ea0c7a18b55acb0
  Author: Youenn Fablet <youenn at apple.com>
  Date:   2024-05-16 (Thu, 16 May 2024)

  Changed paths:
    M Source/WebCore/platform/mediastream/mac/BaseAudioSharedUnit.cpp
    M Source/WebCore/platform/mediastream/mac/BaseAudioSharedUnit.h
    M Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.cpp
    M Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.h
    M Source/WebCore/platform/mediastream/mac/CoreAudioSharedUnit.cpp
    M Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp
    M Source/WebKit/UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp

  Log Message:
  -----------
  Do not delay getUserMedia promise resolution on VPIO unit prewarming
https://bugs.webkit.org/show_bug.cgi?id=274203
rdar://128112002

Reviewed by Eric Carlson.

Before this patch, we were delaying the resolution of the getUserMedia promise upon VPIO creation prewarming.
This was ensuring that there would be no freeze and audio capture would start right away.
But this delays the web page processing.

We are now doing the following when starting capture:
- Prewarm the VPIO unit when GPU process is instructed that it will start audio capture soon.
- Create sources in GPU process, do not wait for warming up to finish..
- Resolve getUserMedia promise.
- Start the sources. When starting microphone capture, complete the prewarming if needed before starting the VPIO unit.

This change allows the web page to manipulate the getUserMedia tracks sooner.
It can then use the tracks to set up a VC call for instance, in parallel to the prewarming of the VPIO unit.
We keep prewarming of the VPIO unit as fast as we can.

Manually tested on macOS, should be a no op on iOS.

* Source/WebCore/platform/mediastream/mac/BaseAudioSharedUnit.cpp:
(WebCore::BaseAudioSharedUnit::startProducingData):
(WebCore::BaseAudioSharedUnit::prepareForNewCapture):
* Source/WebCore/platform/mediastream/mac/BaseAudioSharedUnit.h:
* Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioCaptureSource::whenReady): Deleted.
* Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.h:
* Source/WebCore/platform/mediastream/mac/CoreAudioSharedUnit.cpp:
(WebCore::CoreAudioSharedUnit::prewarmAudioUnitCreation):
* Source/WebKit/UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
(WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):

Canonical link: https://commits.webkit.org/278851@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