Modified: branches/safari-612-branch/Source/WebKit/ChangeLog (286238 => 286239)
--- branches/safari-612-branch/Source/WebKit/ChangeLog 2021-11-29 19:38:08 UTC (rev 286238)
+++ branches/safari-612-branch/Source/WebKit/ChangeLog 2021-11-29 19:38:11 UTC (rev 286239)
@@ -1,3 +1,7 @@
+2021-11-12 Russell Epstein <repst...@apple.com>
+
+ Revert r285690. rdar://problem/83381842
+
2021-11-11 Alan Coon <alanc...@apple.com>
Cherry-pick r285565. rdar://problem/83159358
Modified: branches/safari-612-branch/Source/WebKit/UIProcess/SpeechRecognitionRemoteRealtimeMediaSource.cpp (286238 => 286239)
--- branches/safari-612-branch/Source/WebKit/UIProcess/SpeechRecognitionRemoteRealtimeMediaSource.cpp 2021-11-29 19:38:08 UTC (rev 286238)
+++ branches/safari-612-branch/Source/WebKit/UIProcess/SpeechRecognitionRemoteRealtimeMediaSource.cpp 2021-11-29 19:38:11 UTC (rev 286239)
@@ -77,13 +77,8 @@
void SpeechRecognitionRemoteRealtimeMediaSource::setStorage(const SharedMemory::Handle& handle, const WebCore::CAAudioStreamDescription& description, uint64_t numberOfFrames)
{
- if (!numberOfFrames) {
- m_ringBuffer = nullptr;
- m_buffer = nullptr;
- return;
- }
+ m_description = description;
- m_description = description;
m_ringBuffer = WebCore::CARingBuffer::adoptStorage(makeUniqueRef<ReadOnlySharedRingBufferStorage>(handle), description, numberOfFrames).moveToUniquePtr();
m_buffer = makeUnique<WebCore::WebAudioBufferList>(description);
}
Modified: branches/safari-612-branch/Source/WebKit/WebProcess/Speech/SpeechRecognitionRealtimeMediaSourceManager.cpp (286238 => 286239)
--- branches/safari-612-branch/Source/WebKit/WebProcess/Speech/SpeechRecognitionRealtimeMediaSourceManager.cpp 2021-11-29 19:38:08 UTC (rev 286238)
+++ branches/safari-612-branch/Source/WebKit/WebProcess/Speech/SpeechRecognitionRealtimeMediaSourceManager.cpp 2021-11-29 19:38:11 UTC (rev 286239)
@@ -63,7 +63,7 @@
, m_source(WTFMove(source))
, m_connection(WTFMove(connection))
#if PLATFORM(COCOA)
- , m_ringBuffer(makeUniqueRef<SharedRingBufferStorage>(std::bind(&Source::storageChanged, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)))
+ , m_ringBuffer(makeUniqueRef<SharedRingBufferStorage>(std::bind(&Source::storageChanged, this, std::placeholders::_1)))
#endif
{
m_source->addObserver(*this);
@@ -113,7 +113,9 @@
if (m_description != description) {
ASSERT(description.platformDescription().type == PlatformDescription::CAAudioStreamBasicType);
m_description = *WTF::get<const AudioStreamBasicDescription*>(description.platformDescription().description);
- m_ringBuffer.allocate(m_description.streamDescription(), m_description.sampleRate() * 2);
+
+ m_numberOfFrames = m_description.sampleRate() * 2;
+ m_ringBuffer.allocate(m_description.streamDescription(), m_numberOfFrames);
}
ASSERT(is<WebAudioBufferList>(audioData));
@@ -129,7 +131,7 @@
#if PLATFORM(COCOA)
- void storageChanged(SharedMemory* storage, const WebCore::CAAudioStreamDescription& description, size_t numberOfFrames)
+ void storageChanged(SharedMemory* storage)
{
DisableMallocRestrictionsForCurrentThreadScope scope;
SharedMemory::Handle handle;
@@ -140,7 +142,7 @@
#else
uint64_t dataSize = 0;
#endif
- m_connection->send(Messages::SpeechRecognitionRemoteRealtimeMediaSourceManager::SetStorage(m_identifier, SharedMemory::IPCHandle { WTFMove(handle), dataSize }, description, numberOfFrames), 0);
+ m_connection->send(Messages::SpeechRecognitionRemoteRealtimeMediaSourceManager::SetStorage(m_identifier, SharedMemory::IPCHandle { WTFMove(handle), dataSize }, m_description, m_numberOfFrames), 0);
}
#endif
@@ -160,6 +162,7 @@
Ref<IPC::Connection> m_connection;
#if PLATFORM(COCOA)
+ uint64_t m_numberOfFrames { 0 };
CARingBuffer m_ringBuffer;
CAAudioStreamDescription m_description { };
#endif