[webkit-changes] [WebKit/WebKit] f01494: Fix Safari macOS/iOS high speed audio/video algorithm

Jer Noble noreply at github.com
Mon May 22 21:17:12 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f01494f3adc77374f4935bae8aca1125b083a26b
      https://github.com/WebKit/WebKit/commit/f01494f3adc77374f4935bae8aca1125b083a26b
  Author: Jer Noble <jer.noble at apple.com>
  Date:   2023-05-22 (Mon, 22 May 2023)

  Changed paths:
    M Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.h
    M Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.mm
    M Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
    M Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm
    M Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.cpp
    M Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.h
    M Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.messages.in
    M Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp

  Log Message:
  -----------
  Fix Safari macOS/iOS high speed audio/video algorithm
https://bugs.webkit.org/show_bug.cgi?id=191053
rdar://103940613

Reviewed by Eric Carlson.

The default values for `PitchCorrectionAlgorithm` in `UnifiedWebPreferences.yaml` are not being
propogated across the process boundary to the GPU process. Additionally, MediaPlayerPrivateMediaSourceAVFObjC
is ignoring the setting entirely and just doing its own thing.

Move the existing utility function `audioTimePitchAlgorithmForMediaPlayerPitchCorrectionAlgorithm()` from
MediaPlayerPrivateAVFoundationObjC.mm into MediaSessionManagerCocoa.mm. Then use that utility method in
`MediaPlayerPrivateMediaSourceAVFObjC` instead of hard-coding "Spectral" vs. "Varispeed".

`MediaPlayerPrivateRemote` will only explicitly send a message to `RemoteMediaPlayerProxy` when
`setPitchCorrectionAlgorithm()` is called, which means in the general case that the GPU process never
receives the correct pitch correction algorithm setting. Include `PitchCorrectionAlgorithm` in the
list of values passed to `RemoteMediaPlayerProxy` in `prepareForPlayback()`.

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




More information about the webkit-changes mailing list