Changeset 278746 in webkit
- Timestamp:
- Jun 10, 2021, 6:02:06 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 8 edited
-
ChangeLog (modified) (1 diff)
-
html/HTMLMediaElement.cpp (modified) (1 diff)
-
html/HTMLMediaElement.h (modified) (1 diff)
-
platform/graphics/MediaPlayer.cpp (modified) (1 diff)
-
platform/graphics/MediaPlayer.h (modified) (2 diffs)
-
platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp (modified) (1 diff)
-
platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h (modified) (1 diff)
-
platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r278738 r278746 1 2021-06-10 Chris Dumez <cdumez@apple.com> 2 3 REGRESSION: (r278544) [ Mac-wk1 ] media/media-continues-playing-after-replace-source.html is a flaky failure 4 https://bugs.webkit.org/show_bug.cgi?id=226899 5 <rdar://problem/79160701> 6 7 Reviewed by Ryosuke Niwa. 8 9 Have MediaPlayerPrivateAVFoundationObjC schedule tasks on the HTML event loop instead of simply using 10 callOnMainThread() to address flakiness issues, since the rest of the media code uses the HTML event 11 loop. 12 13 * html/HTMLMediaElement.cpp: 14 (WebCore::HTMLMediaElement::mediaPlayerQueueTaskOnEventLoop): 15 * html/HTMLMediaElement.h: 16 * platform/graphics/MediaPlayer.cpp: 17 (WebCore::MediaPlayer::queueTaskOnEventLoop): 18 * platform/graphics/MediaPlayer.h: 19 (WebCore::MediaPlayerClient::mediaPlayerQueueTaskOnEventLoop): 20 * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: 21 (WebCore::MediaPlayerPrivateAVFoundation::queueTaskOnEventLoop): 22 * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h: 23 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: 24 (-[WebCoreAVFMovieObserver metadataLoaded]): 25 (-[WebCoreAVFMovieObserver didEnd:]): 26 (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]): 27 (-[WebCoreAVFMovieObserver legibleOutput:didOutputAttributedStrings:nativeSampleBuffers:forItemTime:]): 28 (-[WebCoreAVFMovieObserver outputSequenceWasFlushed:]): 29 (-[WebCoreAVFMovieObserver metadataOutput:didOutputTimedMetadataGroups:fromPlayerItemTrack:]): 30 (-[WebCoreAVFMovieObserver metadataCollector:didCollectDateRangeMetadataGroups:indexesOfNewGroups:indexesOfModifiedGroups:]): 31 (-[WebCoreAVFLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]): 32 (-[WebCoreAVFLoaderDelegate resourceLoader:didCancelLoadingRequest:]): 33 1 34 2021-06-10 Alex Christensen <achristensen@webkit.org> 2 35 -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r278646 r278746 8139 8139 } 8140 8140 8141 void HTMLMediaElement::mediaPlayerQueueTaskOnEventLoop(Function<void()>&& task) 8142 { 8143 document().eventLoop().queueTask(TaskSource::MediaElement, WTFMove(task)); 8144 } 8145 8141 8146 template<typename T> void HTMLMediaElement::scheduleEventOn(T& target, Ref<Event>&& event) 8142 8147 { -
trunk/Source/WebCore/html/HTMLMediaElement.h
r278645 r278746 668 668 void mediaPlayerDidInitializeMediaEngine() final; 669 669 void mediaPlayerReloadAndResumePlaybackIfNeeded() final; 670 void mediaPlayerQueueTaskOnEventLoop(Function<void()>&&) final; 670 671 671 672 void scheduleMediaEngineWasUpdated(); -
trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp
r278646 r278746 606 606 } 607 607 608 void MediaPlayer::queueTaskOnEventLoop(Function<void()>&& task) 609 { 610 ASSERT(isMainThread()); 611 client().mediaPlayerQueueTaskOnEventLoop(WTFMove(task)); 612 } 613 608 614 bool MediaPlayer::hasAvailableVideoFrame() const 609 615 { -
trunk/Source/WebCore/platform/graphics/MediaPlayer.h
r278646 r278746 285 285 virtual String audioOutputDeviceIdOverride() const { return { }; } 286 286 287 virtual void mediaPlayerQueueTaskOnEventLoop(Function<void()>&& task) { callOnMainThread(WTFMove(task)); } 288 287 289 #if !RELEASE_LOG_DISABLED 288 290 virtual const void* mediaPlayerLogIdentifier() { return nullptr; } … … 387 389 bool shouldContinueAfterKeyNeeded() const { return m_shouldContinueAfterKeyNeeded; } 388 390 #endif 391 392 void queueTaskOnEventLoop(Function<void()>&&); 389 393 390 394 bool paused() const; -
trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp
r277805 r278746 1053 1053 } 1054 1054 1055 void MediaPlayerPrivateAVFoundation::queueTaskOnEventLoop(Function<void()>&& task) 1056 { 1057 ASSERT(isMainThread()); 1058 if (m_player) 1059 m_player->queueTaskOnEventLoop(WTFMove(task)); 1060 } 1061 1055 1062 #if !RELEASE_LOG_DISABLED 1056 1063 WTFLogChannel& MediaPlayerPrivateAVFoundation::logChannel() const -
trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h
r277958 r278746 65 65 void playbackTargetIsWirelessChanged(); 66 66 #endif 67 68 void queueTaskOnEventLoop(Function<void()>&&); 67 69 68 70 class Notification { -
trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
r278580 r278746 3579 3579 { 3580 3580 ensureOnMainThread([self, strongSelf = retainPtr(self)] { 3581 callOnMainThread([player = m_player] { 3581 if (!m_player) 3582 return; 3583 3584 m_player->queueTaskOnEventLoop([player = m_player] { 3582 3585 if (player) 3583 3586 player->metadataLoaded(); … … 3590 3593 UNUSED_PARAM(unusedNotification); 3591 3594 ensureOnMainThread([self, strongSelf = retainPtr(self)] { 3592 callOnMainThread([player = m_player] { 3595 if (!m_player) 3596 return; 3597 3598 m_player->queueTaskOnEventLoop([player = m_player] { 3593 3599 if (player) 3594 3600 player->didEnd(); … … 3600 3606 { 3601 3607 ensureOnMainThread([self, strongSelf = retainPtr(self), keyPath = retainPtr(keyPath), change = retainPtr(change), object = retainPtr(object), context]() mutable { 3602 callOnMainThread([player = m_player, keyPath = WTFMove(keyPath), change = WTFMove(change), object = WTFMove(object), context] { 3608 if (!m_player) 3609 return; 3610 3611 m_player->queueTaskOnEventLoop([player = m_player, keyPath = WTFMove(keyPath), change = WTFMove(change), object = WTFMove(object), context] { 3603 3612 if (!player) 3604 3613 return; … … 3699 3708 3700 3709 ensureOnMainThread([self, strongSelf = retainPtr(self), strings = retainPtr(strings), nativeSamples = retainPtr(nativeSamples), itemTime]() mutable { 3701 callOnMainThread([player = m_player, strings = WTFMove(strings), nativeSamples = WTFMove(nativeSamples), itemTime] { 3710 if (!m_player) 3711 return; 3712 3713 m_player->queueTaskOnEventLoop([player = m_player, strings = WTFMove(strings), nativeSamples = WTFMove(nativeSamples), itemTime] { 3702 3714 if (!player) 3703 3715 return; … … 3716 3728 3717 3729 ensureOnMainThread([self, strongSelf = retainPtr(self)] { 3718 callOnMainThread([player = m_player] { 3730 if (!m_player) 3731 return; 3732 3733 m_player->queueTaskOnEventLoop([player = m_player] { 3719 3734 if (player) 3720 3735 player->flushCues(); … … 3732 3747 return; 3733 3748 3734 callOnMainThread([player = m_player, metadataGroups = retainPtr(metadataGroups), currentTime = m_player->currentMediaTime()] {3749 m_player->queueTaskOnEventLoop([player = m_player, metadataGroups = retainPtr(metadataGroups), currentTime = m_player->currentMediaTime()] { 3735 3750 if (!player) 3736 3751 return; … … 3753 3768 return; 3754 3769 3755 callOnMainThread([player = m_player, metadataGroups = retainPtr(metadataGroups), currentTime = m_player->currentMediaTime()] {3770 m_player->queueTaskOnEventLoop([player = m_player, metadataGroups = retainPtr(metadataGroups), currentTime = m_player->currentMediaTime()] { 3756 3771 if (!player) 3757 3772 return; … … 3780 3795 3781 3796 ensureOnMainThread([self, strongSelf = retainPtr(self), loadingRequest = retainPtr(loadingRequest)]() mutable { 3782 callOnMainThread([player = m_player, loadingRequest = WTFMove(loadingRequest)] { 3797 if (!m_player) 3798 return; 3799 3800 m_player->queueTaskOnEventLoop([player = m_player, loadingRequest = WTFMove(loadingRequest)] { 3783 3801 if (!player) { 3784 3802 [loadingRequest finishLoadingWithError:nil]; … … 3806 3824 UNUSED_PARAM(resourceLoader); 3807 3825 ensureOnMainThread([self, strongSelf = retainPtr(self), loadingRequest = retainPtr(loadingRequest)]() mutable { 3808 callOnMainThread([player = m_player, loadingRequest = WTFMove(loadingRequest)] { 3826 if (!m_player) 3827 return; 3828 3829 m_player->queueTaskOnEventLoop([player = m_player, loadingRequest = WTFMove(loadingRequest)] { 3809 3830 3810 3831 ScriptDisallowedScope::InMainThread scriptDisallowedScope;
Note:
See TracChangeset
for help on using the changeset viewer.