Title: [274459] trunk/Source/WebKit
Revision
274459
Author
cdu...@apple.com
Date
2021-03-15 19:01:13 -0700 (Mon, 15 Mar 2021)

Log Message

Avoid heap allocation in RemoteAudioDestinationProxy::renderQuantum()
https://bugs.webkit.org/show_bug.cgi?id=223228

Reviewed by Darin Adler.

Avoid heap allocation in RemoteAudioDestinationProxy::renderQuantum() since this runs on the
audio thread.

* WebProcess/GPU/media/RemoteAudioDestinationProxy.cpp:
(WebKit::RemoteAudioDestinationProxy::connectToGPUProcess):
(WebKit::RemoteAudioDestinationProxy::renderQuantum):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (274458 => 274459)


--- trunk/Source/WebKit/ChangeLog	2021-03-16 01:57:01 UTC (rev 274458)
+++ trunk/Source/WebKit/ChangeLog	2021-03-16 02:01:13 UTC (rev 274459)
@@ -1,3 +1,17 @@
+2021-03-15  Chris Dumez  <cdu...@apple.com>
+
+        Avoid heap allocation in RemoteAudioDestinationProxy::renderQuantum()
+        https://bugs.webkit.org/show_bug.cgi?id=223228
+
+        Reviewed by Darin Adler.
+
+        Avoid heap allocation in RemoteAudioDestinationProxy::renderQuantum() since this runs on the
+        audio thread.
+
+        * WebProcess/GPU/media/RemoteAudioDestinationProxy.cpp:
+        (WebKit::RemoteAudioDestinationProxy::connectToGPUProcess):
+        (WebKit::RemoteAudioDestinationProxy::renderQuantum):
+
 2021-03-15  Wenson Hsieh  <wenson_hs...@apple.com>
 
         [iOS] WebPageProxy's EditorState may be stale until the next remote layer tree commit

Modified: trunk/Source/WebKit/WebProcess/GPU/media/RemoteAudioDestinationProxy.cpp (274458 => 274459)


--- trunk/Source/WebKit/WebProcess/GPU/media/RemoteAudioDestinationProxy.cpp	2021-03-16 01:57:01 UTC (rev 274458)
+++ trunk/Source/WebKit/WebProcess/GPU/media/RemoteAudioDestinationProxy.cpp	2021-03-16 02:01:13 UTC (rev 274459)
@@ -123,6 +123,7 @@
     getAudioStreamBasicDescription(streamFormat);
     m_ringBuffer->allocate(streamFormat, m_numberOfFrames);
     m_audioBufferList = makeUnique<WebCore::WebAudioBufferList>(streamFormat);
+    m_audioBufferList->setSampleCount(WebCore::AudioUtilities::renderQuantumSize);
 #endif
 
     startRenderingThread();
@@ -161,7 +162,6 @@
     ASSERT(!isMainRunLoop());
 
 #if PLATFORM(COCOA)
-    m_audioBufferList->setSampleCount(WebCore::AudioUtilities::renderQuantumSize);
     AudioDestinationCocoa::render(m_currentFrame / static_cast<double>(m_sampleRate), mach_absolute_time(), WebCore::AudioUtilities::renderQuantumSize, m_audioBufferList->list());
     m_ringBuffer->store(m_audioBufferList->list(), WebCore::AudioUtilities::renderQuantumSize, m_currentFrame);
     m_currentFrame += WebCore::AudioUtilities::renderQuantumSize;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to