RESOLVED FIXED 75057
Implement MediaElementAudioSourceNode::setFormat() so numberOfChannels and sampleRate are accounted for
https://bugs.webkit.org/show_bug.cgi?id=75057
Summary Implement MediaElementAudioSourceNode::setFormat() so numberOfChannels and sa...
Chris Rogers
Reported 2011-12-21 17:19:03 PST
Implement MediaElementAudioSourceNode::setFormat() so numberOfChannels and sampleRate are accounted for
Attachments
Patch (21.67 KB, patch)
2011-12-21 17:24 PST, Chris Rogers
eric.carlson: review+
Chris Rogers
Comment 1 2011-12-21 17:24:39 PST
WebKit Review Bot
Comment 2 2011-12-21 17:27:43 PST
Attachment 120248 [details] did not pass style-queue: Failed to run "['Tools/Scripts/update-webkit']" exit_code: 9 Updating OpenSource First, rewinding head to replay your work on top of it... Applying: Inform the scrolling coordinator when scrollbar layers come and go Using index info to reconstruct a base tree... <stdin>:474806: trailing whitespace. [Chromium] DatabaseTrackerChromium: iterating DatabaseSet races with Database disposal on worker thread <stdin>:474827: trailing whitespace. Nothing to test, just removing redundant code. Correct behavior tested by <stdin>:475346: trailing whitespace. warning: 3 lines add whitespace errors. Falling back to patching base and 3-way merge... warning: too many files (created: 167528 deleted: 3), skipping inexact rename detection Auto-merging LayoutTests/ChangeLog CONFLICT (content): Merge conflict in LayoutTests/ChangeLog Auto-merging LayoutTests/platform/chromium/test_expectations.txt CONFLICT (content): Merge conflict in LayoutTests/platform/chromium/test_expectations.txt Auto-merging Source/WebCore/ChangeLog CONFLICT (content): Merge conflict in Source/WebCore/ChangeLog Auto-merging Source/WebCore/page/ScrollingCoordinator.h CONFLICT (content): Merge conflict in Source/WebCore/page/ScrollingCoordinator.h Auto-merging Source/WebCore/page/mac/ScrollingCoordinatorMac.mm CONFLICT (content): Merge conflict in Source/WebCore/page/mac/ScrollingCoordinatorMac.mm Auto-merging Source/WebCore/platform/ScrollView.cpp Auto-merging Source/WebCore/rendering/RenderLayerCompositor.cpp CONFLICT (content): Merge conflict in Source/WebCore/rendering/RenderLayerCompositor.cpp Auto-merging Source/WebKit2/ChangeLog CONFLICT (content): Merge conflict in Source/WebKit2/ChangeLog Auto-merging Tools/ChangeLog CONFLICT (content): Merge conflict in Tools/ChangeLog Auto-merging Tools/Scripts/build-webkit Auto-merging Tools/Scripts/webkitdirs.pm CONFLICT (content): Merge conflict in Tools/Scripts/webkitdirs.pm Failed to merge in the changes. Patch failed at 0001 Inform the scrolling coordinator when scrollbar layers come and go When you have resolved this problem run "git rebase --continue". If you would prefer to skip this patch, instead run "git rebase --skip". To restore the original branch and stop rebasing run "git rebase --abort". rebase refs/remotes/origin/master: command returned error: 1 Died at Tools/Scripts/update-webkit line 158. If any of these errors are false positives, please file a bug against check-webkit-style.
Eric Carlson
Comment 3 2011-12-22 08:01:25 PST
Comment on attachment 120248 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=120248&action=review > Source/WebCore/platform/audio/MultiChannelResampler.cpp:90 > + size_t m_framesToProcess; // used to verify that all channels ask for the same amount Nit: Comments should use proper sentences (missing capital and period). > Source/WebCore/platform/audio/MultiChannelResampler.cpp:102 > + OwnPtr<SincResampler> resampler = adoptPtr(new SincResampler(scaleFactor)); > + m_kernels.append(resampler.release()); This local variable isn't necessary, it causes ref count churn. Why doesn't SincResampler use the preferred WebKit idiom of a private constructor plus a create() method? > Source/WebCore/platform/audio/MultiChannelResampler.cpp:108 > + // provider can provide us with multi-channel audio data. But each of our single-channel resamplers (kernels) Nit: Capitalize. > Source/WebCore/platform/audio/MultiChannelResampler.h:48 > + // FIXME: the mac port can have a more highly optimized implementation based on CoreAudio > + // instead of SincResampler. For now the default implementation will be used on all ports. Please include a bug number with the FIXME. > Source/WebCore/platform/audio/MultiChannelResampler.h:53 > + double m_scaleFactor; This is initialized in the constructor but never used in the code. Is it necessary? > Source/WebCore/webaudio/MediaElementAudioSourceNode.cpp:70 > + // FIXME: implement multi-channel greater than stereo. Please include a bug number for the FIXME. > Source/WebCore/webaudio/MediaElementAudioSourceNode.cpp:75 > + if (!numberOfChannels || numberOfChannels > 2 || sourceSampleRate < minSampleRate || sourceSampleRate > maxSampleRate) { > + // process() will generate silence for these uninitialized values. > + m_sourceNumberOfChannels = 0; > + m_sourceSampleRate = 0; > + return; It would be helpful to LOG() exactly which condition(s) trigger this so it is possible to discover why a file generates only silence.
Chris Rogers
Comment 4 2011-12-22 14:40:10 PST
Chris Rogers
Comment 5 2011-12-22 14:40:42 PST
Comment on attachment 120248 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=120248&action=review Eric, thanks for the review! >> Source/WebCore/platform/audio/MultiChannelResampler.cpp:90 >> + size_t m_framesToProcess; // used to verify that all channels ask for the same amount > > Nit: Comments should use proper sentences (missing capital and period). FIXED >> Source/WebCore/platform/audio/MultiChannelResampler.cpp:102 >> + m_kernels.append(resampler.release()); > > This local variable isn't necessary, it causes ref count churn. > > Why doesn't SincResampler use the preferred WebKit idiom of a private constructor plus a create() method? FIXED I'm using the SincResampler class elsewhere as a lightweight local stack-based variable, so that's why the constructor is public. I guess I could still add a create() method too... >> Source/WebCore/platform/audio/MultiChannelResampler.cpp:108 >> + // provider can provide us with multi-channel audio data. But each of our single-channel resamplers (kernels) > > Nit: Capitalize. FIXED >> Source/WebCore/platform/audio/MultiChannelResampler.h:48 >> + // instead of SincResampler. For now the default implementation will be used on all ports. > > Please include a bug number with the FIXME. FIXED: create bug: https://bugs.webkit.org/show_bug.cgi?id=75118 >> Source/WebCore/platform/audio/MultiChannelResampler.h:53 >> + double m_scaleFactor; > > This is initialized in the constructor but never used in the code. Is it necessary? Good point - I removed it. >> Source/WebCore/webaudio/MediaElementAudioSourceNode.cpp:70 >> + // FIXME: implement multi-channel greater than stereo. > > Please include a bug number for the FIXME. Added comment referencing: https://bugs.webkit.org/show_bug.cgi?id=75119 >> Source/WebCore/webaudio/MediaElementAudioSourceNode.cpp:75 >> + return; > > It would be helpful to LOG() exactly which condition(s) trigger this so it is possible to discover why a file generates only silence. Added LOG message
Note You need to log in before you can comment on or make changes to this bug.