Bug 215901

Summary: Update PannerNode to support k-rate automation of its AudioParams
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: Web AudioAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: darin, eric.carlson, esprehn+autocc, ews-watchlist, ggaren, glenn, jer.noble, kondapallykalyan, philipj, sergio, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=215946
Bug Depends on: 215904    
Bug Blocks: 212611    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch none

Description Chris Dumez 2020-08-27 13:31:09 PDT
Update PannerNode to support k-rate automation of its AudioParams.
Comment 1 Chris Dumez 2020-08-28 10:25:12 PDT
Created attachment 407480 [details]
Patch
Comment 2 Chris Dumez 2020-08-28 10:52:58 PDT
Created attachment 407486 [details]
Patch
Comment 3 Chris Dumez 2020-08-28 11:23:38 PDT
Created attachment 407487 [details]
Patch
Comment 4 Chris Dumez 2020-08-28 11:57:11 PDT
Created attachment 407492 [details]
Patch
Comment 5 Chris Dumez 2020-08-28 15:00:48 PDT
Created attachment 407504 [details]
Patch
Comment 6 Chris Dumez 2020-08-28 15:52:16 PDT
Comment on attachment 407504 [details]
Patch

Trying to see if I can simplify the patch a bit by leaving the caching out.
Comment 7 Chris Dumez 2020-08-28 16:51:54 PDT
Created attachment 407515 [details]
Patch
Comment 8 Chris Dumez 2020-08-28 16:55:59 PDT
Created attachment 407516 [details]
Patch
Comment 9 Chris Dumez 2020-08-28 16:56:42 PDT
(In reply to Chris Dumez from comment #8)
> Created attachment 407516 [details]
> Patch

Ok, got the patch as small as I could.
Comment 10 Darin Adler 2020-08-28 17:05:26 PDT
Comment on attachment 407516 [details]
Patch

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

> Source/WebCore/Modules/webaudio/AudioParam.cpp:277
> +        for (unsigned i = 0; i < numberOfValues; ++i)

I suggest starting with 1 so we don’t do values[0] = values[0].

> Source/WebCore/Modules/webaudio/PannerNode.cpp:501
> +    double azimuth = rad2deg(acos(std::clamp(projectedSource.dot(listenerRight), -1.0f, 1.0f)));

std::rad2deg, std::acos
Comment 11 Chris Dumez 2020-08-28 17:45:04 PDT
(In reply to Darin Adler from comment #10)
> Comment on attachment 407516 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=407516&action=review
> 
> > Source/WebCore/Modules/webaudio/AudioParam.cpp:277
> > +        for (unsigned i = 0; i < numberOfValues; ++i)
> 
> I suggest starting with 1 so we don’t do values[0] = values[0].
> 
> > Source/WebCore/Modules/webaudio/PannerNode.cpp:501
> > +    double azimuth = rad2deg(acos(std::clamp(projectedSource.dot(listenerRight), -1.0f, 1.0f)));
> 
> std::rad2deg, std::acos

rad2deg is from MathExtras.h. Will fix acos.
Comment 12 Chris Dumez 2020-08-28 17:47:13 PDT
Created attachment 407520 [details]
Patch
Comment 13 EWS 2020-08-28 19:32:42 PDT
Committed r266319: <https://trac.webkit.org/changeset/266319>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 407520 [details].
Comment 14 Radar WebKit Bug Importer 2020-08-28 19:33:17 PDT
<rdar://problem/67975302>