Bug 220341 - [Cocoa] Revert audioTimePitchAlgorithm to "TimeDomain" from "Spectral"
Summary: [Cocoa] Revert audioTimePitchAlgorithm to "TimeDomain" from "Spectral"
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jer Noble
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-01-05 14:33 PST by Jer Noble
Modified: 2021-01-07 16:51 PST (History)
15 users (show)

See Also:


Attachments
Patch (26.19 KB, patch)
2021-01-05 14:45 PST, Jer Noble
no flags Details | Formatted Diff | Diff
Patch (30.83 KB, patch)
2021-01-05 15:27 PST, Jer Noble
youennf: review+
Details | Formatted Diff | Diff
Patch for landing (30.78 KB, patch)
2021-01-06 11:26 PST, Jer Noble
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch for landing (34.50 KB, patch)
2021-01-06 15:28 PST, Jer Noble
jer.noble: commit-queue-
Details | Formatted Diff | Diff
Patch for landing (30.78 KB, patch)
2021-01-06 15:29 PST, Jer Noble
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jer Noble 2021-01-05 14:33:08 PST
Revert audioTimePitchAlgorithm to "TimeDomain" from "Spectral"
Comment 1 Jer Noble 2021-01-05 14:45:14 PST
Created attachment 417038 [details]
Patch
Comment 2 Radar WebKit Bug Importer 2021-01-05 14:45:39 PST
<rdar://problem/72829926>
Comment 3 Jer Noble 2021-01-05 15:27:11 PST
Created attachment 417042 [details]
Patch
Comment 4 Peng Liu 2021-01-05 15:49:55 PST
Comment on attachment 417042 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=417042&action=review

> Source/WebCore/platform/graphics/MediaPlayer.h:402
> +    PitchCorrectionAlgorithm pitchCorrectionAlgorithm() { return m_pitchCorrectionAlgorithm; }

A const function?

> Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h:291
> +#define WebKitPitchCorrectionAlgorithmPreferenceKey @"WebKitPitchCorrectionAlgorithmKey"

Nit. To be consistent with other keys, maybe
s/WebKitPitchCorrectionAlgorithmKey/WebKitPitchCorrectionAlgorithm/
Comment 5 youenn fablet 2021-01-06 01:40:19 PST
Comment on attachment 417042 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=417042&action=review

> Source/WebCore/ChangeLog:11
> +        Revert to "TimeDomain", which is both more computationally inexpensive, and both propogates

s/propogates/propagates/

> Source/WTF/Scripts/Preferences/WebPreferences.yaml:1722
> +  webcoreBinding: custom

Can we remove that one so that we let WebPage::updateSettingsGenerated update the corresponding settings directly?
Or maybe it is due to the Settings being typed as MediaPlayerEnums::PitchCorrectionAlgorithm.
Might be nice for the pref generator to handle this code without static_cast below.
That might remove some webcoreBinding custom code as well.
Maybe Sam has some ideas here?

> Source/WebCore/html/HTMLMediaElement.cpp:1450
> +    m_player->setPitchCorrectionAlgorithm(static_cast<MediaPlayer::PitchCorrectionAlgorithm>(document().settings().pitchCorrectionAlgorithm()));

Do we really need this static_cast?
Comment 6 Jer Noble 2021-01-06 09:47:58 PST
(In reply to Peng Liu from comment #4)
> Comment on attachment 417042 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=417042&action=review
> 
> > Source/WebCore/platform/graphics/MediaPlayer.h:402
> > +    PitchCorrectionAlgorithm pitchCorrectionAlgorithm() { return m_pitchCorrectionAlgorithm; }
> 
> A const function?

Good idea. Will change.

> > Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h:291
> > +#define WebKitPitchCorrectionAlgorithmPreferenceKey @"WebKitPitchCorrectionAlgorithmKey"
> 
> Nit. To be consistent with other keys, maybe
> s/WebKitPitchCorrectionAlgorithmKey/WebKitPitchCorrectionAlgorithm/

Ok.
Comment 7 Jer Noble 2021-01-06 09:49:20 PST
(In reply to youenn fablet from comment #5)
> Comment on attachment 417042 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=417042&action=review
> 
> > Source/WebCore/ChangeLog:11
> > +        Revert to "TimeDomain", which is both more computationally inexpensive, and both propogates
> 
> s/propogates/propagates/

Will change.

> > Source/WTF/Scripts/Preferences/WebPreferences.yaml:1722
> > +  webcoreBinding: custom
> 
> Can we remove that one so that we let WebPage::updateSettingsGenerated
> update the corresponding settings directly?
> Or maybe it is due to the Settings being typed as
> MediaPlayerEnums::PitchCorrectionAlgorithm.
> Might be nice for the pref generator to handle this code without static_cast
> below.
> That might remove some webcoreBinding custom code as well.
> Maybe Sam has some ideas here?

There's an existing FIXME about adding enum support to the settings binding generator code. I decided not to tackle that bindings generator fix in this patch.

> > Source/WebCore/html/HTMLMediaElement.cpp:1450
> > +    m_player->setPitchCorrectionAlgorithm(static_cast<MediaPlayer::PitchCorrectionAlgorithm>(document().settings().pitchCorrectionAlgorithm()));
> 
> Do we really need this static_cast?

Yep, without it, the compiler issues a warning/error about narrowing a uint32_t to an enum.
Comment 8 youenn fablet 2021-01-06 09:54:39 PST
> > > Source/WebCore/html/HTMLMediaElement.cpp:1450
> > > +    m_player->setPitchCorrectionAlgorithm(static_cast<MediaPlayer::PitchCorrectionAlgorithm>(document().settings().pitchCorrectionAlgorithm()));
> > 
> > Do we really need this static_cast?
> 
> Yep, without it, the compiler issues a warning/error about narrowing a
> uint32_t to an enum.

I would have thought document().settings().pitchCorrectionAlgorithm() to return the value as an enum and not as a uint32_t.
The Settings generator should be able to do that.
Comment 9 Jer Noble 2021-01-06 11:23:12 PST
(In reply to youenn fablet from comment #8)
> > > > Source/WebCore/html/HTMLMediaElement.cpp:1450
> > > > +    m_player->setPitchCorrectionAlgorithm(static_cast<MediaPlayer::PitchCorrectionAlgorithm>(document().settings().pitchCorrectionAlgorithm()));
> > > 
> > > Do we really need this static_cast?
> > 
> > Yep, without it, the compiler issues a warning/error about narrowing a
> > uint32_t to an enum.
> 
> I would have thought document().settings().pitchCorrectionAlgorithm() to
> return the value as an enum and not as a uint32_t.
> The Settings generator should be able to do that.

I was wrong! Just built without the static_cast and no warning/error.
Comment 10 Jer Noble 2021-01-06 11:26:38 PST
Created attachment 417106 [details]
Patch for landing
Comment 11 EWS 2021-01-06 13:02:44 PST
ChangeLog entry in Source/WTF/ChangeLog contains OOPS!.
Comment 12 Jer Noble 2021-01-06 15:28:16 PST
Created attachment 417134 [details]
Patch for landing
Comment 13 Jer Noble 2021-01-06 15:29:55 PST
Created attachment 417135 [details]
Patch for landing
Comment 14 EWS 2021-01-06 16:17:12 PST
Committed r271219: <https://trac.webkit.org/changeset/271219>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 417135 [details].