AudioMediaStreamTrackRendererCocoa should create/start/stop its remote unit on the main thread
Created attachment 398180 [details] Patch
Created attachment 398187 [details] Patch
As discussed with Eric offline, I'll add a comment stating that the design is that pushSamples can only be called between start and stop which is enforced by AudioTrackPrivateMediaStream::startRenderer/stopRenderer.
Created attachment 398191 [details] Patch for landing
Comment on attachment 398180 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=398180&action=review > Source/WebCore/platform/mediastream/mac/AudioMediaStreamTrackRendererCocoa.cpp:79 > if (m_remoteIOUnit) { > AudioOutputUnitStop(m_remoteIOUnit); > AudioComponentInstanceDispose(m_remoteIOUnit); stop() does the same thing, you could call it here. > Source/WebCore/platform/mediastream/mac/AudioMediaStreamTrackRendererCocoa.cpp:159 > + if (!m_dataSource || !m_dataSource->inputDescription() || toCAAudioStreamDescription(*m_dataSource->inputDescription()) != description) { You can use CAAudioStreamDescription's `operator==(const AudioStreamDescription&)` instead of calling toCAAudioStreamDescription
Created attachment 398193 [details] Patch for landing
(In reply to Eric Carlson from comment #5) > Comment on attachment 398180 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=398180&action=review > > > Source/WebCore/platform/mediastream/mac/AudioMediaStreamTrackRendererCocoa.cpp:79 > > if (m_remoteIOUnit) { > > AudioOutputUnitStop(m_remoteIOUnit); > > AudioComponentInstanceDispose(m_remoteIOUnit); > > stop() does the same thing, you could call it here. Will do. > > > Source/WebCore/platform/mediastream/mac/AudioMediaStreamTrackRendererCocoa.cpp:159 > > + if (!m_dataSource || !m_dataSource->inputDescription() || toCAAudioStreamDescription(*m_dataSource->inputDescription()) != description) { > > You can use CAAudioStreamDescription's `operator==(const > AudioStreamDescription&)` instead of calling toCAAudioStreamDescription Tried that but it failed so went this way. I updated CAAudioStreamDescription to make it work, much nicer.
Committed r261063: <https://trac.webkit.org/changeset/261063> All reviewed patches have been landed. Closing bug and clearing flags on attachment 398193 [details].
<rdar://problem/62811472>
*** Bug 208134 has been marked as a duplicate of this bug. ***