[webkit-changes] [WebKit/WebKit] c9e35d: REGRESSION (iOS 16.4 Public Beta) getUserMedia ign...

youennf noreply at github.com
Tue Feb 28 10:47:56 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c9e35ddc3cab05feca0115b83ca0adb780e832d6
      https://github.com/WebKit/WebKit/commit/c9e35ddc3cab05feca0115b83ca0adb780e832d6
  Author: Youenn Fablet <youennf at gmail.com>
  Date:   2023-02-28 (Tue, 28 Feb 2023)

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

  Log Message:
  -----------
  REGRESSION (iOS 16.4 Public Beta) getUserMedia ignores facingMode constraint
https://bugs.webkit.org/show_bug.cgi?id=252560
rdar://problem/105677398

Reviewed by Eric Carlson.

We added a way to favor some back cameras (those that have a great focal range) against other back cameras.
We did this by increasing the facingMode fitness distance for the telephoto back cameras.

The base fitness distance for user/environment facingMode constraint is either 0 (match) or 1 (no match).
When facingMode is environement, the front camera will have a base fitness distance of 1 and a final fitness distance of 1.

The back camera will have a base fitness distance of 0 and a final fitness distance of 0 + the fitness distance increase.
The fitness distance increase is either 0, 1, 2...

The issue is that RealtimeMediaSource::supportsConstraints computes the fitness score by checking whether distance is 0 or something else.
If distance is 0, the score is 32 otherwise it is 1.
This ensures that facingMode has a big weight on the global fitness score.

We now apply facingModeFitnessDistanceAdjustment directly to the global fitness score.
This requires having good devices with a high value.

Renaming facingModeFitnessDistanceAdjustment to facingModeFitnessScoreAdjustment for that reason.

* Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::fitnessDistance):
(WebCore::RealtimeMediaSource::supportsConstraints):
* Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::facingModeFitnessDistanceAdjustment const):

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




More information about the webkit-changes mailing list