Changeset 267036 in webkit
- Timestamp:
- Sep 14, 2020 1:31:34 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r267020 r267036 1 2020-09-14 Chris Dumez <cdumez@apple.com> 2 3 AudioDestinationCocoa should stop hardcoding the number of output channels to 2 4 https://bugs.webkit.org/show_bug.cgi?id=216491 5 6 Reviewed by Darin Adler. 7 8 Rebaseline existing test. 9 10 * web-platform-tests/webaudio/the-audio-api/the-convolvernode-interface/realtime-conv-expected.txt: 11 1 12 2020-09-14 Sam Weinig <weinig@apple.com> 2 13 -
trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-convolvernode-interface/realtime-conv-expected.txt
r267018 r267036 4 4 PASS Audit report 5 5 PASS > [test] Test convolver with real-time context 6 FAIL X SNR is not greater than or equal to 88.457. Got 7 6.95278846153181. assert_true: expected true got false6 FAIL X SNR is not greater than or equal to 88.457. Got 77.00623887904952. assert_true: expected true got false 7 7 FAIL < [test] 1 out of 1 assertions were failed. assert_true: expected true got false 8 8 FAIL # AUDIT TASK RUNNER FINISHED: 1 out of 1 tasks were failed. assert_true: expected true got false -
trunk/Source/WebCore/ChangeLog
r267034 r267036 1 2020-09-14 Chris Dumez <cdumez@apple.com> 2 3 AudioDestinationCocoa should stop hardcoding the number of output channels to 2 4 https://bugs.webkit.org/show_bug.cgi?id=216491 5 6 Reviewed by Darin Adler. 7 8 Stop hardcoding the number of output channels in AudioDestinationCocoa and instead use the AudioDestinationNode's 9 number of output channels. 10 11 * platform/audio/cocoa/AudioDestinationCocoa.cpp: 12 (WebCore::AudioDestination::create): 13 (WebCore::AudioDestinationCocoa::AudioDestinationCocoa): 14 (WebCore::AudioDestinationCocoa::numberOfOutputChannels const): 15 (WebCore::AudioDestinationCocoa::setAudioStreamBasicDescription): 16 (): Deleted. 17 * platform/audio/cocoa/AudioDestinationCocoa.h: 18 * platform/mock/MockAudioDestinationCocoa.cpp: 19 (WebCore::MockAudioDestinationCocoa::MockAudioDestinationCocoa): 20 1 21 2020-09-14 Fujii Hironori <Hironori.Fujii@sony.com> 2 22 -
trunk/Source/WebCore/platform/audio/cocoa/AudioDestinationCocoa.cpp
r267014 r267036 57 57 return AudioDestinationCocoa::createOverride(callback, sampleRate); 58 58 59 auto destination = makeUnique<AudioDestinationCocoa>(callback, sampleRate);59 auto destination = makeUnique<AudioDestinationCocoa>(callback, numberOfOutputChannels, sampleRate); 60 60 destination->configure(); 61 61 return destination; … … 72 72 } 73 73 74 // FIXME: We should not be hardcoding the number of input channels. 75 constexpr unsigned legacyNumberOfOutputChannels { 2 }; 76 77 AudioDestinationCocoa::AudioDestinationCocoa(AudioIOCallback& callback, float sampleRate) 74 AudioDestinationCocoa::AudioDestinationCocoa(AudioIOCallback& callback, unsigned numberOfOutputChannels, float sampleRate) 78 75 : m_outputUnit(0) 79 76 , m_callback(callback) 80 , m_outputBus(AudioBus::create( legacyNumberOfOutputChannels, kRenderBufferSize, false).releaseNonNull())81 , m_renderBus(AudioBus::create( legacyNumberOfOutputChannels, kRenderBufferSize).releaseNonNull())82 , m_fifo(makeUniqueRef<PushPullFIFO>( legacyNumberOfOutputChannels, fifoSize))77 , m_outputBus(AudioBus::create(numberOfOutputChannels, kRenderBufferSize, false).releaseNonNull()) 78 , m_renderBus(AudioBus::create(numberOfOutputChannels, kRenderBufferSize).releaseNonNull()) 79 , m_fifo(makeUniqueRef<PushPullFIFO>(numberOfOutputChannels, fifoSize)) 83 80 , m_contextSampleRate(sampleRate) 84 81 { … … 88 85 if (sampleRate != hardwareSampleRate) { 89 86 double scaleFactor = static_cast<double>(sampleRate) / hardwareSampleRate; 90 m_resampler = makeUnique<MultiChannelResampler>(scaleFactor, legacyNumberOfOutputChannels, kRenderBufferSize);87 m_resampler = makeUnique<MultiChannelResampler>(scaleFactor, numberOfOutputChannels, kRenderBufferSize); 91 88 } 92 89 } … … 96 93 if (m_outputUnit) 97 94 AudioComponentInstanceDispose(m_outputUnit); 95 } 96 97 unsigned AudioDestinationCocoa::numberOfOutputChannels() const 98 { 99 return m_renderBus->numberOfChannels(); 98 100 } 99 101 … … 140 142 streamFormat.mFramesPerPacket = 1; 141 143 streamFormat.mBytesPerFrame = bytesPerFloat; 142 streamFormat.mChannelsPerFrame = 2;144 streamFormat.mChannelsPerFrame = numberOfOutputChannels(); 143 145 streamFormat.mBitsPerChannel = bitsPerByte * bytesPerFloat; 144 146 } -
trunk/Source/WebCore/platform/audio/cocoa/AudioDestinationCocoa.h
r267014 r267036 46 46 class AudioDestinationCocoa : public AudioDestination, public AudioSourceProvider { 47 47 public: 48 AudioDestinationCocoa(AudioIOCallback&, float sampleRate);48 AudioDestinationCocoa(AudioIOCallback&, unsigned numberOfOutputChannels, float sampleRate); 49 49 virtual ~AudioDestinationCocoa(); 50 50 … … 58 58 unsigned framesPerBuffer() const final; 59 59 AudioUnit& outputUnit() { return m_outputUnit; } 60 61 unsigned numberOfOutputChannels() const; 60 62 61 63 // DefaultOutputUnit callback -
trunk/Source/WebCore/platform/mock/MockAudioDestinationCocoa.cpp
r267014 r267036 38 38 39 39 MockAudioDestinationCocoa::MockAudioDestinationCocoa(AudioIOCallback& callback, float sampleRate) 40 : AudioDestinationCocoa(callback, sampleRate)40 : AudioDestinationCocoa(callback, 2, sampleRate) 41 41 , m_workQueue(WorkQueue::create("MockAudioDestinationCocoa Render Queue")) 42 42 , m_timer(RunLoop::current(), this, &MockAudioDestinationCocoa::tick)
Note: See TracChangeset
for help on using the changeset viewer.