Diff
Modified: branches/safari-604-branch/Source/WebCore/ChangeLog (223181 => 223182)
--- branches/safari-604-branch/Source/WebCore/ChangeLog 2017-10-11 16:09:23 UTC (rev 223181)
+++ branches/safari-604-branch/Source/WebCore/ChangeLog 2017-10-11 16:09:26 UTC (rev 223182)
@@ -1,5 +1,26 @@
2017-10-10 Jason Marcell <[email protected]>
+ Cherry-pick r221937. rdar://problem/34893195
+
+ 2017-09-12 Jer Noble <[email protected]>
+
+ [MSE] Don't increase the reported totalFrameDelay for non-displayed frames (or frames coming in while paused).
+ https://bugs.webkit.org/show_bug.cgi?id=175900
+
+ Reviewed by Eric Carlson.
+
+ When seeking to a specific time, the decompression session necessarily needs to be fed samples from before that
+ time (i.e., all samples from the previous I-frame forward). These shouldn't contribute to the "total frame
+ delay" metric. Neither should samples delivered when the video is paused (like, during seeking), as a frame can't
+ be "late" if time is not moving forward.
+
+ * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
+ (WebCore::WebCoreDecompressionSession::handleDecompressionOutput):
+ * platform/cf/CoreMediaSoftLink.cpp:
+ * platform/cf/CoreMediaSoftLink.h:
+
+2017-10-10 Jason Marcell <[email protected]>
+
Cherry-pick r221872. rdar://problem/34891288
2017-09-11 Dean Jackson <[email protected]>
Modified: branches/safari-604-branch/Source/WebCore/platform/cf/CoreMediaSoftLink.cpp (223181 => 223182)
--- branches/safari-604-branch/Source/WebCore/platform/cf/CoreMediaSoftLink.cpp 2017-10-11 16:09:23 UTC (rev 223181)
+++ branches/safari-604-branch/Source/WebCore/platform/cf/CoreMediaSoftLink.cpp 2017-10-11 16:09:26 UTC (rev 223182)
@@ -102,6 +102,7 @@
SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreMedia, CMSetAttachment, void, (CMAttachmentBearerRef target, CFStringRef key, CFTypeRef value, CMAttachmentMode attachmentMode), (target, key, value, attachmentMode))
SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreMedia, CMTimebaseCreateWithMasterClock, OSStatus, (CFAllocatorRef allocator, CMClockRef masterClock, CMTimebaseRef *timebaseOut), (allocator, masterClock, timebaseOut))
SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreMedia, CMTimebaseGetTime, CMTime, (CMTimebaseRef timebase), (timebase))
+SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreMedia, CMTimebaseGetRate, Float64, (CMTimebaseRef timebase), (timebase))
SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreMedia, CMTimebaseSetRate, OSStatus, (CMTimebaseRef timebase, Float64 rate), (timebase, rate))
SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreMedia, CMTimebaseSetTime, OSStatus, (CMTimebaseRef timebase, CMTime time), (timebase, time))
SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreMedia, CMTimebaseGetEffectiveRate, Float64, (CMTimebaseRef timebase), (timebase))
Modified: branches/safari-604-branch/Source/WebCore/platform/cf/CoreMediaSoftLink.h (223181 => 223182)
--- branches/safari-604-branch/Source/WebCore/platform/cf/CoreMediaSoftLink.h 2017-10-11 16:09:23 UTC (rev 223181)
+++ branches/safari-604-branch/Source/WebCore/platform/cf/CoreMediaSoftLink.h 2017-10-11 16:09:26 UTC (rev 223182)
@@ -163,6 +163,8 @@
#define CMTimebaseCreateWithMasterClock softLink_CoreMedia_CMTimebaseCreateWithMasterClock
SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, CoreMedia, CMTimebaseGetTime, CMTime, (CMTimebaseRef timebase), (timebase))
#define CMTimebaseGetTime softLink_CoreMedia_CMTimebaseGetTime
+SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, CoreMedia, CMTimebaseGetRate, Float64, (CMTimebaseRef timebase), (timebase))
+#define CMTimebaseGetRate softLink_CoreMedia_CMTimebaseGetRate
SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, CoreMedia, CMTimebaseSetRate, OSStatus, (CMTimebaseRef timebase, Float64 rate), (timebase, rate))
#define CMTimebaseSetRate softLink_CoreMedia_CMTimebaseSetRate
SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, CoreMedia, CMTimebaseSetTime, OSStatus, (CMTimebaseRef timebase, CMTime time), (timebase, time))
Modified: branches/safari-604-branch/Source/WebCore/platform/graphics/cocoa/WebCoreDecompressionSession.mm (223181 => 223182)
--- branches/safari-604-branch/Source/WebCore/platform/graphics/cocoa/WebCoreDecompressionSession.mm 2017-10-11 16:09:23 UTC (rev 223181)
+++ branches/safari-604-branch/Source/WebCore/platform/graphics/cocoa/WebCoreDecompressionSession.mm 2017-10-11 16:09:26 UTC (rev 223182)
@@ -279,9 +279,12 @@
return;
}
- auto currentTime = CMTimebaseGetTime(m_timebase.get());
- if (m_timebase && CMTimeCompare(presentationTimeStamp, currentTime) < 0)
- m_totalFrameDelay += toMediaTime(CMTimeSubtract(currentTime, presentationTimeStamp));
+ if (displaying && m_timebase) {
+ auto currentTime = CMTimebaseGetTime(m_timebase.get());
+ auto currentRate = CMTimebaseGetRate(m_timebase.get());
+ if (currentRate > 0 && CMTimeCompare(presentationTimeStamp, currentTime) < 0)
+ m_totalFrameDelay += toMediaTime(CMTimeSubtract(currentTime, presentationTimeStamp));
+ }
dispatch_async(m_enqueingQueue.get(), [protectedThis = makeRefPtr(this), status, imageSampleBuffer = adoptCF(rawImageSampleBuffer), infoFlags, displaying] {
UNUSED_PARAM(infoFlags);