Changeset 243489 in webkit
- Timestamp:
- Mar 26, 2019 2:34:07 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r243488 r243489 1 2019-03-26 Philippe Normand <pnormand@igalia.com> 2 3 [GStreamer] Sound loop with Google Hangouts and WhatsApp notifications 4 https://bugs.webkit.org/show_bug.cgi?id=189471 5 6 Reviewed by Xabier Rodriguez-Calvar. 7 8 * platform/gtk/TestExpectations: 9 * platform/gtk/media/video-playing-and-pause-expected.txt: 10 1 11 2019-03-26 Antti Koivisto <antti@apple.com> 2 12 -
trunk/LayoutTests/platform/gtk/TestExpectations
r243437 r243489 1461 1461 webkit.org/b/116976 media/video-played-collapse.html [ Failure Pass Crash ] 1462 1462 1463 webkit.org/b/116977 media/event-attributes.html [ Crash Failure Timeout Pass ]1464 1465 1463 webkit.org/b/103443 fast/parser/parser-yield-timing.html [ Failure Pass ] 1466 1467 webkit.org/b/105191 media/video-playing-and-pause.html [ Failure Pass ]1468 1469 webkit.org/b/118460 media/media-element-play-after-eos.html [ Timeout Pass ]1470 1464 1471 1465 webkit.org/b/119009 http/tests/cache/subresource-failover-to-network.html [ Failure Pass ] … … 1678 1672 1679 1673 webkit.org/b/134981 fast/parser/document-write-during-load.html [ Timeout Pass Crash ] 1680 1681 webkit.org/b/81604 media/video-loop.html [ Timeout Pass ]1682 1674 1683 1675 webkit.org/b/134998 plugins/change-widget-and-click-crash.html [ Timeout Pass Crash ] … … 3818 3810 webkit.org/b/196201 fast/text/ja-sans-serif.html [ ImageOnlyFailure ] 3819 3811 3812 webkit.org/b/116977 media/event-attributes.html [ Failure ] 3813 3820 3814 #//////////////////////////////////////////////////////////////////////////////////////// 3821 3815 # End of non-crashing, non-flaky tests failing -
trunk/LayoutTests/platform/gtk/media/video-playing-and-pause-expected.txt
r148815 r243489 1 1 layer at (0,0) size 800x600 2 2 RenderView at (0,0) size 800x600 3 layer at (0,0) size 800x3 174 RenderBlock {HTML} at (0,0) size 800x3 175 RenderBody {BODY} at (8,16) size 784x29 36 RenderBlock {P} at (0,0) size 784x3 47 RenderText {#text} at (0,0) size 76 6x348 text run at (0,0) width 76 6: "Test that pausing the media element in \"playing\" event handler pauses the media immediately. The video should show the"9 text run at (0,1 7) width 68: "first frame."10 RenderBlock (anonymous) at (0,5 0) size 784x2433 layer at (0,0) size 800x320 4 RenderBlock {HTML} at (0,0) size 800x320 5 RenderBody {BODY} at (8,16) size 784x296 6 RenderBlock {P} at (0,0) size 784x36 7 RenderText {#text} at (0,0) size 764x35 8 text run at (0,0) width 764: "Test that pausing the media element in \"playing\" event handler pauses the media immediately. The video should show the" 9 text run at (0,18) width 68: "first frame." 10 RenderBlock (anonymous) at (0,52) size 784x244 11 11 RenderText {#text} at (0,0) size 0x0 12 layer at (8,6 6) size 320x24012 layer at (8,68) size 320x240 13 13 RenderVideo {VIDEO} at (0,0) size 320x240 14 layer at (8,6 6) size 320x24014 layer at (8,68) size 320x240 15 15 RenderFlexibleBox {DIV} at (0,0) size 320x240 16 16 RenderBlock {DIV} at (0,200) size 320x40 17 layer at (13,27 1) size 310x3017 layer at (13,273) size 310x30 18 18 RenderFlexibleBox {DIV} at (5,5) size 310x30 [bgcolor=#141414CC] 19 RenderButton { INPUT} at (9,0) size 30x3019 RenderButton {BUTTON} at (9,0) size 30x30 20 20 RenderSlider {INPUT} at (49,11) size 93x8 [color=#E6E6E659] 21 21 RenderFlexibleBox {DIV} at (0,0) size 93x8 [border: (1px solid #E6E6E659)] 22 22 RenderBlock {DIV} at (1,-2) size 105x12 23 RenderBlock {DIV} at (-7,0) size 1 3x12 [color=#FFFFFF]23 RenderBlock {DIV} at (-7,0) size 12x12 [color=#FFFFFF] 24 24 RenderBlock {DIV} at (157,0) size 74x30 [color=#FFFFFF] 25 25 RenderText {#text} at (0,7) size 74x15 26 26 text run at (0,7) width 74: "00:00 / 00:06" 27 RenderButton {INPUT} at (239,0) size 30x30 28 RenderButton {INPUT} at (271,0) size 30x30 27 RenderButton {BUTTON} at (239,0) size 30x30 28 RenderFlexibleBox {DIV} at (271,0) size 30x30 29 RenderButton {BUTTON} at (0,0) size 30x30 -
trunk/Source/WebCore/ChangeLog
r243488 r243489 1 2019-03-26 Philippe Normand <pnormand@igalia.com> 2 3 [GStreamer] Sound loop with Google Hangouts and WhatsApp notifications 4 https://bugs.webkit.org/show_bug.cgi?id=189471 5 6 Reviewed by Xabier Rodriguez-Calvar. 7 8 The media duration is now cached (again). The loop issue was 9 triggered by the previous version of the code returning positive 10 infinite duration in didEnd(), followed by the timeupdate event 11 propagation that would trick the HTMLMediaElement into a new call 12 to play(). Now the cached duration is updated to current position 13 at EOS (for forward playback direction only), so the media element 14 no longer triggers a new play call for those cases. 15 16 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: 17 (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer): 18 (WebCore::MediaPlayerPrivateGStreamer::loadFull): 19 (WebCore::MediaPlayerPrivateGStreamer::playbackPosition const): 20 (WebCore::MediaPlayerPrivateGStreamer::platformDuration const): 21 (WebCore::MediaPlayerPrivateGStreamer::durationMediaTime const): 22 (WebCore::MediaPlayerPrivateGStreamer::currentMediaTime const): 23 (WebCore::MediaPlayerPrivateGStreamer::didEnd): 24 (WebCore::MediaPlayerPrivateGStreamer::durationChanged): 25 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: 26 * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: 27 (WebCore::MediaPlayerPrivateGStreamerMSE::currentMediaTime const): 28 1 29 2019-03-26 Antti Koivisto <antti@apple.com> 2 30 -
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
r243197 r243489 137 137 , m_bufferingPercentage(0) 138 138 , m_cachedPosition(MediaTime::invalidTime()) 139 , m_cachedDuration(MediaTime::invalidTime()) 139 140 , m_canFallBackToLastFinishedSeekPosition(false) 140 141 , m_changingRate(false) … … 143 144 , m_isEndReached(false) 144 145 , m_isStreaming(false) 145 , m_durationAtEOS(MediaTime::invalidTime())146 146 , m_paused(true) 147 147 , m_playbackRate(1) … … 303 303 m_player->readyStateChanged(); 304 304 m_volumeAndMuteInitialized = false; 305 m_durationAtEOS = MediaTime::invalidTime();306 305 307 306 if (!m_delayingLoad) … … 358 357 MediaTime MediaPlayerPrivateGStreamer::playbackPosition() const 359 358 { 359 GST_TRACE_OBJECT(pipeline(), "isEndReached: %s, seeking: %s, seekTime: %s", boolForPrinting(m_isEndReached), boolForPrinting(m_seeking), m_seekTime.toString().utf8().data()); 360 360 if (m_isEndReached && m_seeking) 361 361 return m_seekTime; … … 364 364 static const Seconds positionCacheThreshold = 200_ms; 365 365 Seconds now = WTF::WallTime::now().secondsSinceEpoch(); 366 if (m_lastQueryTime && (now - m_lastQueryTime.value()) < positionCacheThreshold && m_cachedPosition.isValid()) 366 if (m_lastQueryTime && (now - m_lastQueryTime.value()) < positionCacheThreshold && m_cachedPosition.isValid()) { 367 GST_TRACE_OBJECT(pipeline(), "Returning cached position: %s", m_cachedPosition.toString().utf8().data()); 367 368 return m_cachedPosition; 369 } 368 370 369 371 m_lastQueryTime = now; … … 376 378 gst_query_unref(query); 377 379 378 GST_TRACE_OBJECT(pipeline(), "Position %" GST_TIME_FORMAT , GST_TIME_ARGS(position));380 GST_TRACE_OBJECT(pipeline(), "Position %" GST_TIME_FORMAT ", canFallBackToLastFinishedSeekPosition: %s", GST_TIME_ARGS(position), boolForPrinting(m_canFallBackToLastFinishedSeekPosition)); 379 381 380 382 MediaTime playbackPosition = MediaTime::zeroTime(); … … 478 480 } 479 481 482 MediaTime MediaPlayerPrivateGStreamer::platformDuration() const 483 { 484 GST_TRACE_OBJECT(pipeline(), "errorOccured: %s, pipeline state: %s", boolForPrinting(m_errorOccured), gst_element_state_get_name(GST_STATE(m_pipeline.get()))); 485 if (m_errorOccured) 486 return MediaTime::invalidTime(); 487 488 // The duration query would fail on a not-prerolled pipeline. 489 if (GST_STATE(m_pipeline.get()) < GST_STATE_PAUSED) 490 return MediaTime::invalidTime(); 491 492 int64_t duration = 0; 493 if (!gst_element_query_duration(m_pipeline.get(), GST_FORMAT_TIME, &duration) || !GST_CLOCK_TIME_IS_VALID(duration)) { 494 GST_DEBUG_OBJECT(pipeline(), "Time duration query failed for %s", m_url.string().utf8().data()); 495 return MediaTime::positiveInfiniteTime(); 496 } 497 498 GST_LOG_OBJECT(pipeline(), "Duration: %" GST_TIME_FORMAT, GST_TIME_ARGS(duration)); 499 return MediaTime(duration, GST_SECOND); 500 } 501 480 502 MediaTime MediaPlayerPrivateGStreamer::durationMediaTime() const 503 { 504 GST_TRACE_OBJECT(pipeline(), "Cached duration: %s", m_cachedDuration.toString().utf8().data()); 505 if (m_cachedDuration.isValid()) 506 return m_cachedDuration; 507 508 MediaTime duration = platformDuration(); 509 if (!duration || duration.isInvalid()) 510 return MediaTime::zeroTime(); 511 512 m_cachedDuration = duration; 513 514 return m_cachedDuration; 515 } 516 517 MediaTime MediaPlayerPrivateGStreamer::currentMediaTime() const 481 518 { 482 519 if (!m_pipeline || m_errorOccured) 483 520 return MediaTime::invalidTime(); 484 521 485 if (m_durationAtEOS.isValid()) 486 return m_durationAtEOS; 487 488 // The duration query would fail on a not-prerolled pipeline. 489 if (GST_STATE(m_pipeline.get()) < GST_STATE_PAUSED) 490 return MediaTime::positiveInfiniteTime(); 491 492 gint64 timeLength = 0; 493 494 if (!gst_element_query_duration(m_pipeline.get(), GST_FORMAT_TIME, &timeLength) || !GST_CLOCK_TIME_IS_VALID(timeLength)) { 495 GST_DEBUG_OBJECT(pipeline(), "Time duration query failed for %s", m_url.string().utf8().data()); 496 return MediaTime::positiveInfiniteTime(); 497 } 498 499 GST_LOG("Duration: %" GST_TIME_FORMAT, GST_TIME_ARGS(timeLength)); 500 501 return MediaTime(timeLength, GST_SECOND); 502 // FIXME: handle 3.14.9.5 properly 503 } 504 505 MediaTime MediaPlayerPrivateGStreamer::currentMediaTime() const 506 { 507 if (!m_pipeline || m_errorOccured) 508 return MediaTime::invalidTime(); 509 522 GST_TRACE_OBJECT(pipeline(), "seeking: %s, seekTime: %s", boolForPrinting(m_seeking), m_seekTime.toString().utf8().data()); 510 523 if (m_seeking) 511 524 return m_seekTime; … … 2201 2214 m_cachedPosition = MediaTime::invalidTime(); 2202 2215 MediaTime now = currentMediaTime(); 2203 if (now > MediaTime { } && now <= durationMediaTime()) 2216 if (now > MediaTime::zeroTime() && !m_seeking) { 2217 m_cachedDuration = now; 2204 2218 m_player->durationChanged(); 2219 } 2205 2220 2206 2221 m_isEndReached = true; 2207 timeChanged();2208 2222 2209 2223 if (!m_player->client().mediaPlayerIsLooping()) { 2210 2224 m_paused = true; 2211 m_durationAtEOS = durationMediaTime();2212 2225 changePipelineState(GST_STATE_READY); 2213 2226 m_downloadFinished = false; 2214 2227 } 2228 timeChanged(); 2215 2229 } 2216 2230 … … 2218 2232 { 2219 2233 MediaTime previousDuration = durationMediaTime(); 2220 2221 // FIXME: Check if this method is still useful, because it's not doing its work at all 2222 // since bug #159458 removed a cacheDuration() call here. 2234 m_cachedDuration = MediaTime::invalidTime(); 2223 2235 2224 2236 // Avoid emiting durationchanged in the case where the previous -
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
r243197 r243489 92 92 bool seeking() const override; 93 93 94 MediaTime platformDuration() const; 94 95 MediaTime durationMediaTime() const override; 95 96 MediaTime currentMediaTime() const override; … … 188 189 189 190 protected: 190 void cacheDuration();191 192 191 bool m_buffering; 193 192 int m_bufferingPercentage; 194 193 mutable MediaTime m_cachedPosition; 194 mutable MediaTime m_cachedDuration; 195 195 bool m_canFallBackToLastFinishedSeekPosition; 196 196 bool m_changingRate; … … 199 199 mutable bool m_isEndReached; 200 200 mutable bool m_isStreaming; 201 mutable MediaTime m_durationAtEOS;202 201 bool m_paused; 203 202 float m_playbackRate; -
trunk/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp
r242034 r243489 783 783 m_isEndReached = true; 784 784 m_cachedPosition = m_mediaTimeDuration; 785 m_durationAtEOS = m_mediaTimeDuration;786 785 m_player->timeChanged(); 787 786 }
Note: See TracChangeset
for help on using the changeset viewer.