Changeset 279500 in webkit
- Timestamp:
- Jul 2, 2021, 12:09:52 AM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.mm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r279498 r279500 1 2021-07-02 Youenn Fablet <youenn@apple.com> 2 3 Make LocalSampleBufferDisplayLayer::requestNotificationWhenReadyForVideoData hop to main thread before hopping to processing thread 4 https://bugs.webkit.org/show_bug.cgi?id=227444 5 <rdar://79413368> 6 7 Reviewed by Chris Dumez. 8 9 It is safer to hop to main thread in requestNotificationWhenReadyForVideoData callback so that we can check weakThis safely. 10 When in main thread, hop to processing thread if LocalSampleBufferDisplayLayer is alive. 11 12 * platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.mm: 13 (WebCore::LocalSampleBufferDisplayLayer::~LocalSampleBufferDisplayLayer): 14 (WebCore::LocalSampleBufferDisplayLayer::requestNotificationWhenReadyForVideoData): 15 1 16 2021-06-30 Darin Adler <darin@apple.com> 2 17 -
trunk/Source/WebCore/platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.mm
r276497 r279500 157 157 #endif 158 158 { 159 ASSERT(isMainThread()); 159 160 } 160 161 … … 187 188 LocalSampleBufferDisplayLayer::~LocalSampleBufferDisplayLayer() 188 189 { 190 ASSERT(isMainThread()); 191 189 192 m_processingQueue->dispatchSync([] { }); 190 193 … … 392 395 { 393 396 auto weakThis = makeWeakPtr(*this); 394 [m_sampleBufferDisplayLayer requestMediaDataWhenReadyOnQueue: m_processingQueue->dispatchQueue() usingBlock:^{397 [m_sampleBufferDisplayLayer requestMediaDataWhenReadyOnQueue:dispatch_get_main_queue() usingBlock:^{ 395 398 if (!weakThis) 396 399 return; 397 400 398 [m_sampleBufferDisplayLayer stopRequestingMediaData]; 399 400 while (!m_pendingVideoSampleQueue.isEmpty()) { 401 if (![m_sampleBufferDisplayLayer isReadyForMoreMediaData]) { 402 requestNotificationWhenReadyForVideoData(); 403 return; 401 m_processingQueue->dispatch([this] { 402 [m_sampleBufferDisplayLayer stopRequestingMediaData]; 403 404 while (!m_pendingVideoSampleQueue.isEmpty()) { 405 if (![m_sampleBufferDisplayLayer isReadyForMoreMediaData]) { 406 requestNotificationWhenReadyForVideoData(); 407 return; 408 } 409 auto sample = m_pendingVideoSampleQueue.takeFirst(); 410 enqueueSampleBuffer(sample); 404 411 } 405 auto sample = m_pendingVideoSampleQueue.takeFirst(); 406 enqueueSampleBuffer(sample); 407 } 412 }); 408 413 }]; 409 414 }
Note:
See TracChangeset
for help on using the changeset viewer.