Implement quality-of-service tiers in WebCoreDecompressionSession
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Oct 2017 19:56:34 +0000 (19:56 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Oct 2017 19:56:34 +0000 (19:56 +0000)
commit5469ef618604bc96e7b34593dd6bd3b7a9e20a3e
tree63f16e0324730726eea30ea14cd25318399079d7
parent4d07c3b7af31913856d166b4192c3c2dd3e2ceae
Implement quality-of-service tiers in WebCoreDecompressionSession
https://bugs.webkit.org/show_bug.cgi?id=177769

Reviewed by Dean Jackson.

VTDecompressionSession will suggest quality-of-service tiers to be used when decompression
can't keep up with playback speed. Use a simple exponential-moving-average heuristic to
determine when to move up and down the tiers.

Drive-by fix: When frames are so late that they miss the display deadline, mark them as
dropped rather than just delayed.

* platform/graphics/cocoa/WebCoreDecompressionSession.h:
* platform/graphics/cocoa/WebCoreDecompressionSession.mm:
(WebCore::WebCoreDecompressionSession::ensureDecompressionSessionForSample):
(WebCore::WebCoreDecompressionSession::decodeSample):
(WebCore::WebCoreDecompressionSession::handleDecompressionOutput):
(WebCore::WebCoreDecompressionSession::automaticDequeue):
(WebCore::WebCoreDecompressionSession::enqueueDecodedSample):
(WebCore::WebCoreDecompressionSession::resetQosTier):
(WebCore::WebCoreDecompressionSession::increaseQosTier):
(WebCore::WebCoreDecompressionSession::decreaseQosTier):
(WebCore::WebCoreDecompressionSession::updateQosWithDecodeTimeStatistics):
* platform/cocoa/VideoToolboxSoftLink.cpp:
* platform/cocoa/VideoToolboxSoftLink.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222803 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/cocoa/VideoToolboxSoftLink.cpp
Source/WebCore/platform/cocoa/VideoToolboxSoftLink.h
Source/WebCore/platform/graphics/cocoa/WebCoreDecompressionSession.h
Source/WebCore/platform/graphics/cocoa/WebCoreDecompressionSession.mm