[webkit-changes] [WebKit/WebKit] 46a4e6: getUserMedia video track getSettings() returns sta...

Eric Carlson noreply at github.com
Sat Dec 14 16:34:44 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 46a4e69cafac4513de5b44023e0e9084f15c5c14
      https://github.com/WebKit/WebKit/commit/46a4e69cafac4513de5b44023e0e9084f15c5c14
  Author: Eric Carlson <eric.carlson at apple.com>
  Date:   2024-12-14 (Sat, 14 Dec 2024)

  Changed paths:
    M Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.h
    M Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm

  Log Message:
  -----------
  getUserMedia video track getSettings() returns stale value for torch and whiteBalanceMode constraints
https://bugs.webkit.org/show_bug.cgi?id=280970
rdar://137870391

Reviewed by Youenn Fablet.

Torch and whiteBalanceMode changes are applied asynchronously so `track.settings` will
return the incorrect value if read after constraints are applied but before the device
setting is applied. To fix this, we return the most recent value set if track.settings
is requested while an update is pending, and return the actual device settings otherwise.

Tested manually.

* Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.h:
* Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::settingsDidChange): Set `m_settingsChangesPending` before
calling `scheduleDeferredTask`, clear it after changing device settings.
(WebCore::AVVideoCaptureSource::settings): Return the currently cached value for torch
and/or whiteBalanceMode if a change is pending, return the device setting otherwise.
(WebCore::AVVideoCaptureSource::applyFrameRateAndZoomWithPreset): Set `m_settingsChangesPending`
before calling `scheduleDeferredTask`, clear it after changing device settings.
(WebCore::AVVideoCaptureSource::updateWhiteBalanceMode): Clear m_currentSettings after
changing device settings to force a refresh the next time settings are queried.
(WebCore::AVVideoCaptureSource::updateTorch): Ditto.

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