Changeset 188390 in webkit
- Timestamp:
- Aug 13, 2015 12:16:09 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r188383 r188390 1 2015-08-13 Eric Carlson <eric.carlson@apple.com> 2 3 Don't short circuit seeking 4 https://bugs.webkit.org/show_bug.cgi?id=147892 5 6 Reviewed by Jer Noble. 7 8 * media/event-attributes-expected.txt: Update for test change. 9 * media/event-attributes.html: There is no reason to expect that a 'timeupdate' will have 10 been sent before 'canplaythrough'. 11 * media/video-seek-to-current-time-expected.txt: Added. 12 * media/video-seek-to-current-time.html: Added. 13 * platform/efl/TestExpectations: Skip new test. 14 * platform/gtk/TestExpectations: Ditto. 15 * platform/mac/TestExpectations: Mark the new test as sometimes failing because of 16 webkit.org/b/147944. 17 * platform/win/TestExpectations: Skip new test. 18 1 19 2015-08-13 Alexey Proskuryakov <ap@apple.com> 2 20 -
trunk/LayoutTests/media/event-attributes-expected.txt
r158743 r188390 6 6 EVENT(canplay) 7 7 EVENT(canplaythrough) 8 EXPECTED (progressEventCount >= '1') OK9 8 10 9 *** starting playback -
trunk/LayoutTests/media/event-attributes.html
r125102 r188390 19 19 { 20 20 case "canplaythrough": 21 testExpected('progressEventCount', 1, '>=');22 21 consoleWrite("<br>*** starting playback"); 23 22 run("video.play()"); -
trunk/LayoutTests/platform/efl/TestExpectations
r188263 r188390 2257 2257 # This test relies on iOS-specific font fallback. 2258 2258 fast/text/arabic-glyph-cache-fill-combine.html [ ImageOnlyFailure ] 2259 2260 # This test uses an MPEG-4 video 2261 media/video-seek-to-current-time.html [ Skip ] -
trunk/LayoutTests/platform/gtk/TestExpectations
r188263 r188390 2424 2424 # This test relies on iOS-specific font fallback. 2425 2425 fast/text/arabic-glyph-cache-fill-combine.html [ ImageOnlyFailure ] 2426 2427 # This test uses an MPEG-4 video 2428 media/video-seek-to-current-time.html [ Skip ] -
trunk/LayoutTests/platform/mac/TestExpectations
r188380 r188390 990 990 webkit.org/b/141294 compositing/reflections/masked-reflection-on-composited.html [ Pass Crash ] 991 991 webkit.org/b/142152 media/track/track-in-band-cues-added-once.html [ Pass Failure ] 992 webkit.org/b/147944 media/video-seek-to-current-time.html [ Pass Failure ] 992 993 ## --- End flaky media tests 993 994 -
trunk/LayoutTests/platform/win/TestExpectations
r188307 r188390 3171 3171 fast/forms/indeterminate-progress-inline-height.html [ Failure ] 3172 3172 fast/forms/listbox-scrollbar-hit-test.html [ Failure ] 3173 3174 # This test uses an MPEG-4 video 3175 media/video-seek-to-current-time.html [ Skip ] -
trunk/Source/WebCore/ChangeLog
r188389 r188390 1 2015-08-13 Eric Carlson <eric.carlson@apple.com> 2 3 Don't short circuit seeking 4 https://bugs.webkit.org/show_bug.cgi?id=147892 5 6 Reviewed by Jer Noble. 7 8 Test: media/video-seek-to-current-time.html 9 10 * html/HTMLMediaElement.cpp: 11 (WebCore::HTMLMediaElement::prepareForLoad): Call clearSeeking. 12 (WebCore::HTMLMediaElement::fastSeek): Add logging. 13 (WebCore::HTMLMediaElement::seekWithTolerance): Add logging. Set m_pendingSeekType. 14 (WebCore::HTMLMediaElement::seekTask): Call clearSeeking. Don't short circuit a 15 if the current or pending seek is a fast seek. Set m_seeking to true immediately 16 before calling media engine as it may have been cleared before the seek task 17 queue ran. 18 (WebCore::HTMLMediaElement::clearSeeking): New. 19 * html/HTMLMediaElement.h: 20 * html/HTMLMediaElementEnums.h: 21 22 * platform/GenericTaskQueue.h: 23 (WebCore::GenericTaskQueue::enqueueTask): Clear m_pendingTasks. 24 25 * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: 26 (WebCore::MediaPlayerPrivateAVFoundation::seekWithTolerance): Don't return early 27 when asked to seek to the current time. 28 (WebCore::MediaPlayerPrivateAVFoundation::invalidateCachedDuration): Remove some 29 extremely noisy logging. 30 31 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: 32 (WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime): Add logging. 33 1 34 2015-08-13 Simon Fraser <simon.fraser@apple.com> 2 35 -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r188234 r188390 1018 1018 1019 1019 // 4.6 - If seeking is true, set it to false. 1020 m_seeking = false;1020 clearSeeking(); 1021 1021 1022 1022 // 4.7 - Set the current playback position to 0. … … 2494 2494 // it is running to complete. 2495 2495 if (m_seekTaskQueue.hasPendingTasks()) { 2496 LOG(Media, "HTMLMediaElement::seekWithTolerance(%p) - cancelling pending seeks", this); 2496 2497 m_seekTaskQueue.cancelAllTasks(); 2497 2498 m_pendingSeek = nullptr; 2499 m_pendingSeekType = NoSeek; 2498 2500 } 2499 2501 … … 2510 2512 // the script. The remainder of these steps must be run asynchronously. 2511 2513 m_pendingSeek = std::make_unique<PendingSeek>(now, time, negativeTolerance, positiveTolerance); 2512 if (fromDOM) 2514 if (fromDOM) { 2515 LOG(Media, "HTMLMediaElement::seekWithTolerance(%p) - enqueuing seek from %s to %s", this, toString(now).utf8().data(), toString(time).utf8().data()); 2513 2516 m_seekTaskQueue.enqueueTask(std::bind(&HTMLMediaElement::seekTask, this)); 2514 else2517 } else 2515 2518 seekTask(); 2516 2519 } … … 2518 2521 void HTMLMediaElement::seekTask() 2519 2522 { 2523 LOG(Media, "HTMLMediaElement::seekTask(%p)", this); 2524 2520 2525 if (!m_player) { 2521 m_seeking = false;2526 clearSeeking(); 2522 2527 return; 2523 2528 } … … 2546 2551 MediaTime mediaTime = m_player->mediaTimeForTimeValue(time); 2547 2552 if (time != mediaTime) 2548 LOG(Media, "HTMLMediaElement::seekT imerFired(%p) - %s - media timeline equivalent is %s", this, toString(time).utf8().data(), toString(mediaTime).utf8().data());2553 LOG(Media, "HTMLMediaElement::seekTask(%p) - %s - media timeline equivalent is %s", this, toString(time).utf8().data(), toString(mediaTime).utf8().data()); 2549 2554 #endif 2550 2555 time = m_player->mediaTimeForTimeValue(time); … … 2555 2560 // attribute then set the seeking IDL attribute to false and abort these steps. 2556 2561 RefPtr<TimeRanges> seekableRanges = seekable(); 2562 bool noSeekRequired = !seekableRanges->length(); 2557 2563 2558 2564 // Short circuit seeking to the current time by just firing the events if no seek is required. 2559 // Don't skip calling the media engine if we are in poster mode because a seek should always 2560 // cancel poster display. 2561 bool noSeekRequired = !seekableRanges->length() || (time == now && displayMode() != Poster); 2565 // Don't skip calling the media engine if 1) we are in poster mode (because a seek should always cancel 2566 // poster display), or 2) if there is a pending fast seek, or 3) if this seek is not an exact seek 2567 SeekType thisSeekType = (negativeTolerance == MediaTime::zeroTime() && positiveTolerance == MediaTime::zeroTime()) ? Precise : Fast; 2568 if (!noSeekRequired && time == now && thisSeekType == Precise && m_pendingSeekType != Fast && displayMode() != Poster) 2569 noSeekRequired = true; 2562 2570 2563 2571 #if ENABLE(MEDIA_SOURCE) … … 2569 2577 2570 2578 if (noSeekRequired) { 2579 LOG(Media, "HTMLMediaElement::seekTask(%p) - seek to %s ignored", this, toString(time).utf8().data()); 2571 2580 if (time == now) { 2572 2581 scheduleEvent(eventNames().seekingEvent); … … 2574 2583 scheduleEvent(eventNames().seekedEvent); 2575 2584 } 2576 m_seeking = false;2585 clearSeeking(); 2577 2586 return; 2578 2587 } … … 2581 2590 m_sentEndEvent = false; 2582 2591 m_lastSeekTime = time; 2592 m_pendingSeekType = thisSeekType; 2593 m_seeking = true; 2583 2594 2584 2595 // 10 - Queue a task to fire a simple event named seeking at the element. … … 2593 2604 } 2594 2605 2606 void HTMLMediaElement::clearSeeking() 2607 { 2608 m_seeking = false; 2609 m_pendingSeekType = NoSeek; 2610 invalidateCachedTime(); 2611 } 2612 2595 2613 void HTMLMediaElement::finishSeek() 2596 2614 { 2597 LOG(Media, "HTMLMediaElement::finishSeek(%p)", this);2598 2599 2615 // 4.8.10.9 Seeking 2600 2616 // 14 - Set the seeking IDL attribute to false. 2601 m_seeking = false; 2617 clearSeeking(); 2618 2619 LOG(Media, "HTMLMediaElement::finishSeek(%p) - current time = %s", this, toString(currentMediaTime()).utf8().data()); 2602 2620 2603 2621 // 15 - Run the time maches on steps. -
trunk/Source/WebCore/html/HTMLMediaElement.h
r188234 r188390 636 636 void seekWithTolerance(const MediaTime&, const MediaTime& negativeTolerance, const MediaTime& positiveTolerance, bool fromDOM); 637 637 void finishSeek(); 638 void c heckIfSeekNeeded();638 void clearSeeking(); 639 639 void addPlayedRange(const MediaTime& start, const MediaTime& end); 640 640 … … 798 798 }; 799 799 std::unique_ptr<PendingSeek> m_pendingSeek; 800 SeekType m_pendingSeekType { NoSeek }; 800 801 801 802 double m_volume; -
trunk/Source/WebCore/html/HTMLMediaElementEnums.h
r186016 r188390 50 50 enum TextTrackVisibilityCheckType { CheckTextTrackVisibility, AssumeTextTrackVisibilityChanged }; 51 51 enum InvalidURLAction { DoNothing, Complain }; 52 53 typedef enum { 54 NoSeek, 55 Fast, 56 Precise 57 } SeekType; 52 58 }; 53 59 -
trunk/Source/WebCore/platform/GenericTaskQueue.h
r187655 r188390 103 103 if (!weakThis) 104 104 return; 105 ASSERT(weakThis->m_pendingTasks); 106 --weakThis->m_pendingTasks; 105 107 task(); 106 108 }); -
trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp
r188002 r188390 274 274 if (time > durationMediaTime()) 275 275 time = durationMediaTime(); 276 277 if (currentMediaTime() == time)278 return;279 276 280 277 if (currentTextTrack()) … … 685 682 void MediaPlayerPrivateAVFoundation::invalidateCachedDuration() 686 683 { 687 LOG(Media, "MediaPlayerPrivateAVFoundation::invalidateCachedDuration(%p)", this);688 689 684 m_cachedDuration = MediaTime::invalidTime(); 690 685 -
trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
r187044 r188390 1306 1306 auto weakThis = createWeakPtr(); 1307 1307 1308 LOG(Media, "MediaPlayerPrivateAVFoundationObjC::seekToTime(%p) - calling seekToTime", this); 1309 1308 1310 [m_avPlayerItem.get() seekToTime:cmTime toleranceBefore:cmBefore toleranceAfter:cmAfter completionHandler:^(BOOL finished) { 1309 callOnMainThread([weakThis, finished] { 1311 double currentTime = CMTimeGetSeconds([m_avPlayerItem currentTime]); 1312 callOnMainThread([weakThis, finished, currentTime] { 1313 UNUSED_PARAM(currentTime); 1310 1314 auto _this = weakThis.get(); 1315 LOG(Media, "MediaPlayerPrivateAVFoundationObjC::seekToTime(%p) - completion handler called, currentTime = %f", _this, currentTime); 1311 1316 if (!_this) 1312 1317 return;
Note: See TracChangeset
for help on using the changeset viewer.