WebKit Bugzilla
Attachment 362639 Details for
Bug 194915
: Update some media logging
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-194915-20190221163010.patch (text/plain), 15.24 KB, created by
Eric Carlson
on 2019-02-21 13:30:12 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Eric Carlson
Created:
2019-02-21 13:30:12 PST
Size:
15.24 KB
patch
obsolete
>Subversion Revision: 241771 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index a6da53fe8e04ad79dd06c117c410a040b2b97e76..6ec227e79b16ee01430fbe2edd40ee78e6aca447 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,38 @@ >+2019-02-21 Eric Carlson <eric.carlson@apple.com> >+ >+ Update some media logging >+ https://bugs.webkit.org/show_bug.cgi?id=194915 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ No new tests, no functional change. >+ >+ * Modules/mediasource/SourceBuffer.cpp: >+ (WebCore::SourceBuffer::evictCodedFrames): >+ (WebCore::SourceBuffer::provideMediaData): >+ (WebCore::SourceBuffer::trySignalAllSamplesInTrackEnqueued): >+ >+ * html/HTMLMediaElement.cpp: >+ (WebCore::HTMLMediaElement::checkPlaybackTargetCompatablity): >+ (WebCore::HTMLMediaElement::loadResource): >+ (WebCore::HTMLMediaElement::updateActiveTextTrackCues): >+ (WebCore::HTMLMediaElement::canTransitionFromAutoplayToPlay const): >+ (WebCore::HTMLMediaElement::seekTask): >+ (WebCore::HTMLMediaElement::playInternal): >+ (WebCore::HTMLMediaElement::pauseInternal): >+ (WebCore::HTMLMediaElement::setLoop): >+ (WebCore::HTMLMediaElement::setControls): >+ (WebCore::HTMLMediaElement::sourceWasRemoved): >+ >+ * html/MediaElementSession.cpp: >+ (WebCore::convertEnumerationToString): >+ >+ * html/MediaElementSession.h: >+ (WTF::LogArgument<WebCore::MediaPlaybackDenialReason>::toString): >+ >+ * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: >+ (WebCore::SourceBufferPrivateAVFObjC::enqueueSample): >+ > 2019-02-19 Commit Queue <commit-queue@webkit.org> > > Unreviewed, rolling out r241722. >diff --git a/Source/WebCore/Modules/mediasource/SourceBuffer.cpp b/Source/WebCore/Modules/mediasource/SourceBuffer.cpp >index 4e8355186c6ac2187cee1f851a776e0954b3c150..f37327ff194ace7d262782692be9ffb5ea69e6d6 100644 >--- a/Source/WebCore/Modules/mediasource/SourceBuffer.cpp >+++ b/Source/WebCore/Modules/mediasource/SourceBuffer.cpp >@@ -990,7 +990,7 @@ void SourceBuffer::evictCodedFrames(size_t newDataSize) > size_t currentTimeRange = buffered.find(currentTime); > if (currentTimeRange == notFound || currentTimeRange == buffered.length() - 1) { > #if !RELEASE_LOG_DISABLED >- ERROR_LOG(LOGIDENTIFIER, "evicted ", initialBufferedSize - extraMemoryCost(), " bytes but FAILED to free enough"); >+ ERROR_LOG(LOGIDENTIFIER, "FAILED to free enough after evicting ", initialBufferedSize - extraMemoryCost()); > #endif > return; > } >@@ -1025,7 +1025,7 @@ void SourceBuffer::evictCodedFrames(size_t newDataSize) > > #if !RELEASE_LOG_DISABLED > if (m_bufferFull) >- ERROR_LOG(LOGIDENTIFIER, "evicted ", initialBufferedSize - extraMemoryCost(), " but FAILED to free enough"); >+ ERROR_LOG(LOGIDENTIFIER, "FAILED to free enough after evicting ", initialBufferedSize - extraMemoryCost()); > else > DEBUG_LOG(LOGIDENTIFIER, "evicted ", initialBufferedSize - extraMemoryCost()); > #endif >@@ -2043,7 +2043,7 @@ void SourceBuffer::provideMediaData(TrackBuffer& trackBuffer, const AtomicString > } > > #if !RELEASE_LOG_DISABLED >- DEBUG_LOG(LOGIDENTIFIER, "Enqueued ", enqueuedSamples, " samples, ", static_cast<size_t>(trackBuffer.decodeQueue.size()), " remaining"); >+ DEBUG_LOG(LOGIDENTIFIER, "enqueued ", enqueuedSamples, " samples, ", static_cast<size_t>(trackBuffer.decodeQueue.size()), " remaining"); > #endif > > trySignalAllSamplesInTrackEnqueued(trackID); >@@ -2052,7 +2052,7 @@ void SourceBuffer::provideMediaData(TrackBuffer& trackBuffer, const AtomicString > void SourceBuffer::trySignalAllSamplesInTrackEnqueued(const AtomicString& trackID) > { > if (m_source->isEnded() && m_trackBufferMap.get(trackID).decodeQueue.empty()) { >- DEBUG_LOG(LOGIDENTIFIER, "All samples in track ", trackID, " enqueued"); >+ DEBUG_LOG(LOGIDENTIFIER, "enqueued all samples from track ", trackID); > m_private->allSamplesInTrackEnqueued(trackID); > } > } >diff --git a/Source/WebCore/html/HTMLMediaElement.cpp b/Source/WebCore/html/HTMLMediaElement.cpp >index 88eae188a0ea032508a5700663601d0397a960c9..b3eb7bbc3217f434b5671838b2a3d80433426adf 100644 >--- a/Source/WebCore/html/HTMLMediaElement.cpp >+++ b/Source/WebCore/html/HTMLMediaElement.cpp >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2007-2018 Apple Inc. All rights reserved. >+ * Copyright (C) 2007-2019 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -1105,8 +1105,11 @@ void HTMLMediaElement::scheduleCheckPlaybackTargetCompatability() > void HTMLMediaElement::checkPlaybackTargetCompatablity() > { > #if ENABLE(WIRELESS_PLAYBACK_TARGET) >+ auto logSiteIdentifier = LOGIDENTIFIER; >+ ALWAYS_LOG(logSiteIdentifier, "task scheduled"); > if (m_isPlayingToWirelessTarget && !m_player->canPlayToWirelessPlaybackTarget()) { >- INFO_LOG(LOGIDENTIFIER, "calling setShouldPlayToPlaybackTarget(false)"); >+ UNUSED_PARAM(logSiteIdentifier); >+ INFO_LOG(logSiteIdentifier, "calling setShouldPlayToPlaybackTarget(false)"); > m_failedToPlayToWirelessTarget = true; > m_player->setShouldPlayToPlaybackTarget(false); > } >@@ -1513,7 +1516,7 @@ void HTMLMediaElement::loadResource(const URL& initialURL, ContentType& contentT > { > ASSERT(initialURL.isEmpty() || isSafeToLoadURL(initialURL, Complain)); > >- INFO_LOG(LOGIDENTIFIER, initialURL, contentType.raw(), keySystem); >+ INFO_LOG(LOGIDENTIFIER, initialURL, contentType, keySystem); > > RefPtr<Frame> frame = document().frame(); > if (!frame) { >@@ -1567,7 +1570,7 @@ void HTMLMediaElement::loadResource(const URL& initialURL, ContentType& contentT > > if (resource) { > url = ApplicationCacheHost::createFileURL(resource->path()); >- INFO_LOG(LOGIDENTIFIER, "will load ", url, " from app cache"); >+ INFO_LOG(LOGIDENTIFIER, "will load from app cache ", url); > } > > INFO_LOG(LOGIDENTIFIER, "m_currentSrc is ", m_currentSrc); >@@ -1783,7 +1786,7 @@ void HTMLMediaElement::updateActiveTextTrackCues(const MediaTime& movieTime) > return; > > auto currentMediaTime = weakThis->currentMediaTime(); >- INFO_LOG(LOGIDENTIFIER, " lambda, currentMediaTime:", currentMediaTime); >+ INFO_LOG(LOGIDENTIFIER, " lambda, currentMediaTime: ", currentMediaTime); > weakThis->updateActiveTextTrackCues(currentMediaTime); > }, nextInterestingTime); > } >@@ -2405,17 +2408,44 @@ void HTMLMediaElement::mediaPlayerReadyStateChanged(MediaPlayer*) > > SuccessOr<MediaPlaybackDenialReason> HTMLMediaElement::canTransitionFromAutoplayToPlay() const > { >- if (isAutoplaying() >- && mediaSession().autoplayPermitted() >- && paused() >- && autoplay() >- && !pausedForUserInteraction() >- && !document().isSandboxed(SandboxAutomaticFeatures) >- && m_readyState == HAVE_ENOUGH_DATA) >- return mediaSession().playbackPermitted(); >+ if (m_readyState != HAVE_ENOUGH_DATA) { >+ ALWAYS_LOG(LOGIDENTIFIER, "m_readyState != HAVE_ENOUGH_DATA"); >+ return MediaPlaybackDenialReason::PageConsentRequired; >+ } >+ if (!isAutoplaying()) { >+ ALWAYS_LOG(LOGIDENTIFIER, "!isAutoplaying"); >+ return MediaPlaybackDenialReason::PageConsentRequired; >+ } >+ if (!mediaSession().autoplayPermitted()) { >+ ALWAYS_LOG(LOGIDENTIFIER, "!mediaSession().autoplayPermitted"); >+ return MediaPlaybackDenialReason::PageConsentRequired; >+ } >+ if (!paused()) { >+ ALWAYS_LOG(LOGIDENTIFIER, "!paused"); >+ return MediaPlaybackDenialReason::PageConsentRequired; >+ } >+ if (!autoplay()) { >+ ALWAYS_LOG(LOGIDENTIFIER, "!autoplay"); >+ return MediaPlaybackDenialReason::PageConsentRequired; >+ } >+ if (pausedForUserInteraction()) { >+ ALWAYS_LOG(LOGIDENTIFIER, "pausedForUserInteraction"); >+ return MediaPlaybackDenialReason::PageConsentRequired; >+ } >+ if (document().isSandboxed(SandboxAutomaticFeatures)) { >+ ALWAYS_LOG(LOGIDENTIFIER, "isSandboxed"); >+ return MediaPlaybackDenialReason::PageConsentRequired; >+ } > >- ALWAYS_LOG(LOGIDENTIFIER, "page consent required"); >- return MediaPlaybackDenialReason::PageConsentRequired; >+ auto permitted = mediaSession().playbackPermitted(); >+#if !RELEASE_LOG_DISABLED >+ if (!permitted) >+ ALWAYS_LOG(LOGIDENTIFIER, permitted.value()); >+ else >+ ALWAYS_LOG(LOGIDENTIFIER, "can transition!"); >+#endif >+ >+ return permitted; > } > > void HTMLMediaElement::dispatchPlayPauseEventsIfNeedsQuirks() >@@ -3095,7 +3125,7 @@ void HTMLMediaElement::seekTask() > #endif > > if (noSeekRequired) { >- INFO_LOG(LOGIDENTIFIER, "seek to ", time, " ignored"); >+ INFO_LOG(LOGIDENTIFIER, "ignored seek to ", time); > if (time == now) { > scheduleEvent(eventNames().seekingEvent); > scheduleTimeupdateEvent(false); >@@ -3530,17 +3560,17 @@ void HTMLMediaElement::playInternal() > ALWAYS_LOG(LOGIDENTIFIER); > > if (isSuspended()) { >- ALWAYS_LOG(LOGIDENTIFIER, " returning because context is suspended"); >+ ALWAYS_LOG(LOGIDENTIFIER, "returning because context is suspended"); > return; > } > > if (!document().hasBrowsingContext()) { >- INFO_LOG(LOGIDENTIFIER, " returning because there is no browsing context"); >+ INFO_LOG(LOGIDENTIFIER, "returning because there is no browsing context"); > return; > } > > if (!m_mediaSession->clientWillBeginPlayback()) { >- ALWAYS_LOG(LOGIDENTIFIER, " returning because of interruption"); >+ ALWAYS_LOG(LOGIDENTIFIER, "returning because of interruption"); > return; > } > >@@ -3627,17 +3657,17 @@ void HTMLMediaElement::pauseInternal() > ALWAYS_LOG(LOGIDENTIFIER); > > if (isSuspended()) { >- ALWAYS_LOG(LOGIDENTIFIER, " returning because context is suspended"); >+ ALWAYS_LOG(LOGIDENTIFIER, "returning because context is suspended"); > return; > } > > if (!document().hasBrowsingContext()) { >- INFO_LOG(LOGIDENTIFIER, " returning because there is no browsing context"); >+ INFO_LOG(LOGIDENTIFIER, "returning because there is no browsing context"); > return; > } > > if (!m_mediaSession->clientWillPausePlayback()) { >- ALWAYS_LOG(LOGIDENTIFIER, " returning because of interruption"); >+ ALWAYS_LOG(LOGIDENTIFIER, "returning because of interruption"); > return; > } > >@@ -3687,10 +3717,10 @@ bool HTMLMediaElement::loop() const > return hasAttributeWithoutSynchronization(loopAttr); > } > >-void HTMLMediaElement::setLoop(bool b) >+void HTMLMediaElement::setLoop(bool loop) > { >- INFO_LOG(LOGIDENTIFIER, b); >- setBooleanAttribute(loopAttr, b); >+ INFO_LOG(LOGIDENTIFIER, loop); >+ setBooleanAttribute(loopAttr, loop); > } > > bool HTMLMediaElement::controls() const >@@ -3704,10 +3734,10 @@ bool HTMLMediaElement::controls() const > return hasAttributeWithoutSynchronization(controlsAttr); > } > >-void HTMLMediaElement::setControls(bool b) >+void HTMLMediaElement::setControls(bool controls) > { >- INFO_LOG(LOGIDENTIFIER, b); >- setBooleanAttribute(controlsAttr, b); >+ INFO_LOG(LOGIDENTIFIER, controls); >+ setBooleanAttribute(controlsAttr, controls); > } > > double HTMLMediaElement::volume() const >@@ -4803,7 +4833,7 @@ void HTMLMediaElement::sourceWasRemoved(HTMLSourceElement& source) > // 4.8.8 - Dynamically modifying a source element and its attribute when the element is already > // inserted in a video or audio element will have no effect. > m_currentSourceNode = nullptr; >- INFO_LOG(LOGIDENTIFIER, "m_currentSourceNode set to 0"); >+ INFO_LOG(LOGIDENTIFIER, "m_currentSourceNode cleared"); > } > } > >diff --git a/Source/WebCore/html/MediaElementSession.cpp b/Source/WebCore/html/MediaElementSession.cpp >index 71ac9956883102752def4d877501226402645a6f..391740e3a80c09d4300210736ee7c8609048428c 100644 >--- a/Source/WebCore/html/MediaElementSession.cpp >+++ b/Source/WebCore/html/MediaElementSession.cpp >@@ -977,6 +977,22 @@ bool MediaElementSession::allowsPlaybackControlsForAutoplayingAudio() const > return page && page->allowsPlaybackControlsForAutoplayingAudio(); > } > >+String convertEnumerationToString(const MediaPlaybackDenialReason enumerationValue) >+{ >+ static const NeverDestroyed<String> values[] = { >+ MAKE_STATIC_STRING_IMPL("UserGestureRequired"), >+ MAKE_STATIC_STRING_IMPL("FullscreenRequired"), >+ MAKE_STATIC_STRING_IMPL("PageConsentRequired"), >+ MAKE_STATIC_STRING_IMPL("InvalidState"), >+ }; >+ static_assert(static_cast<size_t>(MediaPlaybackDenialReason::UserGestureRequired) == 0, "MediaPlaybackDenialReason::UserGestureRequired is not 0 as expected"); >+ static_assert(static_cast<size_t>(MediaPlaybackDenialReason::FullscreenRequired) == 1, "MediaPlaybackDenialReason::FullscreenRequired is not 1 as expected"); >+ static_assert(static_cast<size_t>(MediaPlaybackDenialReason::PageConsentRequired) == 2, "MediaPlaybackDenialReason::PageConsentRequired is not 2 as expected"); >+ static_assert(static_cast<size_t>(MediaPlaybackDenialReason::InvalidState) == 3, "MediaPlaybackDenialReason::InvalidState is not 3 as expected"); >+ ASSERT(static_cast<size_t>(enumerationValue) < WTF_ARRAY_LENGTH(values)); >+ return values[static_cast<size_t>(enumerationValue)]; >+} >+ > } > > #endif // ENABLE(VIDEO) >diff --git a/Source/WebCore/html/MediaElementSession.h b/Source/WebCore/html/MediaElementSession.h >index 597ba27729acc8f2e2e78caf964f5fc808e2a01e..c1d7d3817081d338fa74fbb8c6f663f6c0715dd0 100644 >--- a/Source/WebCore/html/MediaElementSession.h >+++ b/Source/WebCore/html/MediaElementSession.h >@@ -206,8 +206,26 @@ private: > #endif > }; > >+String convertEnumerationToString(const MediaPlaybackDenialReason); >+ > } // namespace WebCore > >+namespace WTF { >+ >+template<typename Type> >+struct LogArgument; >+ >+template <> >+struct LogArgument<WebCore::MediaPlaybackDenialReason> { >+ static String toString(const WebCore::MediaPlaybackDenialReason reason) >+ { >+ return convertEnumerationToString(reason); >+ } >+}; >+ >+}; // namespace WTF >+ >+ > SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::MediaElementSession) > static bool isType(const WebCore::PlatformMediaSession& session) { return WebCore::MediaElementSession::isMediaElementSessionMediaType(session.mediaType()); } > SPECIALIZE_TYPE_TRAITS_END() >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm b/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm >index 992f4593e4f5839c2034a469db763b7e229cf654..d66b4db5bbf182f7f7c5f77f9624cc6b7824d65d 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm >@@ -1117,7 +1117,7 @@ void SourceBufferPrivateAVFObjC::enqueueSample(Ref<MediaSample>&& sample, const > if (platformSample.type != PlatformSample::CMSampleBufferType) > return; > >- DEBUG_LOG(LOGIDENTIFIER, "track ID = ", trackID, "sample = ", sample.get()); >+ DEBUG_LOG(LOGIDENTIFIER, "track ID = ", trackID, ", sample = ", sample.get()); > > if (trackID == m_enabledVideoTrackID) { > CMFormatDescriptionRef formatDescription = CMSampleBufferGetFormatDescription(platformSample.sample.cmSampleBuffer);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 194915
: 362639