haikuwebkit/PerformanceTests/MediaTime/Makefile

3 lines
66 B
Makefile
Raw Permalink Normal View History

Playback stalls when a SourceBuffer append causes frame eviction https://bugs.webkit.org/show_bug.cgi?id=167834 Reviewed by Eric Carlson. PerformanceTests: Add an in-page performance test measuring the amount of time required to append a large amount of media data to a SourceBuffer, and then to completely remove that data 30s at a time. Add a microbenchmark for MediaTime which measures the amount of time required to create a 1M entry std::map and traverse the map 1M times. * Media/MSERemoveCodedFrames.html: Added. * Media/media-source-loader.js: (MediaSourceLoader.prototype.get duration): * MediaTime/Configurations/Base.xcconfig: Added. * MediaTime/Configurations/DebugRelease.xcconfig: Added. * MediaTime/Makefile: Added. * MediaTime/MediaTime.xcodeproj/project.pbxproj: Added. * MediaTime/main.cpp: Added. (performTest): (test): (main): * Skipped: Source/WebCore: Test: PerformanceTests/Media/MSERemoveCodedFrames.html Optimize searching through SampleMap by presentationTime. Many of the methods exposed by PresentationOrderSampleMap used the bare std::equal_range, lower_bound, or upper_bound methods. Unlike those methods exposed on std::map, the bare search methods perform a linear O(n) search, rather than a the binary O(log(n)) search used by std::map. Rewrite those methods using the bare methods in terms of the std::map search methods. Drive-by fix: rename findSampleOnOrAfterPresentationTime to findSampleStartingOnOrAfterPresentationTime to make the behavior of the method more explicit. * Modules/mediasource/SampleMap.cpp: (WebCore::PresentationOrderSampleMap::findSampleContainingPresentationTime): (WebCore::PresentationOrderSampleMap::findSampleStartingOnOrAfterPresentationTime): (WebCore::PresentationOrderSampleMap::reverseFindSampleBeforePresentationTime): (WebCore::DecodeOrderSampleMap::findSyncSampleAfterPresentationTime): (WebCore::PresentationOrderSampleMap::findSamplesBetweenPresentationTimes): (WebCore::PresentationOrderSampleMap::findSamplesWithinPresentationRange): (WebCore::PresentationOrderSampleMap::findSampleOnOrAfterPresentationTime): Deleted. * Modules/mediasource/SampleMap.h: (WebCore::PresentationOrderSampleMap::begin): (WebCore::PresentationOrderSampleMap::end): (WebCore::PresentationOrderSampleMap::rbegin): (WebCore::PresentationOrderSampleMap::rend): (WebCore::DecodeOrderSampleMap::begin): (WebCore::DecodeOrderSampleMap::end): (WebCore::DecodeOrderSampleMap::rbegin): (WebCore::DecodeOrderSampleMap::rend): (WebCore::SampleMap::SampleMap): (WebCore::SampleMap::sizeInBytes): (WebCore::SampleMap::decodeOrder): (WebCore::SampleMap::presentationOrder): * Modules/mediasource/SourceBuffer.cpp: (WebCore::removeSamplesFromTrackBuffer): (WebCore::SourceBuffer::removeCodedFrames): (WebCore::SourceBuffer::reenqueueMediaForTime): * WebCore.xcodeproj/project.pbxproj: Source/WTF: Optimize the MediaTime class; specifically the compare() method. The class only needs 6 bits to store the TimeFlags, so make that a uint8_t rather than uint32_t. The implementation is slightly simpler if the TimeScale is unsigned, so make that a uint32_t rather than int32_t. Inline the comparison operators. Optimize the equality comparison by bitwise-and'ing the flags together and masking the result. Optimize for common comparison scenarios (equal timeScales, equal timeValues(), etc.). Attempt the mathematically simpler simpler method for comparing ratios, and only fall back to the complex method if the results of multiplying the timeScale by the timeValue overflows. * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): (WTF::MediaTime::MediaTime): (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator!): (WTF::MediaTime::operator bool): (WTF::MediaTime::compare): (WTF::MediaTime::setTimeScale): (WTF::abs): (WTF::MediaTime::operator<): Deleted. (WTF::MediaTime::operator>): Deleted. (WTF::MediaTime::operator!=): Deleted. (WTF::MediaTime::operator==): Deleted. (WTF::MediaTime::operator>=): Deleted. (WTF::MediaTime::operator<=): Deleted. * wtf/MediaTime.h: Tools: Add new correctness tests for the Webcore::SampleMap class. Add additional subtests for the WTF::MediaTime class. * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebCore/SampleMap.cpp: Added. (WTF::operator<<): (TestWebKitAPI::TestSample::create): (TestWebKitAPI::TestSample::TestSample): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/184921@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211746 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-02-06 21:49:24 +00:00
SCRIPTS_PATH ?= ../../Tools/Scripts
include ../../Makefile.shared