Changeset 278333 in webkit
- Timestamp:
- Jun 1, 2021, 5:14:56 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
-
ChangeLog (modified) (1 diff)
-
platform/audio/AudioBus.cpp (modified) (1 diff)
-
platform/audio/AudioBus.h (modified) (1 diff)
-
platform/audio/AudioChannel.cpp (modified) (1 diff)
-
platform/audio/AudioChannel.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r278331 r278333 1 2021-06-01 Chris Dumez <cdumez@apple.com> 2 3 Drop unused AudioChannel::resizeSmaller() 4 https://bugs.webkit.org/show_bug.cgi?id=226516 5 6 Reviewed by Sam Weinig. 7 8 * platform/audio/AudioBus.cpp: 9 * platform/audio/AudioBus.h: 10 * platform/audio/AudioChannel.cpp: 11 * platform/audio/AudioChannel.h: 12 1 13 2021-06-01 Wenson Hsieh <wenson_hsieh@apple.com> 2 14 -
trunk/Source/WebCore/platform/audio/AudioBus.cpp
r270468 r278333 74 74 } 75 75 76 void AudioBus::resizeSmaller(size_t newLength)77 {78 ASSERT(newLength <= m_length);79 if (newLength <= m_length)80 m_length = newLength;81 82 for (unsigned i = 0; i < m_channels.size(); ++i)83 m_channels[i]->resizeSmaller(newLength);84 }85 86 76 void AudioBus::zero() 87 77 { -
trunk/Source/WebCore/platform/audio/AudioBus.h
r267544 r278333 84 84 size_t length() const { return m_length; } 85 85 86 // resizeSmaller() can only be called with a new length <= the current length.87 // The data stored in the bus will remain undisturbed.88 void resizeSmaller(size_t newLength);89 90 86 // Sample-rate : 0.0 if unknown or "don't care" 91 87 float sampleRate() const { return m_sampleRate; } -
trunk/Source/WebCore/platform/audio/AudioChannel.cpp
r268026 r278333 38 38 39 39 namespace WebCore { 40 41 void AudioChannel::resizeSmaller(size_t newLength)42 {43 ASSERT(newLength <= m_length);44 if (newLength <= m_length)45 m_length = newLength;46 }47 40 48 41 void AudioChannel::scale(float scale) -
trunk/Source/WebCore/platform/audio/AudioChannel.h
r267544 r278333 45 45 46 46 // Reference an external buffer. 47 explicitAudioChannel(float* storage, size_t length)48 : m_ length(length)49 , m_ rawPointer(storage)47 AudioChannel(float* storage, size_t length) 48 : m_rawPointer(storage) 49 , m_length(length) 50 50 , m_silent(false) 51 51 { … … 54 54 // Manage storage for us. 55 55 explicit AudioChannel(size_t length) 56 : m_length(length) 56 : m_memBuffer(makeUnique<AudioFloatArray>(length)) 57 , m_length(length) 57 58 { 58 m_memBuffer = makeUnique<AudioFloatArray>(length);59 59 } 60 60 … … 74 74 // How many sample-frames do we contain? 75 75 size_t length() const { return m_length; } 76 77 // resizeSmaller() can only be called with a new length <= the current length.78 // The data stored in the bus will remain undisturbed.79 void resizeSmaller(size_t newLength);80 76 81 77 // Direct access to PCM sample data. Non-const accessor clears silent flag. … … 123 119 124 120 private: 125 size_t m_length { 0 };126 127 121 float* m_rawPointer { nullptr }; 128 122 std::unique_ptr<AudioFloatArray> m_memBuffer; 123 size_t m_length { 0 }; 129 124 bool m_silent { true }; 130 125 };
Note:
See TracChangeset
for help on using the changeset viewer.