Changeset 241945 in webkit
- Timestamp:
- Feb 22, 2019 5:52:18 AM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r241942 r241945 1 2019-02-22 Eric Carlson <eric.carlson@apple.com> 2 3 Update some media logging 4 https://bugs.webkit.org/show_bug.cgi?id=194915 5 6 Reviewed by Jer Noble. 7 8 No new tests, no functional change. 9 10 * Modules/mediasource/SourceBuffer.cpp: 11 (WebCore::SourceBuffer::evictCodedFrames): 12 (WebCore::SourceBuffer::provideMediaData): 13 (WebCore::SourceBuffer::trySignalAllSamplesInTrackEnqueued): 14 15 * html/HTMLMediaElement.cpp: 16 (WebCore::HTMLMediaElement::checkPlaybackTargetCompatablity): 17 (WebCore::HTMLMediaElement::loadResource): 18 (WebCore::HTMLMediaElement::updateActiveTextTrackCues): 19 (WebCore::HTMLMediaElement::canTransitionFromAutoplayToPlay const): 20 (WebCore::HTMLMediaElement::seekTask): 21 (WebCore::HTMLMediaElement::playInternal): 22 (WebCore::HTMLMediaElement::pauseInternal): 23 (WebCore::HTMLMediaElement::setLoop): 24 (WebCore::HTMLMediaElement::setControls): 25 (WebCore::HTMLMediaElement::sourceWasRemoved): 26 27 * html/MediaElementSession.cpp: 28 (WebCore::convertEnumerationToString): 29 30 * html/MediaElementSession.h: 31 (WTF::LogArgument<WebCore::MediaPlaybackDenialReason>::toString): 32 33 * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: 34 (WebCore::SourceBufferPrivateAVFObjC::enqueueSample): 35 1 36 2019-02-22 Rob Buis <rbuis@igalia.com> 2 37 -
trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp
r241472 r241945 991 991 if (currentTimeRange == notFound || currentTimeRange == buffered.length() - 1) { 992 992 #if !RELEASE_LOG_DISABLED 993 ERROR_LOG(LOGIDENTIFIER, " evicted ", initialBufferedSize - extraMemoryCost(), " bytes but FAILED to free enough");993 ERROR_LOG(LOGIDENTIFIER, "FAILED to free enough after evicting ", initialBufferedSize - extraMemoryCost()); 994 994 #endif 995 995 return; … … 1026 1026 #if !RELEASE_LOG_DISABLED 1027 1027 if (m_bufferFull) 1028 ERROR_LOG(LOGIDENTIFIER, " evicted ", initialBufferedSize - extraMemoryCost(), " but FAILED to free enough");1028 ERROR_LOG(LOGIDENTIFIER, "FAILED to free enough after evicting ", initialBufferedSize - extraMemoryCost()); 1029 1029 else 1030 1030 DEBUG_LOG(LOGIDENTIFIER, "evicted ", initialBufferedSize - extraMemoryCost()); … … 2044 2044 2045 2045 #if !RELEASE_LOG_DISABLED 2046 DEBUG_LOG(LOGIDENTIFIER, " Enqueued ", enqueuedSamples, " samples, ", static_cast<size_t>(trackBuffer.decodeQueue.size()), " remaining");2046 DEBUG_LOG(LOGIDENTIFIER, "enqueued ", enqueuedSamples, " samples, ", static_cast<size_t>(trackBuffer.decodeQueue.size()), " remaining"); 2047 2047 #endif 2048 2048 … … 2053 2053 { 2054 2054 if (m_source->isEnded() && m_trackBufferMap.get(trackID).decodeQueue.empty()) { 2055 DEBUG_LOG(LOGIDENTIFIER, " All samples in track ", trackID, " enqueued");2055 DEBUG_LOG(LOGIDENTIFIER, "enqueued all samples from track ", trackID); 2056 2056 m_private->allSamplesInTrackEnqueued(trackID); 2057 2057 } -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r241487 r241945 1 1 /* 2 * Copyright (C) 2007-201 8Apple Inc. All rights reserved.2 * Copyright (C) 2007-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 1106 1106 { 1107 1107 #if ENABLE(WIRELESS_PLAYBACK_TARGET) 1108 auto logSiteIdentifier = LOGIDENTIFIER; 1109 ALWAYS_LOG(logSiteIdentifier, "task scheduled"); 1108 1110 if (m_isPlayingToWirelessTarget && !m_player->canPlayToWirelessPlaybackTarget()) { 1109 INFO_LOG(LOGIDENTIFIER, "calling setShouldPlayToPlaybackTarget(false)"); 1111 UNUSED_PARAM(logSiteIdentifier); 1112 INFO_LOG(logSiteIdentifier, "calling setShouldPlayToPlaybackTarget(false)"); 1110 1113 m_failedToPlayToWirelessTarget = true; 1111 1114 m_player->setShouldPlayToPlaybackTarget(false); … … 1514 1517 ASSERT(initialURL.isEmpty() || isSafeToLoadURL(initialURL, Complain)); 1515 1518 1516 INFO_LOG(LOGIDENTIFIER, initialURL, contentType .raw(), keySystem);1519 INFO_LOG(LOGIDENTIFIER, initialURL, contentType, keySystem); 1517 1520 1518 1521 RefPtr<Frame> frame = document().frame(); … … 1568 1571 if (resource) { 1569 1572 url = ApplicationCacheHost::createFileURL(resource->path()); 1570 INFO_LOG(LOGIDENTIFIER, "will load ", url, " from app cache");1573 INFO_LOG(LOGIDENTIFIER, "will load from app cache ", url); 1571 1574 } 1572 1575 … … 1784 1787 1785 1788 auto currentMediaTime = weakThis->currentMediaTime(); 1786 INFO_LOG(LOGIDENTIFIER, " lambda, currentMediaTime: ", currentMediaTime);1789 INFO_LOG(LOGIDENTIFIER, " lambda, currentMediaTime: ", currentMediaTime); 1787 1790 weakThis->updateActiveTextTrackCues(currentMediaTime); 1788 1791 }, nextInterestingTime); … … 2406 2409 SuccessOr<MediaPlaybackDenialReason> HTMLMediaElement::canTransitionFromAutoplayToPlay() const 2407 2410 { 2408 if (isAutoplaying() 2409 && mediaSession().autoplayPermitted() 2410 && paused() 2411 && autoplay() 2412 && !pausedForUserInteraction() 2413 && !document().isSandboxed(SandboxAutomaticFeatures) 2414 && m_readyState == HAVE_ENOUGH_DATA) 2415 return mediaSession().playbackPermitted(); 2416 2417 ALWAYS_LOG(LOGIDENTIFIER, "page consent required"); 2418 return MediaPlaybackDenialReason::PageConsentRequired; 2411 if (m_readyState != HAVE_ENOUGH_DATA) { 2412 ALWAYS_LOG(LOGIDENTIFIER, "m_readyState != HAVE_ENOUGH_DATA"); 2413 return MediaPlaybackDenialReason::PageConsentRequired; 2414 } 2415 if (!isAutoplaying()) { 2416 ALWAYS_LOG(LOGIDENTIFIER, "!isAutoplaying"); 2417 return MediaPlaybackDenialReason::PageConsentRequired; 2418 } 2419 if (!mediaSession().autoplayPermitted()) { 2420 ALWAYS_LOG(LOGIDENTIFIER, "!mediaSession().autoplayPermitted"); 2421 return MediaPlaybackDenialReason::PageConsentRequired; 2422 } 2423 if (!paused()) { 2424 ALWAYS_LOG(LOGIDENTIFIER, "!paused"); 2425 return MediaPlaybackDenialReason::PageConsentRequired; 2426 } 2427 if (!autoplay()) { 2428 ALWAYS_LOG(LOGIDENTIFIER, "!autoplay"); 2429 return MediaPlaybackDenialReason::PageConsentRequired; 2430 } 2431 if (pausedForUserInteraction()) { 2432 ALWAYS_LOG(LOGIDENTIFIER, "pausedForUserInteraction"); 2433 return MediaPlaybackDenialReason::PageConsentRequired; 2434 } 2435 if (document().isSandboxed(SandboxAutomaticFeatures)) { 2436 ALWAYS_LOG(LOGIDENTIFIER, "isSandboxed"); 2437 return MediaPlaybackDenialReason::PageConsentRequired; 2438 } 2439 2440 auto permitted = mediaSession().playbackPermitted(); 2441 #if !RELEASE_LOG_DISABLED 2442 if (!permitted) 2443 ALWAYS_LOG(LOGIDENTIFIER, permitted.value()); 2444 else 2445 ALWAYS_LOG(LOGIDENTIFIER, "can transition!"); 2446 #endif 2447 2448 return permitted; 2419 2449 } 2420 2450 … … 3096 3126 3097 3127 if (noSeekRequired) { 3098 INFO_LOG(LOGIDENTIFIER, " seek to ", time, " ignored");3128 INFO_LOG(LOGIDENTIFIER, "ignored seek to ", time); 3099 3129 if (time == now) { 3100 3130 scheduleEvent(eventNames().seekingEvent); … … 3531 3561 3532 3562 if (isSuspended()) { 3533 ALWAYS_LOG(LOGIDENTIFIER, " 3563 ALWAYS_LOG(LOGIDENTIFIER, "returning because context is suspended"); 3534 3564 return; 3535 3565 } 3536 3566 3537 3567 if (!document().hasBrowsingContext()) { 3538 INFO_LOG(LOGIDENTIFIER, " 3568 INFO_LOG(LOGIDENTIFIER, "returning because there is no browsing context"); 3539 3569 return; 3540 3570 } 3541 3571 3542 3572 if (!m_mediaSession->clientWillBeginPlayback()) { 3543 ALWAYS_LOG(LOGIDENTIFIER, " 3573 ALWAYS_LOG(LOGIDENTIFIER, "returning because of interruption"); 3544 3574 return; 3545 3575 } … … 3628 3658 3629 3659 if (isSuspended()) { 3630 ALWAYS_LOG(LOGIDENTIFIER, " 3660 ALWAYS_LOG(LOGIDENTIFIER, "returning because context is suspended"); 3631 3661 return; 3632 3662 } 3633 3663 3634 3664 if (!document().hasBrowsingContext()) { 3635 INFO_LOG(LOGIDENTIFIER, " 3665 INFO_LOG(LOGIDENTIFIER, "returning because there is no browsing context"); 3636 3666 return; 3637 3667 } 3638 3668 3639 3669 if (!m_mediaSession->clientWillPausePlayback()) { 3640 ALWAYS_LOG(LOGIDENTIFIER, " 3670 ALWAYS_LOG(LOGIDENTIFIER, "returning because of interruption"); 3641 3671 return; 3642 3672 } … … 3688 3718 } 3689 3719 3690 void HTMLMediaElement::setLoop(bool b)3691 { 3692 INFO_LOG(LOGIDENTIFIER, b);3693 setBooleanAttribute(loopAttr, b);3720 void HTMLMediaElement::setLoop(bool loop) 3721 { 3722 INFO_LOG(LOGIDENTIFIER, loop); 3723 setBooleanAttribute(loopAttr, loop); 3694 3724 } 3695 3725 … … 3705 3735 } 3706 3736 3707 void HTMLMediaElement::setControls(bool b)3708 { 3709 INFO_LOG(LOGIDENTIFIER, b);3710 setBooleanAttribute(controlsAttr, b);3737 void HTMLMediaElement::setControls(bool controls) 3738 { 3739 INFO_LOG(LOGIDENTIFIER, controls); 3740 setBooleanAttribute(controlsAttr, controls); 3711 3741 } 3712 3742 … … 4804 4834 // inserted in a video or audio element will have no effect. 4805 4835 m_currentSourceNode = nullptr; 4806 INFO_LOG(LOGIDENTIFIER, "m_currentSourceNode set to 0");4836 INFO_LOG(LOGIDENTIFIER, "m_currentSourceNode cleared"); 4807 4837 } 4808 4838 } -
trunk/Source/WebCore/html/MediaElementSession.cpp
r241548 r241945 978 978 } 979 979 980 String convertEnumerationToString(const MediaPlaybackDenialReason enumerationValue) 981 { 982 static const NeverDestroyed<String> values[] = { 983 MAKE_STATIC_STRING_IMPL("UserGestureRequired"), 984 MAKE_STATIC_STRING_IMPL("FullscreenRequired"), 985 MAKE_STATIC_STRING_IMPL("PageConsentRequired"), 986 MAKE_STATIC_STRING_IMPL("InvalidState"), 987 }; 988 static_assert(static_cast<size_t>(MediaPlaybackDenialReason::UserGestureRequired) == 0, "MediaPlaybackDenialReason::UserGestureRequired is not 0 as expected"); 989 static_assert(static_cast<size_t>(MediaPlaybackDenialReason::FullscreenRequired) == 1, "MediaPlaybackDenialReason::FullscreenRequired is not 1 as expected"); 990 static_assert(static_cast<size_t>(MediaPlaybackDenialReason::PageConsentRequired) == 2, "MediaPlaybackDenialReason::PageConsentRequired is not 2 as expected"); 991 static_assert(static_cast<size_t>(MediaPlaybackDenialReason::InvalidState) == 3, "MediaPlaybackDenialReason::InvalidState is not 3 as expected"); 992 ASSERT(static_cast<size_t>(enumerationValue) < WTF_ARRAY_LENGTH(values)); 993 return values[static_cast<size_t>(enumerationValue)]; 994 } 995 980 996 } 981 997 -
trunk/Source/WebCore/html/MediaElementSession.h
r241548 r241945 207 207 }; 208 208 209 String convertEnumerationToString(const MediaPlaybackDenialReason); 210 209 211 } // namespace WebCore 212 213 namespace WTF { 214 215 template<typename Type> 216 struct LogArgument; 217 218 template <> 219 struct LogArgument<WebCore::MediaPlaybackDenialReason> { 220 static String toString(const WebCore::MediaPlaybackDenialReason reason) 221 { 222 return convertEnumerationToString(reason); 223 } 224 }; 225 226 }; // namespace WTF 227 210 228 211 229 SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::MediaElementSession) -
trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm
r241479 r241945 1118 1118 return; 1119 1119 1120 DEBUG_LOG(LOGIDENTIFIER, "track ID = ", trackID, " sample = ", sample.get());1120 DEBUG_LOG(LOGIDENTIFIER, "track ID = ", trackID, ", sample = ", sample.get()); 1121 1121 1122 1122 if (trackID == m_enabledVideoTrackID) {
Note: See TracChangeset
for help on using the changeset viewer.