[webkit-changes] [WebKit/WebKit] 55bd33: AVVideoCaptureSource is beginning configuration of...

youennf noreply at github.com
Tue Sep 26 01:04:48 PDT 2023


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

  Changed paths:
    M Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp
    M Source/WebCore/platform/mediastream/RealtimeMediaSource.h
    M Source/WebCore/platform/mediastream/cocoa/DisplayCaptureSourceCocoa.h
    M Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.h
    M Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm

  Log Message:
  -----------
  AVVideoCaptureSource is beginning configuration of device even if reapplying the same configuration
https://bugs.webkit.org/show_bug.cgi?id=261749
rdar://113717799

Reviewed by Eric Carlson.

When the AVCaptureSession beginConfiguration is called, this triggers flashing of the camera and camera red pill.
We were doing so whenever applyConstraints is called.

To prevent this, we are now only calling beginConfiguration if we detect some parameters are changed.
These change checks happen in two places, setFrameRateAndZoomWithPreset and updateWhiteBalanceMode.

We are therefore renaming RealtimeMediaSource beginConfiguration/commitConfiguration to startApplyingConstraints and endApplyingConstraints.
We implement startApplyingConstraints and endApplyingConstraints in AVVideoCaptureSource by storing whether we are applying constraints.
In setFrameRateAndZoomWithPreset and updateWhiteBalanceMode, we then call beginConfiguration if some parameters changed and beginConfiguration has not been called already.
endApplyingConstraints will then call commitConfiguration if beginConfiguration was called previously.

Manually tested.

* Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::applyConstraints):
* Source/WebCore/platform/mediastream/RealtimeMediaSource.h:
* Source/WebCore/platform/mediastream/cocoa/DisplayCaptureSourceCocoa.h:
* Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.h:
* Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::startApplyingConstraints):
(WebCore::AVVideoCaptureSource::endApplyingConstraints):
(WebCore::AVVideoCaptureSource::beginConfigurationForConstraintsIfNeeded):
(WebCore::AVVideoCaptureSource::commitConfiguration):
(WebCore::AVVideoCaptureSource::setFrameRateAndZoomWithPreset):
(WebCore::isSameFrameRateRange):
(WebCore::AVVideoCaptureSource::setSessionSizeFrameRateAndZoom):
(WebCore::AVVideoCaptureSource::updateWhiteBalanceMode):
(WebCore::AVVideoCaptureSource::setupSession):
(WebCore::AVVideoCaptureSource::setupCaptureSession):

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




More information about the webkit-changes mailing list