Modified: trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp (241944 => 241945)
--- trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp 2019-02-22 13:43:10 UTC (rev 241944)
+++ trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp 2019-02-22 13:52:18 UTC (rev 241945)
@@ -990,7 +990,7 @@
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 @@
#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 @@
}
#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::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);
}
}
Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (241944 => 241945)
--- trunk/Source/WebCore/html/HTMLMediaElement.cpp 2019-02-22 13:43:10 UTC (rev 241944)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp 2019-02-22 13:52:18 UTC (rev 241945)
@@ -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::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 @@
{
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 @@
if (resource) {
url = ""
- 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 @@
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 @@
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 @@
#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 @@
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 @@
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 @@
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 @@
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 @@
// 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");
}
}
Modified: trunk/Source/WebCore/html/MediaElementSession.cpp (241944 => 241945)
--- trunk/Source/WebCore/html/MediaElementSession.cpp 2019-02-22 13:43:10 UTC (rev 241944)
+++ trunk/Source/WebCore/html/MediaElementSession.cpp 2019-02-22 13:52:18 UTC (rev 241945)
@@ -977,6 +977,22 @@
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)
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm (241944 => 241945)
--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm 2019-02-22 13:43:10 UTC (rev 241944)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm 2019-02-22 13:52:18 UTC (rev 241945)
@@ -1117,7 +1117,7 @@
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);