Changeset 230627 in webkit
- Timestamp:
- Apr 13, 2018 3:09:23 AM (6 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r230625 r230627 1 2018-04-13 Miguel Gomez <magomez@igalia.com> 2 3 [GTK] [gstreamer] video won't unpause when built with -DUSE_GSTREAMER_GL=OFF 4 https://bugs.webkit.org/show_bug.cgi?id=183362 5 6 Reviewed by Carlos Garcia Campos. 7 8 Remove the drawCancelled flag and use a new one to indicate that the player is being destroyed. 9 That new flag is only enabled on destruction and it's not modified by cancelRepaint(), which 10 can be used to handle the pause event without avoiding future renderings. Also cancelRepaint() 11 has only effect when not in AC mode. 12 13 Covered by existent tests. 14 15 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: 16 (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase): 17 (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint): 18 (WebCore::MediaPlayerPrivateGStreamerBase::cancelRepaint): 19 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: 20 1 21 2018-04-13 Xabier Rodriguez Calvar <calvaris@igalia.com> 2 22 -
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp
r230625 r230627 241 241 MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase() 242 242 { 243 // Flag the player as being destroyed, so triggerRepaint will ignore incoming samples. 244 m_destroying = true; 245 243 246 #if ENABLE(ENCRYPTED_MEDIA) 244 247 m_protectionCondition.notifyAll(); … … 259 262 g_signal_handlers_disconnect_matched(m_volumeElement.get(), G_SIGNAL_MATCH_DATA, 0, 0, nullptr, nullptr, this); 260 263 261 // This will release the GStreamer thread from m_drawCondition i f AC is disabled.264 // This will release the GStreamer thread from m_drawCondition in non AC mode in case there's an ongoing triggerRepaint call. 262 265 cancelRepaint(); 263 266 … … 785 788 void MediaPlayerPrivateGStreamerBase::triggerRepaint(GstSample* sample) 786 789 { 790 // Do not try to process new frames if the player is being destroyed by the main thread. 791 if (m_destroying) 792 return; 793 787 794 bool triggerResize; 788 795 { … … 799 806 if (!m_renderingCanBeAccelerated) { 800 807 LockHolder locker(m_drawMutex); 801 if (m_drawCancelled)802 return;803 808 m_drawTimer.startOneShot(0_s); 804 809 m_drawCondition.wait(m_drawMutex); … … 812 817 { 813 818 LockHolder lock(m_drawMutex); 814 if (m_drawCancelled)815 return;816 819 if (!m_platformLayerProxy->scheduleUpdateOnCompositorThread([this] { this->pushTextureToCompositor(); })) 817 820 return; … … 829 832 void MediaPlayerPrivateGStreamerBase::cancelRepaint() 830 833 { 831 LockHolder locker(m_drawMutex); 832 834 // The goal of this function is to release the GStreamer thread from m_drawCondition in triggerRepaint() in non-AC case, 835 // to avoid a deadlock if the player gets paused while waiting for drawing (see https://bugs.webkit.org/show_bug.cgi?id=170003): 836 // the main thread is waiting for the GStreamer thread to pause, but the GStreamer thread is locked waiting for the 837 // main thread to draw. This deadlock doesn't happen when using AC because the sample is processed (not painted) in the compositor 838 // thread, so the main thread can request the pause and wait if the GStreamer thread is waiting for the compositor thread. 833 839 if (!m_renderingCanBeAccelerated) { 834 840 m_drawTimer.stop(); 835 } 836 837 m_drawCancelled = true; 838 m_drawCondition.notifyOne(); 841 LockHolder locker(m_drawMutex); 842 m_drawCondition.notifyOne(); 843 } 839 844 } 840 845 -
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h
r230625 r230627 236 236 Condition m_drawCondition; 237 237 Lock m_drawMutex; 238 bool m_d rawCancelled{ false };238 bool m_destroying { false }; 239 239 RunLoop::Timer<MediaPlayerPrivateGStreamerBase> m_drawTimer; 240 240
Note: See TracChangeset
for help on using the changeset viewer.