haikuwebkit/PerformanceTests/MediaTime/Configurations/DebugRelease.xcconfig

56 lines
2.5 KiB
Plaintext
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
// Copyright (C) 2009, 2010, 2013 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "Base.xcconfig"
ARCHS = $(ARCHS_STANDARD_32_64_BIT);
ONLY_ACTIVE_ARCH = YES;
[macOS] Workaround for MAC_OS_X_VERSION_MAJOR incorrectly including minor version when building with Xcode 12 on macOS Big Sur SUs https://bugs.webkit.org/show_bug.cgi?id=217602 rdar://70194453 Patch by Luming Yin <luming_yin@apple.com> on 2020-10-12 Reviewed by Darin Adler. Due to a bug in Xcode (rdar://70185899), Xcode 12.0 and Xcode 12.1 Beta incorrectly includes the minor release number in MAC_OS_X_VERSION_MAJOR, which causes Debug and Release builds of WebKit to be misconfigured when building on macOS Big Sur SUs, leading to webpages failing to load. To work around the Xcode bug, when the MAC_OS_X_VERSION_MAJOR includes the minor version number, drop the minor version number by explicitly setting TARGET_MAC_OS_X_VERSION_MAJOR to 110000. Note: This change should be reverted after <rdar://70185899> is resolved. PerformanceTests: * DecoderTest/Configurations/DebugRelease.xcconfig: * MediaTime/Configurations/DebugRelease.xcconfig: Source/bmalloc: * Configurations/DebugRelease.xcconfig: Source/JavaScriptCore: * Configurations/DebugRelease.xcconfig: Source/ThirdParty: * gtest/xcode/Config/General.xcconfig: Source/ThirdParty/ANGLE: * Configurations/DebugRelease.xcconfig: Source/ThirdParty/libwebrtc: * Configurations/DebugRelease.xcconfig: Source/WebCore: * Configurations/DebugRelease.xcconfig: Source/WebCore/PAL: * Configurations/DebugRelease.xcconfig: Source/WebInspectorUI: * Configurations/DebugRelease.xcconfig: Source/WebKit: * Configurations/DebugRelease.xcconfig: Source/WebKitLegacy/mac: * Configurations/DebugRelease.xcconfig: Source/WTF: * Configurations/DebugRelease.xcconfig: Tools: * ContentExtensionTester/Configurations/DebugRelease.xcconfig: * DumpRenderTree/mac/Configurations/DebugRelease.xcconfig: * ImageDiff/cg/Configurations/DebugRelease.xcconfig: * MiniBrowser/Configurations/DebugRelease.xcconfig: * TestWebKitAPI/Configurations/DebugRelease.xcconfig: * WebEditingTester/Configurations/DebugRelease.xcconfig: * WebKitTestRunner/Configurations/DebugRelease.xcconfig: * lldb/lldbWebKitTester/Configurations/DebugRelease.xcconfig: Canonical link: https://commits.webkit.org/230363@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268353 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-10-12 16:27:16 +00:00
// FIXME: Once <rdar://problem/70185899> is fixed, replace the following with
[macOS] Workaround for MAC_OS_X_VERSION_MAJOR incorrectly including minor version when building with Xcode 12 on macOS Big Sur SUs https://bugs.webkit.org/show_bug.cgi?id=217602 rdar://70194453 Patch by Luming Yin <luming_yin@apple.com> on 2020-10-12 Reviewed by Darin Adler. The previous workaround turns out to be ineffective because we can't set the value of TARGET_MAC_OS_X_VERSION_MAJOR based on a previous value of itself. Introduce a new variable TARGET_MAC_OS_X_VERSION_MAJOR to determine whether we need to explicitly adjust MAC_OS_X_VERSION_MAJOR to 110000. PerformanceTests: * DecoderTest/Configurations/DebugRelease.xcconfig: * MediaTime/Configurations/DebugRelease.xcconfig: Source/bmalloc: * Configurations/DebugRelease.xcconfig: Source/JavaScriptCore: * Configurations/DebugRelease.xcconfig: Source/ThirdParty: * gtest/xcode/Config/General.xcconfig: Source/ThirdParty/ANGLE: * Configurations/DebugRelease.xcconfig: Source/ThirdParty/libwebrtc: * Configurations/DebugRelease.xcconfig: Source/WebCore: * Configurations/DebugRelease.xcconfig: Source/WebCore/PAL: * Configurations/DebugRelease.xcconfig: Source/WebInspectorUI: * Configurations/DebugRelease.xcconfig: Source/WebKit: * Configurations/DebugRelease.xcconfig: Source/WebKitLegacy/mac: * Configurations/DebugRelease.xcconfig: Source/WTF: * Configurations/DebugRelease.xcconfig: Tools: * ContentExtensionTester/Configurations/DebugRelease.xcconfig: * DumpRenderTree/mac/Configurations/DebugRelease.xcconfig: * ImageDiff/cg/Configurations/DebugRelease.xcconfig: * MiniBrowser/Configurations/DebugRelease.xcconfig: * TestWebKitAPI/Configurations/DebugRelease.xcconfig: * WebEditingTester/Configurations/DebugRelease.xcconfig: * WebKitTestRunner/Configurations/DebugRelease.xcconfig: * lldb/lldbWebKitTester/Configurations/DebugRelease.xcconfig: Canonical link: https://commits.webkit.org/230380@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268371 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-10-12 22:09:36 +00:00
// TARGET_MAC_OS_X_VERSION_MAJOR = $(MAC_OS_X_VERSION_MAJOR)
TARGET_MACOS_11_VERSION_MAJOR = $(TARGET_MACOS_11_VERSION_MAJOR_$(MAC_OS_X_VERSION_MAJOR))
TARGET_MACOS_11_VERSION_MAJOR_110100 = 110000
TARGET_MACOS_11_VERSION_MAJOR_110200 = 110000
TARGET_MACOS_11_VERSION_MAJOR_110300 = 110000
TARGET_MACOS_11_VERSION_MAJOR_110400 = 110000
TARGET_MACOS_11_VERSION_MAJOR_110500 = 110000
TARGET_MACOS_11_VERSION_MAJOR_110600 = 110000
TARGET_MAC_OS_X_VERSION_MAJOR = $(TARGET_MAC_OS_X_VERSION_MAJOR_$(TARGET_MACOS_11_VERSION_MAJOR))
TARGET_MAC_OS_X_VERSION_MAJOR_110000 = 110000
[macOS] Workaround for MAC_OS_X_VERSION_MAJOR incorrectly including minor version when building with Xcode 12 on macOS Big Sur SUs https://bugs.webkit.org/show_bug.cgi?id=217602 rdar://70194453 Patch by Luming Yin <luming_yin@apple.com> on 2020-10-12 Reviewed by Darin Adler. Due to a bug in Xcode (rdar://70185899), Xcode 12.0 and Xcode 12.1 Beta incorrectly includes the minor release number in MAC_OS_X_VERSION_MAJOR, which causes Debug and Release builds of WebKit to be misconfigured when building on macOS Big Sur SUs, leading to webpages failing to load. To work around the Xcode bug, when the MAC_OS_X_VERSION_MAJOR includes the minor version number, drop the minor version number by explicitly setting TARGET_MAC_OS_X_VERSION_MAJOR to 110000. Note: This change should be reverted after <rdar://70185899> is resolved. PerformanceTests: * DecoderTest/Configurations/DebugRelease.xcconfig: * MediaTime/Configurations/DebugRelease.xcconfig: Source/bmalloc: * Configurations/DebugRelease.xcconfig: Source/JavaScriptCore: * Configurations/DebugRelease.xcconfig: Source/ThirdParty: * gtest/xcode/Config/General.xcconfig: Source/ThirdParty/ANGLE: * Configurations/DebugRelease.xcconfig: Source/ThirdParty/libwebrtc: * Configurations/DebugRelease.xcconfig: Source/WebCore: * Configurations/DebugRelease.xcconfig: Source/WebCore/PAL: * Configurations/DebugRelease.xcconfig: Source/WebInspectorUI: * Configurations/DebugRelease.xcconfig: Source/WebKit: * Configurations/DebugRelease.xcconfig: Source/WebKitLegacy/mac: * Configurations/DebugRelease.xcconfig: Source/WTF: * Configurations/DebugRelease.xcconfig: Tools: * ContentExtensionTester/Configurations/DebugRelease.xcconfig: * DumpRenderTree/mac/Configurations/DebugRelease.xcconfig: * ImageDiff/cg/Configurations/DebugRelease.xcconfig: * MiniBrowser/Configurations/DebugRelease.xcconfig: * TestWebKitAPI/Configurations/DebugRelease.xcconfig: * WebEditingTester/Configurations/DebugRelease.xcconfig: * WebKitTestRunner/Configurations/DebugRelease.xcconfig: * lldb/lldbWebKitTester/Configurations/DebugRelease.xcconfig: Canonical link: https://commits.webkit.org/230363@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268353 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-10-12 16:27:16 +00:00
TARGET_MAC_OS_X_VERSION_MAJOR_ = $(MAC_OS_X_VERSION_MAJOR)
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
Remove leftover MACOSX_DEPLOYMENT_TARGET_macosx support https://bugs.webkit.org/show_bug.cgi?id=217649 <rdar://problem/70236877> Reviewed by Darin Adler. Bug 42796 introduced MACOSX_DEPLOYMENT_TARGET_<PLATFORM> as "support for compiling WebKit against iOS SDKs". Support for the iOS part of this feature was later removed in several changes, including Bug 139212, Bug 139463 and Bug 144762. However, vestiges have remained for five or six years in the form of MACOSX_DEPLOYMENT_TARGET_macosx. The inclusion of the platform in MACOSX_DEPLOYMENT_TARGET is no longer needed and can be removed. This changes brings most projects in conformance with other projects that don't support including the platform in MACOSX_DEPLOYMENT_TARGET, including WebEditingTester, gtest, WebKitTestRunner, MiniBrowser, and TestWebKitAPI. Along the way, remove a couple of left-over references to macOS 10.16, and a couple of places where [sdk=macosx*] was still being used. With this change, initialization of MACOSX_DEPLOYMENT_TARGET should be consistent across all projects, with two exceptions: WebKitLauncher (which hardcodes it to 10.12) and libwebrtc's copy of googletest (which hardcodes it to 10.4). The reasons for these hard-coded values is not apparent, so leave them be. PerformanceTests: * DecoderTest/Configurations/DebugRelease.xcconfig: * MediaTime/Configurations/DebugRelease.xcconfig: Source/bmalloc: * Configurations/DebugRelease.xcconfig: Source/JavaScriptCore: * Configurations/DebugRelease.xcconfig: Source/ThirdParty/ANGLE: * Configurations/DebugRelease.xcconfig: Source/ThirdParty/libwebrtc: * Configurations/DebugRelease.xcconfig: Source/WebCore: No new tests -- no changed functionality. * Configurations/DebugRelease.xcconfig: Source/WebCore/PAL: * Configurations/DebugRelease.xcconfig: Source/WebInspectorUI: * Configurations/DebugRelease.xcconfig: Source/WebKit: * Configurations/DebugRelease.xcconfig: Source/WebKitLegacy/mac: * Configurations/DebugRelease.xcconfig: Source/WTF: * Configurations/DebugRelease.xcconfig: Tools: * ContentExtensionTester/Configurations/DebugRelease.xcconfig: * DumpRenderTree/mac/Configurations/DebugRelease.xcconfig: * ImageDiff/cg/Configurations/DebugRelease.xcconfig: * lldb/lldbWebKitTester/Configurations/DebugRelease.xcconfig: Canonical link: https://commits.webkit.org/230417@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268420 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-10-13 21:25:46 +00:00
MACOSX_DEPLOYMENT_TARGET = $(MACOSX_DEPLOYMENT_TARGET_$(TARGET_MAC_OS_X_VERSION_MAJOR));
MACOSX_DEPLOYMENT_TARGET_101300 = 10.13;
MACOSX_DEPLOYMENT_TARGET_101400 = 10.14;
MACOSX_DEPLOYMENT_TARGET_101500 = 10.15;
MACOSX_DEPLOYMENT_TARGET_110000 = 11.0;
MACOSX_DEPLOYMENT_TARGET_120000 = 12.0;
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
GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
SDKROOT = $(SDKROOT_$(USE_INTERNAL_SDK));
SDKROOT_ = macosx;
SDKROOT_YES = macosx.internal;