haikuwebkit/Source/WTF/wtf/MediaTime.cpp

639 lines
18 KiB
C++
Raw Permalink Normal View History

Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
/*
* Copyright (C) 2012-2019 Apple Inc. All rights reserved.
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
*
* 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.
.: Replace "Apple Computer, Inc." with "Apple Inc." in copyright headers https://bugs.webkit.org/show_bug.cgi?id=130276 <rdar://problem/16266927> Reviewed by Simon Fraser. * ManualTests/NPN_Invoke/Info.plist: * ManualTests/NPN_Invoke/main.c: * ManualTests/accessibility/resources/AppletTest.java: Examples: Replace "Apple Computer, Inc." with "Apple Inc." in copyright headers https://bugs.webkit.org/show_bug.cgi?id=130276 <rdar://problem/16266927> Reviewed by Simon Fraser. * NetscapeCocoaPlugin/MenuHandler.h: * NetscapeCocoaPlugin/MenuHandler.m: * NetscapeCocoaPlugin/main.m: * NetscapeCoreAnimationPlugin/main.m: * NetscapeInputMethodPlugin/main.m: PerformanceTests: Replace "Apple Computer, Inc." with "Apple Inc." in copyright headers https://bugs.webkit.org/show_bug.cgi?id=130276 <rdar://problem/16266927> Reviewed by Simon Fraser. * Dromaeo/resources/dromaeo/web/tests/sunspider-3d-raytrace.html: * Dromaeo/resources/dromaeo/web/tests/sunspider-bitops-bitwise-and.html: * Dromaeo/resources/dromaeo/web/tests/sunspider-math-cordic.html: * Dromaeo/resources/dromaeo/web/tests/sunspider-string-tagcloud.html: * LongSpider/3d-morph.js: * LongSpider/3d-raytrace.js: * LongSpider/math-cordic.js: * LongSpider/string-tagcloud.js: * Parser/resources/html5-8266.html: * Parser/resources/html5.html: PerformanceTests/SunSpider: Replace "Apple Computer, Inc." with "Apple Inc." in copyright headers https://bugs.webkit.org/show_bug.cgi?id=130276 <rdar://problem/16266927> Reviewed by Simon Fraser. * hosted/sunspider.html: * hosted/versions.html: * make-hosted: * resources/TEMPLATE.html: * resources/driver-TEMPLATE.html: * resources/results-TEMPLATE.html: * resources/sunspider-analyze-results.js: * resources/sunspider-compare-results.js: * resources/sunspider-standalone-compare.js: * resources/sunspider-standalone-driver.js: * sunspider: * sunspider-compare-results: * tests/sunspider-0.9.1/3d-morph.js: * tests/sunspider-0.9.1/3d-raytrace.js: * tests/sunspider-0.9.1/bitops-bitwise-and.js: * tests/sunspider-0.9.1/math-cordic.js: * tests/sunspider-0.9.1/string-tagcloud.js: * tests/sunspider-0.9/3d-morph.js: * tests/sunspider-0.9/3d-raytrace.js: * tests/sunspider-0.9/bitops-bitwise-and.js: * tests/sunspider-0.9/math-cordic.js: * tests/sunspider-0.9/string-tagcloud.js: * tests/sunspider-1.0.1/3d-morph.js: * tests/sunspider-1.0.1/3d-raytrace.js: * tests/sunspider-1.0.1/bitops-bitwise-and.js: * tests/sunspider-1.0.1/math-cordic.js: * tests/sunspider-1.0.1/string-tagcloud.js: * tests/sunspider-1.0.2/3d-morph.js: * tests/sunspider-1.0.2/3d-raytrace.js: * tests/sunspider-1.0.2/bitops-bitwise-and.js: * tests/sunspider-1.0.2/math-cordic.js: * tests/sunspider-1.0.2/string-tagcloud.js: * tests/sunspider-1.0/3d-morph.js: * tests/sunspider-1.0/3d-raytrace.js: * tests/sunspider-1.0/bitops-bitwise-and.js: * tests/sunspider-1.0/math-cordic.js: * tests/sunspider-1.0/string-tagcloud.js: Source/JavaScriptCore: Replace "Apple Computer, Inc." with "Apple Inc." in copyright headers https://bugs.webkit.org/show_bug.cgi?id=130276 <rdar://problem/16266927> Reviewed by Simon Fraser. * API/APICast.h: * API/JSBase.cpp: * API/JSBase.h: * API/JSBasePrivate.h: * API/JSCallbackConstructor.cpp: * API/JSCallbackConstructor.h: * API/JSCallbackFunction.cpp: * API/JSCallbackFunction.h: * API/JSCallbackObject.cpp: * API/JSCallbackObject.h: * API/JSCallbackObjectFunctions.h: * API/JSClassRef.cpp: * API/JSClassRef.h: * API/JSContextRef.cpp: * API/JSContextRef.h: * API/JSContextRefPrivate.h: * API/JSObjectRef.cpp: * API/JSObjectRef.h: * API/JSProfilerPrivate.cpp: * API/JSProfilerPrivate.h: * API/JSRetainPtr.h: * API/JSStringRef.cpp: * API/JSStringRef.h: * API/JSStringRefBSTR.cpp: * API/JSStringRefBSTR.h: * API/JSStringRefCF.cpp: * API/JSStringRefCF.h: * API/JSValueRef.cpp: * API/JSValueRef.h: * API/JavaScript.h: * API/JavaScriptCore.h: * API/OpaqueJSString.cpp: * API/OpaqueJSString.h: * API/tests/JSNode.c: * API/tests/JSNode.h: * API/tests/JSNodeList.c: * API/tests/JSNodeList.h: * API/tests/Node.c: * API/tests/Node.h: * API/tests/NodeList.c: * API/tests/NodeList.h: * API/tests/minidom.c: * API/tests/minidom.js: * API/tests/testapi.c: * API/tests/testapi.js: * DerivedSources.make: * bindings/ScriptValue.cpp: * bytecode/CodeBlock.cpp: * bytecode/CodeBlock.h: * bytecode/EvalCodeCache.h: * bytecode/Instruction.h: * bytecode/JumpTable.cpp: * bytecode/JumpTable.h: * bytecode/Opcode.cpp: * bytecode/Opcode.h: * bytecode/SamplingTool.cpp: * bytecode/SamplingTool.h: * bytecode/SpeculatedType.cpp: * bytecode/SpeculatedType.h: * bytecode/ValueProfile.h: * bytecompiler/BytecodeGenerator.cpp: * bytecompiler/BytecodeGenerator.h: * bytecompiler/Label.h: * bytecompiler/LabelScope.h: * bytecompiler/RegisterID.h: * debugger/DebuggerCallFrame.cpp: * debugger/DebuggerCallFrame.h: * dfg/DFGDesiredStructureChains.cpp: * dfg/DFGDesiredStructureChains.h: * heap/GCActivityCallback.cpp: * heap/GCActivityCallback.h: * inspector/ConsoleMessage.cpp: * inspector/ConsoleMessage.h: * inspector/IdentifiersFactory.cpp: * inspector/IdentifiersFactory.h: * inspector/InjectedScriptManager.cpp: * inspector/InjectedScriptManager.h: * inspector/InjectedScriptSource.js: * inspector/ScriptBreakpoint.h: * inspector/ScriptDebugListener.h: * inspector/ScriptDebugServer.cpp: * inspector/ScriptDebugServer.h: * inspector/agents/InspectorAgent.cpp: * inspector/agents/InspectorAgent.h: * inspector/agents/InspectorDebuggerAgent.cpp: * inspector/agents/InspectorDebuggerAgent.h: * interpreter/Interpreter.cpp: * interpreter/Interpreter.h: * interpreter/JSStack.cpp: * interpreter/JSStack.h: * interpreter/Register.h: * jit/CompactJITCodeMap.h: * jit/JITStubs.cpp: * jit/JITStubs.h: * jit/JITStubsARM.h: * jit/JITStubsARMv7.h: * jit/JITStubsX86.h: * jit/JITStubsX86_64.h: * os-win32/stdbool.h: * parser/SourceCode.h: * parser/SourceProvider.h: * profiler/LegacyProfiler.cpp: * profiler/LegacyProfiler.h: * profiler/ProfileNode.cpp: * profiler/ProfileNode.h: * runtime/ArrayBufferView.cpp: * runtime/ArrayBufferView.h: * runtime/BatchedTransitionOptimizer.h: * runtime/CallData.h: * runtime/ConstructData.h: * runtime/DumpContext.cpp: * runtime/DumpContext.h: * runtime/ExceptionHelpers.cpp: * runtime/ExceptionHelpers.h: * runtime/InitializeThreading.cpp: * runtime/InitializeThreading.h: * runtime/IntegralTypedArrayBase.h: * runtime/IntendedStructureChain.cpp: * runtime/IntendedStructureChain.h: * runtime/JSActivation.cpp: * runtime/JSActivation.h: * runtime/JSExportMacros.h: * runtime/JSGlobalObject.cpp: * runtime/JSNotAnObject.cpp: * runtime/JSNotAnObject.h: * runtime/JSPropertyNameIterator.cpp: * runtime/JSPropertyNameIterator.h: * runtime/JSSegmentedVariableObject.cpp: * runtime/JSSegmentedVariableObject.h: * runtime/JSSymbolTableObject.cpp: * runtime/JSSymbolTableObject.h: * runtime/JSTypeInfo.h: * runtime/JSVariableObject.cpp: * runtime/JSVariableObject.h: * runtime/PropertyTable.cpp: * runtime/PutPropertySlot.h: * runtime/SamplingCounter.cpp: * runtime/SamplingCounter.h: * runtime/Structure.cpp: * runtime/Structure.h: * runtime/StructureChain.cpp: * runtime/StructureChain.h: * runtime/StructureInlines.h: * runtime/StructureTransitionTable.h: * runtime/SymbolTable.cpp: * runtime/SymbolTable.h: * runtime/TypedArrayBase.h: * runtime/TypedArrayType.cpp: * runtime/TypedArrayType.h: * runtime/VM.cpp: * runtime/VM.h: * yarr/RegularExpression.cpp: * yarr/RegularExpression.h: Source/WebCore: Replace "Apple Computer, Inc." with "Apple Inc." in copyright headers https://bugs.webkit.org/show_bug.cgi?id=130276 <rdar://problem/16266927> Reviewed by Simon Fraser. No new tests because no behavior changes. * DerivedSources.make: * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.cpp: * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.h: * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.idl: * Modules/encryptedmedia/MediaKeyMessageEvent.cpp: * Modules/encryptedmedia/MediaKeyMessageEvent.h: * Modules/encryptedmedia/MediaKeyMessageEvent.idl: * Modules/encryptedmedia/MediaKeyNeededEvent.cpp: * Modules/encryptedmedia/MediaKeyNeededEvent.h: * Modules/encryptedmedia/MediaKeyNeededEvent.idl: * Modules/encryptedmedia/MediaKeySession.idl: * Modules/encryptedmedia/MediaKeys.idl: * Modules/geolocation/NavigatorGeolocation.cpp: * Modules/indexeddb/DOMWindowIndexedDatabase.idl: * Modules/indexeddb/IDBCallbacks.h: * Modules/indexeddb/IDBDatabaseException.cpp: * Modules/indexeddb/IDBDatabaseMetadata.h: * Modules/indexeddb/IDBEventDispatcher.cpp: * Modules/indexeddb/IDBEventDispatcher.h: * Modules/indexeddb/IDBFactory.cpp: * Modules/indexeddb/IDBFactory.h: * Modules/indexeddb/IDBFactoryBackendInterface.cpp: * Modules/indexeddb/IDBFactoryBackendInterface.h: * Modules/indexeddb/IDBHistograms.h: * Modules/indexeddb/IDBIndexMetadata.h: * Modules/indexeddb/IDBObjectStoreMetadata.h: * Modules/indexeddb/IDBRecordIdentifier.h: * Modules/indexeddb/IDBRequest.cpp: * Modules/indexeddb/IDBRequest.h: * Modules/indexeddb/IDBRequest.idl: * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp: * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h: * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl: * Modules/indexeddb/leveldb/IDBFactoryBackendLevelDB.cpp: * Modules/indexeddb/leveldb/IDBFactoryBackendLevelDB.h: * Modules/mediacontrols/MediaControlsHost.cpp: * Modules/mediacontrols/MediaControlsHost.h: * Modules/mediacontrols/MediaControlsHost.idl: * Modules/mediacontrols/mediaControlsApple.css: * Modules/mediacontrols/mediaControlsiOS.css: * Modules/mediasource/AudioTrackMediaSource.h: * Modules/mediasource/AudioTrackMediaSource.idl: * Modules/mediasource/TextTrackMediaSource.h: * Modules/mediasource/TextTrackMediaSource.idl: * Modules/mediasource/VideoTrackMediaSource.h: * Modules/mediasource/VideoTrackMediaSource.idl: * Modules/mediastream/AllAudioCapabilities.h: * Modules/mediastream/AllAudioCapabilities.idl: * Modules/mediastream/AllVideoCapabilities.h: * Modules/mediastream/AllVideoCapabilities.idl: * Modules/mediastream/AudioStreamTrack.cpp: * Modules/mediastream/AudioStreamTrack.h: * Modules/mediastream/AudioStreamTrack.idl: * Modules/mediastream/CapabilityRange.cpp: * Modules/mediastream/CapabilityRange.h: * Modules/mediastream/CapabilityRange.idl: * Modules/mediastream/MediaSourceStates.cpp: * Modules/mediastream/MediaSourceStates.h: * Modules/mediastream/MediaSourceStates.idl: * Modules/mediastream/MediaStreamCapabilities.cpp: * Modules/mediastream/MediaStreamCapabilities.h: * Modules/mediastream/MediaStreamCapabilities.idl: * Modules/mediastream/MediaTrackConstraint.cpp: * Modules/mediastream/MediaTrackConstraint.h: * Modules/mediastream/MediaTrackConstraint.idl: * Modules/mediastream/MediaTrackConstraintSet.cpp: * Modules/mediastream/MediaTrackConstraintSet.h: * Modules/mediastream/MediaTrackConstraints.cpp: * Modules/mediastream/MediaTrackConstraints.h: * Modules/mediastream/MediaTrackConstraints.idl: * Modules/mediastream/NavigatorMediaStream.cpp: * Modules/mediastream/NavigatorUserMediaError.cpp: * Modules/mediastream/RTCConfiguration.idl: * Modules/mediastream/RTCIceServer.idl: * Modules/mediastream/RTCOfferAnswerOptions.cpp: * Modules/mediastream/RTCOfferAnswerOptions.h: * Modules/mediastream/VideoStreamTrack.cpp: * Modules/mediastream/VideoStreamTrack.h: * Modules/mediastream/VideoStreamTrack.idl: * Modules/networkinfo/NetworkInfo.cpp: * Modules/networkinfo/NetworkInfo.h: * Modules/networkinfo/NetworkInfoConnection.cpp: * Modules/networkinfo/NetworkInfoConnection.h: * Modules/networkinfo/NetworkInfoController.cpp: * Modules/notifications/DOMWindowNotifications.cpp: * Modules/notifications/DOMWindowNotifications.h: * Modules/notifications/DOMWindowNotifications.idl: * Modules/notifications/NotificationController.cpp: * Modules/notifications/NotificationController.h: * Modules/notifications/NotificationPermissionCallback.h: * Modules/notifications/NotificationPermissionCallback.idl: * Modules/notifications/WorkerGlobalScopeNotifications.cpp: * Modules/notifications/WorkerGlobalScopeNotifications.h: * Modules/notifications/WorkerGlobalScopeNotifications.idl: * Modules/plugins/PluginReplacement.h: * Modules/plugins/QuickTimePluginReplacement.cpp: * Modules/plugins/QuickTimePluginReplacement.css: * Modules/plugins/QuickTimePluginReplacement.h: * Modules/plugins/QuickTimePluginReplacement.idl: * Modules/quota/DOMWindowQuota.idl: * Modules/speech/DOMWindowSpeechSynthesis.h: * Modules/speech/DOMWindowSpeechSynthesis.idl: * Modules/speech/SpeechSynthesis.cpp: * Modules/speech/SpeechSynthesis.h: * Modules/speech/SpeechSynthesis.idl: * Modules/speech/SpeechSynthesisEvent.cpp: * Modules/speech/SpeechSynthesisEvent.h: * Modules/speech/SpeechSynthesisEvent.idl: * Modules/speech/SpeechSynthesisUtterance.cpp: * Modules/speech/SpeechSynthesisUtterance.h: * Modules/speech/SpeechSynthesisUtterance.idl: * Modules/speech/SpeechSynthesisVoice.cpp: * Modules/speech/SpeechSynthesisVoice.h: * Modules/speech/SpeechSynthesisVoice.idl: * Modules/webaudio/AudioBuffer.cpp: * Modules/webaudio/AudioBuffer.h: * Modules/webaudio/AudioBuffer.idl: * Modules/webaudio/AudioListener.cpp: * Modules/webaudio/AudioListener.h: * Modules/webaudio/AudioListener.idl: * Modules/webaudio/AudioParam.h: * Modules/webaudio/AudioParam.idl: * Modules/webaudio/AudioParamTimeline.h: * Modules/webaudio/AudioScheduledSourceNode.h: * Modules/webaudio/ChannelMergerNode.cpp: * Modules/webaudio/ChannelMergerNode.h: * Modules/webaudio/ChannelMergerNode.idl: * Modules/webaudio/MediaStreamAudioSource.cpp: * Modules/webaudio/MediaStreamAudioSource.h: * Modules/webaudio/PeriodicWave.cpp: * Modules/webaudio/PeriodicWave.h: * Modules/webdatabase/ChangeVersionWrapper.cpp: * Modules/webdatabase/ChangeVersionWrapper.h: * Modules/webdatabase/DOMWindowWebDatabase.cpp: * Modules/webdatabase/DOMWindowWebDatabase.h: * Modules/webdatabase/DOMWindowWebDatabase.idl: * Modules/webdatabase/Database.cpp: * Modules/webdatabase/Database.h: * Modules/webdatabase/Database.idl: * Modules/webdatabase/DatabaseAuthorizer.cpp: * Modules/webdatabase/DatabaseAuthorizer.h: * Modules/webdatabase/DatabaseBackendBase.cpp: * Modules/webdatabase/DatabaseBackendBase.h: * Modules/webdatabase/DatabaseCallback.idl: * Modules/webdatabase/DatabaseContext.cpp: * Modules/webdatabase/DatabaseContext.h: * Modules/webdatabase/DatabaseDetails.h: * Modules/webdatabase/DatabaseTask.cpp: * Modules/webdatabase/DatabaseTask.h: * Modules/webdatabase/DatabaseThread.cpp: * Modules/webdatabase/DatabaseThread.h: * Modules/webdatabase/DatabaseTracker.cpp: * Modules/webdatabase/DatabaseTracker.h: * Modules/webdatabase/SQLCallbackWrapper.h: * Modules/webdatabase/SQLError.h: * Modules/webdatabase/SQLError.idl: * Modules/webdatabase/SQLException.cpp: * Modules/webdatabase/SQLResultSet.cpp: * Modules/webdatabase/SQLResultSet.h: * Modules/webdatabase/SQLResultSet.idl: * Modules/webdatabase/SQLResultSetRowList.cpp: * Modules/webdatabase/SQLResultSetRowList.h: * Modules/webdatabase/SQLResultSetRowList.idl: * Modules/webdatabase/SQLStatement.cpp: * Modules/webdatabase/SQLStatement.h: * Modules/webdatabase/SQLStatementBackend.cpp: * Modules/webdatabase/SQLStatementBackend.h: * Modules/webdatabase/SQLStatementCallback.h: * Modules/webdatabase/SQLStatementCallback.idl: * Modules/webdatabase/SQLStatementErrorCallback.h: * Modules/webdatabase/SQLStatementErrorCallback.idl: * Modules/webdatabase/SQLStatementSync.cpp: * Modules/webdatabase/SQLTransaction.cpp: * Modules/webdatabase/SQLTransaction.h: * Modules/webdatabase/SQLTransaction.idl: * Modules/webdatabase/SQLTransactionBackend.cpp: * Modules/webdatabase/SQLTransactionBackend.h: * Modules/webdatabase/SQLTransactionCallback.h: * Modules/webdatabase/SQLTransactionCallback.idl: * Modules/webdatabase/SQLTransactionErrorCallback.h: * Modules/webdatabase/SQLTransactionErrorCallback.idl: * Modules/webdatabase/WorkerGlobalScopeWebDatabase.cpp: * Modules/webdatabase/WorkerGlobalScopeWebDatabase.h: * Modules/webdatabase/WorkerGlobalScopeWebDatabase.idl: * Resources/deleteButton.tiff: * Resources/deleteButtonPressed.tiff: * WebCore.vcxproj/MigrateScripts: * WebCorePrefix.cpp: * accessibility/AXObjectCache.cpp: * accessibility/AXObjectCache.h: * accessibility/AccessibilityARIAGrid.cpp: * accessibility/AccessibilityARIAGrid.h: * accessibility/AccessibilityARIAGridCell.cpp: * accessibility/AccessibilityARIAGridCell.h: * accessibility/AccessibilityARIAGridRow.cpp: * accessibility/AccessibilityARIAGridRow.h: * accessibility/AccessibilityImageMapLink.cpp: * accessibility/AccessibilityImageMapLink.h: * accessibility/AccessibilityList.cpp: * accessibility/AccessibilityList.h: * accessibility/AccessibilityListBox.cpp: * accessibility/AccessibilityListBox.h: * accessibility/AccessibilityListBoxOption.cpp: * accessibility/AccessibilityListBoxOption.h: * accessibility/AccessibilityMediaControls.cpp: * accessibility/AccessibilityMediaControls.h: * accessibility/AccessibilityNodeObject.cpp: * accessibility/AccessibilityNodeObject.h: * accessibility/AccessibilityObject.cpp: * accessibility/AccessibilityObject.h: * accessibility/AccessibilityRenderObject.cpp: * accessibility/AccessibilityRenderObject.h: * accessibility/AccessibilitySVGRoot.cpp: * accessibility/AccessibilitySVGRoot.h: * accessibility/AccessibilityScrollbar.cpp: * accessibility/AccessibilityScrollbar.h: * accessibility/AccessibilitySlider.cpp: * accessibility/AccessibilitySlider.h: * accessibility/AccessibilityTable.cpp: * accessibility/AccessibilityTable.h: * accessibility/AccessibilityTableCell.cpp: * accessibility/AccessibilityTableCell.h: * accessibility/AccessibilityTableColumn.cpp: * accessibility/AccessibilityTableColumn.h: * accessibility/AccessibilityTableHeaderContainer.cpp: * accessibility/AccessibilityTableHeaderContainer.h: * accessibility/AccessibilityTableRow.cpp: * accessibility/AccessibilityTableRow.h: * accessibility/ios/AXObjectCacheIOS.mm: * accessibility/ios/AccessibilityObjectIOS.mm: * accessibility/ios/WebAccessibilityObjectWrapperIOS.h: * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: * accessibility/mac/AXObjectCacheMac.mm: * accessibility/mac/AccessibilityObjectMac.mm: * accessibility/mac/WebAccessibilityObjectWrapperBase.h: * accessibility/mac/WebAccessibilityObjectWrapperBase.mm: * accessibility/mac/WebAccessibilityObjectWrapperMac.h: * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: * bindings/gobject/WebKitDOMEventTarget.cpp: * bindings/gobject/WebKitDOMHTMLPrivate.cpp: * bindings/gobject/WebKitDOMHTMLPrivate.h: * bindings/js/Dictionary.cpp: * bindings/js/GCController.cpp: * bindings/js/GCController.h: * bindings/js/JSAttrCustom.cpp: * bindings/js/JSAudioTrackCustom.cpp: * bindings/js/JSAudioTrackListCustom.cpp: * bindings/js/JSCSSRuleCustom.cpp: * bindings/js/JSCSSRuleCustom.h: * bindings/js/JSCSSRuleListCustom.cpp: * bindings/js/JSCSSStyleDeclarationCustom.cpp: * bindings/js/JSCSSValueCustom.cpp: * bindings/js/JSCallbackData.cpp: * bindings/js/JSCallbackData.h: * bindings/js/JSCanvasRenderingContextCustom.cpp: * bindings/js/JSClipboardCustom.cpp: * bindings/js/JSCustomSQLStatementErrorCallback.cpp: * bindings/js/JSCustomXPathNSResolver.cpp: * bindings/js/JSCustomXPathNSResolver.h: * bindings/js/JSDOMGlobalObject.cpp: * bindings/js/JSDOMGlobalObject.h: * bindings/js/JSDOMWindowShell.cpp: * bindings/js/JSDOMWindowShell.h: * bindings/js/JSElementCustom.cpp: * bindings/js/JSEventCustom.cpp: * bindings/js/JSHTMLAppletElementCustom.cpp: * bindings/js/JSHTMLCanvasElementCustom.cpp: * bindings/js/JSHTMLDocumentCustom.cpp: * bindings/js/JSHTMLElementCustom.cpp: * bindings/js/JSHTMLEmbedElementCustom.cpp: * bindings/js/JSHTMLFormElementCustom.cpp: * bindings/js/JSHTMLFrameElementCustom.cpp: * bindings/js/JSHTMLFrameSetElementCustom.cpp: * bindings/js/JSHTMLObjectElementCustom.cpp: * bindings/js/JSHTMLSelectElementCustom.h: * bindings/js/JSHistoryCustom.cpp: * bindings/js/JSMediaListCustom.h: * bindings/js/JSMediaSourceStatesCustom.cpp: * bindings/js/JSMediaStreamCapabilitiesCustom.cpp: * bindings/js/JSNamedNodeMapCustom.cpp: * bindings/js/JSNodeCustom.cpp: * bindings/js/JSNodeCustom.h: * bindings/js/JSNodeFilterCustom.cpp: * bindings/js/JSNodeListCustom.cpp: * bindings/js/JSSQLResultSetRowListCustom.cpp: * bindings/js/JSSQLTransactionCustom.cpp: * bindings/js/JSSQLTransactionSyncCustom.cpp: * bindings/js/JSSVGElementInstanceCustom.cpp: * bindings/js/JSStyleSheetCustom.cpp: * bindings/js/JSStyleSheetCustom.h: * bindings/js/JSStyleSheetListCustom.cpp: * bindings/js/JSTextTrackCueCustom.cpp: * bindings/js/JSTextTrackCustom.cpp: * bindings/js/JSTextTrackListCustom.cpp: * bindings/js/JSTouchCustom.cpp: * bindings/js/JSTouchListCustom.cpp: * bindings/js/JSTrackCustom.cpp: * bindings/js/JSTrackCustom.h: * bindings/js/JSTrackEventCustom.cpp: * bindings/js/JSVideoTrackCustom.cpp: * bindings/js/JSVideoTrackListCustom.cpp: * bindings/js/JSWebGLRenderingContextCustom.cpp: * bindings/js/JSWebKitPointCustom.cpp: * bindings/js/JSWorkerGlobalScopeBase.cpp: * bindings/js/JSWorkerGlobalScopeBase.h: * bindings/js/JSXMLHttpRequestCustom.cpp: * bindings/js/JSXSLTProcessorCustom.cpp: * bindings/js/ScriptControllerMac.mm: * bindings/js/ScriptProfile.cpp: * bindings/js/ScriptProfile.h: * bindings/js/ScriptProfileNode.h: * bindings/js/ScriptProfiler.cpp: * bindings/js/ScriptProfiler.h: * bindings/js/SerializedScriptValue.cpp: * bindings/js/SerializedScriptValue.h: * bindings/js/WorkerScriptController.cpp: * bindings/js/WorkerScriptController.h: * bindings/objc/DOM.h: * bindings/objc/DOM.mm: * bindings/objc/DOMAbstractView.mm: * bindings/objc/DOMAbstractViewFrame.h: * bindings/objc/DOMCSS.h: * bindings/objc/DOMCSS.mm: * bindings/objc/DOMCore.h: * bindings/objc/DOMCustomXPathNSResolver.h: * bindings/objc/DOMCustomXPathNSResolver.mm: * bindings/objc/DOMEventException.h: * bindings/objc/DOMEvents.h: * bindings/objc/DOMEvents.mm: * bindings/objc/DOMException.h: * bindings/objc/DOMExtensions.h: * bindings/objc/DOMHTML.h: * bindings/objc/DOMHTML.mm: * bindings/objc/DOMInternal.h: * bindings/objc/DOMInternal.mm: * bindings/objc/DOMObject.h: * bindings/objc/DOMObject.mm: * bindings/objc/DOMPrivate.h: * bindings/objc/DOMRangeException.h: * bindings/objc/DOMRanges.h: * bindings/objc/DOMStylesheets.h: * bindings/objc/DOMTraversal.h: * bindings/objc/DOMUIKitExtensions.h: * bindings/objc/DOMUIKitExtensions.mm: * bindings/objc/DOMUtility.mm: * bindings/objc/DOMViews.h: * bindings/objc/DOMXPath.h: * bindings/objc/DOMXPath.mm: * bindings/objc/DOMXPathException.h: * bindings/objc/ExceptionHandlers.h: * bindings/objc/ExceptionHandlers.mm: * bindings/objc/ObjCEventListener.h: * bindings/objc/ObjCEventListener.mm: * bindings/objc/ObjCNodeFilterCondition.h: * bindings/objc/ObjCNodeFilterCondition.mm: * bindings/objc/PublicDOMInterfaces.h: * bindings/objc/WebScriptObject.mm: * bindings/scripts/CodeGeneratorObjC.pm: * bindings/scripts/InFilesCompiler.pm: (license): * bindings/scripts/InFilesParser.pm: * bindings/scripts/generate-bindings.pl: * bindings/scripts/test/ObjC/DOMFloat64Array.h: * bindings/scripts/test/ObjC/DOMFloat64Array.mm: * bindings/scripts/test/ObjC/DOMFloat64ArrayInternal.h: * bindings/scripts/test/ObjC/DOMTestActiveDOMObject.h: * bindings/scripts/test/ObjC/DOMTestActiveDOMObject.mm: * bindings/scripts/test/ObjC/DOMTestActiveDOMObjectInternal.h: * bindings/scripts/test/ObjC/DOMTestCallback.h: * bindings/scripts/test/ObjC/DOMTestCallback.mm: * bindings/scripts/test/ObjC/DOMTestCallbackInternal.h: * bindings/scripts/test/ObjC/DOMTestCustomNamedGetter.h: * bindings/scripts/test/ObjC/DOMTestCustomNamedGetter.mm: * bindings/scripts/test/ObjC/DOMTestCustomNamedGetterInternal.h: * bindings/scripts/test/ObjC/DOMTestEventConstructor.h: * bindings/scripts/test/ObjC/DOMTestEventConstructor.mm: * bindings/scripts/test/ObjC/DOMTestEventConstructorInternal.h: * bindings/scripts/test/ObjC/DOMTestEventTarget.h: * bindings/scripts/test/ObjC/DOMTestEventTarget.mm: * bindings/scripts/test/ObjC/DOMTestEventTargetInternal.h: * bindings/scripts/test/ObjC/DOMTestException.h: * bindings/scripts/test/ObjC/DOMTestException.mm: * bindings/scripts/test/ObjC/DOMTestExceptionInternal.h: * bindings/scripts/test/ObjC/DOMTestGenerateIsReachable.h: * bindings/scripts/test/ObjC/DOMTestGenerateIsReachable.mm: * bindings/scripts/test/ObjC/DOMTestGenerateIsReachableInternal.h: * bindings/scripts/test/ObjC/DOMTestInterface.h: * bindings/scripts/test/ObjC/DOMTestInterface.mm: * bindings/scripts/test/ObjC/DOMTestInterfaceInternal.h: * bindings/scripts/test/ObjC/DOMTestMediaQueryListListener.h: * bindings/scripts/test/ObjC/DOMTestMediaQueryListListener.mm: * bindings/scripts/test/ObjC/DOMTestMediaQueryListListenerInternal.h: * bindings/scripts/test/ObjC/DOMTestNamedConstructor.h: * bindings/scripts/test/ObjC/DOMTestNamedConstructor.mm: * bindings/scripts/test/ObjC/DOMTestNamedConstructorInternal.h: * bindings/scripts/test/ObjC/DOMTestNode.h: * bindings/scripts/test/ObjC/DOMTestNode.mm: * bindings/scripts/test/ObjC/DOMTestNodeInternal.h: * bindings/scripts/test/ObjC/DOMTestObj.h: * bindings/scripts/test/ObjC/DOMTestObj.mm: * bindings/scripts/test/ObjC/DOMTestObjInternal.h: * bindings/scripts/test/ObjC/DOMTestOverloadedConstructors.h: * bindings/scripts/test/ObjC/DOMTestOverloadedConstructors.mm: * bindings/scripts/test/ObjC/DOMTestOverloadedConstructorsInternal.h: * bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterface.h: * bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterface.mm: * bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterfaceInternal.h: * bindings/scripts/test/ObjC/DOMTestTypedefs.h: * bindings/scripts/test/ObjC/DOMTestTypedefs.mm: * bindings/scripts/test/ObjC/DOMTestTypedefsInternal.h: * bindings/scripts/test/ObjC/DOMattribute.h: * bindings/scripts/test/ObjC/DOMattribute.mm: * bindings/scripts/test/ObjC/DOMattributeInternal.h: * bindings/scripts/test/ObjC/DOMreadonly.h: * bindings/scripts/test/ObjC/DOMreadonly.mm: * bindings/scripts/test/ObjC/DOMreadonlyInternal.h: * bindings/scripts/test/TestCallback.idl: * bindings/scripts/test/TestCustomNamedGetter.idl: * bindings/scripts/test/TestDomainSecurity.idl: * bindings/scripts/test/TestEventConstructor.idl: * bindings/scripts/test/TestEventTarget.idl: * bindings/scripts/test/TestException.idl: * bindings/scripts/test/TestImplements.idl: * bindings/scripts/test/TestInterface.idl: * bindings/scripts/test/TestMediaQueryListListener.idl: * bindings/scripts/test/TestNamedConstructor.idl: * bindings/scripts/test/TestObj.idl: * bindings/scripts/test/TestOverloadedConstructors.idl: * bindings/scripts/test/TestSupplemental.idl: * bridge/Bridge.h: * bridge/IdentifierRep.cpp: * bridge/IdentifierRep.h: * bridge/NP_jsobject.cpp: * bridge/NP_jsobject.h: * bridge/c/CRuntimeObject.cpp: * bridge/c/CRuntimeObject.h: * bridge/c/c_class.cpp: * bridge/c/c_class.h: * bridge/c/c_instance.cpp: * bridge/c/c_instance.h: * bridge/c/c_runtime.cpp: * bridge/c/c_runtime.h: * bridge/c/c_utility.cpp: * bridge/c/c_utility.h: * bridge/jsc/BridgeJSC.cpp: * bridge/jsc/BridgeJSC.h: * bridge/npruntime.cpp: * bridge/npruntime_impl.h: * bridge/npruntime_priv.h: * bridge/objc/ObjCRuntimeObject.h: * bridge/objc/ObjCRuntimeObject.mm: * bridge/objc/WebScriptObject.h: * bridge/objc/objc_class.h: * bridge/objc/objc_class.mm: * bridge/objc/objc_header.h: * bridge/objc/objc_instance.h: * bridge/objc/objc_instance.mm: * bridge/objc/objc_runtime.h: * bridge/objc/objc_runtime.mm: * bridge/objc/objc_utility.h: * bridge/objc/objc_utility.mm: * bridge/runtime_array.cpp: * bridge/runtime_array.h: * bridge/runtime_method.cpp: * bridge/runtime_method.h: * bridge/runtime_object.cpp: * bridge/runtime_object.h: * bridge/runtime_root.cpp: * bridge/runtime_root.h: * bridge/testbindings.mm: * css/CSSAllInOne.cpp: * css/CSSAspectRatioValue.cpp: * css/CSSAspectRatioValue.h: * css/CSSBorderImageSliceValue.cpp: * css/CSSBorderImageSliceValue.h: * css/CSSCanvasValue.cpp: * css/CSSCanvasValue.h: * css/CSSCrossfadeValue.cpp: * css/CSSCrossfadeValue.h: * css/CSSFontFace.cpp: * css/CSSFontFace.h: * css/CSSFontFaceSource.cpp: * css/CSSFontFaceSource.h: * css/CSSFontFaceSrcValue.cpp: * css/CSSFontFaceSrcValue.h: * css/CSSFontFeatureValue.cpp: * css/CSSFontFeatureValue.h: * css/CSSFontSelector.cpp: * css/CSSFontSelector.h: * css/CSSFontValue.cpp: * css/CSSGradientValue.cpp: * css/CSSGradientValue.h: * css/CSSImageGeneratorValue.cpp: * css/CSSImageGeneratorValue.h: * css/CSSMediaRule.cpp: * css/CSSProperty.cpp: * css/CSSProperty.h: * css/CSSReflectValue.cpp: * css/CSSReflectValue.h: * css/CSSReflectionDirection.h: * css/CSSRuleList.cpp: * css/CSSRuleList.h: * css/CSSRuleList.idl: * css/CSSSegmentedFontFace.cpp: * css/CSSSegmentedFontFace.h: * css/CSSShadowValue.cpp: * css/CSSTimingFunctionValue.cpp: * css/CSSTimingFunctionValue.h: * css/CSSUnicodeRangeValue.cpp: * css/CSSUnicodeRangeValue.h: * css/CSSUnknownRule.idl: * css/CSSValue.cpp: * css/CSSValueList.idl: * css/MediaAllInOne.cpp: * css/MediaFeatureNames.cpp: * css/MediaList.idl: * css/MediaQuery.cpp: * css/MediaQuery.h: * css/MediaQueryEvaluator.cpp: * css/MediaQueryEvaluator.h: * css/MediaQueryExp.cpp: * css/MediaQueryExp.h: * css/Pair.h: * css/PropertySetCSSStyleDeclaration.h: * css/RGBColor.cpp: * css/RGBColor.h: * css/SVGCSSParser.cpp: * css/SVGCSSStyleSelector.cpp: * css/StyleInvalidationAnalysis.cpp: * css/StyleInvalidationAnalysis.h: * css/StyleMedia.cpp: * css/StyleMedia.h: * css/StyleMedia.idl: * css/StyleSheet.cpp: * css/WebKitCSSFilterValue.cpp: * css/WebKitCSSFilterValue.h: * css/WebKitCSSFilterValue.idl: * css/WebKitCSSKeyframeRule.cpp: * css/WebKitCSSKeyframeRule.h: * css/WebKitCSSKeyframeRule.idl: * css/WebKitCSSKeyframesRule.cpp: * css/WebKitCSSKeyframesRule.h: * css/WebKitCSSKeyframesRule.idl: * css/WebKitCSSTransformValue.cpp: * css/WebKitCSSTransformValue.h: * css/WebKitCSSTransformValue.idl: * css/make-css-file-arrays.pl: * css/mediaControls.css: * css/mediaControlsEfl.css: * css/mediaControlsEflFullscreen.css: * css/mediaControlsGtk.css: * css/mediaControlsiOS.css: * css/svg.css: * dom/ActiveDOMObject.cpp: * dom/ActiveDOMObject.h: * dom/BeforeLoadEvent.h: * dom/BeforeLoadEvent.idl: * dom/BeforeTextInsertedEvent.cpp: * dom/BeforeTextInsertedEvent.h: * dom/BeforeUnloadEvent.cpp: * dom/BeforeUnloadEvent.h: * dom/BeforeUnloadEvent.idl: * dom/ClassNodeList.cpp: * dom/ClassNodeList.h: * dom/ClientRect.cpp: * dom/ClientRect.h: * dom/ClientRect.idl: * dom/ClientRectList.cpp: * dom/ClientRectList.h: * dom/ClientRectList.idl: * dom/Clipboard.cpp: * dom/Clipboard.idl: * dom/ClipboardAccessPolicy.h: * dom/ClipboardMac.mm: * dom/CompositionEvent.cpp: * dom/CompositionEvent.h: * dom/CompositionEvent.idl: * dom/ContextDestructionObserver.cpp: * dom/ContextDestructionObserver.h: * dom/CurrentScriptIncrementer.h: * dom/CustomEvent.cpp: * dom/CustomEvent.h: * dom/CustomEvent.idl: * dom/DOMCoreException.cpp: * dom/DOMCoreException.h: * dom/DOMCoreException.idl: * dom/DOMError.idl: * dom/DeviceMotionEvent.cpp: * dom/DeviceMotionEvent.h: * dom/DeviceMotionEvent.idl: * dom/DocumentEventQueue.cpp: * dom/DocumentEventQueue.h: * dom/DocumentMarker.h: * dom/DocumentParser.h: * dom/DocumentSharedObjectPool.cpp: * dom/DocumentSharedObjectPool.h: * dom/Entity.idl: * dom/EventContext.cpp: * dom/EventContext.h: * dom/EventException.cpp: * dom/EventException.h: * dom/EventException.idl: * dom/EventListener.idl: * dom/EventListenerMap.cpp: * dom/EventListenerMap.h: * dom/EventNames.cpp: * dom/EventQueue.h: * dom/EventTarget.cpp: * dom/EventTarget.h: * dom/ExceptionBase.cpp: * dom/ExceptionBase.h: * dom/GenericEventQueue.cpp: * dom/GenericEventQueue.h: * dom/KeyboardEvent.idl: * dom/MessageChannel.cpp: * dom/MessageChannel.h: * dom/MessageChannel.idl: * dom/MessageEvent.cpp: * dom/MessageEvent.h: * dom/MessageEvent.idl: * dom/MessagePort.cpp: * dom/MessagePort.h: * dom/MessagePort.idl: * dom/MouseRelatedEvent.h: * dom/MutationEvent.idl: * dom/Notation.idl: * dom/OverflowEvent.cpp: * dom/OverflowEvent.h: * dom/OverflowEvent.idl: * dom/PopStateEvent.cpp: * dom/PopStateEvent.h: * dom/PopStateEvent.idl: * dom/Position.cpp: * dom/Position.h: * dom/ProcessingInstruction.idl: * dom/ProgressEvent.cpp: * dom/ProgressEvent.h: * dom/ProgressEvent.idl: * dom/Range.idl: * dom/RangeException.cpp: * dom/RangeException.h: * dom/ScriptExecutionContext.cpp: * dom/ScriptExecutionContext.h: * dom/SecurityContext.cpp: * dom/SecurityContext.h: * dom/StaticNodeList.cpp: * dom/StaticNodeList.h: * dom/Text.idl: * dom/TextEvent.cpp: * dom/TextEvent.h: * dom/TextEvent.idl: * dom/Touch.cpp: * dom/Touch.h: * dom/Touch.idl: * dom/TouchEvent.cpp: * dom/TouchEvent.h: * dom/TouchEvent.idl: * dom/TouchList.cpp: * dom/TouchList.h: * dom/TouchList.idl: * dom/TransitionEvent.cpp: * dom/TransitionEvent.h: * dom/TransitionEvent.idl: * dom/TreeWalker.idl: * dom/UIEvent.idl: * dom/UIEventWithKeyState.cpp: * dom/WebKitAnimationEvent.cpp: * dom/WebKitAnimationEvent.h: * dom/WebKitAnimationEvent.idl: * dom/WebKitTransitionEvent.cpp: * dom/WebKitTransitionEvent.h: * dom/WebKitTransitionEvent.idl: * dom/make_dom_exceptions.pl: * dom/make_event_factory.pl: * dom/make_names.pl: (printLicenseHeader): * editing/AlternativeTextController.cpp: * editing/AlternativeTextController.h: * editing/AppendNodeCommand.cpp: * editing/AppendNodeCommand.h: * editing/ApplyStyleCommand.cpp: * editing/ApplyStyleCommand.h: * editing/BreakBlockquoteCommand.cpp: * editing/BreakBlockquoteCommand.h: * editing/CompositeEditCommand.cpp: * editing/CompositeEditCommand.h: * editing/CreateLinkCommand.cpp: * editing/CreateLinkCommand.h: * editing/DeleteButton.cpp: * editing/DeleteButton.h: * editing/DeleteButtonController.cpp: * editing/DeleteButtonController.h: * editing/DeleteFromTextNodeCommand.cpp: * editing/DeleteFromTextNodeCommand.h: * editing/DeleteSelectionCommand.cpp: * editing/DeleteSelectionCommand.h: * editing/EditAction.h: * editing/EditCommand.cpp: * editing/EditCommand.h: * editing/EditingBoundary.h: * editing/EditingStyle.cpp: * editing/Editor.cpp: * editing/Editor.h: * editing/EditorCommand.cpp: * editing/EditorDeleteAction.h: * editing/EditorInsertAction.h: * editing/FormatBlockCommand.cpp: * editing/FormatBlockCommand.h: * editing/FrameSelection.cpp: * editing/FrameSelection.h: * editing/HTMLInterchange.cpp: * editing/HTMLInterchange.h: * editing/IndentOutdentCommand.cpp: * editing/IndentOutdentCommand.h: * editing/InsertIntoTextNodeCommand.cpp: * editing/InsertIntoTextNodeCommand.h: * editing/InsertLineBreakCommand.cpp: * editing/InsertLineBreakCommand.h: * editing/InsertListCommand.cpp: * editing/InsertListCommand.h: * editing/InsertNodeBeforeCommand.cpp: * editing/InsertNodeBeforeCommand.h: * editing/InsertParagraphSeparatorCommand.cpp: * editing/InsertParagraphSeparatorCommand.h: * editing/InsertTextCommand.cpp: * editing/InsertTextCommand.h: * editing/MarkupAccumulator.h: * editing/MergeIdenticalElementsCommand.cpp: * editing/MergeIdenticalElementsCommand.h: * editing/ModifySelectionListLevel.cpp: * editing/ModifySelectionListLevel.h: * editing/MoveSelectionCommand.cpp: * editing/MoveSelectionCommand.h: * editing/RemoveCSSPropertyCommand.cpp: * editing/RemoveCSSPropertyCommand.h: * editing/RemoveFormatCommand.cpp: * editing/RemoveFormatCommand.h: * editing/RemoveNodeCommand.cpp: * editing/RemoveNodeCommand.h: * editing/RemoveNodePreservingChildrenCommand.cpp: * editing/RemoveNodePreservingChildrenCommand.h: * editing/ReplaceSelectionCommand.cpp: * editing/ReplaceSelectionCommand.h: * editing/SetNodeAttributeCommand.cpp: * editing/SetNodeAttributeCommand.h: * editing/SetSelectionCommand.cpp: * editing/SetSelectionCommand.h: * editing/SimplifyMarkupCommand.cpp: * editing/SimplifyMarkupCommand.h: * editing/SmartReplace.cpp: * editing/SmartReplace.h: * editing/SmartReplaceCF.cpp: * editing/SpellChecker.cpp: * editing/SpellChecker.h: * editing/SpellingCorrectionCommand.cpp: * editing/SpellingCorrectionCommand.h: * editing/SplitElementCommand.cpp: * editing/SplitElementCommand.h: * editing/SplitTextNodeCommand.cpp: * editing/SplitTextNodeCommand.h: * editing/SplitTextNodeContainingElementCommand.cpp: * editing/SplitTextNodeContainingElementCommand.h: * editing/TextAffinity.h: * editing/TextCheckingHelper.cpp: * editing/TextGranularity.h: * editing/TextIterator.cpp: * editing/TextIterator.h: * editing/TextIteratorBehavior.h: * editing/TypingCommand.cpp: * editing/TypingCommand.h: * editing/UnlinkCommand.cpp: * editing/UnlinkCommand.h: * editing/VisiblePosition.cpp: * editing/VisiblePosition.h: * editing/VisibleSelection.cpp: * editing/VisibleSelection.h: * editing/VisibleUnits.cpp: * editing/VisibleUnits.h: * editing/WrapContentsInDummySpanCommand.cpp: * editing/WrapContentsInDummySpanCommand.h: * editing/WritingDirection.h: * editing/efl/EditorEfl.cpp: * editing/htmlediting.cpp: * editing/htmlediting.h: * editing/mac/EditorMac.mm: * editing/mac/FrameSelectionMac.mm: * editing/markup.cpp: * editing/markup.h: * extract-localizable-strings.pl: * fileapi/FileException.cpp: * history/BackForwardClient.h: * history/BackForwardList.cpp: * history/BackForwardList.h: * history/CachedFrame.cpp: * history/CachedFrame.h: * history/CachedFramePlatformData.h: * history/CachedPage.cpp: * history/CachedPage.h: * history/HistoryItem.cpp: * history/HistoryItem.h: * history/PageCache.cpp: * history/PageCache.h: * history/mac/HistoryItemMac.mm: * html/FTPDirectoryDocument.cpp: * html/FTPDirectoryDocument.h: * html/HTMLAudioElement.cpp: * html/HTMLAudioElement.h: * html/HTMLAudioElement.idl: * html/HTMLCanvasElement.cpp: * html/HTMLCanvasElement.h: * html/HTMLCanvasElement.idl: * html/HTMLFieldSetElement.idl: * html/HTMLImageLoader.h: * html/HTMLMediaElement.cpp: * html/HTMLMediaElement.h: * html/HTMLMediaElement.idl: * html/HTMLOptionsCollection.cpp: * html/HTMLPlugInElement.cpp: * html/HTMLSourceElement.cpp: * html/HTMLSourceElement.h: * html/HTMLSourceElement.idl: * html/HTMLTablePartElement.cpp: * html/HTMLTableRowsCollection.cpp: * html/HTMLTableRowsCollection.h: * html/HTMLTitleElement.idl: * html/HTMLTrackElement.cpp: * html/HTMLTrackElement.h: * html/HTMLTrackElement.idl: * html/HTMLVideoElement.cpp: * html/HTMLVideoElement.h: * html/HTMLVideoElement.idl: * html/ImageData.cpp: * html/ImageData.h: * html/ImageData.idl: * html/ImageDocument.cpp: * html/ImageDocument.h: * html/MediaController.cpp: * html/MediaController.h: * html/MediaController.idl: * html/MediaControllerInterface.h: * html/MediaError.h: * html/MediaError.idl: * html/MediaFragmentURIParser.cpp: * html/MediaFragmentURIParser.h: * html/MediaKeyError.h: * html/MediaKeyError.idl: * html/MediaKeyEvent.cpp: * html/MediaKeyEvent.h: * html/MediaKeyEvent.idl: * html/PluginDocument.cpp: * html/PluginDocument.h: * html/TextDocument.cpp: * html/TextDocument.h: * html/TimeRanges.cpp: * html/TimeRanges.h: * html/TimeRanges.idl: * html/VoidCallback.h: * html/VoidCallback.idl: * html/canvas/CanvasGradient.cpp: * html/canvas/CanvasGradient.h: * html/canvas/CanvasGradient.idl: * html/canvas/CanvasPattern.cpp: * html/canvas/CanvasPattern.h: * html/canvas/CanvasPattern.idl: * html/canvas/CanvasRenderingContext.cpp: * html/canvas/CanvasRenderingContext.h: * html/canvas/CanvasRenderingContext.idl: * html/canvas/CanvasRenderingContext2D.cpp: * html/canvas/CanvasRenderingContext2D.h: * html/canvas/CanvasRenderingContext2D.idl: * html/canvas/CanvasStyle.cpp: * html/canvas/CanvasStyle.h: * html/canvas/DOMPath.idl: * html/canvas/OESVertexArrayObject.cpp: * html/canvas/OESVertexArrayObject.h: * html/canvas/OESVertexArrayObject.idl: * html/canvas/WebGLBuffer.cpp: * html/canvas/WebGLBuffer.h: * html/canvas/WebGLBuffer.idl: * html/canvas/WebGLContextGroup.cpp: * html/canvas/WebGLContextGroup.h: * html/canvas/WebGLContextObject.cpp: * html/canvas/WebGLContextObject.h: * html/canvas/WebGLFramebuffer.cpp: * html/canvas/WebGLFramebuffer.h: * html/canvas/WebGLFramebuffer.idl: * html/canvas/WebGLObject.cpp: * html/canvas/WebGLObject.h: * html/canvas/WebGLProgram.cpp: * html/canvas/WebGLProgram.h: * html/canvas/WebGLProgram.idl: * html/canvas/WebGLRenderbuffer.cpp: * html/canvas/WebGLRenderbuffer.h: * html/canvas/WebGLRenderbuffer.idl: * html/canvas/WebGLRenderingContext.cpp: * html/canvas/WebGLRenderingContext.h: * html/canvas/WebGLRenderingContext.idl: * html/canvas/WebGLShader.cpp: * html/canvas/WebGLShader.h: * html/canvas/WebGLShader.idl: * html/canvas/WebGLSharedObject.cpp: * html/canvas/WebGLSharedObject.h: * html/canvas/WebGLTexture.cpp: * html/canvas/WebGLTexture.h: * html/canvas/WebGLTexture.idl: * html/canvas/WebGLUniformLocation.cpp: * html/canvas/WebGLUniformLocation.h: * html/canvas/WebGLUniformLocation.idl: * html/canvas/WebGLVertexArrayObjectOES.cpp: * html/canvas/WebGLVertexArrayObjectOES.h: * html/canvas/WebGLVertexArrayObjectOES.idl: * html/forms/FileIconLoader.cpp: * html/forms/FileIconLoader.h: * html/parser/TextDocumentParser.cpp: * html/parser/TextDocumentParser.h: * html/shadow/MediaControlElementTypes.cpp: * html/shadow/MediaControlElementTypes.h: * html/shadow/MediaControlElements.cpp: * html/shadow/MediaControlElements.h: * html/shadow/MediaControls.cpp: * html/shadow/MediaControls.h: * html/shadow/MediaControlsApple.cpp: * html/shadow/MediaControlsApple.h: * html/shadow/MediaControlsGtk.cpp: * html/shadow/MediaControlsGtk.h: * html/shadow/SpinButtonElement.cpp: * html/shadow/SpinButtonElement.h: * html/shadow/TextControlInnerElements.cpp: * html/shadow/TextControlInnerElements.h: * html/track/AudioTrack.h: * html/track/AudioTrack.idl: * html/track/AudioTrackList.cpp: * html/track/AudioTrackList.h: * html/track/AudioTrackList.idl: * html/track/DataCue.cpp: * html/track/DataCue.h: * html/track/DataCue.idl: * html/track/InbandGenericTextTrack.cpp: * html/track/InbandGenericTextTrack.h: * html/track/InbandTextTrack.cpp: * html/track/InbandTextTrack.h: * html/track/InbandWebVTTTextTrack.cpp: * html/track/InbandWebVTTTextTrack.h: * html/track/LoadableTextTrack.cpp: * html/track/LoadableTextTrack.h: * html/track/TextTrack.h: * html/track/TextTrack.idl: * html/track/TextTrackCue.idl: * html/track/TextTrackCueGeneric.cpp: * html/track/TextTrackCueGeneric.h: * html/track/TextTrackCueList.cpp: * html/track/TextTrackCueList.h: * html/track/TextTrackCueList.idl: * html/track/TextTrackList.cpp: * html/track/TextTrackList.h: * html/track/TextTrackList.idl: * html/track/TextTrackRegion.idl: * html/track/TextTrackRegionList.cpp: * html/track/TextTrackRegionList.h: * html/track/TextTrackRegionList.idl: * html/track/TrackBase.cpp: * html/track/TrackBase.h: * html/track/TrackEvent.cpp: * html/track/TrackEvent.h: * html/track/TrackEvent.idl: * html/track/TrackListBase.cpp: * html/track/TrackListBase.h: * html/track/VTTCue.idl: * html/track/VideoTrack.h: * html/track/VideoTrack.idl: * html/track/VideoTrackList.cpp: * html/track/VideoTrackList.h: * html/track/VideoTrackList.idl: * html/track/WebVTTElement.cpp: * html/track/WebVTTElement.h: * inspector/CommandLineAPIHost.cpp: * inspector/CommandLineAPIHost.h: * inspector/CommandLineAPIModuleSource.js: * inspector/InspectorAllInOne.cpp: * inspector/InspectorClient.h: * inspector/InspectorDOMAgent.cpp: * inspector/InspectorDOMAgent.h: * inspector/InspectorDOMStorageAgent.cpp: * inspector/InspectorDOMStorageAgent.h: * inspector/InspectorDatabaseAgent.cpp: * inspector/InspectorDatabaseAgent.h: * inspector/InspectorDatabaseResource.cpp: * inspector/InspectorDatabaseResource.h: * inspector/InspectorForwarding.h: * inspector/InspectorFrontendHost.cpp: * inspector/InspectorFrontendHost.h: * inspector/InspectorLayerTreeAgent.h: * inspector/InspectorNodeFinder.cpp: * inspector/InspectorNodeFinder.h: * inspector/InspectorOverlay.cpp: * inspector/InspectorOverlay.h: * inspector/InspectorOverlayPage.html: * inspector/InspectorProfilerAgent.cpp: * inspector/InspectorProfilerAgent.h: * inspector/ScriptProfile.idl: * inspector/ScriptProfileNode.idl: * loader/CookieJar.h: * loader/CrossOriginAccessControl.cpp: * loader/CrossOriginAccessControl.h: * loader/CrossOriginPreflightResultCache.cpp: * loader/CrossOriginPreflightResultCache.h: * loader/DocumentLoader.cpp: * loader/DocumentLoader.h: * loader/DocumentWriter.cpp: * loader/EmptyClients.h: * loader/FormState.cpp: * loader/FormState.h: * loader/FrameLoadRequest.h: * loader/FrameLoader.cpp: * loader/FrameLoader.h: * loader/FrameLoaderClient.h: * loader/FrameLoaderTypes.h: * loader/HistoryController.cpp: * loader/HistoryController.h: * loader/MixedContentChecker.cpp: * loader/NavigationAction.cpp: * loader/NavigationAction.h: * loader/NavigationScheduler.cpp: * loader/NavigationScheduler.h: * loader/NetscapePlugInStreamLoader.cpp: * loader/NetscapePlugInStreamLoader.h: * loader/PolicyCallback.cpp: * loader/PolicyCallback.h: * loader/PolicyChecker.cpp: * loader/PolicyChecker.h: * loader/ProgressTracker.cpp: * loader/ProgressTracker.h: * loader/ResourceBuffer.cpp: * loader/ResourceBuffer.h: * loader/ResourceLoadNotifier.cpp: * loader/ResourceLoadNotifier.h: * loader/ResourceLoader.cpp: * loader/ResourceLoader.h: * loader/SinkDocument.cpp: * loader/SinkDocument.h: * loader/SubframeLoader.cpp: * loader/SubframeLoader.h: * loader/SubresourceLoader.cpp: * loader/SubresourceLoader.h: * loader/SubstituteData.h: * loader/TextTrackLoader.cpp: * loader/appcache/ApplicationCacheAllInOne.cpp: * loader/archive/Archive.cpp: * loader/archive/Archive.h: * loader/archive/ArchiveFactory.cpp: * loader/archive/ArchiveFactory.h: * loader/archive/ArchiveResource.cpp: * loader/archive/ArchiveResource.h: * loader/archive/ArchiveResourceCollection.cpp: * loader/archive/ArchiveResourceCollection.h: * loader/archive/cf/LegacyWebArchive.cpp: * loader/archive/cf/LegacyWebArchive.h: * loader/archive/cf/LegacyWebArchiveMac.mm: * loader/cache/CachePolicy.h: * loader/cache/CachedCSSStyleSheet.cpp: * loader/cache/CachedFont.cpp: * loader/cache/CachedFont.h: * loader/cache/CachedResourceRequest.cpp: * loader/cache/CachedResourceRequest.h: * loader/cache/CachedResourceRequestInitiators.cpp: * loader/cache/CachedResourceRequestInitiators.h: * loader/cf/ResourceLoaderCFNet.cpp: * loader/icon/IconController.cpp: * loader/icon/IconController.h: * loader/icon/IconDatabase.cpp: * loader/icon/IconDatabase.h: * loader/icon/IconDatabaseBase.cpp: * loader/icon/IconDatabaseBase.h: * loader/icon/IconDatabaseClient.h: * loader/icon/IconLoader.cpp: * loader/icon/IconLoader.h: * loader/icon/IconRecord.cpp: * loader/icon/IconRecord.h: * loader/icon/PageURLRecord.cpp: * loader/icon/PageURLRecord.h: * loader/mac/DocumentLoaderMac.cpp: * loader/mac/LoaderNSURLExtras.h: * loader/mac/LoaderNSURLExtras.mm: * loader/mac/ResourceBuffer.mm: * loader/mac/ResourceLoaderMac.mm: * loader/win/DocumentLoaderWin.cpp: * loader/win/FrameLoaderWin.cpp: * mathml/MathMLAllInOne.cpp: * page/AbstractView.idl: * page/AlternativeTextClient.h: * page/AutoscrollController.cpp: * page/AutoscrollController.h: * page/BarProp.cpp: * page/BarProp.h: * page/BarProp.idl: * page/ContentSecurityPolicy.cpp: * page/ContentSecurityPolicy.h: * page/ContextMenuClient.h: * page/ContextMenuContext.cpp: * page/ContextMenuContext.h: * page/ContextMenuController.cpp: * page/ContextMenuController.h: * page/DOMSecurityPolicy.cpp: * page/DOMSecurityPolicy.h: * page/DOMSelection.cpp: * page/DOMSelection.h: * page/DOMSelection.idl: * page/DOMTimer.cpp: * page/DOMTimer.h: * page/DOMWindow.cpp: * page/DOMWindow.h: * page/DOMWindow.idl: * page/DragActions.h: * page/DragClient.h: * page/DragController.cpp: * page/DragController.h: * page/DragSession.h: * page/DragState.h: * page/EditorClient.h: * page/EventHandler.cpp: * page/EventHandler.h: * page/FocusController.cpp: * page/FocusController.h: * page/FocusDirection.h: * page/FrameTree.h: * page/GestureTapHighlighter.cpp: * page/GestureTapHighlighter.h: * page/History.cpp: * page/History.h: * page/History.idl: * page/Location.cpp: * page/Location.h: * page/Location.idl: * page/MouseEventWithHitTestResults.cpp: * page/MouseEventWithHitTestResults.h: * page/Navigator.cpp: * page/NavigatorBase.cpp: * page/NavigatorBase.h: * page/PageConsole.cpp: * page/PageConsole.h: * page/Screen.cpp: * page/Screen.h: * page/Screen.idl: * page/SecurityOrigin.cpp: * page/SecurityOrigin.h: * page/SecurityOriginHash.h: * page/Settings.cpp: * page/Settings.h: * page/SpatialNavigation.cpp: * page/SuspendableTimer.cpp: * page/SuspendableTimer.h: * page/UserContentTypes.h: * page/UserContentURLPattern.cpp: * page/UserContentURLPattern.h: * page/UserScript.h: * page/UserScriptTypes.h: * page/UserStyleSheet.h: * page/UserStyleSheetTypes.h: * page/WebCoreKeyboardUIMode.h: * page/WebKitPoint.h: * page/WebKitPoint.idl: * page/WindowBase64.idl: * page/WindowFeatures.h: * page/WindowFocusAllowedIndicator.cpp: * page/WindowFocusAllowedIndicator.h: * page/WindowTimers.idl: * page/WorkerNavigator.cpp: * page/WorkerNavigator.h: * page/WorkerNavigator.idl: * page/animation/AnimationBase.cpp: * page/animation/AnimationBase.h: * page/animation/AnimationController.cpp: * page/animation/AnimationController.h: * page/animation/AnimationControllerPrivate.h: * page/animation/CSSPropertyAnimation.cpp: * page/animation/CSSPropertyAnimation.h: * page/animation/CompositeAnimation.cpp: * page/animation/CompositeAnimation.h: * page/animation/ImplicitAnimation.cpp: * page/animation/ImplicitAnimation.h: * page/animation/KeyframeAnimation.cpp: * page/animation/KeyframeAnimation.h: * page/efl/DragControllerEfl.cpp: * page/efl/EventHandlerEfl.cpp: * page/gtk/DragControllerGtk.cpp: * page/gtk/EventHandlerGtk.cpp: * page/ios/EventHandlerIOS.mm: * page/mac/DragControllerMac.mm: * page/mac/EventHandlerMac.mm: * page/mac/PageMac.cpp: * page/mac/WebCoreFrameView.h: * page/make_settings.pl: * page/win/DragControllerWin.cpp: * page/win/EventHandlerWin.cpp: * page/win/FrameCGWin.cpp: * page/win/FrameCairoWin.cpp: * page/win/FrameGdiWin.cpp: * page/win/FrameWin.cpp: * page/win/FrameWin.h: * pdf/ios/PDFDocument.h: * platform/Clock.cpp: * platform/Clock.h: * platform/ClockGeneric.cpp: * platform/ClockGeneric.h: * platform/ColorChooser.h: * platform/ColorChooserClient.h: * platform/ContentType.cpp: * platform/ContentType.h: * platform/ContextMenu.h: * platform/ContextMenuItem.h: * platform/Cookie.h: * platform/Cursor.h: * platform/DragData.cpp: * platform/DragData.h: * platform/DragImage.cpp: * platform/DragImage.h: * platform/FileChooser.cpp: * platform/FileChooser.h: * platform/FileSystem.h: * platform/FloatConversion.h: * platform/KillRing.h: * platform/LinkHash.h: * platform/LocalizedStrings.cpp: * platform/LocalizedStrings.h: * platform/Logging.cpp: * platform/Logging.h: * platform/MIMETypeRegistry.cpp: * platform/MIMETypeRegistry.h: * platform/MediaDescription.h: * platform/MediaSample.h: * platform/NotImplemented.h: * platform/PODFreeListArena.h: * platform/Pasteboard.h: * platform/PasteboardStrategy.h: * platform/PlatformExportMacros.h: * platform/PlatformKeyboardEvent.h: * platform/PlatformMenuDescription.h: * platform/PlatformMouseEvent.h: * platform/PlatformPasteboard.h: * platform/PlatformScreen.h: * platform/PlatformSpeechSynthesis.h: * platform/PlatformSpeechSynthesisUtterance.cpp: * platform/PlatformSpeechSynthesisUtterance.h: * platform/PlatformSpeechSynthesisVoice.cpp: * platform/PlatformSpeechSynthesisVoice.h: * platform/PlatformSpeechSynthesizer.cpp: * platform/PlatformSpeechSynthesizer.h: * platform/PlatformWheelEvent.h: * platform/PopupMenuClient.h: * platform/RemoteCommandListener.cpp: * platform/RemoteCommandListener.h: * platform/SSLKeyGenerator.h: * platform/SchemeRegistry.cpp: * platform/SchemeRegistry.h: * platform/ScrollTypes.h: * platform/ScrollView.cpp: * platform/ScrollView.h: * platform/Scrollbar.cpp: * platform/Scrollbar.h: * platform/SharedBuffer.cpp: * platform/SharedBuffer.h: * platform/SharedTimer.h: * platform/Sound.h: * platform/ThreadCheck.h: * platform/ThreadGlobalData.cpp: * platform/ThreadGlobalData.h: * platform/ThreadTimers.cpp: * platform/ThreadTimers.h: * platform/Timer.cpp: * platform/Timer.h: * platform/URL.cpp: * platform/URL.h: * platform/Widget.cpp: * platform/Widget.h: * platform/animation/AnimationUtilities.h: * platform/audio/AudioArray.h: * platform/audio/AudioBus.cpp: * platform/audio/AudioBus.h: * platform/audio/AudioChannel.cpp: * platform/audio/AudioChannel.h: * platform/audio/AudioDestination.h: * platform/audio/AudioFIFO.cpp: * platform/audio/AudioFIFO.h: * platform/audio/AudioFileReader.h: * platform/audio/AudioIOCallback.h: * platform/audio/AudioPullFIFO.cpp: * platform/audio/AudioPullFIFO.h: * platform/audio/AudioSourceProvider.h: * platform/audio/Biquad.cpp: * platform/audio/Biquad.h: * platform/audio/Cone.cpp: * platform/audio/Cone.h: * platform/audio/DirectConvolver.cpp: * platform/audio/DirectConvolver.h: * platform/audio/Distance.cpp: * platform/audio/Distance.h: * platform/audio/DownSampler.cpp: * platform/audio/DownSampler.h: * platform/audio/DynamicsCompressor.cpp: * platform/audio/DynamicsCompressor.h: * platform/audio/DynamicsCompressorKernel.cpp: * platform/audio/DynamicsCompressorKernel.h: * platform/audio/FFTConvolver.cpp: * platform/audio/FFTConvolver.h: * platform/audio/FFTFrame.cpp: * platform/audio/FFTFrame.h: * platform/audio/HRTFDatabase.cpp: * platform/audio/HRTFDatabase.h: * platform/audio/HRTFDatabaseLoader.cpp: * platform/audio/HRTFDatabaseLoader.h: * platform/audio/HRTFElevation.cpp: * platform/audio/HRTFElevation.h: * platform/audio/HRTFKernel.cpp: * platform/audio/HRTFKernel.h: * platform/audio/MultiChannelResampler.cpp: * platform/audio/MultiChannelResampler.h: * platform/audio/Panner.cpp: * platform/audio/Panner.h: * platform/audio/Reverb.cpp: * platform/audio/Reverb.h: * platform/audio/ReverbAccumulationBuffer.cpp: * platform/audio/ReverbAccumulationBuffer.h: * platform/audio/ReverbConvolver.cpp: * platform/audio/ReverbConvolver.h: * platform/audio/ReverbConvolverStage.cpp: * platform/audio/ReverbConvolverStage.h: * platform/audio/ReverbInputBuffer.cpp: * platform/audio/ReverbInputBuffer.h: * platform/audio/SincResampler.cpp: * platform/audio/SincResampler.h: * platform/audio/UpSampler.cpp: * platform/audio/UpSampler.h: * platform/audio/ZeroPole.cpp: * platform/audio/ZeroPole.h: * platform/audio/ios/AudioDestinationIOS.cpp: * platform/audio/ios/AudioDestinationIOS.h: * platform/audio/ios/AudioFileReaderIOS.cpp: * platform/audio/ios/AudioFileReaderIOS.h: * platform/audio/mac/AudioDestinationMac.cpp: * platform/audio/mac/AudioDestinationMac.h: * platform/audio/mac/AudioFileReaderMac.cpp: * platform/audio/mac/AudioFileReaderMac.h: * platform/audio/mac/FFTFrameMac.cpp: * platform/cf/FileSystemCF.cpp: * platform/cf/SharedBufferCF.cpp: * platform/cf/URLCF.cpp: * platform/cocoa/KeyEventCocoa.h: * platform/cocoa/KeyEventCocoa.mm: * platform/efl/CursorEfl.cpp: * platform/efl/EflKeyboardUtilities.cpp: * platform/efl/EflKeyboardUtilities.h: * platform/efl/FileSystemEfl.cpp: * platform/efl/LanguageEfl.cpp: * platform/efl/LocalizedStringsEfl.cpp: * platform/efl/MIMETypeRegistryEfl.cpp: * platform/efl/PlatformKeyboardEventEfl.cpp: * platform/efl/PlatformMouseEventEfl.cpp: * platform/efl/PlatformScreenEfl.cpp: * platform/efl/PlatformWheelEventEfl.cpp: * platform/efl/RenderThemeEfl.h: * platform/efl/ScrollbarEfl.h: * platform/efl/SharedTimerEfl.cpp: * platform/efl/SoundEfl.cpp: * platform/efl/TemporaryLinkStubs.cpp: * platform/efl/WidgetEfl.cpp: * platform/graphics/ANGLEWebKitBridge.cpp: * platform/graphics/ANGLEWebKitBridge.h: * platform/graphics/AudioTrackPrivate.h: * platform/graphics/BitmapImage.cpp: * platform/graphics/BitmapImage.h: * platform/graphics/Color.cpp: * platform/graphics/Color.h: * platform/graphics/CrossfadeGeneratedImage.cpp: * platform/graphics/CrossfadeGeneratedImage.h: * platform/graphics/DashArray.h: * platform/graphics/DisplayRefreshMonitor.cpp: * platform/graphics/DisplayRefreshMonitor.h: * platform/graphics/FloatPoint.cpp: * platform/graphics/FloatPoint.h: * platform/graphics/FloatQuad.cpp: * platform/graphics/FloatQuad.h: * platform/graphics/FloatRect.cpp: * platform/graphics/FloatRect.h: * platform/graphics/FloatSize.cpp: * platform/graphics/FloatSize.h: * platform/graphics/FontBaseline.h: * platform/graphics/FontCache.cpp: * platform/graphics/FontCache.h: * platform/graphics/FontData.cpp: * platform/graphics/FontData.h: * platform/graphics/FontDescription.cpp: * platform/graphics/FontFeatureSettings.cpp: * platform/graphics/FontFeatureSettings.h: * platform/graphics/FontGlyphs.cpp: * platform/graphics/FontOrientation.h: * platform/graphics/FontRenderingMode.h: * platform/graphics/FontSelector.h: * platform/graphics/FontWidthVariant.h: * platform/graphics/FormatConverter.cpp: * platform/graphics/FormatConverter.h: * platform/graphics/GeneratedImage.h: * platform/graphics/Glyph.h: * platform/graphics/GlyphBuffer.h: * platform/graphics/GlyphMetricsMap.h: * platform/graphics/GlyphPage.h: * platform/graphics/GlyphPageTreeNode.cpp: * platform/graphics/GlyphPageTreeNode.h: * platform/graphics/Gradient.cpp: * platform/graphics/Gradient.h: * platform/graphics/GradientImage.h: * platform/graphics/GraphicsContext.h: * platform/graphics/GraphicsContext3D.cpp: * platform/graphics/GraphicsContext3D.h: * platform/graphics/GraphicsLayer.cpp: * platform/graphics/GraphicsLayer.h: * platform/graphics/GraphicsLayerClient.h: * platform/graphics/GraphicsTypes.cpp: * platform/graphics/GraphicsTypes.h: * platform/graphics/GraphicsTypes3D.h: * platform/graphics/Image.cpp: * platform/graphics/Image.h: * platform/graphics/ImageBuffer.cpp: * platform/graphics/ImageBuffer.h: * platform/graphics/ImageBufferData.h: * platform/graphics/ImageObserver.h: * platform/graphics/ImageSource.cpp: * platform/graphics/ImageSource.h: * platform/graphics/InbandTextTrackPrivate.h: * platform/graphics/InbandTextTrackPrivateClient.h: * platform/graphics/IntPoint.cpp: * platform/graphics/IntPoint.h: * platform/graphics/IntSize.cpp: * platform/graphics/IntSize.h: * platform/graphics/MediaPlayer.cpp: * platform/graphics/MediaPlayer.h: * platform/graphics/MediaPlayerPrivate.h: * platform/graphics/MediaSourcePrivateClient.h: * platform/graphics/NativeImagePtr.h: * platform/graphics/OpenGLESShims.h: * platform/graphics/Path.cpp: * platform/graphics/Path.h: * platform/graphics/PathTraversalState.h: * platform/graphics/Pattern.cpp: * platform/graphics/Pattern.h: * platform/graphics/PlatformLayer.h: * platform/graphics/PlatformTimeRanges.cpp: * platform/graphics/PlatformTimeRanges.h: * platform/graphics/SegmentedFontData.cpp: * platform/graphics/SegmentedFontData.h: * platform/graphics/ShadowBlur.cpp: * platform/graphics/ShadowBlur.h: * platform/graphics/SimpleFontData.cpp: * platform/graphics/SourceBufferPrivateClient.h: * platform/graphics/StringTruncator.cpp: * platform/graphics/StringTruncator.h: * platform/graphics/TrackPrivateBase.h: * platform/graphics/VideoTrackPrivate.h: * platform/graphics/WindRule.h: * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.h: * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm: * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.h: * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h: * platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h: * platform/graphics/avfoundation/cf/CoreMediaSoftLinking.h: * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp: * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.h: * platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.cpp: * platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.h: * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h: * platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.cpp: * platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm: * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.h: * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h: * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.mm: * platform/graphics/ca/GraphicsLayerCA.cpp: * platform/graphics/ca/GraphicsLayerCA.h: * platform/graphics/ca/LayerFlushScheduler.cpp: * platform/graphics/ca/LayerFlushScheduler.h: * platform/graphics/ca/LayerFlushSchedulerClient.h: * platform/graphics/ca/PlatformCAAnimation.h: * platform/graphics/ca/PlatformCAFilters.h: * platform/graphics/ca/PlatformCALayer.cpp: * platform/graphics/ca/PlatformCALayer.h: * platform/graphics/ca/PlatformCALayerClient.h: * platform/graphics/ca/TransformationMatrixCA.cpp: * platform/graphics/ca/mac/LayerFlushSchedulerMac.cpp: * platform/graphics/ca/mac/LayerPool.mm: * platform/graphics/ca/mac/PlatformCAAnimationMac.mm: * platform/graphics/ca/mac/PlatformCAFiltersMac.h: * platform/graphics/ca/mac/PlatformCAFiltersMac.mm: * platform/graphics/ca/mac/PlatformCALayerMac.h: * platform/graphics/ca/mac/PlatformCALayerMac.mm: * platform/graphics/ca/mac/WebTiledBackingLayer.h: * platform/graphics/ca/mac/WebTiledBackingLayer.mm: * platform/graphics/ca/win/AbstractCACFLayerTreeHost.h: * platform/graphics/ca/win/CACFLayerTreeHost.cpp: * platform/graphics/ca/win/CACFLayerTreeHost.h: * platform/graphics/ca/win/CACFLayerTreeHostClient.h: * platform/graphics/ca/win/LayerChangesFlusher.cpp: * platform/graphics/ca/win/LayerChangesFlusher.h: * platform/graphics/ca/win/LegacyCACFLayerTreeHost.cpp: * platform/graphics/ca/win/LegacyCACFLayerTreeHost.h: * platform/graphics/ca/win/PlatformCAAnimationWin.cpp: * platform/graphics/ca/win/PlatformCAFiltersWin.cpp: * platform/graphics/ca/win/PlatformCALayerWin.cpp: * platform/graphics/ca/win/PlatformCALayerWin.h: * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp: * platform/graphics/ca/win/PlatformCALayerWinInternal.h: * platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp: * platform/graphics/ca/win/WKCACFViewLayerTreeHost.h: * platform/graphics/cairo/BitmapImageCairo.cpp: * platform/graphics/cairo/CairoUtilities.cpp: * platform/graphics/cairo/CairoUtilities.h: * platform/graphics/cairo/DrawingBufferCairo.cpp: * platform/graphics/cairo/FloatRectCairo.cpp: * platform/graphics/cairo/FontCairo.cpp: * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp: * platform/graphics/cairo/GradientCairo.cpp: * platform/graphics/cairo/GraphicsContext3DCairo.cpp: * platform/graphics/cairo/GraphicsContextCairo.cpp: * platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h: * platform/graphics/cairo/ImageBufferCairo.cpp: * platform/graphics/cairo/ImageBufferDataCairo.h: * platform/graphics/cairo/ImageCairo.cpp: * platform/graphics/cairo/PatternCairo.cpp: * platform/graphics/cairo/PlatformContextCairo.cpp: * platform/graphics/cairo/PlatformContextCairo.h: * platform/graphics/cairo/TransformationMatrixCairo.cpp: * platform/graphics/cg/BitmapImageCG.cpp: * platform/graphics/cg/ColorCG.cpp: * platform/graphics/cg/FloatPointCG.cpp: * platform/graphics/cg/FloatRectCG.cpp: * platform/graphics/cg/FloatSizeCG.cpp: * platform/graphics/cg/GradientCG.cpp: * platform/graphics/cg/GraphicsContext3DCG.cpp: * platform/graphics/cg/GraphicsContextCG.cpp: * platform/graphics/cg/GraphicsContextCG.h: * platform/graphics/cg/GraphicsContextPlatformPrivateCG.h: * platform/graphics/cg/ImageBufferCG.cpp: * platform/graphics/cg/ImageBufferDataCG.cpp: * platform/graphics/cg/ImageBufferDataCG.h: * platform/graphics/cg/ImageCG.cpp: * platform/graphics/cg/ImageSourceCG.cpp: * platform/graphics/cg/IntPointCG.cpp: * platform/graphics/cg/IntRectCG.cpp: * platform/graphics/cg/IntSizeCG.cpp: * platform/graphics/cg/PDFDocumentImage.cpp: * platform/graphics/cg/PDFDocumentImage.h: * platform/graphics/cg/PathCG.cpp: * platform/graphics/cg/PatternCG.cpp: * platform/graphics/cg/TransformationMatrixCG.cpp: * platform/graphics/efl/IconEfl.cpp: * platform/graphics/efl/ImageEfl.cpp: * platform/graphics/filters/FilterOperation.cpp: * platform/graphics/filters/FilterOperation.h: * platform/graphics/filters/FilterOperations.cpp: * platform/graphics/filters/FilterOperations.h: * platform/graphics/freetype/FontPlatformDataFreeType.cpp: * platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp: * platform/graphics/freetype/SimpleFontDataFreeType.cpp: * platform/graphics/gpu/mac/DrawingBufferMac.mm: * platform/graphics/gtk/GdkCairoUtilities.cpp: * platform/graphics/gtk/GdkCairoUtilities.h: * platform/graphics/gtk/IconGtk.cpp: * platform/graphics/gtk/ImageGtk.cpp: * platform/graphics/ios/DisplayRefreshMonitorIOS.mm: * platform/graphics/ios/FontCacheIOS.mm: * platform/graphics/ios/GraphicsContext3DIOS.h: * platform/graphics/ios/InbandTextTrackPrivateAVFIOS.h: * platform/graphics/ios/InbandTextTrackPrivateAVFIOS.mm: * platform/graphics/ios/MediaPlayerPrivateIOS.h: * platform/graphics/ios/MediaPlayerPrivateIOS.mm: * platform/graphics/mac/ColorMac.h: * platform/graphics/mac/ColorMac.mm: * platform/graphics/mac/DisplayRefreshMonitorMac.cpp: * platform/graphics/mac/FloatPointMac.mm: * platform/graphics/mac/FloatRectMac.mm: * platform/graphics/mac/FloatSizeMac.mm: * platform/graphics/mac/FontCacheMac.mm: * platform/graphics/mac/FontCustomPlatformData.h: * platform/graphics/mac/GlyphPageTreeNodeMac.cpp: * platform/graphics/mac/GraphicsContext3DMac.mm: * platform/graphics/mac/GraphicsContextMac.mm: * platform/graphics/mac/ImageMac.mm: * platform/graphics/mac/IntPointMac.mm: * platform/graphics/mac/IntRectMac.mm: * platform/graphics/mac/IntSizeMac.mm: * platform/graphics/mac/MediaPlayerPrivateQTKit.h: * platform/graphics/mac/MediaPlayerPrivateQTKit.mm: * platform/graphics/mac/MediaPlayerProxy.h: * platform/graphics/mac/WebCoreCALayerExtras.h: * platform/graphics/mac/WebCoreCALayerExtras.mm: * platform/graphics/mac/WebGLLayer.h: * platform/graphics/mac/WebGLLayer.mm: * platform/graphics/mac/WebLayer.h: * platform/graphics/mac/WebLayer.mm: * platform/graphics/mac/WebTiledLayer.h: * platform/graphics/mac/WebTiledLayer.mm: * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp: * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp: * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp: * platform/graphics/opentype/OpenTypeUtilities.cpp: * platform/graphics/opentype/OpenTypeUtilities.h: * platform/graphics/transforms/AffineTransform.cpp: * platform/graphics/transforms/AffineTransform.h: * platform/graphics/transforms/Matrix3DTransformOperation.cpp: * platform/graphics/transforms/Matrix3DTransformOperation.h: * platform/graphics/transforms/PerspectiveTransformOperation.cpp: * platform/graphics/transforms/PerspectiveTransformOperation.h: * platform/graphics/transforms/TransformState.cpp: * platform/graphics/transforms/TransformState.h: * platform/graphics/transforms/TransformationMatrix.cpp: * platform/graphics/transforms/TransformationMatrix.h: * platform/graphics/win/FontCGWin.cpp: * platform/graphics/win/FontCacheWin.cpp: * platform/graphics/win/FontCustomPlatformDataCairo.cpp: * platform/graphics/win/FontWin.cpp: * platform/graphics/win/FullScreenController.cpp: * platform/graphics/win/FullScreenController.h: * platform/graphics/win/FullScreenControllerClient.h: * platform/graphics/win/GlyphPageTreeNodeCGWin.cpp: * platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp: * platform/graphics/win/GraphicsContextCGWin.cpp: * platform/graphics/win/GraphicsContextCairoWin.cpp: * platform/graphics/win/GraphicsContextWin.cpp: * platform/graphics/win/ImageCGWin.cpp: * platform/graphics/win/ImageCairoWin.cpp: * platform/graphics/win/ImageWin.cpp: * platform/graphics/win/IntPointWin.cpp: * platform/graphics/win/IntRectWin.cpp: * platform/graphics/win/IntSizeWin.cpp: * platform/graphics/win/LocalWindowsContext.h: * platform/graphics/win/MediaPlayerPrivateTaskTimer.cpp: * platform/graphics/win/MediaPlayerPrivateTaskTimer.h: * platform/graphics/win/SimpleFontDataCGWin.cpp: * platform/graphics/win/SimpleFontDataCairoWin.cpp: * platform/graphics/win/SimpleFontDataWin.cpp: * platform/graphics/win/TransformationMatrixWin.cpp: * platform/graphics/wince/FontCacheWinCE.cpp: * platform/graphics/wince/FontWinCE.cpp: * platform/graphics/wince/MediaPlayerPrivateWinCE.h: * platform/graphics/wince/SimpleFontDataWinCE.cpp: * platform/gtk/CompositionResults.h: * platform/gtk/CursorGtk.cpp: * platform/gtk/GtkPluginWidget.cpp: * platform/gtk/GtkPluginWidget.h: * platform/gtk/LocalizedStringsGtk.cpp: * platform/gtk/MIMETypeRegistryGtk.cpp: * platform/gtk/PlatformKeyboardEventGtk.cpp: * platform/gtk/PlatformMouseEventGtk.cpp: * platform/gtk/PlatformScreenGtk.cpp: * platform/gtk/PlatformWheelEventGtk.cpp: * platform/gtk/RedirectedXCompositeWindow.cpp: * platform/gtk/RedirectedXCompositeWindow.h: * platform/gtk/RenderThemeGtk.h: * platform/gtk/ScrollViewGtk.cpp: * platform/gtk/SharedTimerGtk.cpp: * platform/gtk/TemporaryLinkStubs.cpp: * platform/gtk/UserAgentGtk.cpp: * platform/gtk/UserAgentGtk.h: * platform/gtk/WidgetGtk.cpp: * platform/gtk/WidgetRenderingContext.cpp: * platform/image-decoders/ImageDecoder.h: * platform/image-decoders/cairo/ImageDecoderCairo.cpp: * platform/image-decoders/gif/GIFImageDecoder.cpp: * platform/image-decoders/gif/GIFImageDecoder.h: * platform/image-decoders/gif/GIFImageReader.cpp: * platform/image-decoders/jpeg/JPEGImageDecoder.cpp: * platform/image-decoders/jpeg/JPEGImageDecoder.h: * platform/image-decoders/png/PNGImageDecoder.cpp: * platform/image-decoders/png/PNGImageDecoder.h: * platform/image-decoders/webp/WEBPImageDecoder.cpp: * platform/image-decoders/webp/WEBPImageDecoder.h: * platform/ios/CursorIOS.cpp: * platform/ios/DragImageIOS.mm: * platform/ios/KeyEventCodesIOS.h: * platform/ios/KeyEventIOS.mm: * platform/ios/PlatformPasteboardIOS.mm: * platform/ios/PlatformScreenIOS.mm: * platform/ios/PlatformSpeechSynthesizerIOS.mm: * platform/ios/RemoteCommandListenerIOS.h: * platform/ios/RemoteCommandListenerIOS.mm: * platform/ios/ScrollViewIOS.mm: * platform/ios/SoundIOS.mm: * platform/ios/SystemMemory.h: * platform/ios/SystemMemoryIOS.cpp: * platform/ios/WebCoreSystemInterfaceIOS.h: * platform/ios/WebCoreSystemInterfaceIOS.mm: * platform/ios/WidgetIOS.mm: * platform/mac/BlockExceptions.h: * platform/mac/BlockExceptions.mm: * platform/mac/ContextMenuItemMac.mm: * platform/mac/ContextMenuMac.mm: * platform/mac/CursorMac.mm: * platform/mac/DragDataMac.mm: * platform/mac/DragImageMac.mm: * platform/mac/FileSystemMac.mm: * platform/mac/KeyEventMac.mm: * platform/mac/LocalCurrentGraphicsContext.h: * platform/mac/LocalCurrentGraphicsContext.mm: * platform/mac/LoggingMac.mm: * platform/mac/MIMETypeRegistryMac.mm: * platform/mac/MediaTimeMac.cpp: * platform/mac/MediaTimeMac.h: * platform/mac/PasteboardMac.mm: * platform/mac/PlatformClockCA.cpp: * platform/mac/PlatformClockCA.h: * platform/mac/PlatformClockCM.h: * platform/mac/PlatformClockCM.mm: * platform/mac/PlatformPasteboardMac.mm: * platform/mac/PlatformScreenMac.mm: * platform/mac/PlatformSpeechSynthesisMac.mm: * platform/mac/PlatformSpeechSynthesizerMac.mm: * platform/mac/ScrollViewMac.mm: * platform/mac/SharedBufferMac.mm: * platform/mac/SharedTimerMac.mm: * platform/mac/SoftLinking.h: * platform/mac/SoundMac.mm: * platform/mac/ThreadCheck.mm: * platform/mac/URLMac.mm: * platform/mac/WebCoreNSStringExtras.h: * platform/mac/WebCoreNSStringExtras.mm: * platform/mac/WebCoreNSURLExtras.h: * platform/mac/WebCoreNSURLExtras.mm: * platform/mac/WebCoreObjCExtras.h: * platform/mac/WebCoreObjCExtras.mm: * platform/mac/WebCoreSystemInterface.h: * platform/mac/WebCoreSystemInterface.mm: * platform/mac/WebCoreView.h: * platform/mac/WebCoreView.m: * platform/mac/WebFontCache.h: * platform/mac/WebFontCache.mm: * platform/mac/WebWindowAnimation.h: * platform/mac/WebWindowAnimation.mm: * platform/mac/WidgetMac.mm: * platform/mediastream/MediaStreamConstraintsValidationClient.h: * platform/mediastream/MediaStreamCreationClient.h: * platform/mediastream/MediaStreamSourceCapabilities.h: * platform/mediastream/MediaStreamSourceStates.h: * platform/mediastream/MediaStreamTrackSourcesRequestClient.h: * platform/mediastream/RTCIceServer.h: * platform/mediastream/mac/AVAudioCaptureSource.h: * platform/mediastream/mac/AVAudioCaptureSource.mm: * platform/mediastream/mac/AVCaptureDeviceManager.h: * platform/mediastream/mac/AVCaptureDeviceManager.mm: * platform/mediastream/mac/AVMediaCaptureSource.h: * platform/mediastream/mac/AVMediaCaptureSource.mm: * platform/mediastream/mac/AVVideoCaptureSource.h: * platform/mediastream/mac/AVVideoCaptureSource.mm: * platform/mock/MockMediaStreamCenter.cpp: * platform/mock/MockMediaStreamCenter.h: * platform/mock/PlatformSpeechSynthesizerMock.cpp: * platform/mock/PlatformSpeechSynthesizerMock.h: * platform/mock/mediasource/MockBox.cpp: * platform/mock/mediasource/MockBox.h: * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp: * platform/mock/mediasource/MockMediaPlayerMediaSource.h: * platform/mock/mediasource/MockMediaSourcePrivate.cpp: * platform/mock/mediasource/MockMediaSourcePrivate.h: * platform/mock/mediasource/MockSourceBufferPrivate.cpp: * platform/mock/mediasource/MockSourceBufferPrivate.h: * platform/mock/mediasource/MockTracks.cpp: * platform/mock/mediasource/MockTracks.h: * platform/network/AuthenticationChallengeBase.cpp: * platform/network/AuthenticationChallengeBase.h: * platform/network/Credential.cpp: * platform/network/Credential.h: * platform/network/DNS.h: * platform/network/DNSResolveQueue.cpp: * platform/network/DNSResolveQueue.h: * platform/network/DataURL.cpp: * platform/network/DataURL.h: * platform/network/HTTPHeaderMap.h: * platform/network/HTTPParsers.cpp: * platform/network/HTTPParsers.h: * platform/network/PlatformCookieJar.h: * platform/network/ProtectionSpace.cpp: * platform/network/ProtectionSpace.h: * platform/network/ResourceErrorBase.cpp: * platform/network/ResourceErrorBase.h: * platform/network/ResourceHandle.cpp: * platform/network/ResourceHandle.h: * platform/network/ResourceHandleClient.h: * platform/network/ResourceHandleInternal.h: * platform/network/ResourceRequestBase.cpp: * platform/network/ResourceRequestBase.h: * platform/network/ResourceResponseBase.cpp: * platform/network/ResourceResponseBase.h: * platform/network/cf/AuthenticationCF.cpp: * platform/network/cf/AuthenticationCF.h: * platform/network/cf/AuthenticationChallenge.h: * platform/network/cf/CookieJarCFNet.cpp: * platform/network/cf/CookieStorageCFNet.cpp: * platform/network/cf/DNSCFNet.cpp: * platform/network/cf/DownloadBundle.h: * platform/network/cf/FormDataStreamCFNet.cpp: * platform/network/cf/FormDataStreamCFNet.h: * platform/network/cf/ResourceError.h: * platform/network/cf/ResourceErrorCF.cpp: * platform/network/cf/ResourceHandleCFNet.cpp: * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp: * platform/network/cf/ResourceHandleCFURLConnectionDelegate.h: * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp: * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h: * platform/network/cf/ResourceRequest.h: * platform/network/cf/ResourceRequestCFNet.cpp: * platform/network/cf/ResourceRequestCFNet.h: * platform/network/cf/ResourceResponse.h: * platform/network/cf/ResourceResponseCFNet.cpp: * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp: * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.h: * platform/network/curl/AuthenticationChallenge.h: * platform/network/curl/CurlDownload.cpp: * platform/network/curl/CurlDownload.h: * platform/network/curl/DNSCurl.cpp: * platform/network/curl/DownloadBundle.h: * platform/network/curl/FormDataStreamCurl.cpp: * platform/network/curl/FormDataStreamCurl.h: * platform/network/curl/ResourceError.h: * platform/network/curl/ResourceHandleCurl.cpp: * platform/network/curl/ResourceHandleManager.cpp: * platform/network/curl/ResourceHandleManager.h: * platform/network/curl/ResourceRequest.h: * platform/network/curl/ResourceResponse.h: * platform/network/curl/SSLHandle.cpp: * platform/network/curl/SSLHandle.h: * platform/network/gtk/CredentialBackingStore.cpp: * platform/network/gtk/CredentialBackingStore.h: * platform/network/ios/WebCoreURLResponseIOS.h: * platform/network/ios/WebCoreURLResponseIOS.mm: * platform/network/mac/AuthenticationMac.h: * platform/network/mac/AuthenticationMac.mm: * platform/network/mac/CookieJarMac.mm: * platform/network/mac/CookieStorageMac.mm: * platform/network/mac/FormDataStreamMac.h: * platform/network/mac/FormDataStreamMac.mm: * platform/network/mac/ResourceErrorMac.mm: * platform/network/mac/ResourceHandleMac.mm: * platform/network/mac/ResourceRequestMac.mm: * platform/network/mac/ResourceResponseMac.mm: * platform/network/mac/WebCoreURLResponse.h: * platform/network/mac/WebCoreURLResponse.mm: * platform/network/soup/AuthenticationChallenge.h: * platform/network/soup/AuthenticationChallengeSoup.cpp: * platform/network/soup/CookieJarSoup.h: * platform/network/soup/DNSSoup.cpp: * platform/network/soup/ResourceError.h: * platform/network/soup/ResourceErrorSoup.cpp: * platform/network/soup/ResourceRequest.h: * platform/network/soup/ResourceResponse.h: * platform/network/soup/SoupNetworkSession.cpp: * platform/network/soup/SoupNetworkSession.h: * platform/network/win/CookieJarWin.cpp: * platform/network/win/DownloadBundleWin.cpp: * platform/network/win/ResourceError.h: * platform/network/win/ResourceHandleWin.cpp: * platform/network/win/ResourceRequest.h: * platform/network/win/ResourceResponse.h: * platform/posix/FileSystemPOSIX.cpp: * platform/posix/SharedBufferPOSIX.cpp: * platform/soup/URLSoup.cpp: * platform/sql/SQLValue.cpp: * platform/sql/SQLValue.h: * platform/sql/SQLiteAuthorizer.cpp: * platform/sql/SQLiteDatabase.cpp: * platform/sql/SQLiteDatabase.h: * platform/sql/SQLiteStatement.cpp: * platform/sql/SQLiteStatement.h: * platform/sql/SQLiteTransaction.cpp: * platform/sql/SQLiteTransaction.h: * platform/text/SuffixTree.h: * platform/text/TextAllInOne.cpp: * platform/text/TextBoundaries.cpp: * platform/text/TextBoundaries.h: * platform/text/TextCodec.cpp: * platform/text/TextCodec.h: * platform/text/TextCodecASCIIFastPath.h: * platform/text/TextCodecICU.cpp: * platform/text/TextCodecICU.h: * platform/text/TextCodecLatin1.cpp: * platform/text/TextCodecLatin1.h: * platform/text/TextCodecUTF16.cpp: * platform/text/TextCodecUTF16.h: * platform/text/TextCodecUTF8.cpp: * platform/text/TextCodecUTF8.h: * platform/text/TextCodecUserDefined.cpp: * platform/text/TextCodecUserDefined.h: * platform/text/TextDirection.h: * platform/text/TextEncoding.cpp: * platform/text/TextEncoding.h: * platform/text/TextEncodingRegistry.cpp: * platform/text/TextEncodingRegistry.h: * platform/text/TextStream.cpp: * platform/text/TextStream.h: * platform/text/UnicodeBidi.h: * platform/text/mac/CharsetData.h: * platform/text/mac/TextBoundaries.mm: * platform/text/mac/TextCodecMac.cpp: * platform/text/mac/TextCodecMac.h: * platform/text/mac/character-sets.txt: * platform/text/mac/make-charset-table.pl: * platform/text/win/TextCodecWin.h: * platform/win/BString.cpp: * platform/win/BString.h: * platform/win/COMPtr.h: * platform/win/ClipboardUtilitiesWin.cpp: * platform/win/ClipboardUtilitiesWin.h: * platform/win/ContextMenuItemWin.cpp: * platform/win/ContextMenuWin.cpp: * platform/win/CursorWin.cpp: * platform/win/DragDataWin.cpp: * platform/win/DragImageCGWin.cpp: * platform/win/DragImageCairoWin.cpp: * platform/win/DragImageWin.cpp: * platform/win/FileSystemWin.cpp: * platform/win/GDIObjectCounter.cpp: * platform/win/GDIObjectCounter.h: * platform/win/HWndDC.h: * platform/win/KeyEventWin.cpp: * platform/win/LanguageWin.cpp: * platform/win/MIMETypeRegistryWin.cpp: * platform/win/PasteboardWin.cpp: * platform/win/PlatformMouseEventWin.cpp: * platform/win/PlatformScreenWin.cpp: * platform/win/SharedBufferWin.cpp: * platform/win/SharedTimerWin.cpp: * platform/win/SoftLinking.h: * platform/win/SoundWin.cpp: * platform/win/StructuredExceptionHandlerSuppressor.cpp: * platform/win/TemporaryLinkStubs.cpp: * platform/win/WCDataObject.cpp: * platform/win/WCDataObject.h: * platform/win/WebCoreTextRenderer.cpp: * platform/win/WebCoreTextRenderer.h: * platform/win/WheelEventWin.cpp: * platform/win/WidgetWin.cpp: * platform/win/WindowMessageBroadcaster.cpp: * platform/win/WindowMessageBroadcaster.h: * platform/win/WindowMessageListener.h: * platform/win/WindowsTouch.h: * platform/win/makesafeseh.asm: * plugins/PluginDatabase.cpp: * plugins/PluginDatabase.h: * plugins/PluginDebug.cpp: * plugins/PluginDebug.h: * plugins/PluginPackage.cpp: * plugins/PluginPackage.h: * plugins/PluginQuirkSet.h: * plugins/PluginStream.cpp: * plugins/PluginStream.h: * plugins/PluginView.cpp: * plugins/PluginView.h: * plugins/efl/PluginPackageEfl.cpp: * plugins/efl/PluginViewEfl.cpp: * plugins/gtk/PluginPackageGtk.cpp: * plugins/gtk/PluginViewGtk.cpp: * plugins/mac/PluginPackageMac.cpp: * plugins/mac/PluginViewMac.mm: * plugins/npapi.cpp: * plugins/npfunctions.h: * plugins/npruntime.h: * plugins/win/PluginDatabaseWin.cpp: * plugins/win/PluginPackageWin.cpp: * plugins/win/PluginViewWin.cpp: * plugins/x11/PluginViewX11.cpp: * rendering/EllipsisBox.cpp: * rendering/EllipsisBox.h: * rendering/FilterEffectRenderer.cpp: * rendering/FilterEffectRenderer.h: * rendering/HitTestLocation.h: * rendering/HitTestRequest.h: * rendering/HitTestResult.h: * rendering/HitTestingTransformState.cpp: * rendering/HitTestingTransformState.h: * rendering/RenderBoxRegionInfo.h: * rendering/RenderButton.cpp: * rendering/RenderButton.h: * rendering/RenderDeprecatedFlexibleBox.cpp: * rendering/RenderDeprecatedFlexibleBox.h: * rendering/RenderFieldset.cpp: * rendering/RenderFrameBase.cpp: * rendering/RenderFrameBase.h: * rendering/RenderFrameSet.cpp: * rendering/RenderGeometryMap.cpp: * rendering/RenderGeometryMap.h: * rendering/RenderGrid.cpp: * rendering/RenderGrid.h: * rendering/RenderHTMLCanvas.cpp: * rendering/RenderHTMLCanvas.h: * rendering/RenderIFrame.cpp: * rendering/RenderIFrame.h: * rendering/RenderLayerBacking.cpp: * rendering/RenderLayerBacking.h: * rendering/RenderLayerCompositor.cpp: * rendering/RenderLayerCompositor.h: * rendering/RenderLineBoxList.cpp: * rendering/RenderLineBoxList.h: * rendering/RenderListBox.cpp: * rendering/RenderListBox.h: * rendering/RenderMarquee.h: * rendering/RenderMedia.cpp: * rendering/RenderMedia.h: * rendering/RenderMultiColumnFlowThread.cpp: * rendering/RenderMultiColumnFlowThread.h: * rendering/RenderMultiColumnSet.cpp: * rendering/RenderMultiColumnSet.h: * rendering/RenderNamedFlowThread.cpp: * rendering/RenderNamedFlowThread.h: * rendering/RenderRegionSet.cpp: * rendering/RenderRegionSet.h: * rendering/RenderReplica.cpp: * rendering/RenderReplica.h: * rendering/RenderTheme.cpp: * rendering/RenderTheme.h: * rendering/RenderThemeMac.h: * rendering/RenderThemeWin.h: * rendering/RenderThemeWinCE.cpp: * rendering/RenderThemeWinCE.h: * rendering/RenderTreeAsText.cpp: * rendering/RenderTreeAsText.h: * rendering/RenderVTTCue.cpp: * rendering/RenderVTTCue.h: * rendering/RenderVideo.cpp: * rendering/RenderVideo.h: * rendering/RenderView.h: * rendering/style/SVGRenderStyle.cpp: * rendering/style/SVGRenderStyle.h: * rendering/style/SVGRenderStyleDefs.cpp: * rendering/style/SVGRenderStyleDefs.h: * rendering/style/StyleFilterData.cpp: * rendering/style/StyleFilterData.h: * rendering/style/StylePendingImage.h: * rendering/svg/RenderSVGBlock.cpp: * rendering/svg/RenderSVGBlock.h: * rendering/svg/RenderSVGForeignObject.cpp: * rendering/svg/RenderSVGForeignObject.h: * rendering/svg/RenderSVGImage.cpp: * rendering/svg/RenderSVGInline.h: * rendering/svg/RenderSVGInlineText.cpp: * rendering/svg/RenderSVGPath.h: * rendering/svg/RenderSVGShape.h: * rendering/svg/RenderSVGTSpan.h: * rendering/svg/RenderSVGText.cpp: * rendering/svg/RenderSVGText.h: * rendering/svg/SVGInlineFlowBox.cpp: * rendering/svg/SVGInlineFlowBox.h: * rendering/svg/SVGRenderTreeAsText.cpp: * rendering/svg/SVGRenderTreeAsText.h: * rendering/svg/SVGRootInlineBox.cpp: * rendering/svg/SVGRootInlineBox.h: * storage/StorageEventDispatcher.h: * svg/SVGException.cpp: * svg/graphics/SVGImageChromeClient.h: * workers/Worker.cpp: * workers/Worker.h: * workers/Worker.idl: * workers/WorkerEventQueue.cpp: * workers/WorkerEventQueue.h: * workers/WorkerGlobalScope.cpp: * workers/WorkerGlobalScope.h: * workers/WorkerGlobalScope.idl: * workers/WorkerLocation.cpp: * workers/WorkerLocation.h: * workers/WorkerLocation.idl: * workers/WorkerMessagingProxy.cpp: * workers/WorkerMessagingProxy.h: * workers/WorkerScriptLoader.cpp: * workers/WorkerScriptLoader.h: * workers/WorkerScriptLoaderClient.h: * workers/WorkerThread.cpp: * workers/WorkerThread.h: * xml/DOMParser.h: * xml/DOMParser.idl: * xml/NativeXPathNSResolver.cpp: * xml/NativeXPathNSResolver.h: * xml/XMLHttpRequest.idl: * xml/XMLHttpRequestException.cpp: * xml/XMLHttpRequestException.h: * xml/XMLHttpRequestException.idl: * xml/XMLHttpRequestProgressEvent.h: * xml/XMLHttpRequestProgressEvent.idl: * xml/XMLHttpRequestUpload.idl: * xml/XMLSerializer.h: * xml/XMLSerializer.idl: * xml/XPathEvaluator.cpp: * xml/XPathEvaluator.h: * xml/XPathEvaluator.idl: * xml/XPathException.cpp: * xml/XPathException.h: * xml/XPathException.idl: * xml/XPathExpression.idl: * xml/XPathExpressionNode.cpp: * xml/XPathNSResolver.cpp: * xml/XPathNSResolver.h: * xml/XPathNSResolver.idl: * xml/XPathNodeSet.h: * xml/XPathResult.idl: * xml/XPathUtil.h: * xml/XPathVariableReference.cpp: * xml/XSLTProcessor.idl: * xml/XSLTUnicodeSort.cpp: * xml/XSLTUnicodeSort.h: Source/WebInspectorUI: Replace "Apple Computer, Inc." with "Apple Inc." in copyright headers https://bugs.webkit.org/show_bug.cgi?id=130276 <rdar://problem/16266927> Reviewed by Simon Fraser. * APPLE_IMAGES_LICENSE.rtf: * UserInterface/Base/DOMUtilities.js: * UserInterface/Models/Color.js: * UserInterface/Views/ConsoleCommand.js: * UserInterface/Views/ConsoleCommandResult.js: * UserInterface/Views/ConsoleGroup.js: * UserInterface/Views/ConsoleMessage.js: * UserInterface/Views/ConsoleMessageImpl.js: * UserInterface/Views/DOMTreeElement.js: * UserInterface/Views/DOMTreeOutline.js: * UserInterface/Views/DOMTreeUpdater.js: * UserInterface/Views/GradientSlider.css: * UserInterface/Views/GradientSlider.js: * UserInterface/Views/TreeOutline.js: Source/WebKit: Replace "Apple Computer, Inc." with "Apple Inc." in copyright headers https://bugs.webkit.org/show_bug.cgi?id=130276 <rdar://problem/16266927> Reviewed by Simon Fraser. * scripts/generate-webkitversion.pl: (printLicenseHeader): Source/WebKit/efl: Replace "Apple Computer, Inc." with "Apple Inc." in copyright headers https://bugs.webkit.org/show_bug.cgi?id=130276 <rdar://problem/16266927> Reviewed by Simon Fraser. * WebCoreSupport/ChromeClientEfl.cpp: * WebCoreSupport/ContextMenuClientEfl.cpp: * WebCoreSupport/ContextMenuClientEfl.h: * WebCoreSupport/DeviceMotionClientEfl.cpp: * WebCoreSupport/DeviceOrientationClientEfl.cpp: * WebCoreSupport/DragClientEfl.cpp: * WebCoreSupport/EditorClientEfl.h: * WebCoreSupport/FrameLoaderClientEfl.cpp: * WebCoreSupport/FrameLoaderClientEfl.h: * WebCoreSupport/FrameNetworkingContextEfl.cpp: * WebCoreSupport/FrameNetworkingContextEfl.h: * WebCoreSupport/InspectorClientEfl.h: * WebCoreSupport/NavigatorContentUtilsClientEfl.cpp: * WebCoreSupport/NavigatorContentUtilsClientEfl.h: * WebCoreSupport/NetworkInfoClientEfl.cpp: Source/WebKit/gtk: Replace "Apple Computer, Inc." with "Apple Inc." in copyright headers https://bugs.webkit.org/show_bug.cgi?id=130276 <rdar://problem/16266927> Reviewed by Simon Fraser. * WebCoreSupport/ContextMenuClientGtk.h: * WebCoreSupport/DocumentLoaderGtk.cpp: * WebCoreSupport/DocumentLoaderGtk.h: * WebCoreSupport/EditorClientGtk.h: * WebCoreSupport/FrameLoaderClientGtk.h: * WebCoreSupport/InspectorClientGtk.h: * WebCoreSupport/TextCheckerClientGtk.h: Source/WebKit/ios: Replace "Apple Computer, Inc." with "Apple Inc." in copyright headers https://bugs.webkit.org/show_bug.cgi?id=130276 <rdar://problem/16266927> Reviewed by Simon Fraser. * WebCoreSupport/WebCaretChangeListener.h: * WebCoreSupport/WebInspectorClientIOS.mm: * WebView/WebPlainWhiteView.h: * WebView/WebPlainWhiteView.mm: Source/WebKit/mac: Replace "Apple Computer, Inc." with "Apple Inc." in copyright headers https://bugs.webkit.org/show_bug.cgi?id=130276 <rdar://problem/16266927> Reviewed by Simon Fraser. * Carbon/CarbonUtils.h: * Carbon/CarbonUtils.m: * Carbon/CarbonWindowAdapter.h: * Carbon/CarbonWindowAdapter.mm: * Carbon/CarbonWindowContentView.h: * Carbon/CarbonWindowContentView.m: * Carbon/CarbonWindowFrame.h: * Carbon/CarbonWindowFrame.m: * Carbon/HIViewAdapter.h: * Carbon/HIViewAdapter.m: * Carbon/HIWebView.h: * Carbon/HIWebView.mm: * DOM/WebDOMOperations.h: * DOM/WebDOMOperations.mm: * DOM/WebDOMOperationsInternal.h: * DOM/WebDOMOperationsPrivate.h: * DefaultDelegates/WebDefaultContextMenuDelegate.h: * DefaultDelegates/WebDefaultContextMenuDelegate.mm: * DefaultDelegates/WebDefaultEditingDelegate.h: * DefaultDelegates/WebDefaultEditingDelegate.m: * DefaultDelegates/WebDefaultPolicyDelegate.h: * DefaultDelegates/WebDefaultPolicyDelegate.m: * DefaultDelegates/WebDefaultUIDelegate.h: * DefaultDelegates/WebDefaultUIDelegate.m: * History/WebBackForwardList.h: * History/WebBackForwardList.mm: * History/WebBackForwardListInternal.h: * History/WebBackForwardListPrivate.h: * History/WebHistory.h: * History/WebHistory.mm: * History/WebHistoryInternal.h: * History/WebHistoryItem.h: * History/WebHistoryItem.mm: * History/WebHistoryItemInternal.h: * History/WebHistoryItemPrivate.h: * History/WebHistoryPrivate.h: * History/WebURLsWithTitles.h: * History/WebURLsWithTitles.m: * MigrateHeaders.make: * Misc/OldWebAssertions.c: * Misc/WebCache.h: * Misc/WebCache.mm: * Misc/WebCoreStatistics.h: * Misc/WebCoreStatistics.mm: * Misc/WebDownload.h: * Misc/WebDownload.mm: * Misc/WebDownloadInternal.h: * Misc/WebElementDictionary.h: * Misc/WebElementDictionary.mm: * Misc/WebIconDatabase.h: * Misc/WebIconDatabase.mm: * Misc/WebIconDatabaseDelegate.h: * Misc/WebIconDatabaseInternal.h: * Misc/WebIconDatabasePrivate.h: * Misc/WebKit.h: * Misc/WebKitErrors.h: * Misc/WebKitErrors.m: * Misc/WebKitErrorsPrivate.h: * Misc/WebKitLogging.h: * Misc/WebKitLogging.m: * Misc/WebKitNSStringExtras.h: * Misc/WebKitNSStringExtras.mm: * Misc/WebKitStatistics.h: * Misc/WebKitStatistics.m: * Misc/WebKitStatisticsPrivate.h: * Misc/WebKitSystemBits.h: * Misc/WebKitSystemBits.m: * Misc/WebKitVersionChecks.h: * Misc/WebKitVersionChecks.m: * Misc/WebLocalizableStrings.h: * Misc/WebLocalizableStrings.mm: * Misc/WebNSArrayExtras.h: * Misc/WebNSArrayExtras.m: * Misc/WebNSControlExtras.h: * Misc/WebNSControlExtras.m: * Misc/WebNSDataExtras.h: * Misc/WebNSDataExtras.m: * Misc/WebNSDataExtrasPrivate.h: * Misc/WebNSDictionaryExtras.h: * Misc/WebNSDictionaryExtras.m: * Misc/WebNSEventExtras.h: * Misc/WebNSEventExtras.m: * Misc/WebNSFileManagerExtras.h: * Misc/WebNSFileManagerExtras.mm: * Misc/WebNSImageExtras.h: * Misc/WebNSImageExtras.m: * Misc/WebNSObjectExtras.h: * Misc/WebNSObjectExtras.mm: * Misc/WebNSPasteboardExtras.h: * Misc/WebNSPasteboardExtras.mm: * Misc/WebNSPrintOperationExtras.h: * Misc/WebNSPrintOperationExtras.m: * Misc/WebNSURLExtras.h: * Misc/WebNSURLExtras.mm: * Misc/WebNSURLRequestExtras.h: * Misc/WebNSURLRequestExtras.m: * Misc/WebNSUserDefaultsExtras.h: * Misc/WebNSUserDefaultsExtras.mm: * Misc/WebNSViewExtras.h: * Misc/WebNSViewExtras.m: * Misc/WebNSWindowExtras.h: * Misc/WebNSWindowExtras.m: * Misc/WebStringTruncator.h: * Misc/WebStringTruncator.mm: * Misc/WebTypesInternal.h: * Panels/WebAuthenticationPanel.h: * Panels/WebAuthenticationPanel.m: * Panels/WebPanelAuthenticationHandler.h: * Panels/WebPanelAuthenticationHandler.m: * Plugins/Hosted/ProxyRuntimeObject.h: * Plugins/Hosted/ProxyRuntimeObject.mm: * Plugins/WebBaseNetscapePluginView.h: * Plugins/WebBaseNetscapePluginView.mm: * Plugins/WebBasePluginPackage.h: * Plugins/WebBasePluginPackage.mm: * Plugins/WebJavaPlugIn.h: * Plugins/WebNetscapeContainerCheckContextInfo.h: * Plugins/WebNetscapeContainerCheckPrivate.h: * Plugins/WebNetscapeContainerCheckPrivate.mm: * Plugins/WebNetscapePluginPackage.h: * Plugins/WebNetscapePluginPackage.mm: * Plugins/WebNetscapePluginStream.h: * Plugins/WebNetscapePluginStream.mm: * Plugins/WebNetscapePluginView.h: * Plugins/WebNetscapePluginView.mm: * Plugins/WebPlugin.h: * Plugins/WebPluginContainer.h: * Plugins/WebPluginContainerCheck.h: * Plugins/WebPluginContainerCheck.mm: * Plugins/WebPluginContainerPrivate.h: * Plugins/WebPluginController.h: * Plugins/WebPluginController.mm: * Plugins/WebPluginDatabase.h: * Plugins/WebPluginDatabase.mm: * Plugins/WebPluginPackage.h: * Plugins/WebPluginPackage.mm: * Plugins/WebPluginRequest.h: * Plugins/WebPluginRequest.m: * Plugins/WebPluginViewFactory.h: * Plugins/WebPluginViewFactoryPrivate.h: * Plugins/WebPluginsPrivate.h: * Plugins/WebPluginsPrivate.m: * Plugins/npapi.mm: * Storage/WebDatabaseManager.mm: * Storage/WebDatabaseManagerInternal.h: * Storage/WebDatabaseManagerPrivate.h: * WebCoreSupport/SearchPopupMenuMac.mm: * WebCoreSupport/WebAlternativeTextClient.h: * WebCoreSupport/WebAlternativeTextClient.mm: * WebCoreSupport/WebCachedFramePlatformData.h: * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: * WebCoreSupport/WebContextMenuClient.h: * WebCoreSupport/WebContextMenuClient.mm: * WebCoreSupport/WebDragClient.h: * WebCoreSupport/WebDragClient.mm: * WebCoreSupport/WebEditorClient.h: * WebCoreSupport/WebEditorClient.mm: * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: * WebCoreSupport/WebIconDatabaseClient.h: * WebCoreSupport/WebIconDatabaseClient.mm: * WebCoreSupport/WebInspectorClient.h: * WebCoreSupport/WebInspectorClient.mm: * WebCoreSupport/WebJavaScriptTextInputPanel.h: * WebCoreSupport/WebJavaScriptTextInputPanel.m: * WebCoreSupport/WebSecurityOrigin.mm: * WebCoreSupport/WebSecurityOriginInternal.h: * WebCoreSupport/WebSecurityOriginPrivate.h: * WebCoreSupport/WebSystemInterface.h: * WebCoreSupport/WebSystemInterface.mm: * WebInspector/WebInspector.h: * WebInspector/WebInspector.mm: * WebInspector/WebInspectorPrivate.h: * WebInspector/WebNodeHighlight.h: * WebInspector/WebNodeHighlight.mm: * WebInspector/WebNodeHighlightView.h: * WebInspector/WebNodeHighlightView.mm: * WebInspector/WebNodeHighlighter.h: * WebInspector/WebNodeHighlighter.mm: * WebKitLegacy/MigrateHeadersToLegacy.make: * WebKitPrefix.h: * WebView/WebArchive.h: * WebView/WebArchive.mm: * WebView/WebArchiveInternal.h: * WebView/WebClipView.h: * WebView/WebClipView.mm: * WebView/WebDashboardRegion.h: * WebView/WebDashboardRegion.mm: * WebView/WebDataSource.h: * WebView/WebDataSource.mm: * WebView/WebDataSourceInternal.h: * WebView/WebDataSourcePrivate.h: * WebView/WebDelegateImplementationCaching.h: * WebView/WebDelegateImplementationCaching.mm: * WebView/WebDocument.h: * WebView/WebDocumentInternal.h: * WebView/WebDocumentLoaderMac.h: * WebView/WebDocumentLoaderMac.mm: * WebView/WebDocumentPrivate.h: * WebView/WebDynamicScrollBarsViewInternal.h: * WebView/WebEditingDelegate.h: * WebView/WebEditingDelegatePrivate.h: * WebView/WebFormDelegate.h: * WebView/WebFormDelegate.m: * WebView/WebFormDelegatePrivate.h: * WebView/WebFrame.h: * WebView/WebFrame.mm: * WebView/WebFrameInternal.h: * WebView/WebFrameLoadDelegate.h: * WebView/WebFrameLoadDelegatePrivate.h: * WebView/WebFramePrivate.h: * WebView/WebFrameView.h: * WebView/WebFrameView.mm: * WebView/WebFrameViewInternal.h: * WebView/WebFrameViewPrivate.h: * WebView/WebHTMLRepresentation.h: * WebView/WebHTMLRepresentation.mm: * WebView/WebHTMLRepresentationPrivate.h: * WebView/WebHTMLView.h: * WebView/WebHTMLView.mm: * WebView/WebHTMLViewInternal.h: * WebView/WebHTMLViewPrivate.h: * WebView/WebNotification.h: * WebView/WebNotification.mm: * WebView/WebNotificationInternal.h: * WebView/WebPDFRepresentation.h: * WebView/WebPDFRepresentation.mm: * WebView/WebPDFView.h: * WebView/WebPDFView.mm: * WebView/WebPolicyDelegate.h: * WebView/WebPolicyDelegate.mm: * WebView/WebPolicyDelegatePrivate.h: * WebView/WebPreferenceKeysPrivate.h: * WebView/WebPreferences.h: * WebView/WebPreferences.mm: * WebView/WebPreferencesPrivate.h: * WebView/WebRenderLayer.h: * WebView/WebRenderLayer.mm: * WebView/WebRenderNode.h: * WebView/WebRenderNode.mm: * WebView/WebResource.h: * WebView/WebResource.mm: * WebView/WebResourceInternal.h: * WebView/WebResourceLoadDelegate.h: * WebView/WebResourceLoadDelegatePrivate.h: * WebView/WebResourcePrivate.h: * WebView/WebScriptDebugDelegate.h: * WebView/WebScriptDebugDelegate.mm: * WebView/WebScriptDebugger.h: * WebView/WebScriptDebugger.mm: * WebView/WebTextCompletionController.mm: * WebView/WebUIDelegate.h: * WebView/WebUIDelegatePrivate.h: * WebView/WebView.h: * WebView/WebView.mm: * WebView/WebViewData.h: * WebView/WebViewData.mm: * WebView/WebViewInternal.h: * WebView/WebViewPrivate.h: Source/WebKit/win: Replace "Apple Computer, Inc." with "Apple Inc." in copyright headers https://bugs.webkit.org/show_bug.cgi?id=130276 <rdar://problem/16266927> Reviewed by Simon Fraser. * CFDictionaryPropertyBag.cpp: * CFDictionaryPropertyBag.h: * CodeAnalysisConfig.h: * DOMCSSClasses.cpp: * DOMCSSClasses.h: * DOMCoreClasses.cpp: * DOMCoreClasses.h: * DOMEventsClasses.cpp: * DOMEventsClasses.h: * DOMHTMLClasses.cpp: * DOMHTMLClasses.h: * DefaultDownloadDelegate.cpp: * DefaultDownloadDelegate.h: * DefaultPolicyDelegate.cpp: * DefaultPolicyDelegate.h: * ForEachCoClass.cpp: * ForEachCoClass.h: * FullscreenVideoController.cpp: * FullscreenVideoController.h: * Interfaces/AccessibilityDelegate.idl: * Interfaces/DOMCSS.idl: * Interfaces/DOMCore.idl: * Interfaces/DOMEvents.idl: * Interfaces/DOMExtensions.idl: * Interfaces/DOMHTML.idl: * Interfaces/DOMPrivate.idl: * Interfaces/DOMRange.idl: * Interfaces/DOMWindow.idl: * Interfaces/IGEN_DOMObject.idl: * Interfaces/IWebArchive.idl: * Interfaces/IWebBackForwardList.idl: * Interfaces/IWebBackForwardListPrivate.idl: * Interfaces/IWebCache.idl: * Interfaces/IWebDataSource.idl: * Interfaces/IWebDatabaseManager.idl: * Interfaces/IWebDocument.idl: * Interfaces/IWebDownload.idl: * Interfaces/IWebEditingDelegate.idl: * Interfaces/IWebError.idl: * Interfaces/IWebErrorPrivate.idl: * Interfaces/IWebFormDelegate.idl: * Interfaces/IWebFrame.idl: * Interfaces/IWebFrameLoadDelegate.idl: * Interfaces/IWebFrameLoadDelegatePrivate.idl: * Interfaces/IWebFrameLoadDelegatePrivate2.idl: * Interfaces/IWebFramePrivate.idl: * Interfaces/IWebFrameView.idl: * Interfaces/IWebHTMLRepresentation.idl: * Interfaces/IWebHTTPURLResponse.idl: * Interfaces/IWebHistory.idl: * Interfaces/IWebHistoryDelegate.idl: * Interfaces/IWebHistoryItem.idl: * Interfaces/IWebHistoryItemPrivate.idl: * Interfaces/IWebHistoryPrivate.idl: * Interfaces/IWebIconDatabase.idl: * Interfaces/IWebInspector.idl: * Interfaces/IWebInspectorPrivate.idl: * Interfaces/IWebJavaScriptCollector.idl: * Interfaces/IWebKitStatistics.idl: * Interfaces/IWebMutableURLRequest.idl: * Interfaces/IWebMutableURLRequestPrivate.idl: * Interfaces/IWebNavigationData.idl: * Interfaces/IWebNotification.idl: * Interfaces/IWebNotificationCenter.idl: * Interfaces/IWebNotificationObserver.idl: * Interfaces/IWebPolicyDelegate.idl: * Interfaces/IWebPolicyDelegatePrivate.idl: * Interfaces/IWebPreferences.idl: * Interfaces/IWebPreferencesPrivate.idl: * Interfaces/IWebResource.idl: * Interfaces/IWebResourceLoadDelegate.idl: * Interfaces/IWebResourceLoadDelegatePrivate.idl: * Interfaces/IWebResourceLoadDelegatePrivate2.idl: * Interfaces/IWebScriptObject.idl: * Interfaces/IWebSecurityOrigin.idl: * Interfaces/IWebSerializedJSValuePrivate.idl: * Interfaces/IWebTextRenderer.idl: * Interfaces/IWebUIDelegate.idl: * Interfaces/IWebUIDelegatePrivate.idl: * Interfaces/IWebURLAuthenticationChallenge.idl: * Interfaces/IWebURLRequest.idl: * Interfaces/IWebURLResponse.idl: * Interfaces/IWebURLResponsePrivate.idl: * Interfaces/IWebUndoManager.idl: * Interfaces/IWebUndoTarget.idl: * Interfaces/IWebView.idl: * Interfaces/IWebViewPrivate.idl: * Interfaces/WebKit.idl: * Interfaces/WebScrollbarTypes.idl: * MarshallingHelpers.cpp: * MarshallingHelpers.h: * MemoryStream.cpp: * MemoryStream.h: * ProgIDMacros.h: * WebActionPropertyBag.cpp: * WebActionPropertyBag.h: * WebBackForwardList.cpp: * WebBackForwardList.h: * WebCache.cpp: * WebCache.h: * WebCachedFramePlatformData.h: * WebCoreSupport/WebChromeClient.cpp: * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebContextMenuClient.cpp: * WebCoreSupport/WebContextMenuClient.h: * WebCoreSupport/WebDragClient.cpp: * WebCoreSupport/WebDragClient.h: * WebCoreSupport/WebEditorClient.cpp: * WebCoreSupport/WebEditorClient.h: * WebCoreSupport/WebFrameLoaderClient.cpp: * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebInspectorClient.cpp: * WebCoreSupport/WebInspectorClient.h: * WebCoreSupport/WebInspectorDelegate.cpp: * WebCoreSupport/WebInspectorDelegate.h: * WebDataSource.cpp: * WebDataSource.h: * WebDatabaseManager.cpp: * WebDatabaseManager.h: * WebDocumentLoader.cpp: * WebDocumentLoader.h: * WebDownload.cpp: * WebDownload.h: * WebDownloadCFNet.cpp: * WebDownloadCurl.cpp: * WebDropSource.cpp: * WebDropSource.h: * WebElementPropertyBag.cpp: * WebElementPropertyBag.h: * WebError.cpp: * WebError.h: * WebFrame.cpp: * WebFrame.h: * WebFramePolicyListener.cpp: * WebFramePolicyListener.h: * WebHTMLRepresentation.cpp: * WebHTMLRepresentation.h: * WebHistory.cpp: * WebHistory.h: * WebHistoryItem.cpp: * WebHistoryItem.h: * WebIconDatabase.cpp: * WebIconDatabase.h: * WebInspector.cpp: * WebInspector.h: * WebJavaScriptCollector.cpp: * WebJavaScriptCollector.h: * WebKitCOMAPI.cpp: * WebKitCOMAPI.h: * WebKitClassFactory.cpp: * WebKitClassFactory.h: * WebKitDLL.cpp: * WebKitDLL.h: * WebKitGraphics.cpp: * WebKitGraphics.h: * WebKitLogging.cpp: * WebKitLogging.h: * WebKitPrefix.cpp: * WebKitPrefix.h: * WebKitStatistics.cpp: * WebKitStatistics.h: * WebKitStatisticsPrivate.h: * WebKitSystemBits.cpp: * WebKitSystemBits.h: * WebLocalizableStrings.cpp: * WebLocalizableStrings.h: * WebMutableURLRequest.cpp: * WebMutableURLRequest.h: * WebNavigationData.cpp: * WebNavigationData.h: * WebNodeHighlight.cpp: * WebNodeHighlight.h: * WebNotification.cpp: * WebNotification.h: * WebNotificationCenter.cpp: * WebNotificationCenter.h: * WebPreferenceKeysPrivate.h: * WebPreferences.cpp: * WebPreferences.h: * WebResource.cpp: * WebResource.h: * WebScriptObject.cpp: * WebScriptObject.h: * WebSecurityOrigin.cpp: * WebSecurityOrigin.h: * WebTextRenderer.cpp: * WebTextRenderer.h: * WebURLAuthenticationChallenge.cpp: * WebURLAuthenticationChallenge.h: * WebURLAuthenticationChallengeSender.cpp: * WebURLAuthenticationChallengeSender.h: * WebURLAuthenticationChallengeSenderCFNet.cpp: * WebURLAuthenticationChallengeSenderCurl.cpp: * WebURLCredential.cpp: * WebURLCredential.h: * WebURLProtectionSpace.cpp: * WebURLProtectionSpace.h: * WebURLResponse.cpp: * WebURLResponse.h: * WebView.cpp: * WebView.h: Source/WebKit2: Replace "Apple Computer, Inc." with "Apple Inc." in copyright headers https://bugs.webkit.org/show_bug.cgi?id=130276 <rdar://problem/16266927> Reviewed by Simon Fraser. * Shared/AsyncRequest.cpp: * Shared/AsyncRequest.h: * Shared/ContextMenuContextData.cpp: * Shared/ContextMenuContextData.h: * Shared/Databases/DatabaseProcessCreationParameters.h: * Shared/Databases/IndexedDB/IDBUtilities.cpp: * Shared/Databases/IndexedDB/IDBUtilities.h: * Shared/mac/RemoteLayerBackingStore.h: * Shared/mac/RemoteLayerBackingStore.mm: * UIProcess/API/Cocoa/WKBackForwardList.h: * UIProcess/API/Cocoa/WKBackForwardListItem.h: Removed. * UIProcess/API/Cocoa/WKNavigation.h: * UIProcess/API/Cocoa/WKNavigationAction.h: Removed. * UIProcess/API/Cocoa/WKNavigationDelegate.h: * UIProcess/API/Cocoa/WKNavigationResponse.h: Removed. * UIProcess/API/Cocoa/WKNavigationTrigger.h: Added. (NS_ENUM): * UIProcess/API/Cocoa/WKWebView.h: * UIProcess/API/CoordinatedGraphics/WKCoordinatedScene.cpp: * UIProcess/API/CoordinatedGraphics/WKCoordinatedScene.h: * UIProcess/CoordinatedGraphics/WKCoordinatedSceneAPICast.h: * WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.cpp: * WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.h: * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp: * WebProcess/Databases/IndexedDB/WebIDBServerConnection.h: * WebProcess/Databases/WebToDatabaseProcessConnection.cpp: * WebProcess/Databases/WebToDatabaseProcessConnection.h: * WebProcess/WebCoreSupport/WebAlternativeTextClient.h: * WebProcess/WebCoreSupport/mac/WebAlternativeTextClient.cpp: * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm: * WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp: * WebProcess/WebPage/mac/GraphicsLayerCARemote.h: * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: * WebProcess/WebPage/mac/PlatformCALayerRemote.h: * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h: * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm: * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp: * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h: Source/WTF: Replace "Apple Computer, Inc." with "Apple Inc." in copyright headers https://bugs.webkit.org/show_bug.cgi?id=130276 <rdar://problem/16266927> Reviewed by Simon Fraser. * wtf/ASCIICType.h: * wtf/AVLTree.h: * wtf/Assertions.cpp: * wtf/Assertions.h: * wtf/Atomics.cpp: * wtf/Atomics.h: * wtf/AutodrainedPool.h: * wtf/AutodrainedPoolMac.mm: * wtf/BoundsCheckedPointer.h: * wtf/CryptographicUtilities.cpp: * wtf/CryptographicallyRandomNumber.h: * wtf/CurrentTime.h: * wtf/Deque.h: * wtf/DisallowCType.h: * wtf/ExportMacros.h: * wtf/FeatureDefines.h: * wtf/GetPtr.h: * wtf/HashIterators.h: * wtf/Locker.h: * wtf/MainThread.cpp: * wtf/MainThread.h: * wtf/MathExtras.h: * wtf/MediaTime.cpp: * wtf/MediaTime.h: * wtf/MessageQueue.h: * wtf/MetaAllocator.cpp: * wtf/MetaAllocator.h: * wtf/MetaAllocatorHandle.h: * wtf/OSRandomSource.cpp: * wtf/OSRandomSource.h: * wtf/Platform.h: * wtf/RandomNumber.cpp: * wtf/RandomNumber.h: * wtf/RandomNumberSeed.h: * wtf/RedBlackTree.h: * wtf/RunLoopTimer.h: * wtf/RunLoopTimerCF.cpp: * wtf/SchedulePair.h: * wtf/SchedulePairCF.cpp: * wtf/SchedulePairMac.mm: * wtf/SegmentedVector.h: * wtf/StackBounds.h: * wtf/StaticConstructors.h: * wtf/StringExtras.h: * wtf/ThreadFunctionInvocation.h: * wtf/ThreadSafeRefCounted.h: * wtf/ThreadSpecific.h: * wtf/Threading.h: * wtf/ThreadingPrimitives.h: * wtf/ThreadingPthreads.cpp: * wtf/ThreadingWin.cpp: * wtf/WTFThreadData.cpp: * wtf/WTFThreadData.h: * wtf/efl/OwnPtrEfl.cpp: * wtf/mac/MainThreadMac.mm: * wtf/text/AtomicStringHash.h: * wtf/text/AtomicStringImpl.h: * wtf/text/Base64.h: * wtf/text/CString.cpp: * wtf/text/CString.h: * wtf/text/LChar.h: * wtf/text/cf/StringCF.cpp: * wtf/text/mac/StringMac.mm: * wtf/unicode/CharacterNames.h: * wtf/unicode/Collator.h: * wtf/unicode/CollatorDefault.cpp: * wtf/unicode/UTF8.cpp: * wtf/unicode/UTF8.h: * wtf/unicode/icu/CollatorICU.cpp: * wtf/win/MainThreadWin.cpp: Tools: Replace "Apple Computer, Inc." with "Apple Inc." in copyright headers https://bugs.webkit.org/show_bug.cgi?id=130276 <rdar://problem/16266927> Reviewed by Simon Fraser. * BuildSlaveSupport/build-launcher-app: * BuildSlaveSupport/build-launcher-dmg: * DumpRenderTree/DumpRenderTree.h: * DumpRenderTree/DumpRenderTreePrefix.h: * DumpRenderTree/GCController.cpp: * DumpRenderTree/GCController.h: * DumpRenderTree/JavaScriptThreading.cpp: * DumpRenderTree/JavaScriptThreading.h: * DumpRenderTree/PixelDumpSupport.cpp: * DumpRenderTree/PixelDumpSupport.h: * DumpRenderTree/TestNetscapePlugIn/PluginObjectMac.mm: * DumpRenderTree/TestRunner.cpp: * DumpRenderTree/TestRunner.h: * DumpRenderTree/WorkQueue.cpp: * DumpRenderTree/WorkQueue.h: * DumpRenderTree/WorkQueueItem.h: * DumpRenderTree/atk/AccessibilityCallbacks.h: * DumpRenderTree/atk/AccessibilityCallbacksAtk.cpp: * DumpRenderTree/cairo/PixelDumpSupportCairo.cpp: * DumpRenderTree/cairo/PixelDumpSupportCairo.h: * DumpRenderTree/cg/PixelDumpSupportCG.cpp: * DumpRenderTree/cg/PixelDumpSupportCG.h: * DumpRenderTree/efl/EditingCallbacks.cpp: * DumpRenderTree/efl/EditingCallbacks.h: * DumpRenderTree/efl/EventSender.cpp: * DumpRenderTree/efl/EventSender.h: * DumpRenderTree/efl/GCControllerEfl.cpp: * DumpRenderTree/efl/PixelDumpSupportEfl.cpp: * DumpRenderTree/efl/TestRunnerEfl.cpp: * DumpRenderTree/gtk/DumpRenderTree.cpp: * DumpRenderTree/gtk/DumpRenderTreeGtk.h: * DumpRenderTree/gtk/EditingCallbacks.cpp: * DumpRenderTree/gtk/EditingCallbacks.h: * DumpRenderTree/gtk/EventSender.cpp: * DumpRenderTree/gtk/EventSender.h: * DumpRenderTree/gtk/GCControllerGtk.cpp: * DumpRenderTree/gtk/PixelDumpSupportGtk.cpp: * DumpRenderTree/gtk/SelfScrollingWebKitWebView.cpp: * DumpRenderTree/gtk/SelfScrollingWebKitWebView.h: * DumpRenderTree/gtk/TestRunnerGtk.cpp: * DumpRenderTree/gtk/TextInputController.cpp: * DumpRenderTree/gtk/TextInputController.h: * DumpRenderTree/ios/PerlSupport/IPhoneSimulatorNotification/Makefile.PL: * DumpRenderTree/ios/PerlSupport/IPhoneSimulatorNotification/lib/IPhoneSimulatorNotification.pm: * DumpRenderTree/ios/PixelDumpSupportIOS.mm: * DumpRenderTree/mac/AppleScriptController.h: * DumpRenderTree/mac/AppleScriptController.m: * DumpRenderTree/mac/CheckedMalloc.cpp: * DumpRenderTree/mac/CheckedMalloc.h: * DumpRenderTree/mac/DumpRenderTree.mm: * DumpRenderTree/mac/DumpRenderTreeDraggingInfo.h: * DumpRenderTree/mac/DumpRenderTreeDraggingInfo.mm: * DumpRenderTree/mac/DumpRenderTreeMac.h: * DumpRenderTree/mac/DumpRenderTreePasteboard.h: * DumpRenderTree/mac/DumpRenderTreePasteboard.m: * DumpRenderTree/mac/DumpRenderTreeWindow.h: * DumpRenderTree/mac/DumpRenderTreeWindow.mm: * DumpRenderTree/mac/EditingDelegate.h: * DumpRenderTree/mac/EditingDelegate.mm: * DumpRenderTree/mac/EventSendingController.h: * DumpRenderTree/mac/EventSendingController.mm: * DumpRenderTree/mac/FrameLoadDelegate.h: * DumpRenderTree/mac/FrameLoadDelegate.mm: * DumpRenderTree/mac/GCControllerMac.mm: * DumpRenderTree/mac/MockWebNotificationProvider.h: * DumpRenderTree/mac/MockWebNotificationProvider.mm: * DumpRenderTree/mac/NavigationController.h: * DumpRenderTree/mac/NavigationController.m: * DumpRenderTree/mac/ObjCController.h: * DumpRenderTree/mac/ObjCController.m: * DumpRenderTree/mac/ObjCPlugin.h: * DumpRenderTree/mac/ObjCPlugin.m: * DumpRenderTree/mac/ObjCPluginFunction.h: * DumpRenderTree/mac/ObjCPluginFunction.m: * DumpRenderTree/mac/PixelDumpSupportMac.mm: * DumpRenderTree/mac/PolicyDelegate.h: * DumpRenderTree/mac/PolicyDelegate.mm: * DumpRenderTree/mac/ResourceLoadDelegate.h: * DumpRenderTree/mac/ResourceLoadDelegate.mm: * DumpRenderTree/mac/TestRunnerMac.mm: * DumpRenderTree/mac/TextInputController.h: * DumpRenderTree/mac/TextInputController.m: * DumpRenderTree/mac/UIDelegate.h: * DumpRenderTree/mac/UIDelegate.mm: * DumpRenderTree/mac/WorkQueueItemMac.mm: * DumpRenderTree/win/DRTDataObject.cpp: * DumpRenderTree/win/DRTDataObject.h: * DumpRenderTree/win/DRTDesktopNotificationPresenter.h: * DumpRenderTree/win/DRTDropSource.cpp: * DumpRenderTree/win/DRTDropSource.h: * DumpRenderTree/win/DraggingInfo.h: * DumpRenderTree/win/DumpRenderTree.cpp: * DumpRenderTree/win/DumpRenderTreeWin.h: * DumpRenderTree/win/EditingDelegate.cpp: * DumpRenderTree/win/EditingDelegate.h: * DumpRenderTree/win/EventSender.cpp: * DumpRenderTree/win/EventSender.h: * DumpRenderTree/win/FrameLoadDelegate.cpp: * DumpRenderTree/win/FrameLoadDelegate.h: * DumpRenderTree/win/GCControllerWin.cpp: * DumpRenderTree/win/HistoryDelegate.cpp: * DumpRenderTree/win/HistoryDelegate.h: * DumpRenderTree/win/MD5.cpp: * DumpRenderTree/win/MD5.h: * DumpRenderTree/win/PixelDumpSupportWin.cpp: * DumpRenderTree/win/PolicyDelegate.cpp: * DumpRenderTree/win/PolicyDelegate.h: * DumpRenderTree/win/ResourceLoadDelegate.cpp: * DumpRenderTree/win/ResourceLoadDelegate.h: * DumpRenderTree/win/TestRunnerWin.cpp: * DumpRenderTree/win/TextInputController.cpp: * DumpRenderTree/win/TextInputController.h: * DumpRenderTree/win/TextInputControllerWin.cpp: * DumpRenderTree/win/UIDelegate.cpp: * DumpRenderTree/win/UIDelegate.h: * DumpRenderTree/win/WorkQueueItemWin.cpp: * EWebLauncher/main.c: * GtkLauncher/main.c: * ImageDiff/efl/ImageDiff.cpp: * ImageDiff/gtk/ImageDiff.cpp: * MiniBrowser/gtk/main.c: * Scripts/SpacingHeuristics.pm: * Scripts/VCSUtils.pm: * Scripts/bisect-builds: * Scripts/build-dumprendertree: * Scripts/build-jsc: * Scripts/build-webkit: * Scripts/check-dom-results: * Scripts/check-for-exit-time-destructors: * Scripts/check-for-global-initializers: * Scripts/commit-log-editor: * Scripts/compare-timing-files: * Scripts/debug-minibrowser: * Scripts/debug-safari: * Scripts/do-file-rename: * Scripts/find-extra-includes: * Scripts/generate-coverage-data: * Scripts/make-script-test-wrappers: * Scripts/malloc-tree: * Scripts/old-run-webkit-tests: * Scripts/parse-malloc-history: * Scripts/report-include-statistics: * Scripts/resolve-ChangeLogs: * Scripts/run-bindings-tests: * Scripts/run-iexploder-tests: * Scripts/run-javascriptcore-tests: * Scripts/run-jsc: * Scripts/run-launcher: * Scripts/run-leaks: * Scripts/run-mangleme-tests: * Scripts/run-minibrowser: * Scripts/run-pageloadtest: * Scripts/run-regexp-tests: * Scripts/run-safari: * Scripts/run-sunspider: * Scripts/run-webkit-app: * Scripts/sampstat: * Scripts/set-webkit-configuration: * Scripts/sort-Xcode-project-file: * Scripts/sort-export-file: * Scripts/split-file-by-class: * Scripts/sunspider-compare-results: * Scripts/svn-apply: * Scripts/svn-create-patch: * Scripts/svn-unapply: * Scripts/test-webkit-scripts: * Scripts/update-javascriptcore-test-results: * Scripts/update-webkit: * Scripts/update-webkit-auxiliary-libs: * Scripts/update-webkit-dependency: * Scripts/update-webkit-localizable-strings: * Scripts/update-webkit-support-libs: * Scripts/update-webkit-wincairo-libs: * Scripts/webkit-build-directory: * Scripts/webkitdirs.pm: (installedSafariPath): * Scripts/webkitperl/VCSUtils_unittest/parseChunkRange.pl: * Scripts/webkitperl/VCSUtils_unittest/parseDiffHeader.pl: * Scripts/webkitperl/VCSUtils_unittest/parseSvnDiffFooter.pl: * Scripts/webkitperl/VCSUtils_unittest/parseSvnDiffHeader.pl: * Scripts/webkitperl/VCSUtils_unittest/parseSvnProperty.pl: * Scripts/webkitperl/VCSUtils_unittest/parseSvnPropertyValue.pl: * Scripts/webkitperl/features.pm: * Scripts/webkitperl/httpd.pm: * Scripts/webkitpy/bindings/main.py: * Scripts/webkitpy/to_be_moved/update_webgl_conformance_tests.py: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: * TestWebKitAPI/Tests/WTF/cf/RetainPtr.cpp: * TestWebKitAPI/Tests/WTF/cf/RetainPtrHashing.cpp: * TestWebKitAPI/Tests/WTF/ns/RetainPtr.mm: * WebKitTestRunner/InjectedBundle/gtk/ActivateFontsGtk.cpp: * WebKitTestRunner/InjectedBundle/gtk/InjectedBundleUtilities.cpp: * WebKitTestRunner/InjectedBundle/gtk/InjectedBundleUtilities.h: * WebKitTestRunner/PixelDumpSupport.cpp: * WebKitTestRunner/PixelDumpSupport.h: * WebKitTestRunner/gtk/EventSenderProxyGtk.cpp: * WinLauncher/WinLauncher.cpp: * WinLauncher/WinLauncher.h: * WinLauncher/stdafx.cpp: * WinLauncher/stdafx.h: WebKitLibraries: Replace "Apple Computer, Inc." with "Apple Inc." in copyright headers https://bugs.webkit.org/show_bug.cgi?id=130276 <rdar://problem/16266927> Reviewed by Simon Fraser. * win/include/WebKitSystemInterface/WebKitSystemInterface.h: * win/tools/scripts/auto-version.sh: Websites/webkit.org: Replace "Apple Computer, Inc." with "Apple Inc." in copyright headers https://bugs.webkit.org/show_bug.cgi?id=130276 <rdar://problem/16266927> Reviewed by Simon Fraser. * blog/wp-content/textfield_screenshot.jpg: * misc/WebKitDetect.html: * misc/WebKitDetect.js: * perf/sunspider-0.9.1/sunspider-0.9.1/driver.html: * perf/sunspider-0.9.1/sunspider-0.9.1/results.html: * perf/sunspider-0.9.1/sunspider-0.9.1/sunspider-test-contents.js: * perf/sunspider-0.9.1/sunspider-0.9/driver.html: * perf/sunspider-0.9.1/sunspider-0.9/results.html: * perf/sunspider-0.9.1/sunspider-0.9/sunspider-test-contents.js: * perf/sunspider-0.9.1/sunspider-analyze-results.js: * perf/sunspider-0.9.1/sunspider-compare-results.js: * perf/sunspider-0.9/3d-cube.html: * perf/sunspider-0.9/3d-morph.html: * perf/sunspider-0.9/3d-raytrace.html: * perf/sunspider-0.9/access-binary-trees.html: * perf/sunspider-0.9/access-fannkuch.html: * perf/sunspider-0.9/access-nbody.html: * perf/sunspider-0.9/access-nsieve.html: * perf/sunspider-0.9/bitops-3bit-bits-in-byte.html: * perf/sunspider-0.9/bitops-bits-in-byte.html: * perf/sunspider-0.9/bitops-bitwise-and.html: * perf/sunspider-0.9/bitops-nsieve-bits.html: * perf/sunspider-0.9/controlflow-recursive.html: * perf/sunspider-0.9/crypto-aes.html: * perf/sunspider-0.9/crypto-md5.html: * perf/sunspider-0.9/crypto-sha1.html: * perf/sunspider-0.9/date-format-tofte.html: * perf/sunspider-0.9/date-format-xparb.html: * perf/sunspider-0.9/math-cordic.html: * perf/sunspider-0.9/math-partial-sums.html: * perf/sunspider-0.9/math-spectral-norm.html: * perf/sunspider-0.9/regexp-dna.html: * perf/sunspider-0.9/string-base64.html: * perf/sunspider-0.9/string-fasta.html: * perf/sunspider-0.9/string-tagcloud.html: * perf/sunspider-0.9/string-unpack-code.html: * perf/sunspider-0.9/string-validate-input.html: * perf/sunspider-0.9/sunspider-analyze-results.js: * perf/sunspider-0.9/sunspider-compare-results.js: * perf/sunspider-0.9/sunspider-driver.html: * perf/sunspider-0.9/sunspider-record-result.js: * perf/sunspider-0.9/sunspider-results.html: * perf/sunspider-1.0.1/sunspider-1.0.1/driver.html: * perf/sunspider-1.0.1/sunspider-1.0.1/results.html: * perf/sunspider-1.0.1/sunspider-1.0.1/sunspider-test-contents.js: * perf/sunspider-1.0.1/sunspider-analyze-results.js: * perf/sunspider-1.0.1/sunspider-compare-results.js: * perf/sunspider-1.0.1/sunspider.html: * perf/sunspider-1.0.2/sunspider-1.0.2/driver.html: * perf/sunspider-1.0.2/sunspider-1.0.2/results.html: * perf/sunspider-1.0.2/sunspider-1.0.2/sunspider-test-contents.js: * perf/sunspider-1.0.2/sunspider-analyze-results.js: * perf/sunspider-1.0.2/sunspider-compare-results.js: * perf/sunspider-1.0.2/sunspider.html: * perf/sunspider-1.0/sunspider-1.0/driver.html: * perf/sunspider-1.0/sunspider-1.0/results.html: * perf/sunspider-1.0/sunspider-1.0/sunspider-test-contents.js: * perf/sunspider-1.0/sunspider-analyze-results.js: * perf/sunspider-1.0/sunspider-compare-results.js: * perf/sunspider-1.0/sunspider.html: * perf/sunspider/sunspider.html: * perf/sunspider/versions.html: * quality/reporting.html: LayoutTests: Replace "Apple Computer, Inc." with "Apple Inc." in copyright headers https://bugs.webkit.org/show_bug.cgi?id=130276 <rdar://problem/16266927> Reviewed by Simon Fraser. * editing/resources/TIFF-pasteboard-data.dat: * fast/backgrounds/repeat/resources/gradient.gif: * fast/forms/resources/apple.gif: * http/tests/webgl/1.0.2/resources/webgl_test_files/conformance/resources/fragmentShader.frag: * http/tests/webgl/1.0.2/resources/webgl_test_files/conformance/resources/vertexShader.vert: * platform/win/TestExpectations: * platform/wincairo/TestExpectations: * platform/wk2/TestExpectations: * webgl/1.0.1/resources/webgl_test_files/conformance/attribs/gl-vertexattribpointer-offsets.html: * webgl/1.0.1/resources/webgl_test_files/conformance/context/context-attribute-preserve-drawing-buffer.html: * webgl/1.0.1/resources/webgl_test_files/conformance/context/incorrect-context-object-behaviour.html: * webgl/1.0.1/resources/webgl_test_files/conformance/misc/bad-arguments-test.html: * webgl/1.0.1/resources/webgl_test_files/conformance/misc/invalid-passed-params.html: * webgl/1.0.1/resources/webgl_test_files/conformance/misc/null-object-behaviour.html: * webgl/1.0.1/resources/webgl_test_files/conformance/misc/type-conversion-test.html: * webgl/1.0.1/resources/webgl_test_files/conformance/programs/get-active-test.html: * webgl/1.0.1/resources/webgl_test_files/conformance/rendering/draw-arrays-out-of-bounds.html: * webgl/1.0.1/resources/webgl_test_files/conformance/rendering/draw-elements-out-of-bounds.html: * webgl/1.0.1/resources/webgl_test_files/conformance/rendering/line-loop-tri-fan.html: * webgl/1.0.1/resources/webgl_test_files/conformance/rendering/triangle.html: * webgl/1.0.1/resources/webgl_test_files/conformance/resources/fragmentShader.frag: * webgl/1.0.1/resources/webgl_test_files/conformance/resources/vertexShader.vert: * webgl/1.0.1/resources/webgl_test_files/conformance/resources/webgl-test.js: * webgl/1.0.1/resources/webgl_test_files/conformance/state/gl-get-calls.html: * webgl/1.0.1/resources/webgl_test_files/conformance/state/gl-object-get-calls.html: * webgl/1.0.1/resources/webgl_test_files/conformance/typedarrays/array-unit-tests.html: * webgl/1.0.1/resources/webgl_test_files/extra/canvas-compositing-test.html: * webgl/1.0.2/resources/webgl_test_files/conformance/resources/fragmentShader.frag: * webgl/1.0.2/resources/webgl_test_files/conformance/resources/vertexShader.vert: * webgl/resources/webgl_test_files/conformance/resources/fragmentShader.frag: * webgl/resources/webgl_test_files/conformance/resources/vertexShader.vert: Canonical link: https://commits.webkit.org/148261@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@165676 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-03-15 04:08:27 +00:00
* 3. Neither the name of Apple Inc. ("Apple") nor the names of
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "config.h"
Use pragma once in WTF https://bugs.webkit.org/show_bug.cgi?id=190527 Reviewed by Chris Dumez. Source/WTF: We also need to consistently include wtf headers from within wtf so we can build wtf without symbol redefinition errors from including the copy in Source and the copy in the build directory. * wtf/ASCIICType.h: * wtf/Assertions.cpp: * wtf/Assertions.h: * wtf/Atomics.h: * wtf/AutomaticThread.cpp: * wtf/AutomaticThread.h: * wtf/BackwardsGraph.h: * wtf/Bag.h: * wtf/BagToHashMap.h: * wtf/BitVector.cpp: * wtf/BitVector.h: * wtf/Bitmap.h: * wtf/BloomFilter.h: * wtf/Box.h: * wtf/BubbleSort.h: * wtf/BumpPointerAllocator.h: * wtf/ByteOrder.h: * wtf/CPUTime.cpp: * wtf/CallbackAggregator.h: * wtf/CheckedArithmetic.h: * wtf/CheckedBoolean.h: * wtf/ClockType.cpp: * wtf/ClockType.h: * wtf/CommaPrinter.h: * wtf/CompilationThread.cpp: * wtf/CompilationThread.h: * wtf/Compiler.h: * wtf/ConcurrentPtrHashSet.cpp: * wtf/ConcurrentVector.h: * wtf/Condition.h: * wtf/CountingLock.cpp: * wtf/CrossThreadTaskHandler.cpp: * wtf/CryptographicUtilities.cpp: * wtf/CryptographicUtilities.h: * wtf/CryptographicallyRandomNumber.cpp: * wtf/CryptographicallyRandomNumber.h: * wtf/CurrentTime.cpp: * wtf/DataLog.cpp: * wtf/DataLog.h: * wtf/DateMath.cpp: * wtf/DateMath.h: * wtf/DecimalNumber.cpp: * wtf/DecimalNumber.h: * wtf/Deque.h: * wtf/DisallowCType.h: * wtf/Dominators.h: * wtf/DoublyLinkedList.h: * wtf/FastBitVector.cpp: * wtf/FastMalloc.cpp: * wtf/FastMalloc.h: * wtf/FeatureDefines.h: * wtf/FilePrintStream.cpp: * wtf/FilePrintStream.h: * wtf/FlipBytes.h: * wtf/FunctionDispatcher.cpp: * wtf/FunctionDispatcher.h: * wtf/GetPtr.h: * wtf/Gigacage.cpp: * wtf/GlobalVersion.cpp: * wtf/GraphNodeWorklist.h: * wtf/GregorianDateTime.cpp: * wtf/GregorianDateTime.h: * wtf/HashFunctions.h: * wtf/HashMap.h: * wtf/HashMethod.h: * wtf/HashSet.h: * wtf/HashTable.cpp: * wtf/HashTraits.h: * wtf/Indenter.h: * wtf/IndexSparseSet.h: * wtf/InlineASM.h: * wtf/Insertion.h: * wtf/IteratorAdaptors.h: * wtf/IteratorRange.h: * wtf/JSONValues.cpp: * wtf/JSValueMalloc.cpp: * wtf/LEBDecoder.h: * wtf/Language.cpp: * wtf/ListDump.h: * wtf/Lock.cpp: * wtf/Lock.h: * wtf/LockAlgorithm.h: * wtf/LockedPrintStream.cpp: * wtf/Locker.h: * wtf/MD5.cpp: * wtf/MD5.h: * wtf/MainThread.cpp: * wtf/MainThread.h: * wtf/MallocPtr.h: * wtf/MathExtras.h: * wtf/MediaTime.cpp: * wtf/MediaTime.h: * wtf/MemoryPressureHandler.cpp: * wtf/MessageQueue.h: * wtf/MetaAllocator.cpp: * wtf/MetaAllocator.h: * wtf/MetaAllocatorHandle.h: * wtf/MonotonicTime.cpp: * wtf/MonotonicTime.h: * wtf/NakedPtr.h: * wtf/NoLock.h: * wtf/NoTailCalls.h: * wtf/Noncopyable.h: * wtf/NumberOfCores.cpp: * wtf/NumberOfCores.h: * wtf/OSAllocator.h: * wtf/OSAllocatorPosix.cpp: * wtf/OSRandomSource.cpp: * wtf/OSRandomSource.h: * wtf/ObjcRuntimeExtras.h: * wtf/OrderMaker.h: * wtf/PackedIntVector.h: * wtf/PageAllocation.h: * wtf/PageBlock.cpp: * wtf/PageBlock.h: * wtf/PageReservation.h: * wtf/ParallelHelperPool.cpp: * wtf/ParallelHelperPool.h: * wtf/ParallelJobs.h: * wtf/ParallelJobsLibdispatch.h: * wtf/ParallelVectorIterator.h: * wtf/ParkingLot.cpp: * wtf/ParkingLot.h: * wtf/Platform.h: * wtf/PointerComparison.h: * wtf/Poisoned.cpp: * wtf/PrintStream.cpp: * wtf/PrintStream.h: * wtf/ProcessID.h: * wtf/ProcessPrivilege.cpp: * wtf/RAMSize.cpp: * wtf/RAMSize.h: * wtf/RandomDevice.cpp: * wtf/RandomNumber.cpp: * wtf/RandomNumber.h: * wtf/RandomNumberSeed.h: * wtf/RangeSet.h: * wtf/RawPointer.h: * wtf/ReadWriteLock.cpp: * wtf/RedBlackTree.h: * wtf/Ref.h: * wtf/RefCountedArray.h: * wtf/RefCountedLeakCounter.cpp: * wtf/RefCountedLeakCounter.h: * wtf/RefCounter.h: * wtf/RefPtr.h: * wtf/RetainPtr.h: * wtf/RunLoop.cpp: * wtf/RunLoop.h: * wtf/RunLoopTimer.h: * wtf/RunLoopTimerCF.cpp: * wtf/SHA1.cpp: * wtf/SHA1.h: * wtf/SaturatedArithmetic.h: (saturatedSubtraction): * wtf/SchedulePair.h: * wtf/SchedulePairCF.cpp: * wtf/SchedulePairMac.mm: * wtf/ScopedLambda.h: * wtf/Seconds.cpp: * wtf/Seconds.h: * wtf/SegmentedVector.h: * wtf/SentinelLinkedList.h: * wtf/SharedTask.h: * wtf/SimpleStats.h: * wtf/SingleRootGraph.h: * wtf/SinglyLinkedList.h: * wtf/SixCharacterHash.cpp: * wtf/SixCharacterHash.h: * wtf/SmallPtrSet.h: * wtf/Spectrum.h: * wtf/StackBounds.cpp: * wtf/StackBounds.h: * wtf/StackStats.cpp: * wtf/StackStats.h: * wtf/StackTrace.cpp: * wtf/StdLibExtras.h: * wtf/StreamBuffer.h: * wtf/StringHashDumpContext.h: * wtf/StringPrintStream.cpp: * wtf/StringPrintStream.h: * wtf/ThreadGroup.cpp: * wtf/ThreadMessage.cpp: * wtf/ThreadSpecific.h: * wtf/Threading.cpp: * wtf/Threading.h: * wtf/ThreadingPrimitives.h: * wtf/ThreadingPthreads.cpp: * wtf/TimeWithDynamicClockType.cpp: * wtf/TimeWithDynamicClockType.h: * wtf/TimingScope.cpp: * wtf/TinyLRUCache.h: * wtf/TinyPtrSet.h: * wtf/TriState.h: * wtf/TypeCasts.h: * wtf/UUID.cpp: * wtf/UnionFind.h: * wtf/VMTags.h: * wtf/ValueCheck.h: * wtf/Vector.h: * wtf/VectorTraits.h: * wtf/WallTime.cpp: * wtf/WallTime.h: * wtf/WeakPtr.h: * wtf/WeakRandom.h: * wtf/WordLock.cpp: * wtf/WordLock.h: * wtf/WorkQueue.cpp: * wtf/WorkQueue.h: * wtf/WorkerPool.cpp: * wtf/cf/LanguageCF.cpp: * wtf/cf/RunLoopCF.cpp: * wtf/cocoa/Entitlements.mm: * wtf/cocoa/MachSendRight.cpp: * wtf/cocoa/MainThreadCocoa.mm: * wtf/cocoa/MemoryFootprintCocoa.cpp: * wtf/cocoa/WorkQueueCocoa.cpp: * wtf/dtoa.cpp: * wtf/dtoa.h: * wtf/ios/WebCoreThread.cpp: * wtf/ios/WebCoreThread.h: * wtf/mac/AppKitCompatibilityDeclarations.h: * wtf/mac/DeprecatedSymbolsUsedBySafari.mm: * wtf/mbmalloc.cpp: * wtf/persistence/PersistentCoders.cpp: * wtf/persistence/PersistentDecoder.cpp: * wtf/persistence/PersistentEncoder.cpp: * wtf/spi/cf/CFBundleSPI.h: * wtf/spi/darwin/CommonCryptoSPI.h: * wtf/text/ASCIIFastPath.h: * wtf/text/ASCIILiteral.cpp: * wtf/text/AtomicString.cpp: * wtf/text/AtomicString.h: * wtf/text/AtomicStringHash.h: * wtf/text/AtomicStringImpl.cpp: * wtf/text/AtomicStringImpl.h: * wtf/text/AtomicStringTable.cpp: * wtf/text/AtomicStringTable.h: * wtf/text/Base64.cpp: * wtf/text/CString.cpp: * wtf/text/CString.h: * wtf/text/ConversionMode.h: * wtf/text/ExternalStringImpl.cpp: * wtf/text/IntegerToStringConversion.h: * wtf/text/LChar.h: * wtf/text/LineEnding.cpp: * wtf/text/StringBuffer.h: * wtf/text/StringBuilder.cpp: * wtf/text/StringBuilder.h: * wtf/text/StringBuilderJSON.cpp: * wtf/text/StringCommon.h: * wtf/text/StringConcatenate.h: * wtf/text/StringHash.h: * wtf/text/StringImpl.cpp: * wtf/text/StringImpl.h: * wtf/text/StringOperators.h: * wtf/text/StringView.cpp: * wtf/text/StringView.h: * wtf/text/SymbolImpl.cpp: * wtf/text/SymbolRegistry.cpp: * wtf/text/SymbolRegistry.h: * wtf/text/TextBreakIterator.cpp: * wtf/text/TextBreakIterator.h: * wtf/text/TextBreakIteratorInternalICU.h: * wtf/text/TextPosition.h: * wtf/text/TextStream.cpp: * wtf/text/UniquedStringImpl.h: * wtf/text/WTFString.cpp: * wtf/text/WTFString.h: * wtf/text/cocoa/StringCocoa.mm: * wtf/text/cocoa/StringViewCocoa.mm: * wtf/text/cocoa/TextBreakIteratorInternalICUCocoa.cpp: * wtf/text/icu/UTextProvider.cpp: * wtf/text/icu/UTextProvider.h: * wtf/text/icu/UTextProviderLatin1.cpp: * wtf/text/icu/UTextProviderLatin1.h: * wtf/text/icu/UTextProviderUTF16.cpp: * wtf/text/icu/UTextProviderUTF16.h: * wtf/threads/BinarySemaphore.cpp: * wtf/threads/BinarySemaphore.h: * wtf/threads/Signals.cpp: * wtf/unicode/CharacterNames.h: * wtf/unicode/Collator.h: * wtf/unicode/CollatorDefault.cpp: * wtf/unicode/UTF8.cpp: * wtf/unicode/UTF8.h: Tools: Put WorkQueue in namespace DRT so it does not conflict with WTF::WorkQueue. * DumpRenderTree/TestRunner.cpp: (TestRunner::queueLoadHTMLString): (TestRunner::queueLoadAlternateHTMLString): (TestRunner::queueBackNavigation): (TestRunner::queueForwardNavigation): (TestRunner::queueLoadingScript): (TestRunner::queueNonLoadingScript): (TestRunner::queueReload): * DumpRenderTree/WorkQueue.cpp: (WorkQueue::singleton): Deleted. (WorkQueue::WorkQueue): Deleted. (WorkQueue::queue): Deleted. (WorkQueue::dequeue): Deleted. (WorkQueue::count): Deleted. (WorkQueue::clear): Deleted. (WorkQueue::processWork): Deleted. * DumpRenderTree/WorkQueue.h: (WorkQueue::setFrozen): Deleted. * DumpRenderTree/WorkQueueItem.h: * DumpRenderTree/mac/DumpRenderTree.mm: (runTest): * DumpRenderTree/mac/FrameLoadDelegate.mm: (-[FrameLoadDelegate processWork:]): (-[FrameLoadDelegate webView:locationChangeDone:forDataSource:]): * DumpRenderTree/mac/TestRunnerMac.mm: (TestRunner::notifyDone): (TestRunner::forceImmediateCompletion): (TestRunner::queueLoad): * DumpRenderTree/win/DumpRenderTree.cpp: (runTest): * DumpRenderTree/win/FrameLoadDelegate.cpp: (FrameLoadDelegate::processWork): (FrameLoadDelegate::locationChangeDone): * DumpRenderTree/win/TestRunnerWin.cpp: (TestRunner::notifyDone): (TestRunner::forceImmediateCompletion): (TestRunner::queueLoad): Canonical link: https://commits.webkit.org/205473@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237099 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-15 14:24:49 +00:00
#include <wtf/MediaTime.h>
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
#include <algorithm>
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
#include <cstdlib>
#include <wtf/Assertions.h>
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
#include <wtf/CheckedArithmetic.h>
Web Inspector: Optionally log WebKit log parameters as JSON https://bugs.webkit.org/show_bug.cgi?id=180529 <rdar://problem/35909462> Reviewed by Joseph Pecoraro. Source/JavaScriptCore: * inspector/ConsoleMessage.cpp: (Inspector::ConsoleMessage::ConsoleMessage): New constructor that takes a vector of JSON log values. Concatenate all adjacent strings to make logging cleaner. (Inspector::ConsoleMessage::addToFrontend): Process WebKit logging arguments. (Inspector::ConsoleMessage::scriptState const): * inspector/ConsoleMessage.h: * inspector/InjectedScript.cpp: (Inspector::InjectedScript::wrapJSONString const): Wrap JSON string log arguments. * inspector/InjectedScript.h: * inspector/InjectedScriptSource.js: (let.InjectedScript.prototype.wrapJSONString): Source/WebCore: * dom/Document.cpp: (WebCore::Document::didLogMessage):Update for API change. Don't check for main thread, that is already done in addConsoleMessage. * dom/Document.h: * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::updatePlayState): Cleanup logging. * html/track/DataCue.cpp: (WebCore::DataCue::toJSONString const): Serialize to JSON string. (WebCore::DataCue::toString const): Deleted. * html/track/DataCue.h: (WTF::LogArgument<WebCore::DataCue>::toString): * html/track/TextTrackCue.cpp: (WebCore::TextTrackCue::toJSON const): Ditto. (WebCore::TextTrackCue::toJSONString const): (WebCore::TextTrackCue::toString const): Deleted. * html/track/TextTrackCue.h: (WTF::LogArgument<WebCore::TextTrackCue>::toString): * html/track/TextTrackCueGeneric.cpp: (WebCore::TextTrackCueGeneric::toJSONString const): Ditto. (WebCore::TextTrackCueGeneric::toString const): Deleted. * html/track/TextTrackCueGeneric.h: (WTF::LogArgument<WebCore::TextTrackCueGeneric>::toString): * html/track/VTTCue.cpp: (WebCore::VTTCue::toJSONString const): Ditto. (WebCore::VTTCue::toString const): Deleted. * html/track/VTTCue.h: (WTF::LogArgument<WebCore::VTTCue>::toString): * platform/graphics/InbandTextTrackPrivateClient.h: (WebCore::GenericCueData::toJSONString const): Ditto. (WTF::LogArgument<WebCore::GenericCueData>::toString): (WebCore::GenericCueData::toString const): Deleted. * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: (WebCore::InbandTextTrackPrivateAVF::processAttributedStrings): Cleanup logging. (WebCore::InbandTextTrackPrivateAVF::removeCompletedCues): Ditto. (WebCore::InbandTextTrackPrivateAVF::processNativeSamples): Log the entire cue. (WebCore::InbandTextTrackPrivateAVF::readNativeSampleBuffer): Cleanup logging. * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: (WebCore::MediaPlayerPrivateAVFoundation::maxMediaTimeSeekable const): Don't log, it isn't interesting and happens frequently. (WebCore::MediaPlayerPrivateAVFoundation::minMediaTimeSeekable const): Ditto. * platform/graphics/iso/ISOVTTCue.cpp: (WebCore::ISOWebVTTCue::toJSONString const): Serialize to JSON string. * platform/graphics/iso/ISOVTTCue.h: (WTF::LogArgument<WebCore::ISOWebVTTCue>::toString): Ditto. Source/WTF: * wtf/Logger.h: (WTF::Logger::log): (WTF::LogArgument<Logger::LogSiteIdentifier>::toString): * wtf/MediaTime.cpp: (WTF::MediaTime::toJSONString const): Serialize to JSON string. * wtf/MediaTime.h: LayoutTests: * inspector/canvas/recording-2d-expected.txt: * inspector/canvas/recording-webgl-expected.txt: * inspector/canvas/recording-webgl-snapshots-expected.txt: Canonical link: https://commits.webkit.org/196579@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225764 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-12-12 00:41:54 +00:00
#include <wtf/JSONValues.h>
#include <wtf/MathExtras.h>
[MSE] Appends of overlapping sample data do not clear existing samples properly. https://bugs.webkit.org/show_bug.cgi?id=133435 Reviewed by Darin Adler. Source/WebCore: Test: media/media-source/media-source-overlapping-append.html The MSE spec has a spec error in how it removes overlapping frames. The intention seems to be to check for overlapping samples only when the incoming sample increases the highest presentation time field. But due to a mismatch in the range of a sample, defined as [start, end), and the check, which treats the end as inclusive, the overlapping check is almost never run. Add the sample comparison logic to match [start, end) ranges, and rename the existing check to differentiate it from the new one: * Modules/mediasource/SampleMap.cpp: (WebCore::SamplePresentationTimeIsInsideRangeComparator::operator()): (WebCore::SamplePresentationTimeIsWithinRangeComparator::operator()): (WebCore::SampleMap::findSamplesBetweenPresentationTimes): (WebCore::SampleMap::findSamplesWithinPresentationRange): * Modules/mediasource/SampleMap.h: Update the overlapping check to occur whenever the highest presentation time increases, and update the logic within that check to catch all overlapping frames. * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment): (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): (WebCore::SourceBuffer::bufferedSamplesForTrackID): * Modules/mediasource/SourceBuffer.h: * WebCore.exp.in: Add a dump method to MediaSample so that samples can be easily converted to a string for testing. * platform/MediaSample.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::MediaSampleAVFObjC::presentationSize): (WebCore::MediaSampleAVFObjC::dump): Update the Mock MSE implementation to pass along a "generation" field, to aid in testing. * platform/mock/mediasource/MockBox.cpp: (WebCore::MockSampleBox::MockSampleBox): * platform/mock/mediasource/MockBox.h: * platform/mock/mediasource/MockSourceBufferPrivate.cpp: (WebCore::MockMediaSample::dump): Add a method to internals to dump the buffered samples to string. * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::bufferedSamplesForTrackID): * Modules/mediasource/SourceBuffer.h: * testing/Internals.cpp: (WebCore::Internals::bufferedSamplesForTrackID): * testing/Internals.h: * testing/Internals.idl: Source/WTF: Add a dump method to MediaTime, so that MediaTimes can be easily converted to strings (for logging purposes). * wtf/MediaTime.cpp: (WTF::MediaTime::dump): * wtf/MediaTime.h: LayoutTests: * media/media-source/media-source-overlapping-append-expected.txt: Added. * media/media-source/media-source-overlapping-append.html: Added. * media/media-source/mock-media-source.js: Canonical link: https://commits.webkit.org/151463@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@169523 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-06-02 05:16:46 +00:00
#include <wtf/PrintStream.h>
Streamline PODIntervalTree code and remove ValueToString https://bugs.webkit.org/show_bug.cgi?id=199782 Reviewed by Anders Carlsson. Source/WebCore: * dom/Element.cpp: Updated includes. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::ignoreTrackDisplayUpdateRequests const): Moved this function out of line so we don't have to include PODIntervalTree.h in the header. But also, it's only used inside this file. Also updated for m_cueData. (WebCore::HTMLMediaElement::updateActiveTextTrackCues): More of the same. (WebCore::HTMLMediaElement::textTrackAddCue): Ditto. (WebCore::HTMLMediaElement::textTrackRemoveCue): Ditto. (WebCore::HTMLMediaElement::currentlyActiveCues const): Ditto. * html/HTMLMediaElement.h: Changed to not include PODIntervalTree.h, which in turn includes PODRedBlackTree.h, to significantly cut down how many times we have to compile those headers. Moved some functions out of line. Made m_cueData to hold the two cue-related objects so they don't have to be defined in the header. Also removed ValueToString specializations. * html/track/TextTrackCue.cpp: (WebCore::operator<<): Added debug-only overload of TextStream operator. (WebCore::TextTrackCue::debugString const): Deleted. * html/track/TextTrackCue.h: Updated for the above. * html/track/VTTCue.h: Added comments about the incorrect implementation of isType for VTTCue. Tweaked formatting a bit as well. * platform/LayoutUnit.h: Removed ValueToString specialization. * platform/PODInterval.h: Use #pragma once. Removed inaccurate comments saying this works only with POD. Use TextStream instead of ValueToString. Added overloads to the constructor so we can do move semantics instead of copy semantics, slightly better for WeakPtr. Removed the toString function and added an overload of operator<< with TextStream. Use "{ }" instead of "0" as the default value for user data. * platform/PODIntervalTree.h: Removed unneeded includes and unusual default argument types for the templates. Changed setNeedsFullOrderingComparisons and node updating to use template arguments instead of virtual functions and runtime setters. This allowed removal of the constructor and the init function since the defaults take care of both. Removed the overload of the allOverlaps function that uses an out argument. Removed unneeded use of WTF_MAKE_NONCOPYABLE. Use "{ }" instead of 0 for the default value for user data. Changed the createInterval function to use move semantics. Changed the nextIntervalAfter function to just take a point, not require and interval and use its high point. The PODIntervalTree::updateNode function is replaced with the PODIntervalNodeUpdater::update function. Removed the ValueToString use and the overriding as well and replaced with TextStream use. * platform/PODRedBlackTree.h: Updated comments to reflect the fact that this is not specific to POD and uses TextStream. Also that the needsFullOrderingComparisons technique is now a template argument. Use pragma once. Added FIXME about a few major improvements we should make. (WebCore::PODRedBlackTree::~PODRedBlackTree): Made non-virtual since we use template arguments for polymorphism and don't need virtual functions too. (WebCore::PODRedBlackTree::clear): Rewrote to use a non-recursive algorithm to delete the tree nodes. (WebCore::PODRedBlackTree::add): Added an overload that takes an rvalue reference for move semantics. (WebCore::PODRedBlackTree::visitInorder const): Deleted. (WebCore::PODRedBlackTree::size const): Deleted. (WebCore::PODRedBlackTree::isEmpty const): Replaced the inefficiently implemented size function with this much faster function. Could have also made a more efficient size function, but no client needs it. (WebCore::PODRedBlackTree::setNeedsFullOrderingComparisons): Deleted. (WebCore::PODRedBlackTree::checkInvariants const): Made non-virtual since there is no need for polymorphism. (WebCore::PODRedBlackTree::Node::Node): Use rvalue reference and move semantics. (WebCore::PODRedBlackTree::Node::copyFrom): Deleted. (WebCore::PODRedBlackTree::Node::moveDataFrom): Use move instead of copy. Also removed the gratuitous use of virtual. (WebCore::PODRedBlackTree::updateNode): Made non-virtual and instead call through the NodeUpdaterType (actually more like "traits"). (WebCore::PODRedBlackTree::treeSearch const): Use template argument instead of data member. (WebCore::PODRedBlackTree::treeSuccessor): Made a static member function. (WebCore::PODRedBlackTree::treeMinimum): Ditto. (WebCore::PODRedBlackTree::treeSuccessorInPostOrder): Added. Useful when deleting the tree so we visit children before deleting the parent. (WebCore::PODRedBlackTree::deleteNode): Use moveDataFrom when moving the data from a node that we are about to delete. (WebCore::PODRedBlackTree::visitInorderImpl const): Deleted. (WebCore::PODRedBlackTree::markFree): Deleted. (WebCore::PODRedBlackTree::Counter): Deleted. (WebCore::PODRedBlackTree::dumpFromNode const): Use TextStream. * platform/graphics/FloatPolygon.cpp: (WebCore::FloatPolygon::FloatPolygon): Tweaked coding style a bit. (WebCore::FloatPolygon::overlappingEdges const): Changed to use a return value instead of an out argument. Also tweaked coding style a bit. (WebCore::FloatPolygonEdge::debugString const): Deleted. (WebCore::ooperator>>): Implemented TextStream overload. * platform/graphics/FloatPolygon.h: Updated for above, removed ValueToString specialization. * rendering/FloatingObjects.cpp: (WebCore::FloatingObject::debugString const): Deleted. (WebCore::operator<<): Implemented TextStream overload. * rendering/FloatingObjects.h: Ditto. Also removed include of PODIntervalTree.h and used a forward declaration instead. * rendering/RenderBlock.cpp: Updated includes. * rendering/RenderFragmentContainer.cpp: (WebCore::RenderFragmentContainer::debugString const): Deleted. (WebCore::operator<<): Implemented TextStream overload. * rendering/RenderFragmentContainer.h: Ditto. * rendering/RenderFragmentedFlow.cpp: (WebCore::RenderFragmentedFlow::FragmentSearchAdapter::FragmentSearchAdapter): Moved this class here from the header, moving the one function body that was already here up in the file. (WebCore::RenderFragmentedFlow::fragmentAtBlockOffset const): Refactored and tweaked code sequence a bit, did not change logic. (WebCore::RenderFragmentedFlow::updateFragmentsFragmentedFlowPortionRect): Tweaked code style a bit. * rendering/RenderFragmentedFlow.h: Moved FragmentSearchAdapter out of the header, and tweaked coding style a bit. Removed ValueToString specialization. * rendering/shapes/PolygonShape.cpp: (WebCore::PolygonShape::getExcludedInterval const): Updated to use the return value from the overlappingEdges function rather than an out argument. * rendering/updating/RenderTreeBuilder.cpp: Updated includes. * rendering/updating/RenderTreeBuilderFirstLetter.h: Updated forward declarations. * rendering/updating/RenderTreeBuilderMultiColumn.cpp: Updated includes. * rendering/updating/RenderTreePosition.h: Removed includes of RenderFragmentedFlow.h, RenderText.h, and RenderView.h, since none are needed by this header. * rendering/updating/RenderTreeUpdater.cpp: Updated includes. Source/WTF: * WTF.xcodeproj/project.pbxproj: Remove ValueToString.h. * wtf/CMakeLists.txt: Ditto. * wtf/MediaTime.cpp: (WTF::operator<<): Implement debug-only TextStream serialization based on toJSONString. * wtf/MediaTime.h: Ditto. * wtf/text/ValueToString.h: Removed. Canonical link: https://commits.webkit.org/218237@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@253290 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-12-09 17:12:48 +00:00
#include <wtf/text/TextStream.h>
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
namespace WTF {
[WTF] Allow MediaTime static constants https://bugs.webkit.org/show_bug.cgi?id=205723 Reviewed by Darin Adler. Source/WebCore: Since MediaTime no longer has a non-trivial destructor, declaring MediaTime variables no longer has potential side effects as far as the compiler is concerned and it can therefore print "unused variable" errors where that is the case. This patch marks one of such variable as intentionally unused, since it's only used in Debug and would otherwise break the Release build. Actually unused variables are also removed. * platform/graphics/cocoa/WebCoreDecompressionSession.mm: (WebCore::WebCoreDecompressionSession::imageForTime): * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::sourceBufferPrivateFastSeekTimeForMediaTime): * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::removeCodedFrames): Source/WTF: Despite all its convenience methods, at its core MediaTime is a rather trivial class with only integral members. Despite this, since it had a destructor declared, this made the class non-trivially destructible even if the implementation was empty, and therefore clang did not allow to use it for static variables unless done in form of a pointer. By removing the destructor this restriction is lifted and we don't need heap allocations for static MediaTime objects. Previous usages of heap allocation for static MediaTime objects have been rewritten to take advantage of this. Test coverage is provided by successful compilation without [-Werror,-Wexit-time-destructors] errors and existing tests. * wtf/MediaTime.cpp: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): (WTF::MediaTime::~MediaTime): Deleted. * wtf/MediaTime.h: Canonical link: https://commits.webkit.org/219059@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254200 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-01-08 15:57:03 +00:00
static_assert(std::is_trivially_destructible_v<MediaTime>, "MediaTime should be trivially destructible.");
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
static uint32_t greatestCommonDivisor(uint32_t a, uint32_t b)
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
{
ASSERT(a);
ASSERT(b);
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
// Euclid's Algorithm
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
uint32_t temp = 0;
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
while (b) {
temp = b;
b = a % b;
a = temp;
}
ASSERT(a);
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
return a;
}
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
static uint32_t leastCommonMultiple(uint32_t a, uint32_t b, uint32_t &result)
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
{
return safeMultiply(a, b / greatestCommonDivisor(a, b), result);
}
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
static int64_t signum(int64_t val)
{
return (0 < val) - (val < 0);
}
const uint32_t MediaTime::MaximumTimeScale = 1000000000;
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
MediaTime::MediaTime(const MediaTime& rhs)
{
*this = rhs;
}
[WTF] MediaTime should support round-tripping from and to doubles. https://bugs.webkit.org/show_bug.cgi?id=139248 Reviewed by Eric Carlson. Source/WebCore: Check whether the MediaTime's underlying data is floating point before converting to a CMTime or QTTime. * platform/graphics/avfoundation/MediaTimeAVFoundation.cpp: (WebCore::toCMTime): * platform/graphics/mac/MediaTimeQTKit.mm: (WebCore::toQTTime): Source/WTF: MediaTimes should be able to return precisely the same double value as was used when the MediaTime was created, so long as that MediaTime was not modified in a non-destructive way. This will allow API which accepts floating-point values to return the exact same value when asked, but still be able to store that value as a MediaTime. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): Added; store the floating-point value in a union. (WTF::MediaTime::createWithDouble): Ditto. (WTF::MediaTime::toFloat): If the value is a double, just return it. (WTF::MediaTime::toDouble): Ditto. (WTF::MediaTime::operator+): Special case when one or both sides are doubles. (WTF::MediaTime::operator-): Ditto. (WTF::MediaTime::operator*): Ditto. (WTF::MediaTime::compare): Ditto. (WTF::abs): Ditto. (WTF::MediaTime::setTimeScale): Convert the MediaTime from a double. Tools: Add API tests for new features of MediaTime. Update the LLDB python provider to correctly display the MediaTimes after this change. * TestWebKitAPI/Tests/WTF/MediaTime.cpp: (WTF::operator<<): (TestWebKitAPI::TEST): * lldb/lldb_webkit.py: (WTFMediaTime_SummaryProvider): (WTFMediaTimeProvider.timeValueAsDouble): (WTFMediaTimeProvider.isIndefinite): (WTFMediaTimeProvider): (WTFMediaTimeProvider.hasDoubleValue): Canonical link: https://commits.webkit.org/157162@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@176863 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-12-05 20:51:02 +00:00
MediaTime MediaTime::createWithFloat(float floatTime)
{
if (floatTime != floatTime)
return invalidTime();
if (std::isinf(floatTime))
return std::signbit(floatTime) ? negativeInfiniteTime() : positiveInfiniteTime();
MediaTime value(0, DefaultTimeScale, Valid | DoubleValue);
value.m_timeValueAsDouble = floatTime;
return value;
}
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
MediaTime MediaTime::createWithFloat(float floatTime, uint32_t timeScale)
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
{
if (floatTime != floatTime)
return invalidTime();
The 'global isinf/isnan' compiler quirk required when using clang with libstdc++ https://bugs.webkit.org/show_bug.cgi?id=109325 Reviewed by Anders Carlsson. Prefix calls to the isinf and isnan methods with std::, declaring we want to use the two methods as they're provided by the C++ standard library being used. Source/JavaScriptCore: * API/JSValueRef.cpp: (JSValueMakeNumber): * JSCTypedArrayStubs.h: (JSC): * bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::emitLoad): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::constantNaN): * offlineasm/cloop.rb: * runtime/DateConstructor.cpp: (JSC::dateUTC): Also include an opportunistic style fix. * runtime/DateInstance.cpp: (JSC::DateInstance::calculateGregorianDateTime): (JSC::DateInstance::calculateGregorianDateTimeUTC): * runtime/DatePrototype.cpp: (JSC::dateProtoFuncGetMilliSeconds): (JSC::dateProtoFuncGetUTCMilliseconds): (JSC::setNewValueFromTimeArgs): (JSC::setNewValueFromDateArgs): (JSC::dateProtoFuncSetYear): * runtime/JSCJSValue.cpp: (JSC::JSValue::toInteger): * runtime/JSDateMath.cpp: (JSC::getUTCOffset): (JSC::parseDateFromNullTerminatedCharacters): (JSC::parseDate): * runtime/JSGlobalObjectFunctions.cpp: (JSC::globalFuncIsNaN): * runtime/MathObject.cpp: (JSC::mathProtoFuncMax): (JSC::mathProtoFuncMin): (JSC::mathProtoFuncPow): * runtime/PropertyDescriptor.cpp: (JSC::sameValue): Source/WebCore: No new tests as there's no change in functionality. * Modules/mediasource/MediaSource.cpp: (WebCore::MediaSource::setDuration): * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::totalPitchRate): * Modules/webaudio/AudioParam.cpp: (WebCore::AudioParam::setValue): * Modules/webaudio/AudioParamTimeline.cpp: (WebCore::isValidNumber): * Modules/webaudio/PannerNode.cpp: (WebCore::fixNANs): * bindings/js/IDBBindingUtilities.cpp: (WebCore::createIDBKeyFromValue): * bindings/js/JSDataViewCustom.cpp: (WebCore::getDataViewMember): * bindings/js/JSGeolocationCustom.cpp: (WebCore::setTimeout): (WebCore::setMaximumAge): * bindings/js/JSHTMLOptionsCollectionCustom.cpp: (WebCore::JSHTMLOptionsCollection::setLength): * bindings/js/JSWebKitPointCustom.cpp: (WebCore::JSWebKitPointConstructor::constructJSWebKitPoint): * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): (GenerateParametersCheck): * bindings/scripts/CodeGeneratorV8.pm: (GenerateParametersCheck): * bindings/scripts/test/JS/JSFloat64Array.cpp: (WebCore::JSFloat64Array::getByIndex): * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::jsTestObjPrototypeFunctionClassMethodWithClamp): * bindings/scripts/test/V8/V8TestObj.cpp: (WebCore::TestObjV8Internal::classMethodWithClampCallback): * bindings/v8/IDBBindingUtilities.cpp: (WebCore::createIDBKeyFromValue): * bindings/v8/V8Binding.cpp: (WebCore::toInt32): (WebCore::toUInt32): * bindings/v8/custom/V8GeolocationCustom.cpp: (WebCore::createPositionOptions): * bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp: (WebCore::V8HTMLOptionsCollection::lengthAccessorSetter): * bindings/v8/custom/V8WebKitPointCustom.cpp: (WebCore::V8WebKitPoint::constructorCallbackCustom): * bridge/qt/qt_runtime.cpp: (JSC::Bindings::convertValueToQVariant): * css/WebKitCSSMatrix.cpp: (WebCore::WebKitCSSMatrix::translate): (WebCore::WebKitCSSMatrix::scale): (WebCore::WebKitCSSMatrix::rotate): (WebCore::WebKitCSSMatrix::rotateAxisAngle): (WebCore::WebKitCSSMatrix::skewX): (WebCore::WebKitCSSMatrix::skewY): * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::percentLoaded): (WebCore::HTMLMediaElement::mediaPlayerTimeChanged): (WebCore::HTMLMediaElement::endedPlayback): * html/MediaController.cpp: (MediaController::duration): * html/canvas/WebGLRenderingContext.cpp: (WebCore): (WebCore::WebGLRenderingContext::clearColor): * html/track/TextTrack.cpp: (WebCore::TextTrack::addCue): * html/track/TextTrackCue.cpp: (WebCore::TextTrackCue::setStartTime): (WebCore::TextTrackCue::setEndTime): * page/DOMWindow.cpp: (WebCore::DOMWindow::adjustWindowRect): * page/WindowFeatures.cpp: (WebCore::WindowFeatures::floatFeature): Also include an opportunistic style fix. * platform/CalculationValue.cpp: (WebCore::CalculationValue::evaluate): * platform/Decimal.cpp: (WebCore::Decimal::fromDouble): * platform/Length.cpp: (WebCore::Length::nonNanCalculatedValue): * platform/audio/AudioResampler.cpp: (WebCore::AudioResampler::setRate): * platform/audio/DynamicsCompressorKernel.cpp: (WebCore::DynamicsCompressorKernel::process): * platform/audio/Reverb.cpp: (WebCore::calculateNormalizationScale): * platform/graphics/Font.cpp: (WebCore::Font::width): * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h: (WebCore::MediaPlayerPrivateAVFoundation::isLiveStream): * platform/graphics/gpu/LoopBlinnMathUtils.cpp: (LoopBlinnMathUtils): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::buffered): (WebCore::MediaPlayerPrivateGStreamer::maxTimeSeekable): * platform/graphics/mac/MediaPlayerPrivateQTKit.mm: (WebCore::MediaPlayerPrivateQTKit::maxTimeSeekable): * platform/graphics/opentype/OpenTypeVerticalData.cpp: (WebCore::OpenTypeVerticalData::getVerticalTranslationsForGlyphs): * platform/graphics/transforms/TransformationMatrix.cpp: (WebCore::clampEdgeValue): (WebCore::TransformationMatrix::clampedBoundsOfProjectedQuad): * platform/network/ResourceResponseBase.cpp: (WebCore::ResourceResponseBase::parseCacheControlDirectives): * rendering/RenderMediaControlsChromium.cpp: (WebCore::paintMediaSlider): (WebCore::paintMediaVolumeSlider): * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintMediaSliderTrack): * svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::beginElementAt): (WebCore::SVGAnimationElement::endElementAt): * svg/SVGSVGElement.cpp: (WebCore::SVGSVGElement::setCurrentTime): * svg/animation/SMILTime.h: (WebCore::SMILTime::SMILTime): * svg/animation/SVGSMILElement.cpp: (WebCore::SVGSMILElement::addBeginTime): (WebCore::SVGSMILElement::addEndTime): * xml/XPathFunctions.cpp: (WebCore::XPath::FunSubstring::evaluate): (WebCore::XPath::FunRound::round): * xml/XPathValue.cpp: (WebCore::XPath::Value::toBoolean): Also include an opportunistic style fix. (WebCore::XPath::Value::toString): Source/WebKit/chromium: * tests/DecimalTest.cpp: (TEST_F): Source/WebKit/mac: * tests/DecimalTest.cpp: (TEST_F): Source/WTF: * wtf/Compiler.h: Remove the global isinf/isnan compiler quirk definitions. They're not required anymore. * wtf/DateMath.cpp: Move the workaround for isinf on Solaris into the std namespace. Ditto for isinf and isnan when using MSVC. Stop bringing the isinf and isnan methods into the global scope when using other configurations. (WTF::parseDateFromNullTerminatedCharacters): * wtf/IntegralTypedArrayBase.h: (WTF::IntegralTypedArrayBase::set): * wtf/MathExtras.h: (std): (std::isinf): (wtf_fmod): (wtf_pow): (doubleToInteger): * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): * wtf/Uint8ClampedArray.h: (WTF::Uint8ClampedArray::set): Tools: * DumpRenderTree/TestRunner.cpp: (setAppCacheMaximumSizeCallback): (setApplicationCacheOriginQuotaCallback): (setDatabaseQuotaCallback): Canonical link: https://commits.webkit.org/128030@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@142810 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-02-13 23:01:21 +00:00
if (std::isinf(floatTime))
Stop placing std::isfinite and std::signbit inside the global scope https://bugs.webkit.org/show_bug.cgi?id=109817 Reviewed by Darin Adler. Prefix calls to the isfinite and signbit methods with std:: as the two methods are no longer being imported into the global scope. Source/JavaScriptCore: * assembler/MacroAssembler.h: (JSC::MacroAssembler::shouldBlindDouble): * offlineasm/cloop.rb: * runtime/BigInteger.h: (JSC::BigInteger::BigInteger): * runtime/DateConstructor.cpp: (JSC::constructDate): * runtime/DatePrototype.cpp: (JSC::fillStructuresUsingTimeArgs): (JSC::fillStructuresUsingDateArgs): (JSC::dateProtoFuncToISOString): (JSC::dateProtoFuncSetYear): * runtime/JSCJSValueInlines.h: (JSC::JSValue::JSValue): * runtime/JSGlobalObjectFunctions.cpp: (JSC::globalFuncIsFinite): * runtime/JSONObject.cpp: (JSC::Stringifier::appendStringifiedValue): * runtime/MathObject.cpp: (JSC::mathProtoFuncMax): Also include an opportunistic style fix. (JSC::mathProtoFuncMin): Ditto. * runtime/NumberPrototype.cpp: (JSC::toStringWithRadix): (JSC::numberProtoFuncToExponential): (JSC::numberProtoFuncToFixed): (JSC::numberProtoFuncToPrecision): (JSC::numberProtoFuncToString): * runtime/Uint16WithFraction.h: (JSC::Uint16WithFraction::Uint16WithFraction): Source/WebCore: No new tests as there's no change in functionality. * bindings/js/JSCanvasRenderingContext2DCustom.cpp: (WebCore::JSCanvasRenderingContext2D::setWebkitLineDash): * bindings/js/JSDOMBinding.cpp: (WebCore::jsDateOrNull): * bindings/js/JSDOMBinding.h: (WebCore::finiteInt32Value): * bindings/v8/V8Binding.h: (WebCore::v8DateOrNull): * css/CSSPrimitiveValue.cpp: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): * html/BaseDateAndTimeInputType.cpp: (WebCore::BaseDateAndTimeInputType::parseToNumber): * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::setValueAsNumber): * html/HTMLMeterElement.cpp: (WebCore::HTMLMeterElement::setMin): (WebCore::HTMLMeterElement::setMax): (WebCore::HTMLMeterElement::setValue): (WebCore::HTMLMeterElement::setLow): (WebCore::HTMLMeterElement::setHigh): (WebCore::HTMLMeterElement::setOptimum): * html/HTMLProgressElement.cpp: (WebCore::HTMLProgressElement::value): (WebCore::HTMLProgressElement::setValue): (WebCore::HTMLProgressElement::max): (WebCore::HTMLProgressElement::setMax): * html/MonthInputType.cpp: (WebCore::MonthInputType::valueAsDate): (WebCore::MonthInputType::defaultValueForStepUp): (WebCore::MonthInputType::parseToNumber): * html/NumberInputType.cpp: (WebCore::NumberInputType::typeMismatchFor): (WebCore::NumberInputType::sanitizeValue): (WebCore::NumberInputType::hasBadInput): * html/RangeInputType.cpp: (WebCore::RangeInputType::typeMismatchFor): * html/TimeInputType.cpp: (WebCore::TimeInputType::defaultValueForStepUp): * html/canvas/CanvasPathMethods.cpp: (WebCore::CanvasPathMethods::moveTo): (WebCore::CanvasPathMethods::lineTo): (WebCore::CanvasPathMethods::quadraticCurveTo): (WebCore::CanvasPathMethods::bezierCurveTo): (WebCore::CanvasPathMethods::arcTo): (WebCore::CanvasPathMethods::arc): (WebCore::CanvasPathMethods::rect): * html/canvas/CanvasRenderingContext2D.cpp: (WebCore::CanvasRenderingContext2D::setLineWidth): (WebCore::CanvasRenderingContext2D::setMiterLimit): (WebCore::CanvasRenderingContext2D::setShadowOffsetX): (WebCore::CanvasRenderingContext2D::setShadowOffsetY): (WebCore::CanvasRenderingContext2D::setShadowBlur): (WebCore::lineDashSequenceIsValid): (WebCore::CanvasRenderingContext2D::setLineDashOffset): (WebCore::CanvasRenderingContext2D::scale): (WebCore::CanvasRenderingContext2D::rotate): (WebCore::CanvasRenderingContext2D::translate): (WebCore::CanvasRenderingContext2D::transform): (WebCore::CanvasRenderingContext2D::setTransform): (WebCore::validateRectForCanvas): (WebCore::CanvasRenderingContext2D::isPointInPath): (WebCore::CanvasRenderingContext2D::isPointInStroke): (WebCore::CanvasRenderingContext2D::drawImage): (WebCore::CanvasRenderingContext2D::createLinearGradient): (WebCore::CanvasRenderingContext2D::createRadialGradient): (WebCore::CanvasRenderingContext2D::createImageData): (WebCore::CanvasRenderingContext2D::getImageData): (WebCore::CanvasRenderingContext2D::putImageData): (WebCore::CanvasRenderingContext2D::drawTextInternal): * html/parser/HTMLParserIdioms.cpp: (WebCore::parseToDoubleForNumberType): * html/shadow/MediaControlElements.cpp: (WebCore::MediaControlTimelineElement::setDuration): * html/shadow/MediaControls.cpp: (WebCore::MediaControls::reset): * html/shadow/MediaControlsApple.cpp: (WebCore::MediaControlsApple::reset): * html/shadow/MediaControlsBlackBerry.cpp: (WebCore::MediaControlFullscreenTimelineElement::setDuration): (WebCore::MediaControlsBlackBerry::reset): * inspector/InspectorValues.cpp: (WebCore::InspectorBasicValue::writeJSON): * loader/cache/CachedResource.cpp: (WebCore::CachedResource::currentAge): (WebCore::CachedResource::freshnessLifetime): * page/DOMWindow.cpp: (WebCore::DOMWindow::adjustWindowRect): * platform/DateComponents.cpp: (WebCore::DateComponents::setMillisecondsSinceEpochForDate): (WebCore::DateComponents::setMillisecondsSinceEpochForDateTime): (WebCore::DateComponents::setMillisecondsSinceEpochForMonth): (WebCore::DateComponents::setMillisecondsSinceMidnight): (WebCore::DateComponents::setMonthsSinceEpoch): (WebCore::DateComponents::setMillisecondsSinceEpochForWeek): * platform/Decimal.cpp: (WebCore::Decimal::fromDouble): * platform/FileSystem.h: (WebCore::isValidFileTime): * platform/LocalizedStrings.cpp: (WebCore::localizedMediaTimeDescription): * platform/graphics/cairo/CairoUtilities.cpp: (WebCore::drawPatternToCairoContext): * platform/graphics/cairo/PathCairo.cpp: (WebCore::Path::addArc): (WebCore::Path::contains): * platform/graphics/cg/PathCG.cpp: (WebCore::Path::addArc): * platform/graphics/gstreamer/FullscreenVideoControllerGStreamer.cpp: (WebCore::FullscreenVideoControllerGStreamer::timeToString): * platform/graphics/openvg/PathOpenVG.cpp: (WebCore::Path::addArc): * platform/graphics/skia/SkiaUtils.h: (WebCore::WebCoreFloatToSkScalar): (WebCore::WebCoreDoubleToSkScalar): * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp: (WebCore::MediaPlayerPrivateQuickTimeVisualContext::maxTimeSeekable): * platform/gtk/LocalizedStringsGtk.cpp: (WebCore::localizedMediaTimeDescription): * platform/mac/WebVideoFullscreenHUDWindowController.mm: (timeToString): * platform/network/ResourceResponseBase.cpp: (WebCore::parseDateValueInHeader): * platform/qt/LocalizedStringsQt.cpp: (WebCore::localizedMediaTimeDescription): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::resolveFlexibleLengths): * rendering/RenderMediaControlsChromium.cpp: (WebCore::formatChromiumMediaControlsTime): * rendering/RenderTheme.cpp: (WebCore::RenderTheme::formatMediaControlsTime): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::setFontSize): * svg/SVGPathParser.cpp: (WebCore::SVGPathParser::decomposeArcToCubic): * xml/XPathFunctions.cpp: (WebCore::XPath::FunRound::round): * xml/XPathValue.cpp: (WebCore::XPath::Value::toString): Source/WebKit/win: * FullscreenVideoController.cpp: (timeToString): Source/WTF: On Solaris and OpenBSD platforms or when using Visual C++ the two methods are now defined (as incompatibility workarounds) inside the std namespace. * wtf/DateMath.cpp: (WTF::timeClip): * wtf/DecimalNumber.h: (WTF::DecimalNumber::DecimalNumber): * wtf/MathExtras.h: (std): (std::isfinite): (std::signbit): (lrint): (wtf_pow): (decomposeDouble): * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): * wtf/dtoa.cpp: (WTF::dtoa): Canonical link: https://commits.webkit.org/128430@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@143232 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-02-18 17:13:23 +00:00
return std::signbit(floatTime) ? negativeInfiniteTime() : positiveInfiniteTime();
if (floatTime >= maxPlusOne<int64_t>)
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
return positiveInfiniteTime();
if (floatTime < std::numeric_limits<int64_t>::min())
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
return negativeInfiniteTime();
if (!timeScale)
return std::signbit(floatTime) ? negativeInfiniteTime() : positiveInfiniteTime();
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
while (floatTime * timeScale >= maxPlusOne<int64_t>)
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
timeScale /= 2;
return MediaTime(static_cast<int64_t>(floatTime * timeScale), timeScale, Valid);
}
[WTF] MediaTime should support round-tripping from and to doubles. https://bugs.webkit.org/show_bug.cgi?id=139248 Reviewed by Eric Carlson. Source/WebCore: Check whether the MediaTime's underlying data is floating point before converting to a CMTime or QTTime. * platform/graphics/avfoundation/MediaTimeAVFoundation.cpp: (WebCore::toCMTime): * platform/graphics/mac/MediaTimeQTKit.mm: (WebCore::toQTTime): Source/WTF: MediaTimes should be able to return precisely the same double value as was used when the MediaTime was created, so long as that MediaTime was not modified in a non-destructive way. This will allow API which accepts floating-point values to return the exact same value when asked, but still be able to store that value as a MediaTime. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): Added; store the floating-point value in a union. (WTF::MediaTime::createWithDouble): Ditto. (WTF::MediaTime::toFloat): If the value is a double, just return it. (WTF::MediaTime::toDouble): Ditto. (WTF::MediaTime::operator+): Special case when one or both sides are doubles. (WTF::MediaTime::operator-): Ditto. (WTF::MediaTime::operator*): Ditto. (WTF::MediaTime::compare): Ditto. (WTF::abs): Ditto. (WTF::MediaTime::setTimeScale): Convert the MediaTime from a double. Tools: Add API tests for new features of MediaTime. Update the LLDB python provider to correctly display the MediaTimes after this change. * TestWebKitAPI/Tests/WTF/MediaTime.cpp: (WTF::operator<<): (TestWebKitAPI::TEST): * lldb/lldb_webkit.py: (WTFMediaTime_SummaryProvider): (WTFMediaTimeProvider.timeValueAsDouble): (WTFMediaTimeProvider.isIndefinite): (WTFMediaTimeProvider): (WTFMediaTimeProvider.hasDoubleValue): Canonical link: https://commits.webkit.org/157162@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@176863 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-12-05 20:51:02 +00:00
MediaTime MediaTime::createWithDouble(double doubleTime)
{
if (doubleTime != doubleTime)
return invalidTime();
if (std::isinf(doubleTime))
return std::signbit(doubleTime) ? negativeInfiniteTime() : positiveInfiniteTime();
MediaTime value(0, DefaultTimeScale, Valid | DoubleValue);
value.m_timeValueAsDouble = doubleTime;
return value;
}
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
MediaTime MediaTime::createWithDouble(double doubleTime, uint32_t timeScale)
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
{
if (doubleTime != doubleTime)
return invalidTime();
The 'global isinf/isnan' compiler quirk required when using clang with libstdc++ https://bugs.webkit.org/show_bug.cgi?id=109325 Reviewed by Anders Carlsson. Prefix calls to the isinf and isnan methods with std::, declaring we want to use the two methods as they're provided by the C++ standard library being used. Source/JavaScriptCore: * API/JSValueRef.cpp: (JSValueMakeNumber): * JSCTypedArrayStubs.h: (JSC): * bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::emitLoad): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::constantNaN): * offlineasm/cloop.rb: * runtime/DateConstructor.cpp: (JSC::dateUTC): Also include an opportunistic style fix. * runtime/DateInstance.cpp: (JSC::DateInstance::calculateGregorianDateTime): (JSC::DateInstance::calculateGregorianDateTimeUTC): * runtime/DatePrototype.cpp: (JSC::dateProtoFuncGetMilliSeconds): (JSC::dateProtoFuncGetUTCMilliseconds): (JSC::setNewValueFromTimeArgs): (JSC::setNewValueFromDateArgs): (JSC::dateProtoFuncSetYear): * runtime/JSCJSValue.cpp: (JSC::JSValue::toInteger): * runtime/JSDateMath.cpp: (JSC::getUTCOffset): (JSC::parseDateFromNullTerminatedCharacters): (JSC::parseDate): * runtime/JSGlobalObjectFunctions.cpp: (JSC::globalFuncIsNaN): * runtime/MathObject.cpp: (JSC::mathProtoFuncMax): (JSC::mathProtoFuncMin): (JSC::mathProtoFuncPow): * runtime/PropertyDescriptor.cpp: (JSC::sameValue): Source/WebCore: No new tests as there's no change in functionality. * Modules/mediasource/MediaSource.cpp: (WebCore::MediaSource::setDuration): * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::totalPitchRate): * Modules/webaudio/AudioParam.cpp: (WebCore::AudioParam::setValue): * Modules/webaudio/AudioParamTimeline.cpp: (WebCore::isValidNumber): * Modules/webaudio/PannerNode.cpp: (WebCore::fixNANs): * bindings/js/IDBBindingUtilities.cpp: (WebCore::createIDBKeyFromValue): * bindings/js/JSDataViewCustom.cpp: (WebCore::getDataViewMember): * bindings/js/JSGeolocationCustom.cpp: (WebCore::setTimeout): (WebCore::setMaximumAge): * bindings/js/JSHTMLOptionsCollectionCustom.cpp: (WebCore::JSHTMLOptionsCollection::setLength): * bindings/js/JSWebKitPointCustom.cpp: (WebCore::JSWebKitPointConstructor::constructJSWebKitPoint): * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): (GenerateParametersCheck): * bindings/scripts/CodeGeneratorV8.pm: (GenerateParametersCheck): * bindings/scripts/test/JS/JSFloat64Array.cpp: (WebCore::JSFloat64Array::getByIndex): * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::jsTestObjPrototypeFunctionClassMethodWithClamp): * bindings/scripts/test/V8/V8TestObj.cpp: (WebCore::TestObjV8Internal::classMethodWithClampCallback): * bindings/v8/IDBBindingUtilities.cpp: (WebCore::createIDBKeyFromValue): * bindings/v8/V8Binding.cpp: (WebCore::toInt32): (WebCore::toUInt32): * bindings/v8/custom/V8GeolocationCustom.cpp: (WebCore::createPositionOptions): * bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp: (WebCore::V8HTMLOptionsCollection::lengthAccessorSetter): * bindings/v8/custom/V8WebKitPointCustom.cpp: (WebCore::V8WebKitPoint::constructorCallbackCustom): * bridge/qt/qt_runtime.cpp: (JSC::Bindings::convertValueToQVariant): * css/WebKitCSSMatrix.cpp: (WebCore::WebKitCSSMatrix::translate): (WebCore::WebKitCSSMatrix::scale): (WebCore::WebKitCSSMatrix::rotate): (WebCore::WebKitCSSMatrix::rotateAxisAngle): (WebCore::WebKitCSSMatrix::skewX): (WebCore::WebKitCSSMatrix::skewY): * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::percentLoaded): (WebCore::HTMLMediaElement::mediaPlayerTimeChanged): (WebCore::HTMLMediaElement::endedPlayback): * html/MediaController.cpp: (MediaController::duration): * html/canvas/WebGLRenderingContext.cpp: (WebCore): (WebCore::WebGLRenderingContext::clearColor): * html/track/TextTrack.cpp: (WebCore::TextTrack::addCue): * html/track/TextTrackCue.cpp: (WebCore::TextTrackCue::setStartTime): (WebCore::TextTrackCue::setEndTime): * page/DOMWindow.cpp: (WebCore::DOMWindow::adjustWindowRect): * page/WindowFeatures.cpp: (WebCore::WindowFeatures::floatFeature): Also include an opportunistic style fix. * platform/CalculationValue.cpp: (WebCore::CalculationValue::evaluate): * platform/Decimal.cpp: (WebCore::Decimal::fromDouble): * platform/Length.cpp: (WebCore::Length::nonNanCalculatedValue): * platform/audio/AudioResampler.cpp: (WebCore::AudioResampler::setRate): * platform/audio/DynamicsCompressorKernel.cpp: (WebCore::DynamicsCompressorKernel::process): * platform/audio/Reverb.cpp: (WebCore::calculateNormalizationScale): * platform/graphics/Font.cpp: (WebCore::Font::width): * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h: (WebCore::MediaPlayerPrivateAVFoundation::isLiveStream): * platform/graphics/gpu/LoopBlinnMathUtils.cpp: (LoopBlinnMathUtils): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::buffered): (WebCore::MediaPlayerPrivateGStreamer::maxTimeSeekable): * platform/graphics/mac/MediaPlayerPrivateQTKit.mm: (WebCore::MediaPlayerPrivateQTKit::maxTimeSeekable): * platform/graphics/opentype/OpenTypeVerticalData.cpp: (WebCore::OpenTypeVerticalData::getVerticalTranslationsForGlyphs): * platform/graphics/transforms/TransformationMatrix.cpp: (WebCore::clampEdgeValue): (WebCore::TransformationMatrix::clampedBoundsOfProjectedQuad): * platform/network/ResourceResponseBase.cpp: (WebCore::ResourceResponseBase::parseCacheControlDirectives): * rendering/RenderMediaControlsChromium.cpp: (WebCore::paintMediaSlider): (WebCore::paintMediaVolumeSlider): * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintMediaSliderTrack): * svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::beginElementAt): (WebCore::SVGAnimationElement::endElementAt): * svg/SVGSVGElement.cpp: (WebCore::SVGSVGElement::setCurrentTime): * svg/animation/SMILTime.h: (WebCore::SMILTime::SMILTime): * svg/animation/SVGSMILElement.cpp: (WebCore::SVGSMILElement::addBeginTime): (WebCore::SVGSMILElement::addEndTime): * xml/XPathFunctions.cpp: (WebCore::XPath::FunSubstring::evaluate): (WebCore::XPath::FunRound::round): * xml/XPathValue.cpp: (WebCore::XPath::Value::toBoolean): Also include an opportunistic style fix. (WebCore::XPath::Value::toString): Source/WebKit/chromium: * tests/DecimalTest.cpp: (TEST_F): Source/WebKit/mac: * tests/DecimalTest.cpp: (TEST_F): Source/WTF: * wtf/Compiler.h: Remove the global isinf/isnan compiler quirk definitions. They're not required anymore. * wtf/DateMath.cpp: Move the workaround for isinf on Solaris into the std namespace. Ditto for isinf and isnan when using MSVC. Stop bringing the isinf and isnan methods into the global scope when using other configurations. (WTF::parseDateFromNullTerminatedCharacters): * wtf/IntegralTypedArrayBase.h: (WTF::IntegralTypedArrayBase::set): * wtf/MathExtras.h: (std): (std::isinf): (wtf_fmod): (wtf_pow): (doubleToInteger): * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): * wtf/Uint8ClampedArray.h: (WTF::Uint8ClampedArray::set): Tools: * DumpRenderTree/TestRunner.cpp: (setAppCacheMaximumSizeCallback): (setApplicationCacheOriginQuotaCallback): (setDatabaseQuotaCallback): Canonical link: https://commits.webkit.org/128030@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@142810 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-02-13 23:01:21 +00:00
if (std::isinf(doubleTime))
Stop placing std::isfinite and std::signbit inside the global scope https://bugs.webkit.org/show_bug.cgi?id=109817 Reviewed by Darin Adler. Prefix calls to the isfinite and signbit methods with std:: as the two methods are no longer being imported into the global scope. Source/JavaScriptCore: * assembler/MacroAssembler.h: (JSC::MacroAssembler::shouldBlindDouble): * offlineasm/cloop.rb: * runtime/BigInteger.h: (JSC::BigInteger::BigInteger): * runtime/DateConstructor.cpp: (JSC::constructDate): * runtime/DatePrototype.cpp: (JSC::fillStructuresUsingTimeArgs): (JSC::fillStructuresUsingDateArgs): (JSC::dateProtoFuncToISOString): (JSC::dateProtoFuncSetYear): * runtime/JSCJSValueInlines.h: (JSC::JSValue::JSValue): * runtime/JSGlobalObjectFunctions.cpp: (JSC::globalFuncIsFinite): * runtime/JSONObject.cpp: (JSC::Stringifier::appendStringifiedValue): * runtime/MathObject.cpp: (JSC::mathProtoFuncMax): Also include an opportunistic style fix. (JSC::mathProtoFuncMin): Ditto. * runtime/NumberPrototype.cpp: (JSC::toStringWithRadix): (JSC::numberProtoFuncToExponential): (JSC::numberProtoFuncToFixed): (JSC::numberProtoFuncToPrecision): (JSC::numberProtoFuncToString): * runtime/Uint16WithFraction.h: (JSC::Uint16WithFraction::Uint16WithFraction): Source/WebCore: No new tests as there's no change in functionality. * bindings/js/JSCanvasRenderingContext2DCustom.cpp: (WebCore::JSCanvasRenderingContext2D::setWebkitLineDash): * bindings/js/JSDOMBinding.cpp: (WebCore::jsDateOrNull): * bindings/js/JSDOMBinding.h: (WebCore::finiteInt32Value): * bindings/v8/V8Binding.h: (WebCore::v8DateOrNull): * css/CSSPrimitiveValue.cpp: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): * html/BaseDateAndTimeInputType.cpp: (WebCore::BaseDateAndTimeInputType::parseToNumber): * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::setValueAsNumber): * html/HTMLMeterElement.cpp: (WebCore::HTMLMeterElement::setMin): (WebCore::HTMLMeterElement::setMax): (WebCore::HTMLMeterElement::setValue): (WebCore::HTMLMeterElement::setLow): (WebCore::HTMLMeterElement::setHigh): (WebCore::HTMLMeterElement::setOptimum): * html/HTMLProgressElement.cpp: (WebCore::HTMLProgressElement::value): (WebCore::HTMLProgressElement::setValue): (WebCore::HTMLProgressElement::max): (WebCore::HTMLProgressElement::setMax): * html/MonthInputType.cpp: (WebCore::MonthInputType::valueAsDate): (WebCore::MonthInputType::defaultValueForStepUp): (WebCore::MonthInputType::parseToNumber): * html/NumberInputType.cpp: (WebCore::NumberInputType::typeMismatchFor): (WebCore::NumberInputType::sanitizeValue): (WebCore::NumberInputType::hasBadInput): * html/RangeInputType.cpp: (WebCore::RangeInputType::typeMismatchFor): * html/TimeInputType.cpp: (WebCore::TimeInputType::defaultValueForStepUp): * html/canvas/CanvasPathMethods.cpp: (WebCore::CanvasPathMethods::moveTo): (WebCore::CanvasPathMethods::lineTo): (WebCore::CanvasPathMethods::quadraticCurveTo): (WebCore::CanvasPathMethods::bezierCurveTo): (WebCore::CanvasPathMethods::arcTo): (WebCore::CanvasPathMethods::arc): (WebCore::CanvasPathMethods::rect): * html/canvas/CanvasRenderingContext2D.cpp: (WebCore::CanvasRenderingContext2D::setLineWidth): (WebCore::CanvasRenderingContext2D::setMiterLimit): (WebCore::CanvasRenderingContext2D::setShadowOffsetX): (WebCore::CanvasRenderingContext2D::setShadowOffsetY): (WebCore::CanvasRenderingContext2D::setShadowBlur): (WebCore::lineDashSequenceIsValid): (WebCore::CanvasRenderingContext2D::setLineDashOffset): (WebCore::CanvasRenderingContext2D::scale): (WebCore::CanvasRenderingContext2D::rotate): (WebCore::CanvasRenderingContext2D::translate): (WebCore::CanvasRenderingContext2D::transform): (WebCore::CanvasRenderingContext2D::setTransform): (WebCore::validateRectForCanvas): (WebCore::CanvasRenderingContext2D::isPointInPath): (WebCore::CanvasRenderingContext2D::isPointInStroke): (WebCore::CanvasRenderingContext2D::drawImage): (WebCore::CanvasRenderingContext2D::createLinearGradient): (WebCore::CanvasRenderingContext2D::createRadialGradient): (WebCore::CanvasRenderingContext2D::createImageData): (WebCore::CanvasRenderingContext2D::getImageData): (WebCore::CanvasRenderingContext2D::putImageData): (WebCore::CanvasRenderingContext2D::drawTextInternal): * html/parser/HTMLParserIdioms.cpp: (WebCore::parseToDoubleForNumberType): * html/shadow/MediaControlElements.cpp: (WebCore::MediaControlTimelineElement::setDuration): * html/shadow/MediaControls.cpp: (WebCore::MediaControls::reset): * html/shadow/MediaControlsApple.cpp: (WebCore::MediaControlsApple::reset): * html/shadow/MediaControlsBlackBerry.cpp: (WebCore::MediaControlFullscreenTimelineElement::setDuration): (WebCore::MediaControlsBlackBerry::reset): * inspector/InspectorValues.cpp: (WebCore::InspectorBasicValue::writeJSON): * loader/cache/CachedResource.cpp: (WebCore::CachedResource::currentAge): (WebCore::CachedResource::freshnessLifetime): * page/DOMWindow.cpp: (WebCore::DOMWindow::adjustWindowRect): * platform/DateComponents.cpp: (WebCore::DateComponents::setMillisecondsSinceEpochForDate): (WebCore::DateComponents::setMillisecondsSinceEpochForDateTime): (WebCore::DateComponents::setMillisecondsSinceEpochForMonth): (WebCore::DateComponents::setMillisecondsSinceMidnight): (WebCore::DateComponents::setMonthsSinceEpoch): (WebCore::DateComponents::setMillisecondsSinceEpochForWeek): * platform/Decimal.cpp: (WebCore::Decimal::fromDouble): * platform/FileSystem.h: (WebCore::isValidFileTime): * platform/LocalizedStrings.cpp: (WebCore::localizedMediaTimeDescription): * platform/graphics/cairo/CairoUtilities.cpp: (WebCore::drawPatternToCairoContext): * platform/graphics/cairo/PathCairo.cpp: (WebCore::Path::addArc): (WebCore::Path::contains): * platform/graphics/cg/PathCG.cpp: (WebCore::Path::addArc): * platform/graphics/gstreamer/FullscreenVideoControllerGStreamer.cpp: (WebCore::FullscreenVideoControllerGStreamer::timeToString): * platform/graphics/openvg/PathOpenVG.cpp: (WebCore::Path::addArc): * platform/graphics/skia/SkiaUtils.h: (WebCore::WebCoreFloatToSkScalar): (WebCore::WebCoreDoubleToSkScalar): * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp: (WebCore::MediaPlayerPrivateQuickTimeVisualContext::maxTimeSeekable): * platform/gtk/LocalizedStringsGtk.cpp: (WebCore::localizedMediaTimeDescription): * platform/mac/WebVideoFullscreenHUDWindowController.mm: (timeToString): * platform/network/ResourceResponseBase.cpp: (WebCore::parseDateValueInHeader): * platform/qt/LocalizedStringsQt.cpp: (WebCore::localizedMediaTimeDescription): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::resolveFlexibleLengths): * rendering/RenderMediaControlsChromium.cpp: (WebCore::formatChromiumMediaControlsTime): * rendering/RenderTheme.cpp: (WebCore::RenderTheme::formatMediaControlsTime): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::setFontSize): * svg/SVGPathParser.cpp: (WebCore::SVGPathParser::decomposeArcToCubic): * xml/XPathFunctions.cpp: (WebCore::XPath::FunRound::round): * xml/XPathValue.cpp: (WebCore::XPath::Value::toString): Source/WebKit/win: * FullscreenVideoController.cpp: (timeToString): Source/WTF: On Solaris and OpenBSD platforms or when using Visual C++ the two methods are now defined (as incompatibility workarounds) inside the std namespace. * wtf/DateMath.cpp: (WTF::timeClip): * wtf/DecimalNumber.h: (WTF::DecimalNumber::DecimalNumber): * wtf/MathExtras.h: (std): (std::isfinite): (std::signbit): (lrint): (wtf_pow): (decomposeDouble): * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): * wtf/dtoa.cpp: (WTF::dtoa): Canonical link: https://commits.webkit.org/128430@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@143232 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-02-18 17:13:23 +00:00
return std::signbit(doubleTime) ? negativeInfiniteTime() : positiveInfiniteTime();
if (doubleTime >= maxPlusOne<int64_t>)
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
return positiveInfiniteTime();
if (doubleTime < std::numeric_limits<int64_t>::min())
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
return negativeInfiniteTime();
if (!timeScale)
return std::signbit(doubleTime) ? negativeInfiniteTime() : positiveInfiniteTime();
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
while (doubleTime * timeScale >= maxPlusOne<int64_t>)
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
timeScale /= 2;
2017-06-08 13:10:51 +00:00
return MediaTime(static_cast<int64_t>(std::round(doubleTime * timeScale)), timeScale, Valid);
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
}
float MediaTime::toFloat() const
{
if (isInvalid() || isIndefinite())
return std::numeric_limits<float>::quiet_NaN();
if (isPositiveInfinite())
return std::numeric_limits<float>::infinity();
if (isNegativeInfinite())
return -std::numeric_limits<float>::infinity();
[WTF] MediaTime should support round-tripping from and to doubles. https://bugs.webkit.org/show_bug.cgi?id=139248 Reviewed by Eric Carlson. Source/WebCore: Check whether the MediaTime's underlying data is floating point before converting to a CMTime or QTTime. * platform/graphics/avfoundation/MediaTimeAVFoundation.cpp: (WebCore::toCMTime): * platform/graphics/mac/MediaTimeQTKit.mm: (WebCore::toQTTime): Source/WTF: MediaTimes should be able to return precisely the same double value as was used when the MediaTime was created, so long as that MediaTime was not modified in a non-destructive way. This will allow API which accepts floating-point values to return the exact same value when asked, but still be able to store that value as a MediaTime. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): Added; store the floating-point value in a union. (WTF::MediaTime::createWithDouble): Ditto. (WTF::MediaTime::toFloat): If the value is a double, just return it. (WTF::MediaTime::toDouble): Ditto. (WTF::MediaTime::operator+): Special case when one or both sides are doubles. (WTF::MediaTime::operator-): Ditto. (WTF::MediaTime::operator*): Ditto. (WTF::MediaTime::compare): Ditto. (WTF::abs): Ditto. (WTF::MediaTime::setTimeScale): Convert the MediaTime from a double. Tools: Add API tests for new features of MediaTime. Update the LLDB python provider to correctly display the MediaTimes after this change. * TestWebKitAPI/Tests/WTF/MediaTime.cpp: (WTF::operator<<): (TestWebKitAPI::TEST): * lldb/lldb_webkit.py: (WTFMediaTime_SummaryProvider): (WTFMediaTimeProvider.timeValueAsDouble): (WTFMediaTimeProvider.isIndefinite): (WTFMediaTimeProvider): (WTFMediaTimeProvider.hasDoubleValue): Canonical link: https://commits.webkit.org/157162@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@176863 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-12-05 20:51:02 +00:00
if (hasDoubleValue())
return m_timeValueAsDouble;
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
return static_cast<float>(m_timeValue) / m_timeScale;
}
double MediaTime::toDouble() const
{
if (isInvalid() || isIndefinite())
return std::numeric_limits<double>::quiet_NaN();
if (isPositiveInfinite())
return std::numeric_limits<double>::infinity();
if (isNegativeInfinite())
return -std::numeric_limits<double>::infinity();
[WTF] MediaTime should support round-tripping from and to doubles. https://bugs.webkit.org/show_bug.cgi?id=139248 Reviewed by Eric Carlson. Source/WebCore: Check whether the MediaTime's underlying data is floating point before converting to a CMTime or QTTime. * platform/graphics/avfoundation/MediaTimeAVFoundation.cpp: (WebCore::toCMTime): * platform/graphics/mac/MediaTimeQTKit.mm: (WebCore::toQTTime): Source/WTF: MediaTimes should be able to return precisely the same double value as was used when the MediaTime was created, so long as that MediaTime was not modified in a non-destructive way. This will allow API which accepts floating-point values to return the exact same value when asked, but still be able to store that value as a MediaTime. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): Added; store the floating-point value in a union. (WTF::MediaTime::createWithDouble): Ditto. (WTF::MediaTime::toFloat): If the value is a double, just return it. (WTF::MediaTime::toDouble): Ditto. (WTF::MediaTime::operator+): Special case when one or both sides are doubles. (WTF::MediaTime::operator-): Ditto. (WTF::MediaTime::operator*): Ditto. (WTF::MediaTime::compare): Ditto. (WTF::abs): Ditto. (WTF::MediaTime::setTimeScale): Convert the MediaTime from a double. Tools: Add API tests for new features of MediaTime. Update the LLDB python provider to correctly display the MediaTimes after this change. * TestWebKitAPI/Tests/WTF/MediaTime.cpp: (WTF::operator<<): (TestWebKitAPI::TEST): * lldb/lldb_webkit.py: (WTFMediaTime_SummaryProvider): (WTFMediaTimeProvider.timeValueAsDouble): (WTFMediaTimeProvider.isIndefinite): (WTFMediaTimeProvider): (WTFMediaTimeProvider.hasDoubleValue): Canonical link: https://commits.webkit.org/157162@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@176863 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-12-05 20:51:02 +00:00
if (hasDoubleValue())
return m_timeValueAsDouble;
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
return static_cast<double>(m_timeValue) / m_timeScale;
}
MediaTime& MediaTime::operator=(const MediaTime& rhs)
{
m_timeValue = rhs.m_timeValue;
m_timeScale = rhs.m_timeScale;
m_timeFlags = rhs.m_timeFlags;
return *this;
}
MediaTime MediaTime::operator+(const MediaTime& rhs) const
{
if (rhs.isInvalid() || isInvalid())
return invalidTime();
if (rhs.isIndefinite() || isIndefinite())
return indefiniteTime();
if (isPositiveInfinite() && rhs.isNegativeInfinite())
return invalidTime();
if (isNegativeInfinite() && rhs.isPositiveInfinite())
return invalidTime();
if (isPositiveInfinite() || rhs.isPositiveInfinite())
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
return positiveInfiniteTime();
if (isNegativeInfinite() || rhs.isNegativeInfinite())
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
return negativeInfiniteTime();
[WTF] MediaTime should support round-tripping from and to doubles. https://bugs.webkit.org/show_bug.cgi?id=139248 Reviewed by Eric Carlson. Source/WebCore: Check whether the MediaTime's underlying data is floating point before converting to a CMTime or QTTime. * platform/graphics/avfoundation/MediaTimeAVFoundation.cpp: (WebCore::toCMTime): * platform/graphics/mac/MediaTimeQTKit.mm: (WebCore::toQTTime): Source/WTF: MediaTimes should be able to return precisely the same double value as was used when the MediaTime was created, so long as that MediaTime was not modified in a non-destructive way. This will allow API which accepts floating-point values to return the exact same value when asked, but still be able to store that value as a MediaTime. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): Added; store the floating-point value in a union. (WTF::MediaTime::createWithDouble): Ditto. (WTF::MediaTime::toFloat): If the value is a double, just return it. (WTF::MediaTime::toDouble): Ditto. (WTF::MediaTime::operator+): Special case when one or both sides are doubles. (WTF::MediaTime::operator-): Ditto. (WTF::MediaTime::operator*): Ditto. (WTF::MediaTime::compare): Ditto. (WTF::abs): Ditto. (WTF::MediaTime::setTimeScale): Convert the MediaTime from a double. Tools: Add API tests for new features of MediaTime. Update the LLDB python provider to correctly display the MediaTimes after this change. * TestWebKitAPI/Tests/WTF/MediaTime.cpp: (WTF::operator<<): (TestWebKitAPI::TEST): * lldb/lldb_webkit.py: (WTFMediaTime_SummaryProvider): (WTFMediaTimeProvider.timeValueAsDouble): (WTFMediaTimeProvider.isIndefinite): (WTFMediaTimeProvider): (WTFMediaTimeProvider.hasDoubleValue): Canonical link: https://commits.webkit.org/157162@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@176863 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-12-05 20:51:02 +00:00
if (hasDoubleValue() && rhs.hasDoubleValue())
return MediaTime::createWithDouble(m_timeValueAsDouble + rhs.m_timeValueAsDouble);
MediaSource duration attribute should not be equal to Infinity when set to a value greater than 2^64 https://bugs.webkit.org/show_bug.cgi?id=171668 Reviewed by Jer Noble. MediaSource duration attribute is a double represented in MediaSource by a MediaTime instance created with MediaTime::CreateWithDouble(). This method implements an overflow control mechanism which sets MediaTime to Infinity when the double value passed as argument is greater than 2^64. This patch removes the overflow control mechanism when time value is represented as a double. This patch also modifies the behavior of mathematical operations between a double MediaTime and rational MediaTime: the rational MediaTime is converted to a double before applying the operation. Double MediaTime precision is the same as for double. Overflow mechanisms still apply to the conversion of a double MediaTime to rational with setTimescale() method. No behavior change for rational MediaTime. LayoutTests/imported/w3c: Update test expectations. * web-platform-tests/media-source/mediasource-duration-boundaryconditions-expected.txt: Source/WTF: * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): Tools: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Add tests to check operation results between double and rational MediaTime. (TestWebKitAPI::TEST): LayoutTests: Update test expectations. * media/media-source/media-source-timeoffset-expected.txt: * platform/gtk/imported/w3c/web-platform-tests/media-source/mediasource-duration-boundaryconditions-expected.txt: * platform/mac-elcapitan/imported/w3c/web-platform-tests/media-source/mediasource-duration-boundaryconditions-expected.txt: Canonical link: https://commits.webkit.org/190223@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@218247 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-06-14 08:44:29 +00:00
if (hasDoubleValue() || rhs.hasDoubleValue())
return MediaTime::createWithDouble(toDouble() + rhs.toDouble());
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
MediaTime a = *this;
MediaTime b = rhs;
[WTF] MediaTime should support round-tripping from and to doubles. https://bugs.webkit.org/show_bug.cgi?id=139248 Reviewed by Eric Carlson. Source/WebCore: Check whether the MediaTime's underlying data is floating point before converting to a CMTime or QTTime. * platform/graphics/avfoundation/MediaTimeAVFoundation.cpp: (WebCore::toCMTime): * platform/graphics/mac/MediaTimeQTKit.mm: (WebCore::toQTTime): Source/WTF: MediaTimes should be able to return precisely the same double value as was used when the MediaTime was created, so long as that MediaTime was not modified in a non-destructive way. This will allow API which accepts floating-point values to return the exact same value when asked, but still be able to store that value as a MediaTime. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): Added; store the floating-point value in a union. (WTF::MediaTime::createWithDouble): Ditto. (WTF::MediaTime::toFloat): If the value is a double, just return it. (WTF::MediaTime::toDouble): Ditto. (WTF::MediaTime::operator+): Special case when one or both sides are doubles. (WTF::MediaTime::operator-): Ditto. (WTF::MediaTime::operator*): Ditto. (WTF::MediaTime::compare): Ditto. (WTF::abs): Ditto. (WTF::MediaTime::setTimeScale): Convert the MediaTime from a double. Tools: Add API tests for new features of MediaTime. Update the LLDB python provider to correctly display the MediaTimes after this change. * TestWebKitAPI/Tests/WTF/MediaTime.cpp: (WTF::operator<<): (TestWebKitAPI::TEST): * lldb/lldb_webkit.py: (WTFMediaTime_SummaryProvider): (WTFMediaTimeProvider.timeValueAsDouble): (WTFMediaTimeProvider.isIndefinite): (WTFMediaTimeProvider): (WTFMediaTimeProvider.hasDoubleValue): Canonical link: https://commits.webkit.org/157162@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@176863 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-12-05 20:51:02 +00:00
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
uint32_t commonTimeScale;
[WTF] MediaTime should support round-tripping from and to doubles. https://bugs.webkit.org/show_bug.cgi?id=139248 Reviewed by Eric Carlson. Source/WebCore: Check whether the MediaTime's underlying data is floating point before converting to a CMTime or QTTime. * platform/graphics/avfoundation/MediaTimeAVFoundation.cpp: (WebCore::toCMTime): * platform/graphics/mac/MediaTimeQTKit.mm: (WebCore::toQTTime): Source/WTF: MediaTimes should be able to return precisely the same double value as was used when the MediaTime was created, so long as that MediaTime was not modified in a non-destructive way. This will allow API which accepts floating-point values to return the exact same value when asked, but still be able to store that value as a MediaTime. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): Added; store the floating-point value in a union. (WTF::MediaTime::createWithDouble): Ditto. (WTF::MediaTime::toFloat): If the value is a double, just return it. (WTF::MediaTime::toDouble): Ditto. (WTF::MediaTime::operator+): Special case when one or both sides are doubles. (WTF::MediaTime::operator-): Ditto. (WTF::MediaTime::operator*): Ditto. (WTF::MediaTime::compare): Ditto. (WTF::abs): Ditto. (WTF::MediaTime::setTimeScale): Convert the MediaTime from a double. Tools: Add API tests for new features of MediaTime. Update the LLDB python provider to correctly display the MediaTimes after this change. * TestWebKitAPI/Tests/WTF/MediaTime.cpp: (WTF::operator<<): (TestWebKitAPI::TEST): * lldb/lldb_webkit.py: (WTFMediaTime_SummaryProvider): (WTFMediaTimeProvider.timeValueAsDouble): (WTFMediaTimeProvider.isIndefinite): (WTFMediaTimeProvider): (WTFMediaTimeProvider.hasDoubleValue): Canonical link: https://commits.webkit.org/157162@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@176863 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-12-05 20:51:02 +00:00
if (!leastCommonMultiple(a.m_timeScale, b.m_timeScale, commonTimeScale) || commonTimeScale > MaximumTimeScale)
commonTimeScale = MaximumTimeScale;
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
a.setTimeScale(commonTimeScale);
b.setTimeScale(commonTimeScale);
while (!safeAdd(a.m_timeValue, b.m_timeValue, a.m_timeValue)) {
if (commonTimeScale == 1)
return a.m_timeValue > 0 ? positiveInfiniteTime() : negativeInfiniteTime();
commonTimeScale /= 2;
a.setTimeScale(commonTimeScale);
b.setTimeScale(commonTimeScale);
}
return a;
}
MediaTime MediaTime::operator-(const MediaTime& rhs) const
{
if (rhs.isInvalid() || isInvalid())
return invalidTime();
if (rhs.isIndefinite() || isIndefinite())
return indefiniteTime();
if (isPositiveInfinite() && rhs.isPositiveInfinite())
return invalidTime();
if (isNegativeInfinite() && rhs.isNegativeInfinite())
return invalidTime();
if (isPositiveInfinite() || rhs.isNegativeInfinite())
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
return positiveInfiniteTime();
if (isNegativeInfinite() || rhs.isPositiveInfinite())
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
return negativeInfiniteTime();
[WTF] MediaTime should support round-tripping from and to doubles. https://bugs.webkit.org/show_bug.cgi?id=139248 Reviewed by Eric Carlson. Source/WebCore: Check whether the MediaTime's underlying data is floating point before converting to a CMTime or QTTime. * platform/graphics/avfoundation/MediaTimeAVFoundation.cpp: (WebCore::toCMTime): * platform/graphics/mac/MediaTimeQTKit.mm: (WebCore::toQTTime): Source/WTF: MediaTimes should be able to return precisely the same double value as was used when the MediaTime was created, so long as that MediaTime was not modified in a non-destructive way. This will allow API which accepts floating-point values to return the exact same value when asked, but still be able to store that value as a MediaTime. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): Added; store the floating-point value in a union. (WTF::MediaTime::createWithDouble): Ditto. (WTF::MediaTime::toFloat): If the value is a double, just return it. (WTF::MediaTime::toDouble): Ditto. (WTF::MediaTime::operator+): Special case when one or both sides are doubles. (WTF::MediaTime::operator-): Ditto. (WTF::MediaTime::operator*): Ditto. (WTF::MediaTime::compare): Ditto. (WTF::abs): Ditto. (WTF::MediaTime::setTimeScale): Convert the MediaTime from a double. Tools: Add API tests for new features of MediaTime. Update the LLDB python provider to correctly display the MediaTimes after this change. * TestWebKitAPI/Tests/WTF/MediaTime.cpp: (WTF::operator<<): (TestWebKitAPI::TEST): * lldb/lldb_webkit.py: (WTFMediaTime_SummaryProvider): (WTFMediaTimeProvider.timeValueAsDouble): (WTFMediaTimeProvider.isIndefinite): (WTFMediaTimeProvider): (WTFMediaTimeProvider.hasDoubleValue): Canonical link: https://commits.webkit.org/157162@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@176863 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-12-05 20:51:02 +00:00
if (hasDoubleValue() && rhs.hasDoubleValue())
return MediaTime::createWithDouble(m_timeValueAsDouble - rhs.m_timeValueAsDouble);
MediaSource duration attribute should not be equal to Infinity when set to a value greater than 2^64 https://bugs.webkit.org/show_bug.cgi?id=171668 Reviewed by Jer Noble. MediaSource duration attribute is a double represented in MediaSource by a MediaTime instance created with MediaTime::CreateWithDouble(). This method implements an overflow control mechanism which sets MediaTime to Infinity when the double value passed as argument is greater than 2^64. This patch removes the overflow control mechanism when time value is represented as a double. This patch also modifies the behavior of mathematical operations between a double MediaTime and rational MediaTime: the rational MediaTime is converted to a double before applying the operation. Double MediaTime precision is the same as for double. Overflow mechanisms still apply to the conversion of a double MediaTime to rational with setTimescale() method. No behavior change for rational MediaTime. LayoutTests/imported/w3c: Update test expectations. * web-platform-tests/media-source/mediasource-duration-boundaryconditions-expected.txt: Source/WTF: * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): Tools: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Add tests to check operation results between double and rational MediaTime. (TestWebKitAPI::TEST): LayoutTests: Update test expectations. * media/media-source/media-source-timeoffset-expected.txt: * platform/gtk/imported/w3c/web-platform-tests/media-source/mediasource-duration-boundaryconditions-expected.txt: * platform/mac-elcapitan/imported/w3c/web-platform-tests/media-source/mediasource-duration-boundaryconditions-expected.txt: Canonical link: https://commits.webkit.org/190223@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@218247 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-06-14 08:44:29 +00:00
if (hasDoubleValue() || rhs.hasDoubleValue())
return MediaTime::createWithDouble(toDouble() - rhs.toDouble());
[WTF] MediaTime should support round-tripping from and to doubles. https://bugs.webkit.org/show_bug.cgi?id=139248 Reviewed by Eric Carlson. Source/WebCore: Check whether the MediaTime's underlying data is floating point before converting to a CMTime or QTTime. * platform/graphics/avfoundation/MediaTimeAVFoundation.cpp: (WebCore::toCMTime): * platform/graphics/mac/MediaTimeQTKit.mm: (WebCore::toQTTime): Source/WTF: MediaTimes should be able to return precisely the same double value as was used when the MediaTime was created, so long as that MediaTime was not modified in a non-destructive way. This will allow API which accepts floating-point values to return the exact same value when asked, but still be able to store that value as a MediaTime. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): Added; store the floating-point value in a union. (WTF::MediaTime::createWithDouble): Ditto. (WTF::MediaTime::toFloat): If the value is a double, just return it. (WTF::MediaTime::toDouble): Ditto. (WTF::MediaTime::operator+): Special case when one or both sides are doubles. (WTF::MediaTime::operator-): Ditto. (WTF::MediaTime::operator*): Ditto. (WTF::MediaTime::compare): Ditto. (WTF::abs): Ditto. (WTF::MediaTime::setTimeScale): Convert the MediaTime from a double. Tools: Add API tests for new features of MediaTime. Update the LLDB python provider to correctly display the MediaTimes after this change. * TestWebKitAPI/Tests/WTF/MediaTime.cpp: (WTF::operator<<): (TestWebKitAPI::TEST): * lldb/lldb_webkit.py: (WTFMediaTime_SummaryProvider): (WTFMediaTimeProvider.timeValueAsDouble): (WTFMediaTimeProvider.isIndefinite): (WTFMediaTimeProvider): (WTFMediaTimeProvider.hasDoubleValue): Canonical link: https://commits.webkit.org/157162@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@176863 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-12-05 20:51:02 +00:00
MediaTime a = *this;
MediaTime b = rhs;
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
uint32_t commonTimeScale;
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
if (!leastCommonMultiple(this->m_timeScale, rhs.m_timeScale, commonTimeScale) || commonTimeScale > MaximumTimeScale)
commonTimeScale = MaximumTimeScale;
a.setTimeScale(commonTimeScale);
b.setTimeScale(commonTimeScale);
while (!safeSub(a.m_timeValue, b.m_timeValue, a.m_timeValue)) {
if (commonTimeScale == 1)
return a.m_timeValue > 0 ? positiveInfiniteTime() : negativeInfiniteTime();
commonTimeScale /= 2;
a.setTimeScale(commonTimeScale);
b.setTimeScale(commonTimeScale);
}
return a;
}
Refactoring: make MediaTime the primary time type for audiovisual times. https://bugs.webkit.org/show_bug.cgi?id=133579 Reviewed by Eric Carlson. Source/JavaScriptCore: Add a utility function which converts a MediaTime to a JSNumber. * runtime/JSCJSValue.h: (JSC::jsNumber): Source/WebCore: In order to limit the number of floating-point rounding errors for media systems which can make use of rational time objects. Add some convenience methods to convert between QTTime and MediaTime. * platform/graphics/mac/MediaTimeQTKit.h: Added. * platform/graphics/mac/MediaTimeQTKit.mm: Added. (WebCore::toMediaTime): (WebCore::toQTTime): Rename MediaTimeMac -> MediaTimeAVFoundation: * platform/graphics/avfoundation/MediaTimeAVFoundation.cpp: Renamed from Source/WebCore/platform/mac/MediaTimeMac.cpp. (WebCore::toMediaTime): (WebCore::toCMTime): * platform/graphics/avfoundation/MediaTimeAVFoundation.h: Renamed from Source/WebCore/platform/mac/MediaTimeMac.h. Use MediaTime instead of double: * Modules/mediasource/MediaSource.cpp: (WebCore::MediaSource::duration): (WebCore::MediaSource::currentTime): (WebCore::MediaSource::buffered): (WebCore::MediaSource::setDuration): (WebCore::MediaSource::activeRanges): * Modules/mediasource/MediaSource.h: * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::remove): (WebCore::SourceBuffer::removeCodedFrames): (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment): (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): (WebCore::SourceBuffer::hasCurrentTime): (WebCore::SourceBuffer::hasFutureTime): (WebCore::SourceBuffer::canPlayThrough): * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDataCueCustom.cpp: (WebCore::JSDataCueConstructor::constructJSDataCue): * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::HTMLMediaElement): (WebCore::HTMLMediaElement::parseAttribute): * html/HTMLMediaElement.h: (WebCore::ValueToString<MediaTime>::string): * html/MediaFragmentURIParser.cpp: (WebCore::MediaFragmentURIParser::MediaFragmentURIParser): (WebCore::MediaFragmentURIParser::startTime): (WebCore::MediaFragmentURIParser::endTime): (WebCore::MediaFragmentURIParser::parseTimeFragment): (WebCore::MediaFragmentURIParser::parseNPTFragment): (WebCore::MediaFragmentURIParser::parseNPTTime): (WebCore::MediaFragmentURIParser::invalidTimeValue): Deleted. * html/MediaFragmentURIParser.h: * html/TimeRanges.h: (WebCore::TimeRanges::ranges): * html/track/DataCue.cpp: (WebCore::DataCue::DataCue): * html/track/DataCue.h: (WebCore::DataCue::create): * html/track/InbandDataTextTrack.cpp: (WebCore::InbandDataTextTrack::addDataCue): (WebCore::InbandDataTextTrack::updateDataCue): (WebCore::InbandDataTextTrack::removeDataCue): * html/track/InbandDataTextTrack.h: * html/track/InbandGenericTextTrack.cpp: (WebCore::InbandGenericTextTrack::updateCueFromCueData): (WebCore::InbandGenericTextTrack::addGenericCue): (WebCore::InbandGenericTextTrack::removeGenericCue): * html/track/InbandTextTrack.cpp: (WebCore::InbandTextTrack::startTimeVariance): * html/track/InbandTextTrack.h: * html/track/InbandWebVTTTextTrack.cpp: (WebCore::InbandWebVTTTextTrack::newCuesParsed): * html/track/TextTrack.cpp: (WebCore::TextTrack::addCue): (WebCore::TextTrack::hasCue): * html/track/TextTrack.h: (WebCore::TextTrack::startTimeVariance): * html/track/TextTrackCue.cpp: (WebCore::TextTrackCue::create): (WebCore::TextTrackCue::TextTrackCue): (WebCore::TextTrackCue::setStartTime): (WebCore::TextTrackCue::setEndTime): (WebCore::TextTrackCue::hasEquivalentStartTime): * html/track/TextTrackCue.h: (WebCore::TextTrackCue::startTime): (WebCore::TextTrackCue::endTime): * html/track/TextTrackCueGeneric.cpp: (WebCore::TextTrackCueGeneric::TextTrackCueGeneric): * html/track/TextTrackCueGeneric.h: * html/track/TextTrackCueList.cpp: (WebCore::TextTrackCueList::add): * html/track/VTTCue.cpp: (WebCore::VTTCue::VTTCue): (WebCore::VTTCue::markFutureAndPastNodes): (WebCore::VTTCue::updateDisplayTree): * html/track/VTTCue.h: (WebCore::VTTCue::create): * html/track/WebVTTParser.cpp: (WebCore::WebVTTParser::WebVTTParser): (WebCore::WebVTTParser::resetCueValues): (WebCore::WebVTTParser::collectTimeStamp): (WebCore::WebVTTTreeBuilder::constructTreeFromToken): * html/track/WebVTTParser.h: (WebCore::WebVTTCueData::startTime): (WebCore::WebVTTCueData::setStartTime): (WebCore::WebVTTCueData::endTime): (WebCore::WebVTTCueData::setEndTime): (WebCore::WebVTTCueData::WebVTTCueData): Deleted. * platform/graphics/InbandTextTrackPrivateClient.h: (WebCore::GenericCueData::startTime): (WebCore::GenericCueData::setStartTime): (WebCore::GenericCueData::endTime): (WebCore::GenericCueData::setEndTime): (WebCore::GenericCueData::GenericCueData): * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::duration): (WebCore::MediaPlayer::startTime): (WebCore::MediaPlayer::initialTime): (WebCore::MediaPlayer::currentTime): (WebCore::MediaPlayer::seekWithTolerance): (WebCore::MediaPlayer::seek): (WebCore::MediaPlayer::maxTimeSeekable): (WebCore::MediaPlayer::minTimeSeekable): (WebCore::MediaPlayer::mediaTimeForTimeValue): (WebCore::MediaPlayer::totalFrameDelay): * platform/graphics/MediaPlayer.h: * platform/graphics/MediaPlayerPrivate.h: (WebCore::MediaPlayerPrivateInterface::durationMediaTime): (WebCore::MediaPlayerPrivateInterface::currentMediaTime): (WebCore::MediaPlayerPrivateInterface::seek): (WebCore::MediaPlayerPrivateInterface::seekWithTolerance): (WebCore::MediaPlayerPrivateInterface::startTime): (WebCore::MediaPlayerPrivateInterface::initialTime): (WebCore::MediaPlayerPrivateInterface::seekable): (WebCore::MediaPlayerPrivateInterface::maxMediaTimeSeekable): (WebCore::MediaPlayerPrivateInterface::minMediaTimeSeekable): (WebCore::MediaPlayerPrivateInterface::mediaTimeForTimeValue): (WebCore::MediaPlayerPrivateInterface::totalFrameDelay): (WebCore::MediaPlayerPrivateInterface::startTimeDouble): Deleted. (WebCore::MediaPlayerPrivateInterface::maxTimeSeekableDouble): Deleted. (WebCore::MediaPlayerPrivateInterface::mediaTimeForTimeValueDouble): Deleted. * platform/graphics/MediaSourcePrivateClient.h: * platform/graphics/TrackPrivateBase.h: (WebCore::TrackPrivateBase::startTimeVariance): * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp: (WebCore::InbandMetadataTextTrackPrivateAVF::InbandMetadataTextTrackPrivateAVF): (WebCore::InbandMetadataTextTrackPrivateAVF::addDataCue): (WebCore::InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes): (WebCore::InbandMetadataTextTrackPrivateAVF::flushPartialCues): * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h: (WebCore::IncompleteMetaDataCue::IncompleteMetaDataCue): (WebCore::IncompleteMetaDataCue::startTime): * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: (WebCore::InbandTextTrackPrivateAVF::processCue): (WebCore::InbandTextTrackPrivateAVF::resetCueValues): * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.h: * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: (WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation): (WebCore::MediaPlayerPrivateAVFoundation::durationMediaTime): (WebCore::MediaPlayerPrivateAVFoundation::seek): (WebCore::MediaPlayerPrivateAVFoundation::seekWithTolerance): (WebCore::MediaPlayerPrivateAVFoundation::maxMediaTimeSeekable): (WebCore::MediaPlayerPrivateAVFoundation::minMediaTimeSeekable): (WebCore::MediaPlayerPrivateAVFoundation::maxTimeLoaded): (WebCore::MediaPlayerPrivateAVFoundation::didLoadingProgress): (WebCore::MediaPlayerPrivateAVFoundation::updateStates): (WebCore::MediaPlayerPrivateAVFoundation::loadedTimeRangesChanged): (WebCore::MediaPlayerPrivateAVFoundation::seekableTimeRangesChanged): (WebCore::MediaPlayerPrivateAVFoundation::timeChanged): (WebCore::MediaPlayerPrivateAVFoundation::didEnd): (WebCore::MediaPlayerPrivateAVFoundation::invalidateCachedDuration): (WebCore::MediaPlayerPrivateAVFoundation::scheduleMainThreadNotification): (WebCore::MediaPlayerPrivateAVFoundation::extraMemoryCost): (WebCore::MediaPlayerPrivateAVFoundation::duration): Deleted. (WebCore::MediaPlayerPrivateAVFoundation::maxTimeSeekableDouble): Deleted. (WebCore::MediaPlayerPrivateAVFoundation::minTimeSeekable): Deleted. * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h: (WebCore::MediaPlayerPrivateAVFoundation::Notification::Notification): (WebCore::MediaPlayerPrivateAVFoundation::Notification::time): * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: (WebCore::MediaPlayerPrivateAVFoundationCF::platformDuration): (WebCore::MediaPlayerPrivateAVFoundationCF::currentTime): (WebCore::MediaPlayerPrivateAVFoundationCF::seekToTime): (WebCore::MediaPlayerPrivateAVFoundationCF::platformDuration): (WebCore::MediaPlayerPrivateAVFoundationCF::currentTime): (WebCore::MediaPlayerPrivateAVFoundationCF::seekToTime): (WebCore::MediaPlayerPrivateAVFoundationCF::platformMinTimeSeekable): (WebCore::MediaPlayerPrivateAVFoundationCF::platformMaxTimeSeekable): (WebCore::MediaPlayerPrivateAVFoundationCF::platformMaxTimeLoaded): (WebCore::MediaPlayerPrivateAVFoundationCF::mediaTimeForTimeValue): Deleted. (WebCore::AVFWrapper::seekToTime): Deleted. (WebCore::LegibleOutputData::LegibleOutputData): Deleted. (WebCore::AVFWrapper::createImageForTimeInRect): Deleted. (WebCore::MediaPlayerPrivateAVFoundationCF::platformMinTimeSeekable): (WebCore::MediaPlayerPrivateAVFoundationCF::platformMaxTimeSeekable): (WebCore::MediaPlayerPrivateAVFoundationCF::platformMaxTimeLoaded): (WebCore::MediaPlayerPrivateAVFoundationCF::mediaTimeForTimeValue): Deleted. (WebCore::AVFWrapper::seekToTime): Deleted. (WebCore::LegibleOutputData::LegibleOutputData): Deleted. (WebCore::AVFWrapper::createImageForTimeInRect): Deleted. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC): (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad): (WebCore::MediaPlayerPrivateAVFoundationObjC::platformDuration): (WebCore::MediaPlayerPrivateAVFoundationObjC::currentMediaTime): (WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime): (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMinTimeSeekable): (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMaxTimeSeekable): (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMaxTimeLoaded): (WebCore::MediaPlayerPrivateAVFoundationObjC::mediaTimeForTimeValue): (WebCore::MediaPlayerPrivateAVFoundationObjC::processCue): (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive): (WebCore::MediaPlayerPrivateAVFoundationObjC::durationDidChange): (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]): (-[WebCoreAVFMovieObserver legibleOutput:didOutputAttributedStrings:nativeSampleBuffers:forItemTime:]): (WebCore::MediaPlayerPrivateAVFoundationObjC::currentTime): Deleted. * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationMediaTime): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::startTime): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::initialTime): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekable): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::maxMediaTimeSeekable): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::minMediaTimeSeekable): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::totalFrameDelay): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationDouble): Deleted. (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::currentTimeDouble): Deleted. (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::startTimeDouble): Deleted. (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::maxTimeSeekableDouble): Deleted. (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::minTimeSeekable): Deleted. * platform/graphics/avfoundation/objc/OutOfBandTextTrackPrivateAVF.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: * platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h: (WebCore::InbandMetadataTextTrackPrivateGStreamer::addDataCue): * platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h: (WebCore::InbandMetadataTextTrackPrivateGStreamer::addDataCue): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::processMpegTsSection): (WebCore::MediaPlayerPrivateGStreamer::processTableOfContentsEntry): (WebCore::MediaPlayerPrivateGStreamer::processMpegTsSection): (WebCore::MediaPlayerPrivateGStreamer::processTableOfContentsEntry): * platform/graphics/mac/MediaPlayerPrivateQTKit.h: * platform/graphics/mac/MediaPlayerPrivateQTKit.mm: * platform/graphics/mac/MediaPlayerPrivateQTKit.mm: (WebCore::maxValueForTimeRanges): (WebCore::MediaPlayerPrivateQTKit::MediaPlayerPrivateQTKit): (WebCore::MediaPlayerPrivateQTKit::durationMediaTime): (WebCore::MediaPlayerPrivateQTKit::currentMediaTime): (WebCore::MediaPlayerPrivateQTKit::seek): (WebCore::MediaPlayerPrivateQTKit::doSeek): (WebCore::MediaPlayerPrivateQTKit::cancelSeek): (WebCore::MediaPlayerPrivateQTKit::seekTimerFired): (WebCore::MediaPlayerPrivateQTKit::seeking): (WebCore::MediaPlayerPrivateQTKit::setPreservesPitch): (WebCore::MediaPlayerPrivateQTKit::buffered): (WebCore::MediaPlayerPrivateQTKit::maxMediaTimeSeekable): (WebCore::MediaPlayerPrivateQTKit::maxMediaTimeLoaded): (WebCore::MediaPlayerPrivateQTKit::didLoadingProgress): (WebCore::MediaPlayerPrivateQTKit::updateStates): (WebCore::MediaPlayerPrivateQTKit::timeChanged): (WebCore::MediaPlayerPrivateQTKit::didEnd): (WebCore::MediaPlayerPrivateQTKit::maxMediaTimeSeekable): (WebCore::MediaPlayerPrivateQTKit::maxMediaTimeLoaded): (WebCore::MediaPlayerPrivateQTKit::createQTTime): Deleted. (WebCore::MediaPlayerPrivateQTKit::duration): Deleted. (WebCore::MediaPlayerPrivateQTKit::currentTime): Deleted. (WebCore::MediaPlayerPrivateQTKit::maxTimeSeekable): Deleted. (WebCore::MediaPlayerPrivateQTKit::maxTimeLoaded): Deleted. (WebCore::MediaPlayerPrivateQTKit::mediaTimeForTimeValue): Deleted. * platform/mac/PlatformClockCM.mm: * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp: (WebCore::MockMediaPlayerMediaSource::maxMediaTimeSeekable): (WebCore::MockMediaPlayerMediaSource::currentMediaTime): (WebCore::MockMediaPlayerMediaSource::durationMediaTime): (WebCore::MockMediaPlayerMediaSource::seekWithTolerance): (WebCore::MockMediaPlayerMediaSource::totalFrameDelay): (WebCore::MockMediaPlayerMediaSource::maxTimeSeekableDouble): Deleted. (WebCore::MockMediaPlayerMediaSource::currentTimeDouble): Deleted. (WebCore::MockMediaPlayerMediaSource::durationDouble): Deleted. * platform/mock/mediasource/MockMediaPlayerMediaSource.h: * platform/mock/mediasource/MockMediaSourcePrivate.cpp: (WebCore::MockMediaSourcePrivate::MockMediaSourcePrivate): * platform/mock/mediasource/MockMediaSourcePrivate.h: * platform/mock/mediasource/MockSourceBufferPrivate.cpp: (WebCore::MockSourceBufferPrivate::enqueueSample): Source/WTF: Add a unary minus operator, and add unimplemented private casting operators, to make unintentional double->MediaTime and MediaTime->double casts hard errors. * wtf/MediaTime.cpp: (WTF::MediaTime::operator-): * wtf/MediaTime.h: LayoutTests: Update the http/media tests to use byte-ranges, and update our byte-range CGI script to return correct headers. Remove the platform expected results for media/video-seek-past-end-paused.html now that we pass. * http/tests/media/reload-after-dialog.html: * http/tests/media/video-error-abort.html: * http/tests/media/video-throttled-load.cgi: * platform/mac/media/video-seek-past-end-paused-expected.txt: Removed. * platform/mac/TestExpectations: Canonical link: https://commits.webkit.org/154380@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173318 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-09-05 18:38:59 +00:00
MediaTime MediaTime::operator-() const
{
if (isInvalid())
return invalidTime();
if (isIndefinite())
return indefiniteTime();
if (isPositiveInfinite())
return negativeInfiniteTime();
if (isNegativeInfinite())
return positiveInfiniteTime();
MediaTime negativeTime = *this;
[WTF] MediaTime should support round-tripping from and to doubles. https://bugs.webkit.org/show_bug.cgi?id=139248 Reviewed by Eric Carlson. Source/WebCore: Check whether the MediaTime's underlying data is floating point before converting to a CMTime or QTTime. * platform/graphics/avfoundation/MediaTimeAVFoundation.cpp: (WebCore::toCMTime): * platform/graphics/mac/MediaTimeQTKit.mm: (WebCore::toQTTime): Source/WTF: MediaTimes should be able to return precisely the same double value as was used when the MediaTime was created, so long as that MediaTime was not modified in a non-destructive way. This will allow API which accepts floating-point values to return the exact same value when asked, but still be able to store that value as a MediaTime. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): Added; store the floating-point value in a union. (WTF::MediaTime::createWithDouble): Ditto. (WTF::MediaTime::toFloat): If the value is a double, just return it. (WTF::MediaTime::toDouble): Ditto. (WTF::MediaTime::operator+): Special case when one or both sides are doubles. (WTF::MediaTime::operator-): Ditto. (WTF::MediaTime::operator*): Ditto. (WTF::MediaTime::compare): Ditto. (WTF::abs): Ditto. (WTF::MediaTime::setTimeScale): Convert the MediaTime from a double. Tools: Add API tests for new features of MediaTime. Update the LLDB python provider to correctly display the MediaTimes after this change. * TestWebKitAPI/Tests/WTF/MediaTime.cpp: (WTF::operator<<): (TestWebKitAPI::TEST): * lldb/lldb_webkit.py: (WTFMediaTime_SummaryProvider): (WTFMediaTimeProvider.timeValueAsDouble): (WTFMediaTimeProvider.isIndefinite): (WTFMediaTimeProvider): (WTFMediaTimeProvider.hasDoubleValue): Canonical link: https://commits.webkit.org/157162@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@176863 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-12-05 20:51:02 +00:00
if (negativeTime.hasDoubleValue())
negativeTime.m_timeValueAsDouble = -negativeTime.m_timeValueAsDouble;
else
negativeTime.m_timeValue = -negativeTime.m_timeValue;
Refactoring: make MediaTime the primary time type for audiovisual times. https://bugs.webkit.org/show_bug.cgi?id=133579 Reviewed by Eric Carlson. Source/JavaScriptCore: Add a utility function which converts a MediaTime to a JSNumber. * runtime/JSCJSValue.h: (JSC::jsNumber): Source/WebCore: In order to limit the number of floating-point rounding errors for media systems which can make use of rational time objects. Add some convenience methods to convert between QTTime and MediaTime. * platform/graphics/mac/MediaTimeQTKit.h: Added. * platform/graphics/mac/MediaTimeQTKit.mm: Added. (WebCore::toMediaTime): (WebCore::toQTTime): Rename MediaTimeMac -> MediaTimeAVFoundation: * platform/graphics/avfoundation/MediaTimeAVFoundation.cpp: Renamed from Source/WebCore/platform/mac/MediaTimeMac.cpp. (WebCore::toMediaTime): (WebCore::toCMTime): * platform/graphics/avfoundation/MediaTimeAVFoundation.h: Renamed from Source/WebCore/platform/mac/MediaTimeMac.h. Use MediaTime instead of double: * Modules/mediasource/MediaSource.cpp: (WebCore::MediaSource::duration): (WebCore::MediaSource::currentTime): (WebCore::MediaSource::buffered): (WebCore::MediaSource::setDuration): (WebCore::MediaSource::activeRanges): * Modules/mediasource/MediaSource.h: * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::remove): (WebCore::SourceBuffer::removeCodedFrames): (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment): (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): (WebCore::SourceBuffer::hasCurrentTime): (WebCore::SourceBuffer::hasFutureTime): (WebCore::SourceBuffer::canPlayThrough): * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDataCueCustom.cpp: (WebCore::JSDataCueConstructor::constructJSDataCue): * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::HTMLMediaElement): (WebCore::HTMLMediaElement::parseAttribute): * html/HTMLMediaElement.h: (WebCore::ValueToString<MediaTime>::string): * html/MediaFragmentURIParser.cpp: (WebCore::MediaFragmentURIParser::MediaFragmentURIParser): (WebCore::MediaFragmentURIParser::startTime): (WebCore::MediaFragmentURIParser::endTime): (WebCore::MediaFragmentURIParser::parseTimeFragment): (WebCore::MediaFragmentURIParser::parseNPTFragment): (WebCore::MediaFragmentURIParser::parseNPTTime): (WebCore::MediaFragmentURIParser::invalidTimeValue): Deleted. * html/MediaFragmentURIParser.h: * html/TimeRanges.h: (WebCore::TimeRanges::ranges): * html/track/DataCue.cpp: (WebCore::DataCue::DataCue): * html/track/DataCue.h: (WebCore::DataCue::create): * html/track/InbandDataTextTrack.cpp: (WebCore::InbandDataTextTrack::addDataCue): (WebCore::InbandDataTextTrack::updateDataCue): (WebCore::InbandDataTextTrack::removeDataCue): * html/track/InbandDataTextTrack.h: * html/track/InbandGenericTextTrack.cpp: (WebCore::InbandGenericTextTrack::updateCueFromCueData): (WebCore::InbandGenericTextTrack::addGenericCue): (WebCore::InbandGenericTextTrack::removeGenericCue): * html/track/InbandTextTrack.cpp: (WebCore::InbandTextTrack::startTimeVariance): * html/track/InbandTextTrack.h: * html/track/InbandWebVTTTextTrack.cpp: (WebCore::InbandWebVTTTextTrack::newCuesParsed): * html/track/TextTrack.cpp: (WebCore::TextTrack::addCue): (WebCore::TextTrack::hasCue): * html/track/TextTrack.h: (WebCore::TextTrack::startTimeVariance): * html/track/TextTrackCue.cpp: (WebCore::TextTrackCue::create): (WebCore::TextTrackCue::TextTrackCue): (WebCore::TextTrackCue::setStartTime): (WebCore::TextTrackCue::setEndTime): (WebCore::TextTrackCue::hasEquivalentStartTime): * html/track/TextTrackCue.h: (WebCore::TextTrackCue::startTime): (WebCore::TextTrackCue::endTime): * html/track/TextTrackCueGeneric.cpp: (WebCore::TextTrackCueGeneric::TextTrackCueGeneric): * html/track/TextTrackCueGeneric.h: * html/track/TextTrackCueList.cpp: (WebCore::TextTrackCueList::add): * html/track/VTTCue.cpp: (WebCore::VTTCue::VTTCue): (WebCore::VTTCue::markFutureAndPastNodes): (WebCore::VTTCue::updateDisplayTree): * html/track/VTTCue.h: (WebCore::VTTCue::create): * html/track/WebVTTParser.cpp: (WebCore::WebVTTParser::WebVTTParser): (WebCore::WebVTTParser::resetCueValues): (WebCore::WebVTTParser::collectTimeStamp): (WebCore::WebVTTTreeBuilder::constructTreeFromToken): * html/track/WebVTTParser.h: (WebCore::WebVTTCueData::startTime): (WebCore::WebVTTCueData::setStartTime): (WebCore::WebVTTCueData::endTime): (WebCore::WebVTTCueData::setEndTime): (WebCore::WebVTTCueData::WebVTTCueData): Deleted. * platform/graphics/InbandTextTrackPrivateClient.h: (WebCore::GenericCueData::startTime): (WebCore::GenericCueData::setStartTime): (WebCore::GenericCueData::endTime): (WebCore::GenericCueData::setEndTime): (WebCore::GenericCueData::GenericCueData): * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::duration): (WebCore::MediaPlayer::startTime): (WebCore::MediaPlayer::initialTime): (WebCore::MediaPlayer::currentTime): (WebCore::MediaPlayer::seekWithTolerance): (WebCore::MediaPlayer::seek): (WebCore::MediaPlayer::maxTimeSeekable): (WebCore::MediaPlayer::minTimeSeekable): (WebCore::MediaPlayer::mediaTimeForTimeValue): (WebCore::MediaPlayer::totalFrameDelay): * platform/graphics/MediaPlayer.h: * platform/graphics/MediaPlayerPrivate.h: (WebCore::MediaPlayerPrivateInterface::durationMediaTime): (WebCore::MediaPlayerPrivateInterface::currentMediaTime): (WebCore::MediaPlayerPrivateInterface::seek): (WebCore::MediaPlayerPrivateInterface::seekWithTolerance): (WebCore::MediaPlayerPrivateInterface::startTime): (WebCore::MediaPlayerPrivateInterface::initialTime): (WebCore::MediaPlayerPrivateInterface::seekable): (WebCore::MediaPlayerPrivateInterface::maxMediaTimeSeekable): (WebCore::MediaPlayerPrivateInterface::minMediaTimeSeekable): (WebCore::MediaPlayerPrivateInterface::mediaTimeForTimeValue): (WebCore::MediaPlayerPrivateInterface::totalFrameDelay): (WebCore::MediaPlayerPrivateInterface::startTimeDouble): Deleted. (WebCore::MediaPlayerPrivateInterface::maxTimeSeekableDouble): Deleted. (WebCore::MediaPlayerPrivateInterface::mediaTimeForTimeValueDouble): Deleted. * platform/graphics/MediaSourcePrivateClient.h: * platform/graphics/TrackPrivateBase.h: (WebCore::TrackPrivateBase::startTimeVariance): * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp: (WebCore::InbandMetadataTextTrackPrivateAVF::InbandMetadataTextTrackPrivateAVF): (WebCore::InbandMetadataTextTrackPrivateAVF::addDataCue): (WebCore::InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes): (WebCore::InbandMetadataTextTrackPrivateAVF::flushPartialCues): * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h: (WebCore::IncompleteMetaDataCue::IncompleteMetaDataCue): (WebCore::IncompleteMetaDataCue::startTime): * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: (WebCore::InbandTextTrackPrivateAVF::processCue): (WebCore::InbandTextTrackPrivateAVF::resetCueValues): * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.h: * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: (WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation): (WebCore::MediaPlayerPrivateAVFoundation::durationMediaTime): (WebCore::MediaPlayerPrivateAVFoundation::seek): (WebCore::MediaPlayerPrivateAVFoundation::seekWithTolerance): (WebCore::MediaPlayerPrivateAVFoundation::maxMediaTimeSeekable): (WebCore::MediaPlayerPrivateAVFoundation::minMediaTimeSeekable): (WebCore::MediaPlayerPrivateAVFoundation::maxTimeLoaded): (WebCore::MediaPlayerPrivateAVFoundation::didLoadingProgress): (WebCore::MediaPlayerPrivateAVFoundation::updateStates): (WebCore::MediaPlayerPrivateAVFoundation::loadedTimeRangesChanged): (WebCore::MediaPlayerPrivateAVFoundation::seekableTimeRangesChanged): (WebCore::MediaPlayerPrivateAVFoundation::timeChanged): (WebCore::MediaPlayerPrivateAVFoundation::didEnd): (WebCore::MediaPlayerPrivateAVFoundation::invalidateCachedDuration): (WebCore::MediaPlayerPrivateAVFoundation::scheduleMainThreadNotification): (WebCore::MediaPlayerPrivateAVFoundation::extraMemoryCost): (WebCore::MediaPlayerPrivateAVFoundation::duration): Deleted. (WebCore::MediaPlayerPrivateAVFoundation::maxTimeSeekableDouble): Deleted. (WebCore::MediaPlayerPrivateAVFoundation::minTimeSeekable): Deleted. * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h: (WebCore::MediaPlayerPrivateAVFoundation::Notification::Notification): (WebCore::MediaPlayerPrivateAVFoundation::Notification::time): * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: (WebCore::MediaPlayerPrivateAVFoundationCF::platformDuration): (WebCore::MediaPlayerPrivateAVFoundationCF::currentTime): (WebCore::MediaPlayerPrivateAVFoundationCF::seekToTime): (WebCore::MediaPlayerPrivateAVFoundationCF::platformDuration): (WebCore::MediaPlayerPrivateAVFoundationCF::currentTime): (WebCore::MediaPlayerPrivateAVFoundationCF::seekToTime): (WebCore::MediaPlayerPrivateAVFoundationCF::platformMinTimeSeekable): (WebCore::MediaPlayerPrivateAVFoundationCF::platformMaxTimeSeekable): (WebCore::MediaPlayerPrivateAVFoundationCF::platformMaxTimeLoaded): (WebCore::MediaPlayerPrivateAVFoundationCF::mediaTimeForTimeValue): Deleted. (WebCore::AVFWrapper::seekToTime): Deleted. (WebCore::LegibleOutputData::LegibleOutputData): Deleted. (WebCore::AVFWrapper::createImageForTimeInRect): Deleted. (WebCore::MediaPlayerPrivateAVFoundationCF::platformMinTimeSeekable): (WebCore::MediaPlayerPrivateAVFoundationCF::platformMaxTimeSeekable): (WebCore::MediaPlayerPrivateAVFoundationCF::platformMaxTimeLoaded): (WebCore::MediaPlayerPrivateAVFoundationCF::mediaTimeForTimeValue): Deleted. (WebCore::AVFWrapper::seekToTime): Deleted. (WebCore::LegibleOutputData::LegibleOutputData): Deleted. (WebCore::AVFWrapper::createImageForTimeInRect): Deleted. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC): (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad): (WebCore::MediaPlayerPrivateAVFoundationObjC::platformDuration): (WebCore::MediaPlayerPrivateAVFoundationObjC::currentMediaTime): (WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime): (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMinTimeSeekable): (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMaxTimeSeekable): (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMaxTimeLoaded): (WebCore::MediaPlayerPrivateAVFoundationObjC::mediaTimeForTimeValue): (WebCore::MediaPlayerPrivateAVFoundationObjC::processCue): (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive): (WebCore::MediaPlayerPrivateAVFoundationObjC::durationDidChange): (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]): (-[WebCoreAVFMovieObserver legibleOutput:didOutputAttributedStrings:nativeSampleBuffers:forItemTime:]): (WebCore::MediaPlayerPrivateAVFoundationObjC::currentTime): Deleted. * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationMediaTime): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::startTime): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::initialTime): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekable): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::maxMediaTimeSeekable): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::minMediaTimeSeekable): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::totalFrameDelay): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationDouble): Deleted. (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::currentTimeDouble): Deleted. (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::startTimeDouble): Deleted. (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::maxTimeSeekableDouble): Deleted. (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::minTimeSeekable): Deleted. * platform/graphics/avfoundation/objc/OutOfBandTextTrackPrivateAVF.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: * platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h: (WebCore::InbandMetadataTextTrackPrivateGStreamer::addDataCue): * platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h: (WebCore::InbandMetadataTextTrackPrivateGStreamer::addDataCue): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::processMpegTsSection): (WebCore::MediaPlayerPrivateGStreamer::processTableOfContentsEntry): (WebCore::MediaPlayerPrivateGStreamer::processMpegTsSection): (WebCore::MediaPlayerPrivateGStreamer::processTableOfContentsEntry): * platform/graphics/mac/MediaPlayerPrivateQTKit.h: * platform/graphics/mac/MediaPlayerPrivateQTKit.mm: * platform/graphics/mac/MediaPlayerPrivateQTKit.mm: (WebCore::maxValueForTimeRanges): (WebCore::MediaPlayerPrivateQTKit::MediaPlayerPrivateQTKit): (WebCore::MediaPlayerPrivateQTKit::durationMediaTime): (WebCore::MediaPlayerPrivateQTKit::currentMediaTime): (WebCore::MediaPlayerPrivateQTKit::seek): (WebCore::MediaPlayerPrivateQTKit::doSeek): (WebCore::MediaPlayerPrivateQTKit::cancelSeek): (WebCore::MediaPlayerPrivateQTKit::seekTimerFired): (WebCore::MediaPlayerPrivateQTKit::seeking): (WebCore::MediaPlayerPrivateQTKit::setPreservesPitch): (WebCore::MediaPlayerPrivateQTKit::buffered): (WebCore::MediaPlayerPrivateQTKit::maxMediaTimeSeekable): (WebCore::MediaPlayerPrivateQTKit::maxMediaTimeLoaded): (WebCore::MediaPlayerPrivateQTKit::didLoadingProgress): (WebCore::MediaPlayerPrivateQTKit::updateStates): (WebCore::MediaPlayerPrivateQTKit::timeChanged): (WebCore::MediaPlayerPrivateQTKit::didEnd): (WebCore::MediaPlayerPrivateQTKit::maxMediaTimeSeekable): (WebCore::MediaPlayerPrivateQTKit::maxMediaTimeLoaded): (WebCore::MediaPlayerPrivateQTKit::createQTTime): Deleted. (WebCore::MediaPlayerPrivateQTKit::duration): Deleted. (WebCore::MediaPlayerPrivateQTKit::currentTime): Deleted. (WebCore::MediaPlayerPrivateQTKit::maxTimeSeekable): Deleted. (WebCore::MediaPlayerPrivateQTKit::maxTimeLoaded): Deleted. (WebCore::MediaPlayerPrivateQTKit::mediaTimeForTimeValue): Deleted. * platform/mac/PlatformClockCM.mm: * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp: (WebCore::MockMediaPlayerMediaSource::maxMediaTimeSeekable): (WebCore::MockMediaPlayerMediaSource::currentMediaTime): (WebCore::MockMediaPlayerMediaSource::durationMediaTime): (WebCore::MockMediaPlayerMediaSource::seekWithTolerance): (WebCore::MockMediaPlayerMediaSource::totalFrameDelay): (WebCore::MockMediaPlayerMediaSource::maxTimeSeekableDouble): Deleted. (WebCore::MockMediaPlayerMediaSource::currentTimeDouble): Deleted. (WebCore::MockMediaPlayerMediaSource::durationDouble): Deleted. * platform/mock/mediasource/MockMediaPlayerMediaSource.h: * platform/mock/mediasource/MockMediaSourcePrivate.cpp: (WebCore::MockMediaSourcePrivate::MockMediaSourcePrivate): * platform/mock/mediasource/MockMediaSourcePrivate.h: * platform/mock/mediasource/MockSourceBufferPrivate.cpp: (WebCore::MockSourceBufferPrivate::enqueueSample): Source/WTF: Add a unary minus operator, and add unimplemented private casting operators, to make unintentional double->MediaTime and MediaTime->double casts hard errors. * wtf/MediaTime.cpp: (WTF::MediaTime::operator-): * wtf/MediaTime.h: LayoutTests: Update the http/media tests to use byte-ranges, and update our byte-range CGI script to return correct headers. Remove the platform expected results for media/video-seek-past-end-paused.html now that we pass. * http/tests/media/reload-after-dialog.html: * http/tests/media/video-error-abort.html: * http/tests/media/video-throttled-load.cgi: * platform/mac/media/video-seek-past-end-paused-expected.txt: Removed. * platform/mac/TestExpectations: Canonical link: https://commits.webkit.org/154380@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173318 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-09-05 18:38:59 +00:00
return negativeTime;
}
MediaTime MediaTime::operator*(int32_t rhs) const
{
if (isInvalid())
return invalidTime();
if (isIndefinite())
return indefiniteTime();
if (!rhs)
return zeroTime();
if (isPositiveInfinite()) {
if (rhs > 0)
return positiveInfiniteTime();
return negativeInfiniteTime();
}
if (isNegativeInfinite()) {
if (rhs > 0)
return negativeInfiniteTime();
return positiveInfiniteTime();
}
MediaTime a = *this;
[WTF] MediaTime should support round-tripping from and to doubles. https://bugs.webkit.org/show_bug.cgi?id=139248 Reviewed by Eric Carlson. Source/WebCore: Check whether the MediaTime's underlying data is floating point before converting to a CMTime or QTTime. * platform/graphics/avfoundation/MediaTimeAVFoundation.cpp: (WebCore::toCMTime): * platform/graphics/mac/MediaTimeQTKit.mm: (WebCore::toQTTime): Source/WTF: MediaTimes should be able to return precisely the same double value as was used when the MediaTime was created, so long as that MediaTime was not modified in a non-destructive way. This will allow API which accepts floating-point values to return the exact same value when asked, but still be able to store that value as a MediaTime. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): Added; store the floating-point value in a union. (WTF::MediaTime::createWithDouble): Ditto. (WTF::MediaTime::toFloat): If the value is a double, just return it. (WTF::MediaTime::toDouble): Ditto. (WTF::MediaTime::operator+): Special case when one or both sides are doubles. (WTF::MediaTime::operator-): Ditto. (WTF::MediaTime::operator*): Ditto. (WTF::MediaTime::compare): Ditto. (WTF::abs): Ditto. (WTF::MediaTime::setTimeScale): Convert the MediaTime from a double. Tools: Add API tests for new features of MediaTime. Update the LLDB python provider to correctly display the MediaTimes after this change. * TestWebKitAPI/Tests/WTF/MediaTime.cpp: (WTF::operator<<): (TestWebKitAPI::TEST): * lldb/lldb_webkit.py: (WTFMediaTime_SummaryProvider): (WTFMediaTimeProvider.timeValueAsDouble): (WTFMediaTimeProvider.isIndefinite): (WTFMediaTimeProvider): (WTFMediaTimeProvider.hasDoubleValue): Canonical link: https://commits.webkit.org/157162@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@176863 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-12-05 20:51:02 +00:00
if (a.hasDoubleValue()) {
a.m_timeValueAsDouble *= rhs;
return a;
}
while (!safeMultiply(a.m_timeValue, rhs, a.m_timeValue)) {
if (a.m_timeScale == 1)
return signum(a.m_timeValue) == signum(rhs) ? positiveInfiniteTime() : negativeInfiniteTime();
a.setTimeScale(a.m_timeScale / 2);
}
return a;
}
Refactoring: make MediaTime the primary time type for audiovisual times. https://bugs.webkit.org/show_bug.cgi?id=133579 Reviewed by Eric Carlson. Source/JavaScriptCore: Add a utility function which converts a MediaTime to a JSNumber. * runtime/JSCJSValue.h: (JSC::jsNumber): Source/WebCore: In order to limit the number of floating-point rounding errors for media systems which can make use of rational time objects. Add some convenience methods to convert between QTTime and MediaTime. * platform/graphics/mac/MediaTimeQTKit.h: Added. * platform/graphics/mac/MediaTimeQTKit.mm: Added. (WebCore::toMediaTime): (WebCore::toQTTime): Rename MediaTimeMac -> MediaTimeAVFoundation: * platform/graphics/avfoundation/MediaTimeAVFoundation.cpp: Renamed from Source/WebCore/platform/mac/MediaTimeMac.cpp. (WebCore::toMediaTime): (WebCore::toCMTime): * platform/graphics/avfoundation/MediaTimeAVFoundation.h: Renamed from Source/WebCore/platform/mac/MediaTimeMac.h. Use MediaTime instead of double: * Modules/mediasource/MediaSource.cpp: (WebCore::MediaSource::duration): (WebCore::MediaSource::currentTime): (WebCore::MediaSource::buffered): (WebCore::MediaSource::setDuration): (WebCore::MediaSource::activeRanges): * Modules/mediasource/MediaSource.h: * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::remove): (WebCore::SourceBuffer::removeCodedFrames): (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment): (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): (WebCore::SourceBuffer::hasCurrentTime): (WebCore::SourceBuffer::hasFutureTime): (WebCore::SourceBuffer::canPlayThrough): * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDataCueCustom.cpp: (WebCore::JSDataCueConstructor::constructJSDataCue): * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::HTMLMediaElement): (WebCore::HTMLMediaElement::parseAttribute): * html/HTMLMediaElement.h: (WebCore::ValueToString<MediaTime>::string): * html/MediaFragmentURIParser.cpp: (WebCore::MediaFragmentURIParser::MediaFragmentURIParser): (WebCore::MediaFragmentURIParser::startTime): (WebCore::MediaFragmentURIParser::endTime): (WebCore::MediaFragmentURIParser::parseTimeFragment): (WebCore::MediaFragmentURIParser::parseNPTFragment): (WebCore::MediaFragmentURIParser::parseNPTTime): (WebCore::MediaFragmentURIParser::invalidTimeValue): Deleted. * html/MediaFragmentURIParser.h: * html/TimeRanges.h: (WebCore::TimeRanges::ranges): * html/track/DataCue.cpp: (WebCore::DataCue::DataCue): * html/track/DataCue.h: (WebCore::DataCue::create): * html/track/InbandDataTextTrack.cpp: (WebCore::InbandDataTextTrack::addDataCue): (WebCore::InbandDataTextTrack::updateDataCue): (WebCore::InbandDataTextTrack::removeDataCue): * html/track/InbandDataTextTrack.h: * html/track/InbandGenericTextTrack.cpp: (WebCore::InbandGenericTextTrack::updateCueFromCueData): (WebCore::InbandGenericTextTrack::addGenericCue): (WebCore::InbandGenericTextTrack::removeGenericCue): * html/track/InbandTextTrack.cpp: (WebCore::InbandTextTrack::startTimeVariance): * html/track/InbandTextTrack.h: * html/track/InbandWebVTTTextTrack.cpp: (WebCore::InbandWebVTTTextTrack::newCuesParsed): * html/track/TextTrack.cpp: (WebCore::TextTrack::addCue): (WebCore::TextTrack::hasCue): * html/track/TextTrack.h: (WebCore::TextTrack::startTimeVariance): * html/track/TextTrackCue.cpp: (WebCore::TextTrackCue::create): (WebCore::TextTrackCue::TextTrackCue): (WebCore::TextTrackCue::setStartTime): (WebCore::TextTrackCue::setEndTime): (WebCore::TextTrackCue::hasEquivalentStartTime): * html/track/TextTrackCue.h: (WebCore::TextTrackCue::startTime): (WebCore::TextTrackCue::endTime): * html/track/TextTrackCueGeneric.cpp: (WebCore::TextTrackCueGeneric::TextTrackCueGeneric): * html/track/TextTrackCueGeneric.h: * html/track/TextTrackCueList.cpp: (WebCore::TextTrackCueList::add): * html/track/VTTCue.cpp: (WebCore::VTTCue::VTTCue): (WebCore::VTTCue::markFutureAndPastNodes): (WebCore::VTTCue::updateDisplayTree): * html/track/VTTCue.h: (WebCore::VTTCue::create): * html/track/WebVTTParser.cpp: (WebCore::WebVTTParser::WebVTTParser): (WebCore::WebVTTParser::resetCueValues): (WebCore::WebVTTParser::collectTimeStamp): (WebCore::WebVTTTreeBuilder::constructTreeFromToken): * html/track/WebVTTParser.h: (WebCore::WebVTTCueData::startTime): (WebCore::WebVTTCueData::setStartTime): (WebCore::WebVTTCueData::endTime): (WebCore::WebVTTCueData::setEndTime): (WebCore::WebVTTCueData::WebVTTCueData): Deleted. * platform/graphics/InbandTextTrackPrivateClient.h: (WebCore::GenericCueData::startTime): (WebCore::GenericCueData::setStartTime): (WebCore::GenericCueData::endTime): (WebCore::GenericCueData::setEndTime): (WebCore::GenericCueData::GenericCueData): * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::duration): (WebCore::MediaPlayer::startTime): (WebCore::MediaPlayer::initialTime): (WebCore::MediaPlayer::currentTime): (WebCore::MediaPlayer::seekWithTolerance): (WebCore::MediaPlayer::seek): (WebCore::MediaPlayer::maxTimeSeekable): (WebCore::MediaPlayer::minTimeSeekable): (WebCore::MediaPlayer::mediaTimeForTimeValue): (WebCore::MediaPlayer::totalFrameDelay): * platform/graphics/MediaPlayer.h: * platform/graphics/MediaPlayerPrivate.h: (WebCore::MediaPlayerPrivateInterface::durationMediaTime): (WebCore::MediaPlayerPrivateInterface::currentMediaTime): (WebCore::MediaPlayerPrivateInterface::seek): (WebCore::MediaPlayerPrivateInterface::seekWithTolerance): (WebCore::MediaPlayerPrivateInterface::startTime): (WebCore::MediaPlayerPrivateInterface::initialTime): (WebCore::MediaPlayerPrivateInterface::seekable): (WebCore::MediaPlayerPrivateInterface::maxMediaTimeSeekable): (WebCore::MediaPlayerPrivateInterface::minMediaTimeSeekable): (WebCore::MediaPlayerPrivateInterface::mediaTimeForTimeValue): (WebCore::MediaPlayerPrivateInterface::totalFrameDelay): (WebCore::MediaPlayerPrivateInterface::startTimeDouble): Deleted. (WebCore::MediaPlayerPrivateInterface::maxTimeSeekableDouble): Deleted. (WebCore::MediaPlayerPrivateInterface::mediaTimeForTimeValueDouble): Deleted. * platform/graphics/MediaSourcePrivateClient.h: * platform/graphics/TrackPrivateBase.h: (WebCore::TrackPrivateBase::startTimeVariance): * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp: (WebCore::InbandMetadataTextTrackPrivateAVF::InbandMetadataTextTrackPrivateAVF): (WebCore::InbandMetadataTextTrackPrivateAVF::addDataCue): (WebCore::InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes): (WebCore::InbandMetadataTextTrackPrivateAVF::flushPartialCues): * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h: (WebCore::IncompleteMetaDataCue::IncompleteMetaDataCue): (WebCore::IncompleteMetaDataCue::startTime): * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: (WebCore::InbandTextTrackPrivateAVF::processCue): (WebCore::InbandTextTrackPrivateAVF::resetCueValues): * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.h: * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: (WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation): (WebCore::MediaPlayerPrivateAVFoundation::durationMediaTime): (WebCore::MediaPlayerPrivateAVFoundation::seek): (WebCore::MediaPlayerPrivateAVFoundation::seekWithTolerance): (WebCore::MediaPlayerPrivateAVFoundation::maxMediaTimeSeekable): (WebCore::MediaPlayerPrivateAVFoundation::minMediaTimeSeekable): (WebCore::MediaPlayerPrivateAVFoundation::maxTimeLoaded): (WebCore::MediaPlayerPrivateAVFoundation::didLoadingProgress): (WebCore::MediaPlayerPrivateAVFoundation::updateStates): (WebCore::MediaPlayerPrivateAVFoundation::loadedTimeRangesChanged): (WebCore::MediaPlayerPrivateAVFoundation::seekableTimeRangesChanged): (WebCore::MediaPlayerPrivateAVFoundation::timeChanged): (WebCore::MediaPlayerPrivateAVFoundation::didEnd): (WebCore::MediaPlayerPrivateAVFoundation::invalidateCachedDuration): (WebCore::MediaPlayerPrivateAVFoundation::scheduleMainThreadNotification): (WebCore::MediaPlayerPrivateAVFoundation::extraMemoryCost): (WebCore::MediaPlayerPrivateAVFoundation::duration): Deleted. (WebCore::MediaPlayerPrivateAVFoundation::maxTimeSeekableDouble): Deleted. (WebCore::MediaPlayerPrivateAVFoundation::minTimeSeekable): Deleted. * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h: (WebCore::MediaPlayerPrivateAVFoundation::Notification::Notification): (WebCore::MediaPlayerPrivateAVFoundation::Notification::time): * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: (WebCore::MediaPlayerPrivateAVFoundationCF::platformDuration): (WebCore::MediaPlayerPrivateAVFoundationCF::currentTime): (WebCore::MediaPlayerPrivateAVFoundationCF::seekToTime): (WebCore::MediaPlayerPrivateAVFoundationCF::platformDuration): (WebCore::MediaPlayerPrivateAVFoundationCF::currentTime): (WebCore::MediaPlayerPrivateAVFoundationCF::seekToTime): (WebCore::MediaPlayerPrivateAVFoundationCF::platformMinTimeSeekable): (WebCore::MediaPlayerPrivateAVFoundationCF::platformMaxTimeSeekable): (WebCore::MediaPlayerPrivateAVFoundationCF::platformMaxTimeLoaded): (WebCore::MediaPlayerPrivateAVFoundationCF::mediaTimeForTimeValue): Deleted. (WebCore::AVFWrapper::seekToTime): Deleted. (WebCore::LegibleOutputData::LegibleOutputData): Deleted. (WebCore::AVFWrapper::createImageForTimeInRect): Deleted. (WebCore::MediaPlayerPrivateAVFoundationCF::platformMinTimeSeekable): (WebCore::MediaPlayerPrivateAVFoundationCF::platformMaxTimeSeekable): (WebCore::MediaPlayerPrivateAVFoundationCF::platformMaxTimeLoaded): (WebCore::MediaPlayerPrivateAVFoundationCF::mediaTimeForTimeValue): Deleted. (WebCore::AVFWrapper::seekToTime): Deleted. (WebCore::LegibleOutputData::LegibleOutputData): Deleted. (WebCore::AVFWrapper::createImageForTimeInRect): Deleted. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC): (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad): (WebCore::MediaPlayerPrivateAVFoundationObjC::platformDuration): (WebCore::MediaPlayerPrivateAVFoundationObjC::currentMediaTime): (WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime): (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMinTimeSeekable): (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMaxTimeSeekable): (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMaxTimeLoaded): (WebCore::MediaPlayerPrivateAVFoundationObjC::mediaTimeForTimeValue): (WebCore::MediaPlayerPrivateAVFoundationObjC::processCue): (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive): (WebCore::MediaPlayerPrivateAVFoundationObjC::durationDidChange): (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]): (-[WebCoreAVFMovieObserver legibleOutput:didOutputAttributedStrings:nativeSampleBuffers:forItemTime:]): (WebCore::MediaPlayerPrivateAVFoundationObjC::currentTime): Deleted. * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationMediaTime): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::startTime): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::initialTime): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekable): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::maxMediaTimeSeekable): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::minMediaTimeSeekable): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::totalFrameDelay): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationDouble): Deleted. (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::currentTimeDouble): Deleted. (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::startTimeDouble): Deleted. (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::maxTimeSeekableDouble): Deleted. (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::minTimeSeekable): Deleted. * platform/graphics/avfoundation/objc/OutOfBandTextTrackPrivateAVF.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: * platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h: (WebCore::InbandMetadataTextTrackPrivateGStreamer::addDataCue): * platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h: (WebCore::InbandMetadataTextTrackPrivateGStreamer::addDataCue): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::processMpegTsSection): (WebCore::MediaPlayerPrivateGStreamer::processTableOfContentsEntry): (WebCore::MediaPlayerPrivateGStreamer::processMpegTsSection): (WebCore::MediaPlayerPrivateGStreamer::processTableOfContentsEntry): * platform/graphics/mac/MediaPlayerPrivateQTKit.h: * platform/graphics/mac/MediaPlayerPrivateQTKit.mm: * platform/graphics/mac/MediaPlayerPrivateQTKit.mm: (WebCore::maxValueForTimeRanges): (WebCore::MediaPlayerPrivateQTKit::MediaPlayerPrivateQTKit): (WebCore::MediaPlayerPrivateQTKit::durationMediaTime): (WebCore::MediaPlayerPrivateQTKit::currentMediaTime): (WebCore::MediaPlayerPrivateQTKit::seek): (WebCore::MediaPlayerPrivateQTKit::doSeek): (WebCore::MediaPlayerPrivateQTKit::cancelSeek): (WebCore::MediaPlayerPrivateQTKit::seekTimerFired): (WebCore::MediaPlayerPrivateQTKit::seeking): (WebCore::MediaPlayerPrivateQTKit::setPreservesPitch): (WebCore::MediaPlayerPrivateQTKit::buffered): (WebCore::MediaPlayerPrivateQTKit::maxMediaTimeSeekable): (WebCore::MediaPlayerPrivateQTKit::maxMediaTimeLoaded): (WebCore::MediaPlayerPrivateQTKit::didLoadingProgress): (WebCore::MediaPlayerPrivateQTKit::updateStates): (WebCore::MediaPlayerPrivateQTKit::timeChanged): (WebCore::MediaPlayerPrivateQTKit::didEnd): (WebCore::MediaPlayerPrivateQTKit::maxMediaTimeSeekable): (WebCore::MediaPlayerPrivateQTKit::maxMediaTimeLoaded): (WebCore::MediaPlayerPrivateQTKit::createQTTime): Deleted. (WebCore::MediaPlayerPrivateQTKit::duration): Deleted. (WebCore::MediaPlayerPrivateQTKit::currentTime): Deleted. (WebCore::MediaPlayerPrivateQTKit::maxTimeSeekable): Deleted. (WebCore::MediaPlayerPrivateQTKit::maxTimeLoaded): Deleted. (WebCore::MediaPlayerPrivateQTKit::mediaTimeForTimeValue): Deleted. * platform/mac/PlatformClockCM.mm: * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp: (WebCore::MockMediaPlayerMediaSource::maxMediaTimeSeekable): (WebCore::MockMediaPlayerMediaSource::currentMediaTime): (WebCore::MockMediaPlayerMediaSource::durationMediaTime): (WebCore::MockMediaPlayerMediaSource::seekWithTolerance): (WebCore::MockMediaPlayerMediaSource::totalFrameDelay): (WebCore::MockMediaPlayerMediaSource::maxTimeSeekableDouble): Deleted. (WebCore::MockMediaPlayerMediaSource::currentTimeDouble): Deleted. (WebCore::MockMediaPlayerMediaSource::durationDouble): Deleted. * platform/mock/mediasource/MockMediaPlayerMediaSource.h: * platform/mock/mediasource/MockMediaSourcePrivate.cpp: (WebCore::MockMediaSourcePrivate::MockMediaSourcePrivate): * platform/mock/mediasource/MockMediaSourcePrivate.h: * platform/mock/mediasource/MockSourceBufferPrivate.cpp: (WebCore::MockSourceBufferPrivate::enqueueSample): Source/WTF: Add a unary minus operator, and add unimplemented private casting operators, to make unintentional double->MediaTime and MediaTime->double casts hard errors. * wtf/MediaTime.cpp: (WTF::MediaTime::operator-): * wtf/MediaTime.h: LayoutTests: Update the http/media tests to use byte-ranges, and update our byte-range CGI script to return correct headers. Remove the platform expected results for media/video-seek-past-end-paused.html now that we pass. * http/tests/media/reload-after-dialog.html: * http/tests/media/video-error-abort.html: * http/tests/media/video-throttled-load.cgi: * platform/mac/media/video-seek-past-end-paused-expected.txt: Removed. * platform/mac/TestExpectations: Canonical link: https://commits.webkit.org/154380@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173318 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-09-05 18:38:59 +00:00
bool MediaTime::operator!() const
{
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
return (m_timeFlags == Valid && !m_timeValue)
|| (m_timeFlags == (Valid | DoubleValue) && !m_timeValueAsDouble)
|| isInvalid();
Refactoring: make MediaTime the primary time type for audiovisual times. https://bugs.webkit.org/show_bug.cgi?id=133579 Reviewed by Eric Carlson. Source/JavaScriptCore: Add a utility function which converts a MediaTime to a JSNumber. * runtime/JSCJSValue.h: (JSC::jsNumber): Source/WebCore: In order to limit the number of floating-point rounding errors for media systems which can make use of rational time objects. Add some convenience methods to convert between QTTime and MediaTime. * platform/graphics/mac/MediaTimeQTKit.h: Added. * platform/graphics/mac/MediaTimeQTKit.mm: Added. (WebCore::toMediaTime): (WebCore::toQTTime): Rename MediaTimeMac -> MediaTimeAVFoundation: * platform/graphics/avfoundation/MediaTimeAVFoundation.cpp: Renamed from Source/WebCore/platform/mac/MediaTimeMac.cpp. (WebCore::toMediaTime): (WebCore::toCMTime): * platform/graphics/avfoundation/MediaTimeAVFoundation.h: Renamed from Source/WebCore/platform/mac/MediaTimeMac.h. Use MediaTime instead of double: * Modules/mediasource/MediaSource.cpp: (WebCore::MediaSource::duration): (WebCore::MediaSource::currentTime): (WebCore::MediaSource::buffered): (WebCore::MediaSource::setDuration): (WebCore::MediaSource::activeRanges): * Modules/mediasource/MediaSource.h: * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::remove): (WebCore::SourceBuffer::removeCodedFrames): (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment): (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): (WebCore::SourceBuffer::hasCurrentTime): (WebCore::SourceBuffer::hasFutureTime): (WebCore::SourceBuffer::canPlayThrough): * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDataCueCustom.cpp: (WebCore::JSDataCueConstructor::constructJSDataCue): * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::HTMLMediaElement): (WebCore::HTMLMediaElement::parseAttribute): * html/HTMLMediaElement.h: (WebCore::ValueToString<MediaTime>::string): * html/MediaFragmentURIParser.cpp: (WebCore::MediaFragmentURIParser::MediaFragmentURIParser): (WebCore::MediaFragmentURIParser::startTime): (WebCore::MediaFragmentURIParser::endTime): (WebCore::MediaFragmentURIParser::parseTimeFragment): (WebCore::MediaFragmentURIParser::parseNPTFragment): (WebCore::MediaFragmentURIParser::parseNPTTime): (WebCore::MediaFragmentURIParser::invalidTimeValue): Deleted. * html/MediaFragmentURIParser.h: * html/TimeRanges.h: (WebCore::TimeRanges::ranges): * html/track/DataCue.cpp: (WebCore::DataCue::DataCue): * html/track/DataCue.h: (WebCore::DataCue::create): * html/track/InbandDataTextTrack.cpp: (WebCore::InbandDataTextTrack::addDataCue): (WebCore::InbandDataTextTrack::updateDataCue): (WebCore::InbandDataTextTrack::removeDataCue): * html/track/InbandDataTextTrack.h: * html/track/InbandGenericTextTrack.cpp: (WebCore::InbandGenericTextTrack::updateCueFromCueData): (WebCore::InbandGenericTextTrack::addGenericCue): (WebCore::InbandGenericTextTrack::removeGenericCue): * html/track/InbandTextTrack.cpp: (WebCore::InbandTextTrack::startTimeVariance): * html/track/InbandTextTrack.h: * html/track/InbandWebVTTTextTrack.cpp: (WebCore::InbandWebVTTTextTrack::newCuesParsed): * html/track/TextTrack.cpp: (WebCore::TextTrack::addCue): (WebCore::TextTrack::hasCue): * html/track/TextTrack.h: (WebCore::TextTrack::startTimeVariance): * html/track/TextTrackCue.cpp: (WebCore::TextTrackCue::create): (WebCore::TextTrackCue::TextTrackCue): (WebCore::TextTrackCue::setStartTime): (WebCore::TextTrackCue::setEndTime): (WebCore::TextTrackCue::hasEquivalentStartTime): * html/track/TextTrackCue.h: (WebCore::TextTrackCue::startTime): (WebCore::TextTrackCue::endTime): * html/track/TextTrackCueGeneric.cpp: (WebCore::TextTrackCueGeneric::TextTrackCueGeneric): * html/track/TextTrackCueGeneric.h: * html/track/TextTrackCueList.cpp: (WebCore::TextTrackCueList::add): * html/track/VTTCue.cpp: (WebCore::VTTCue::VTTCue): (WebCore::VTTCue::markFutureAndPastNodes): (WebCore::VTTCue::updateDisplayTree): * html/track/VTTCue.h: (WebCore::VTTCue::create): * html/track/WebVTTParser.cpp: (WebCore::WebVTTParser::WebVTTParser): (WebCore::WebVTTParser::resetCueValues): (WebCore::WebVTTParser::collectTimeStamp): (WebCore::WebVTTTreeBuilder::constructTreeFromToken): * html/track/WebVTTParser.h: (WebCore::WebVTTCueData::startTime): (WebCore::WebVTTCueData::setStartTime): (WebCore::WebVTTCueData::endTime): (WebCore::WebVTTCueData::setEndTime): (WebCore::WebVTTCueData::WebVTTCueData): Deleted. * platform/graphics/InbandTextTrackPrivateClient.h: (WebCore::GenericCueData::startTime): (WebCore::GenericCueData::setStartTime): (WebCore::GenericCueData::endTime): (WebCore::GenericCueData::setEndTime): (WebCore::GenericCueData::GenericCueData): * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::duration): (WebCore::MediaPlayer::startTime): (WebCore::MediaPlayer::initialTime): (WebCore::MediaPlayer::currentTime): (WebCore::MediaPlayer::seekWithTolerance): (WebCore::MediaPlayer::seek): (WebCore::MediaPlayer::maxTimeSeekable): (WebCore::MediaPlayer::minTimeSeekable): (WebCore::MediaPlayer::mediaTimeForTimeValue): (WebCore::MediaPlayer::totalFrameDelay): * platform/graphics/MediaPlayer.h: * platform/graphics/MediaPlayerPrivate.h: (WebCore::MediaPlayerPrivateInterface::durationMediaTime): (WebCore::MediaPlayerPrivateInterface::currentMediaTime): (WebCore::MediaPlayerPrivateInterface::seek): (WebCore::MediaPlayerPrivateInterface::seekWithTolerance): (WebCore::MediaPlayerPrivateInterface::startTime): (WebCore::MediaPlayerPrivateInterface::initialTime): (WebCore::MediaPlayerPrivateInterface::seekable): (WebCore::MediaPlayerPrivateInterface::maxMediaTimeSeekable): (WebCore::MediaPlayerPrivateInterface::minMediaTimeSeekable): (WebCore::MediaPlayerPrivateInterface::mediaTimeForTimeValue): (WebCore::MediaPlayerPrivateInterface::totalFrameDelay): (WebCore::MediaPlayerPrivateInterface::startTimeDouble): Deleted. (WebCore::MediaPlayerPrivateInterface::maxTimeSeekableDouble): Deleted. (WebCore::MediaPlayerPrivateInterface::mediaTimeForTimeValueDouble): Deleted. * platform/graphics/MediaSourcePrivateClient.h: * platform/graphics/TrackPrivateBase.h: (WebCore::TrackPrivateBase::startTimeVariance): * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp: (WebCore::InbandMetadataTextTrackPrivateAVF::InbandMetadataTextTrackPrivateAVF): (WebCore::InbandMetadataTextTrackPrivateAVF::addDataCue): (WebCore::InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes): (WebCore::InbandMetadataTextTrackPrivateAVF::flushPartialCues): * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h: (WebCore::IncompleteMetaDataCue::IncompleteMetaDataCue): (WebCore::IncompleteMetaDataCue::startTime): * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: (WebCore::InbandTextTrackPrivateAVF::processCue): (WebCore::InbandTextTrackPrivateAVF::resetCueValues): * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.h: * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: (WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation): (WebCore::MediaPlayerPrivateAVFoundation::durationMediaTime): (WebCore::MediaPlayerPrivateAVFoundation::seek): (WebCore::MediaPlayerPrivateAVFoundation::seekWithTolerance): (WebCore::MediaPlayerPrivateAVFoundation::maxMediaTimeSeekable): (WebCore::MediaPlayerPrivateAVFoundation::minMediaTimeSeekable): (WebCore::MediaPlayerPrivateAVFoundation::maxTimeLoaded): (WebCore::MediaPlayerPrivateAVFoundation::didLoadingProgress): (WebCore::MediaPlayerPrivateAVFoundation::updateStates): (WebCore::MediaPlayerPrivateAVFoundation::loadedTimeRangesChanged): (WebCore::MediaPlayerPrivateAVFoundation::seekableTimeRangesChanged): (WebCore::MediaPlayerPrivateAVFoundation::timeChanged): (WebCore::MediaPlayerPrivateAVFoundation::didEnd): (WebCore::MediaPlayerPrivateAVFoundation::invalidateCachedDuration): (WebCore::MediaPlayerPrivateAVFoundation::scheduleMainThreadNotification): (WebCore::MediaPlayerPrivateAVFoundation::extraMemoryCost): (WebCore::MediaPlayerPrivateAVFoundation::duration): Deleted. (WebCore::MediaPlayerPrivateAVFoundation::maxTimeSeekableDouble): Deleted. (WebCore::MediaPlayerPrivateAVFoundation::minTimeSeekable): Deleted. * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h: (WebCore::MediaPlayerPrivateAVFoundation::Notification::Notification): (WebCore::MediaPlayerPrivateAVFoundation::Notification::time): * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: (WebCore::MediaPlayerPrivateAVFoundationCF::platformDuration): (WebCore::MediaPlayerPrivateAVFoundationCF::currentTime): (WebCore::MediaPlayerPrivateAVFoundationCF::seekToTime): (WebCore::MediaPlayerPrivateAVFoundationCF::platformDuration): (WebCore::MediaPlayerPrivateAVFoundationCF::currentTime): (WebCore::MediaPlayerPrivateAVFoundationCF::seekToTime): (WebCore::MediaPlayerPrivateAVFoundationCF::platformMinTimeSeekable): (WebCore::MediaPlayerPrivateAVFoundationCF::platformMaxTimeSeekable): (WebCore::MediaPlayerPrivateAVFoundationCF::platformMaxTimeLoaded): (WebCore::MediaPlayerPrivateAVFoundationCF::mediaTimeForTimeValue): Deleted. (WebCore::AVFWrapper::seekToTime): Deleted. (WebCore::LegibleOutputData::LegibleOutputData): Deleted. (WebCore::AVFWrapper::createImageForTimeInRect): Deleted. (WebCore::MediaPlayerPrivateAVFoundationCF::platformMinTimeSeekable): (WebCore::MediaPlayerPrivateAVFoundationCF::platformMaxTimeSeekable): (WebCore::MediaPlayerPrivateAVFoundationCF::platformMaxTimeLoaded): (WebCore::MediaPlayerPrivateAVFoundationCF::mediaTimeForTimeValue): Deleted. (WebCore::AVFWrapper::seekToTime): Deleted. (WebCore::LegibleOutputData::LegibleOutputData): Deleted. (WebCore::AVFWrapper::createImageForTimeInRect): Deleted. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC): (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad): (WebCore::MediaPlayerPrivateAVFoundationObjC::platformDuration): (WebCore::MediaPlayerPrivateAVFoundationObjC::currentMediaTime): (WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime): (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMinTimeSeekable): (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMaxTimeSeekable): (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMaxTimeLoaded): (WebCore::MediaPlayerPrivateAVFoundationObjC::mediaTimeForTimeValue): (WebCore::MediaPlayerPrivateAVFoundationObjC::processCue): (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive): (WebCore::MediaPlayerPrivateAVFoundationObjC::durationDidChange): (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]): (-[WebCoreAVFMovieObserver legibleOutput:didOutputAttributedStrings:nativeSampleBuffers:forItemTime:]): (WebCore::MediaPlayerPrivateAVFoundationObjC::currentTime): Deleted. * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationMediaTime): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::startTime): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::initialTime): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekable): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::maxMediaTimeSeekable): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::minMediaTimeSeekable): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::totalFrameDelay): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationDouble): Deleted. (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::currentTimeDouble): Deleted. (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::startTimeDouble): Deleted. (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::maxTimeSeekableDouble): Deleted. (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::minTimeSeekable): Deleted. * platform/graphics/avfoundation/objc/OutOfBandTextTrackPrivateAVF.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: * platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h: (WebCore::InbandMetadataTextTrackPrivateGStreamer::addDataCue): * platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h: (WebCore::InbandMetadataTextTrackPrivateGStreamer::addDataCue): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::processMpegTsSection): (WebCore::MediaPlayerPrivateGStreamer::processTableOfContentsEntry): (WebCore::MediaPlayerPrivateGStreamer::processMpegTsSection): (WebCore::MediaPlayerPrivateGStreamer::processTableOfContentsEntry): * platform/graphics/mac/MediaPlayerPrivateQTKit.h: * platform/graphics/mac/MediaPlayerPrivateQTKit.mm: * platform/graphics/mac/MediaPlayerPrivateQTKit.mm: (WebCore::maxValueForTimeRanges): (WebCore::MediaPlayerPrivateQTKit::MediaPlayerPrivateQTKit): (WebCore::MediaPlayerPrivateQTKit::durationMediaTime): (WebCore::MediaPlayerPrivateQTKit::currentMediaTime): (WebCore::MediaPlayerPrivateQTKit::seek): (WebCore::MediaPlayerPrivateQTKit::doSeek): (WebCore::MediaPlayerPrivateQTKit::cancelSeek): (WebCore::MediaPlayerPrivateQTKit::seekTimerFired): (WebCore::MediaPlayerPrivateQTKit::seeking): (WebCore::MediaPlayerPrivateQTKit::setPreservesPitch): (WebCore::MediaPlayerPrivateQTKit::buffered): (WebCore::MediaPlayerPrivateQTKit::maxMediaTimeSeekable): (WebCore::MediaPlayerPrivateQTKit::maxMediaTimeLoaded): (WebCore::MediaPlayerPrivateQTKit::didLoadingProgress): (WebCore::MediaPlayerPrivateQTKit::updateStates): (WebCore::MediaPlayerPrivateQTKit::timeChanged): (WebCore::MediaPlayerPrivateQTKit::didEnd): (WebCore::MediaPlayerPrivateQTKit::maxMediaTimeSeekable): (WebCore::MediaPlayerPrivateQTKit::maxMediaTimeLoaded): (WebCore::MediaPlayerPrivateQTKit::createQTTime): Deleted. (WebCore::MediaPlayerPrivateQTKit::duration): Deleted. (WebCore::MediaPlayerPrivateQTKit::currentTime): Deleted. (WebCore::MediaPlayerPrivateQTKit::maxTimeSeekable): Deleted. (WebCore::MediaPlayerPrivateQTKit::maxTimeLoaded): Deleted. (WebCore::MediaPlayerPrivateQTKit::mediaTimeForTimeValue): Deleted. * platform/mac/PlatformClockCM.mm: * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp: (WebCore::MockMediaPlayerMediaSource::maxMediaTimeSeekable): (WebCore::MockMediaPlayerMediaSource::currentMediaTime): (WebCore::MockMediaPlayerMediaSource::durationMediaTime): (WebCore::MockMediaPlayerMediaSource::seekWithTolerance): (WebCore::MockMediaPlayerMediaSource::totalFrameDelay): (WebCore::MockMediaPlayerMediaSource::maxTimeSeekableDouble): Deleted. (WebCore::MockMediaPlayerMediaSource::currentTimeDouble): Deleted. (WebCore::MockMediaPlayerMediaSource::durationDouble): Deleted. * platform/mock/mediasource/MockMediaPlayerMediaSource.h: * platform/mock/mediasource/MockMediaSourcePrivate.cpp: (WebCore::MockMediaSourcePrivate::MockMediaSourcePrivate): * platform/mock/mediasource/MockMediaSourcePrivate.h: * platform/mock/mediasource/MockSourceBufferPrivate.cpp: (WebCore::MockSourceBufferPrivate::enqueueSample): Source/WTF: Add a unary minus operator, and add unimplemented private casting operators, to make unintentional double->MediaTime and MediaTime->double casts hard errors. * wtf/MediaTime.cpp: (WTF::MediaTime::operator-): * wtf/MediaTime.h: LayoutTests: Update the http/media tests to use byte-ranges, and update our byte-range CGI script to return correct headers. Remove the platform expected results for media/video-seek-past-end-paused.html now that we pass. * http/tests/media/reload-after-dialog.html: * http/tests/media/video-error-abort.html: * http/tests/media/video-throttled-load.cgi: * platform/mac/media/video-seek-past-end-paused-expected.txt: Removed. * platform/mac/TestExpectations: Canonical link: https://commits.webkit.org/154380@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173318 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-09-05 18:38:59 +00:00
}
MediaTime::operator bool() const
{
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
return !(m_timeFlags == Valid && !m_timeValue)
&& !(m_timeFlags == (Valid | DoubleValue) && !m_timeValueAsDouble)
&& !isInvalid();
Refactoring: make MediaTime the primary time type for audiovisual times. https://bugs.webkit.org/show_bug.cgi?id=133579 Reviewed by Eric Carlson. Source/JavaScriptCore: Add a utility function which converts a MediaTime to a JSNumber. * runtime/JSCJSValue.h: (JSC::jsNumber): Source/WebCore: In order to limit the number of floating-point rounding errors for media systems which can make use of rational time objects. Add some convenience methods to convert between QTTime and MediaTime. * platform/graphics/mac/MediaTimeQTKit.h: Added. * platform/graphics/mac/MediaTimeQTKit.mm: Added. (WebCore::toMediaTime): (WebCore::toQTTime): Rename MediaTimeMac -> MediaTimeAVFoundation: * platform/graphics/avfoundation/MediaTimeAVFoundation.cpp: Renamed from Source/WebCore/platform/mac/MediaTimeMac.cpp. (WebCore::toMediaTime): (WebCore::toCMTime): * platform/graphics/avfoundation/MediaTimeAVFoundation.h: Renamed from Source/WebCore/platform/mac/MediaTimeMac.h. Use MediaTime instead of double: * Modules/mediasource/MediaSource.cpp: (WebCore::MediaSource::duration): (WebCore::MediaSource::currentTime): (WebCore::MediaSource::buffered): (WebCore::MediaSource::setDuration): (WebCore::MediaSource::activeRanges): * Modules/mediasource/MediaSource.h: * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::remove): (WebCore::SourceBuffer::removeCodedFrames): (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment): (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): (WebCore::SourceBuffer::hasCurrentTime): (WebCore::SourceBuffer::hasFutureTime): (WebCore::SourceBuffer::canPlayThrough): * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDataCueCustom.cpp: (WebCore::JSDataCueConstructor::constructJSDataCue): * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::HTMLMediaElement): (WebCore::HTMLMediaElement::parseAttribute): * html/HTMLMediaElement.h: (WebCore::ValueToString<MediaTime>::string): * html/MediaFragmentURIParser.cpp: (WebCore::MediaFragmentURIParser::MediaFragmentURIParser): (WebCore::MediaFragmentURIParser::startTime): (WebCore::MediaFragmentURIParser::endTime): (WebCore::MediaFragmentURIParser::parseTimeFragment): (WebCore::MediaFragmentURIParser::parseNPTFragment): (WebCore::MediaFragmentURIParser::parseNPTTime): (WebCore::MediaFragmentURIParser::invalidTimeValue): Deleted. * html/MediaFragmentURIParser.h: * html/TimeRanges.h: (WebCore::TimeRanges::ranges): * html/track/DataCue.cpp: (WebCore::DataCue::DataCue): * html/track/DataCue.h: (WebCore::DataCue::create): * html/track/InbandDataTextTrack.cpp: (WebCore::InbandDataTextTrack::addDataCue): (WebCore::InbandDataTextTrack::updateDataCue): (WebCore::InbandDataTextTrack::removeDataCue): * html/track/InbandDataTextTrack.h: * html/track/InbandGenericTextTrack.cpp: (WebCore::InbandGenericTextTrack::updateCueFromCueData): (WebCore::InbandGenericTextTrack::addGenericCue): (WebCore::InbandGenericTextTrack::removeGenericCue): * html/track/InbandTextTrack.cpp: (WebCore::InbandTextTrack::startTimeVariance): * html/track/InbandTextTrack.h: * html/track/InbandWebVTTTextTrack.cpp: (WebCore::InbandWebVTTTextTrack::newCuesParsed): * html/track/TextTrack.cpp: (WebCore::TextTrack::addCue): (WebCore::TextTrack::hasCue): * html/track/TextTrack.h: (WebCore::TextTrack::startTimeVariance): * html/track/TextTrackCue.cpp: (WebCore::TextTrackCue::create): (WebCore::TextTrackCue::TextTrackCue): (WebCore::TextTrackCue::setStartTime): (WebCore::TextTrackCue::setEndTime): (WebCore::TextTrackCue::hasEquivalentStartTime): * html/track/TextTrackCue.h: (WebCore::TextTrackCue::startTime): (WebCore::TextTrackCue::endTime): * html/track/TextTrackCueGeneric.cpp: (WebCore::TextTrackCueGeneric::TextTrackCueGeneric): * html/track/TextTrackCueGeneric.h: * html/track/TextTrackCueList.cpp: (WebCore::TextTrackCueList::add): * html/track/VTTCue.cpp: (WebCore::VTTCue::VTTCue): (WebCore::VTTCue::markFutureAndPastNodes): (WebCore::VTTCue::updateDisplayTree): * html/track/VTTCue.h: (WebCore::VTTCue::create): * html/track/WebVTTParser.cpp: (WebCore::WebVTTParser::WebVTTParser): (WebCore::WebVTTParser::resetCueValues): (WebCore::WebVTTParser::collectTimeStamp): (WebCore::WebVTTTreeBuilder::constructTreeFromToken): * html/track/WebVTTParser.h: (WebCore::WebVTTCueData::startTime): (WebCore::WebVTTCueData::setStartTime): (WebCore::WebVTTCueData::endTime): (WebCore::WebVTTCueData::setEndTime): (WebCore::WebVTTCueData::WebVTTCueData): Deleted. * platform/graphics/InbandTextTrackPrivateClient.h: (WebCore::GenericCueData::startTime): (WebCore::GenericCueData::setStartTime): (WebCore::GenericCueData::endTime): (WebCore::GenericCueData::setEndTime): (WebCore::GenericCueData::GenericCueData): * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::duration): (WebCore::MediaPlayer::startTime): (WebCore::MediaPlayer::initialTime): (WebCore::MediaPlayer::currentTime): (WebCore::MediaPlayer::seekWithTolerance): (WebCore::MediaPlayer::seek): (WebCore::MediaPlayer::maxTimeSeekable): (WebCore::MediaPlayer::minTimeSeekable): (WebCore::MediaPlayer::mediaTimeForTimeValue): (WebCore::MediaPlayer::totalFrameDelay): * platform/graphics/MediaPlayer.h: * platform/graphics/MediaPlayerPrivate.h: (WebCore::MediaPlayerPrivateInterface::durationMediaTime): (WebCore::MediaPlayerPrivateInterface::currentMediaTime): (WebCore::MediaPlayerPrivateInterface::seek): (WebCore::MediaPlayerPrivateInterface::seekWithTolerance): (WebCore::MediaPlayerPrivateInterface::startTime): (WebCore::MediaPlayerPrivateInterface::initialTime): (WebCore::MediaPlayerPrivateInterface::seekable): (WebCore::MediaPlayerPrivateInterface::maxMediaTimeSeekable): (WebCore::MediaPlayerPrivateInterface::minMediaTimeSeekable): (WebCore::MediaPlayerPrivateInterface::mediaTimeForTimeValue): (WebCore::MediaPlayerPrivateInterface::totalFrameDelay): (WebCore::MediaPlayerPrivateInterface::startTimeDouble): Deleted. (WebCore::MediaPlayerPrivateInterface::maxTimeSeekableDouble): Deleted. (WebCore::MediaPlayerPrivateInterface::mediaTimeForTimeValueDouble): Deleted. * platform/graphics/MediaSourcePrivateClient.h: * platform/graphics/TrackPrivateBase.h: (WebCore::TrackPrivateBase::startTimeVariance): * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp: (WebCore::InbandMetadataTextTrackPrivateAVF::InbandMetadataTextTrackPrivateAVF): (WebCore::InbandMetadataTextTrackPrivateAVF::addDataCue): (WebCore::InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes): (WebCore::InbandMetadataTextTrackPrivateAVF::flushPartialCues): * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h: (WebCore::IncompleteMetaDataCue::IncompleteMetaDataCue): (WebCore::IncompleteMetaDataCue::startTime): * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: (WebCore::InbandTextTrackPrivateAVF::processCue): (WebCore::InbandTextTrackPrivateAVF::resetCueValues): * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.h: * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: (WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation): (WebCore::MediaPlayerPrivateAVFoundation::durationMediaTime): (WebCore::MediaPlayerPrivateAVFoundation::seek): (WebCore::MediaPlayerPrivateAVFoundation::seekWithTolerance): (WebCore::MediaPlayerPrivateAVFoundation::maxMediaTimeSeekable): (WebCore::MediaPlayerPrivateAVFoundation::minMediaTimeSeekable): (WebCore::MediaPlayerPrivateAVFoundation::maxTimeLoaded): (WebCore::MediaPlayerPrivateAVFoundation::didLoadingProgress): (WebCore::MediaPlayerPrivateAVFoundation::updateStates): (WebCore::MediaPlayerPrivateAVFoundation::loadedTimeRangesChanged): (WebCore::MediaPlayerPrivateAVFoundation::seekableTimeRangesChanged): (WebCore::MediaPlayerPrivateAVFoundation::timeChanged): (WebCore::MediaPlayerPrivateAVFoundation::didEnd): (WebCore::MediaPlayerPrivateAVFoundation::invalidateCachedDuration): (WebCore::MediaPlayerPrivateAVFoundation::scheduleMainThreadNotification): (WebCore::MediaPlayerPrivateAVFoundation::extraMemoryCost): (WebCore::MediaPlayerPrivateAVFoundation::duration): Deleted. (WebCore::MediaPlayerPrivateAVFoundation::maxTimeSeekableDouble): Deleted. (WebCore::MediaPlayerPrivateAVFoundation::minTimeSeekable): Deleted. * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h: (WebCore::MediaPlayerPrivateAVFoundation::Notification::Notification): (WebCore::MediaPlayerPrivateAVFoundation::Notification::time): * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: (WebCore::MediaPlayerPrivateAVFoundationCF::platformDuration): (WebCore::MediaPlayerPrivateAVFoundationCF::currentTime): (WebCore::MediaPlayerPrivateAVFoundationCF::seekToTime): (WebCore::MediaPlayerPrivateAVFoundationCF::platformDuration): (WebCore::MediaPlayerPrivateAVFoundationCF::currentTime): (WebCore::MediaPlayerPrivateAVFoundationCF::seekToTime): (WebCore::MediaPlayerPrivateAVFoundationCF::platformMinTimeSeekable): (WebCore::MediaPlayerPrivateAVFoundationCF::platformMaxTimeSeekable): (WebCore::MediaPlayerPrivateAVFoundationCF::platformMaxTimeLoaded): (WebCore::MediaPlayerPrivateAVFoundationCF::mediaTimeForTimeValue): Deleted. (WebCore::AVFWrapper::seekToTime): Deleted. (WebCore::LegibleOutputData::LegibleOutputData): Deleted. (WebCore::AVFWrapper::createImageForTimeInRect): Deleted. (WebCore::MediaPlayerPrivateAVFoundationCF::platformMinTimeSeekable): (WebCore::MediaPlayerPrivateAVFoundationCF::platformMaxTimeSeekable): (WebCore::MediaPlayerPrivateAVFoundationCF::platformMaxTimeLoaded): (WebCore::MediaPlayerPrivateAVFoundationCF::mediaTimeForTimeValue): Deleted. (WebCore::AVFWrapper::seekToTime): Deleted. (WebCore::LegibleOutputData::LegibleOutputData): Deleted. (WebCore::AVFWrapper::createImageForTimeInRect): Deleted. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC): (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad): (WebCore::MediaPlayerPrivateAVFoundationObjC::platformDuration): (WebCore::MediaPlayerPrivateAVFoundationObjC::currentMediaTime): (WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime): (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMinTimeSeekable): (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMaxTimeSeekable): (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMaxTimeLoaded): (WebCore::MediaPlayerPrivateAVFoundationObjC::mediaTimeForTimeValue): (WebCore::MediaPlayerPrivateAVFoundationObjC::processCue): (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive): (WebCore::MediaPlayerPrivateAVFoundationObjC::durationDidChange): (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]): (-[WebCoreAVFMovieObserver legibleOutput:didOutputAttributedStrings:nativeSampleBuffers:forItemTime:]): (WebCore::MediaPlayerPrivateAVFoundationObjC::currentTime): Deleted. * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationMediaTime): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::startTime): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::initialTime): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekable): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::maxMediaTimeSeekable): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::minMediaTimeSeekable): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::totalFrameDelay): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationDouble): Deleted. (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::currentTimeDouble): Deleted. (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::startTimeDouble): Deleted. (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::maxTimeSeekableDouble): Deleted. (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::minTimeSeekable): Deleted. * platform/graphics/avfoundation/objc/OutOfBandTextTrackPrivateAVF.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: * platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h: (WebCore::InbandMetadataTextTrackPrivateGStreamer::addDataCue): * platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h: (WebCore::InbandMetadataTextTrackPrivateGStreamer::addDataCue): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::processMpegTsSection): (WebCore::MediaPlayerPrivateGStreamer::processTableOfContentsEntry): (WebCore::MediaPlayerPrivateGStreamer::processMpegTsSection): (WebCore::MediaPlayerPrivateGStreamer::processTableOfContentsEntry): * platform/graphics/mac/MediaPlayerPrivateQTKit.h: * platform/graphics/mac/MediaPlayerPrivateQTKit.mm: * platform/graphics/mac/MediaPlayerPrivateQTKit.mm: (WebCore::maxValueForTimeRanges): (WebCore::MediaPlayerPrivateQTKit::MediaPlayerPrivateQTKit): (WebCore::MediaPlayerPrivateQTKit::durationMediaTime): (WebCore::MediaPlayerPrivateQTKit::currentMediaTime): (WebCore::MediaPlayerPrivateQTKit::seek): (WebCore::MediaPlayerPrivateQTKit::doSeek): (WebCore::MediaPlayerPrivateQTKit::cancelSeek): (WebCore::MediaPlayerPrivateQTKit::seekTimerFired): (WebCore::MediaPlayerPrivateQTKit::seeking): (WebCore::MediaPlayerPrivateQTKit::setPreservesPitch): (WebCore::MediaPlayerPrivateQTKit::buffered): (WebCore::MediaPlayerPrivateQTKit::maxMediaTimeSeekable): (WebCore::MediaPlayerPrivateQTKit::maxMediaTimeLoaded): (WebCore::MediaPlayerPrivateQTKit::didLoadingProgress): (WebCore::MediaPlayerPrivateQTKit::updateStates): (WebCore::MediaPlayerPrivateQTKit::timeChanged): (WebCore::MediaPlayerPrivateQTKit::didEnd): (WebCore::MediaPlayerPrivateQTKit::maxMediaTimeSeekable): (WebCore::MediaPlayerPrivateQTKit::maxMediaTimeLoaded): (WebCore::MediaPlayerPrivateQTKit::createQTTime): Deleted. (WebCore::MediaPlayerPrivateQTKit::duration): Deleted. (WebCore::MediaPlayerPrivateQTKit::currentTime): Deleted. (WebCore::MediaPlayerPrivateQTKit::maxTimeSeekable): Deleted. (WebCore::MediaPlayerPrivateQTKit::maxTimeLoaded): Deleted. (WebCore::MediaPlayerPrivateQTKit::mediaTimeForTimeValue): Deleted. * platform/mac/PlatformClockCM.mm: * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp: (WebCore::MockMediaPlayerMediaSource::maxMediaTimeSeekable): (WebCore::MockMediaPlayerMediaSource::currentMediaTime): (WebCore::MockMediaPlayerMediaSource::durationMediaTime): (WebCore::MockMediaPlayerMediaSource::seekWithTolerance): (WebCore::MockMediaPlayerMediaSource::totalFrameDelay): (WebCore::MockMediaPlayerMediaSource::maxTimeSeekableDouble): Deleted. (WebCore::MockMediaPlayerMediaSource::currentTimeDouble): Deleted. (WebCore::MockMediaPlayerMediaSource::durationDouble): Deleted. * platform/mock/mediasource/MockMediaPlayerMediaSource.h: * platform/mock/mediasource/MockMediaSourcePrivate.cpp: (WebCore::MockMediaSourcePrivate::MockMediaSourcePrivate): * platform/mock/mediasource/MockMediaSourcePrivate.h: * platform/mock/mediasource/MockSourceBufferPrivate.cpp: (WebCore::MockSourceBufferPrivate::enqueueSample): Source/WTF: Add a unary minus operator, and add unimplemented private casting operators, to make unintentional double->MediaTime and MediaTime->double casts hard errors. * wtf/MediaTime.cpp: (WTF::MediaTime::operator-): * wtf/MediaTime.h: LayoutTests: Update the http/media tests to use byte-ranges, and update our byte-range CGI script to return correct headers. Remove the platform expected results for media/video-seek-past-end-paused.html now that we pass. * http/tests/media/reload-after-dialog.html: * http/tests/media/video-error-abort.html: * http/tests/media/video-throttled-load.cgi: * platform/mac/media/video-seek-past-end-paused-expected.txt: Removed. * platform/mac/TestExpectations: Canonical link: https://commits.webkit.org/154380@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173318 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-09-05 18:38:59 +00:00
}
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
MediaTime::ComparisonFlags MediaTime::compare(const MediaTime& rhs) const
{
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
auto andFlags = m_timeFlags & rhs.m_timeFlags;
if (andFlags & (PositiveInfinite | NegativeInfinite | Indefinite))
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
return EqualTo;
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
auto orFlags = m_timeFlags | rhs.m_timeFlags;
if (!(orFlags & Valid))
return EqualTo;
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
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
if (!(andFlags & Valid))
return isInvalid() ? GreaterThan : LessThan;
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
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
if (orFlags & NegativeInfinite)
return isNegativeInfinite() ? LessThan : GreaterThan;
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
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
if (orFlags & PositiveInfinite)
return isPositiveInfinite() ? GreaterThan : LessThan;
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
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
if (orFlags & Indefinite)
return isIndefinite() ? GreaterThan : LessThan;
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
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
if (andFlags & DoubleValue) {
[WTF] MediaTime should support round-tripping from and to doubles. https://bugs.webkit.org/show_bug.cgi?id=139248 Reviewed by Eric Carlson. Source/WebCore: Check whether the MediaTime's underlying data is floating point before converting to a CMTime or QTTime. * platform/graphics/avfoundation/MediaTimeAVFoundation.cpp: (WebCore::toCMTime): * platform/graphics/mac/MediaTimeQTKit.mm: (WebCore::toQTTime): Source/WTF: MediaTimes should be able to return precisely the same double value as was used when the MediaTime was created, so long as that MediaTime was not modified in a non-destructive way. This will allow API which accepts floating-point values to return the exact same value when asked, but still be able to store that value as a MediaTime. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): Added; store the floating-point value in a union. (WTF::MediaTime::createWithDouble): Ditto. (WTF::MediaTime::toFloat): If the value is a double, just return it. (WTF::MediaTime::toDouble): Ditto. (WTF::MediaTime::operator+): Special case when one or both sides are doubles. (WTF::MediaTime::operator-): Ditto. (WTF::MediaTime::operator*): Ditto. (WTF::MediaTime::compare): Ditto. (WTF::abs): Ditto. (WTF::MediaTime::setTimeScale): Convert the MediaTime from a double. Tools: Add API tests for new features of MediaTime. Update the LLDB python provider to correctly display the MediaTimes after this change. * TestWebKitAPI/Tests/WTF/MediaTime.cpp: (WTF::operator<<): (TestWebKitAPI::TEST): * lldb/lldb_webkit.py: (WTFMediaTime_SummaryProvider): (WTFMediaTimeProvider.timeValueAsDouble): (WTFMediaTimeProvider.isIndefinite): (WTFMediaTimeProvider): (WTFMediaTimeProvider.hasDoubleValue): Canonical link: https://commits.webkit.org/157162@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@176863 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-12-05 20:51:02 +00:00
if (m_timeValueAsDouble == rhs.m_timeValueAsDouble)
return EqualTo;
return m_timeValueAsDouble < rhs.m_timeValueAsDouble ? LessThan : GreaterThan;
}
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
if (orFlags & DoubleValue) {
double a = toDouble();
double b = rhs.toDouble();
if (a > b)
return GreaterThan;
if (a < b)
return LessThan;
return EqualTo;
}
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
if ((m_timeValue < 0) != (rhs.m_timeValue < 0))
return m_timeValue < 0 ? LessThan : GreaterThan;
if (!m_timeValue && !rhs.m_timeValue)
return EqualTo;
if (m_timeScale == rhs.m_timeScale) {
if (m_timeValue == rhs.m_timeValue)
return EqualTo;
return m_timeValue < rhs.m_timeValue ? LessThan : GreaterThan;
}
if (m_timeValue == rhs.m_timeValue)
return m_timeScale < rhs.m_timeScale ? GreaterThan : LessThan;
if (m_timeValue >= 0) {
if (m_timeValue < rhs.m_timeValue && m_timeScale > rhs.m_timeScale)
return LessThan;
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
if (m_timeValue > rhs.m_timeValue && m_timeScale < rhs.m_timeScale)
return GreaterThan;
} else {
if (m_timeValue < rhs.m_timeValue && m_timeScale < rhs.m_timeScale)
return LessThan;
if (m_timeValue > rhs.m_timeValue && m_timeScale > rhs.m_timeScale)
return GreaterThan;
}
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
int64_t lhsFactor;
int64_t rhsFactor;
if (safeMultiply(m_timeValue, static_cast<int64_t>(rhs.m_timeScale), lhsFactor)
&& safeMultiply(rhs.m_timeValue, static_cast<int64_t>(m_timeScale), rhsFactor)) {
if (lhsFactor == rhsFactor)
return EqualTo;
return lhsFactor < rhsFactor ? LessThan : GreaterThan;
}
[WTF] MediaTime should support round-tripping from and to doubles. https://bugs.webkit.org/show_bug.cgi?id=139248 Reviewed by Eric Carlson. Source/WebCore: Check whether the MediaTime's underlying data is floating point before converting to a CMTime or QTTime. * platform/graphics/avfoundation/MediaTimeAVFoundation.cpp: (WebCore::toCMTime): * platform/graphics/mac/MediaTimeQTKit.mm: (WebCore::toQTTime): Source/WTF: MediaTimes should be able to return precisely the same double value as was used when the MediaTime was created, so long as that MediaTime was not modified in a non-destructive way. This will allow API which accepts floating-point values to return the exact same value when asked, but still be able to store that value as a MediaTime. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): Added; store the floating-point value in a union. (WTF::MediaTime::createWithDouble): Ditto. (WTF::MediaTime::toFloat): If the value is a double, just return it. (WTF::MediaTime::toDouble): Ditto. (WTF::MediaTime::operator+): Special case when one or both sides are doubles. (WTF::MediaTime::operator-): Ditto. (WTF::MediaTime::operator*): Ditto. (WTF::MediaTime::compare): Ditto. (WTF::abs): Ditto. (WTF::MediaTime::setTimeScale): Convert the MediaTime from a double. Tools: Add API tests for new features of MediaTime. Update the LLDB python provider to correctly display the MediaTimes after this change. * TestWebKitAPI/Tests/WTF/MediaTime.cpp: (WTF::operator<<): (TestWebKitAPI::TEST): * lldb/lldb_webkit.py: (WTFMediaTime_SummaryProvider): (WTFMediaTimeProvider.timeValueAsDouble): (WTFMediaTimeProvider.isIndefinite): (WTFMediaTimeProvider): (WTFMediaTimeProvider.hasDoubleValue): Canonical link: https://commits.webkit.org/157162@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@176863 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-12-05 20:51:02 +00:00
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
int64_t rhsWhole = rhs.m_timeValue / rhs.m_timeScale;
int64_t lhsWhole = m_timeValue / m_timeScale;
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
if (lhsWhole > rhsWhole)
return GreaterThan;
if (lhsWhole < rhsWhole)
return LessThan;
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
int64_t rhsRemain = rhs.m_timeValue % rhs.m_timeScale;
int64_t lhsRemain = m_timeValue % m_timeScale;
lhsFactor = lhsRemain * rhs.m_timeScale;
rhsFactor = rhsRemain * m_timeScale;
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
if (lhsFactor == rhsFactor)
return EqualTo;
return lhsFactor > rhsFactor ? GreaterThan : LessThan;
}
bool MediaTime::isBetween(const MediaTime& a, const MediaTime& b) const
{
if (a > b)
return *this > b && *this < a;
return *this > a && *this < b;
}
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
const MediaTime& MediaTime::zeroTime()
{
[WTF] Allow MediaTime static constants https://bugs.webkit.org/show_bug.cgi?id=205723 Reviewed by Darin Adler. Source/WebCore: Since MediaTime no longer has a non-trivial destructor, declaring MediaTime variables no longer has potential side effects as far as the compiler is concerned and it can therefore print "unused variable" errors where that is the case. This patch marks one of such variable as intentionally unused, since it's only used in Debug and would otherwise break the Release build. Actually unused variables are also removed. * platform/graphics/cocoa/WebCoreDecompressionSession.mm: (WebCore::WebCoreDecompressionSession::imageForTime): * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::sourceBufferPrivateFastSeekTimeForMediaTime): * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::removeCodedFrames): Source/WTF: Despite all its convenience methods, at its core MediaTime is a rather trivial class with only integral members. Despite this, since it had a destructor declared, this made the class non-trivially destructible even if the implementation was empty, and therefore clang did not allow to use it for static variables unless done in form of a pointer. By removing the destructor this restriction is lifted and we don't need heap allocations for static MediaTime objects. Previous usages of heap allocation for static MediaTime objects have been rewritten to take advantage of this. Test coverage is provided by successful compilation without [-Werror,-Wexit-time-destructors] errors and existing tests. * wtf/MediaTime.cpp: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): (WTF::MediaTime::~MediaTime): Deleted. * wtf/MediaTime.h: Canonical link: https://commits.webkit.org/219059@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254200 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-01-08 15:57:03 +00:00
static const MediaTime time(0, 1, Valid);
return time;
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
}
const MediaTime& MediaTime::invalidTime()
{
[WTF] Allow MediaTime static constants https://bugs.webkit.org/show_bug.cgi?id=205723 Reviewed by Darin Adler. Source/WebCore: Since MediaTime no longer has a non-trivial destructor, declaring MediaTime variables no longer has potential side effects as far as the compiler is concerned and it can therefore print "unused variable" errors where that is the case. This patch marks one of such variable as intentionally unused, since it's only used in Debug and would otherwise break the Release build. Actually unused variables are also removed. * platform/graphics/cocoa/WebCoreDecompressionSession.mm: (WebCore::WebCoreDecompressionSession::imageForTime): * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::sourceBufferPrivateFastSeekTimeForMediaTime): * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::removeCodedFrames): Source/WTF: Despite all its convenience methods, at its core MediaTime is a rather trivial class with only integral members. Despite this, since it had a destructor declared, this made the class non-trivially destructible even if the implementation was empty, and therefore clang did not allow to use it for static variables unless done in form of a pointer. By removing the destructor this restriction is lifted and we don't need heap allocations for static MediaTime objects. Previous usages of heap allocation for static MediaTime objects have been rewritten to take advantage of this. Test coverage is provided by successful compilation without [-Werror,-Wexit-time-destructors] errors and existing tests. * wtf/MediaTime.cpp: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): (WTF::MediaTime::~MediaTime): Deleted. * wtf/MediaTime.h: Canonical link: https://commits.webkit.org/219059@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254200 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-01-08 15:57:03 +00:00
static const MediaTime time(-1, 1, 0);
return time;
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
}
const MediaTime& MediaTime::positiveInfiniteTime()
{
[WTF] Allow MediaTime static constants https://bugs.webkit.org/show_bug.cgi?id=205723 Reviewed by Darin Adler. Source/WebCore: Since MediaTime no longer has a non-trivial destructor, declaring MediaTime variables no longer has potential side effects as far as the compiler is concerned and it can therefore print "unused variable" errors where that is the case. This patch marks one of such variable as intentionally unused, since it's only used in Debug and would otherwise break the Release build. Actually unused variables are also removed. * platform/graphics/cocoa/WebCoreDecompressionSession.mm: (WebCore::WebCoreDecompressionSession::imageForTime): * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::sourceBufferPrivateFastSeekTimeForMediaTime): * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::removeCodedFrames): Source/WTF: Despite all its convenience methods, at its core MediaTime is a rather trivial class with only integral members. Despite this, since it had a destructor declared, this made the class non-trivially destructible even if the implementation was empty, and therefore clang did not allow to use it for static variables unless done in form of a pointer. By removing the destructor this restriction is lifted and we don't need heap allocations for static MediaTime objects. Previous usages of heap allocation for static MediaTime objects have been rewritten to take advantage of this. Test coverage is provided by successful compilation without [-Werror,-Wexit-time-destructors] errors and existing tests. * wtf/MediaTime.cpp: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): (WTF::MediaTime::~MediaTime): Deleted. * wtf/MediaTime.h: Canonical link: https://commits.webkit.org/219059@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254200 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-01-08 15:57:03 +00:00
static const MediaTime time(0, 1, PositiveInfinite | Valid);
return time;
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
}
const MediaTime& MediaTime::negativeInfiniteTime()
{
[WTF] Allow MediaTime static constants https://bugs.webkit.org/show_bug.cgi?id=205723 Reviewed by Darin Adler. Source/WebCore: Since MediaTime no longer has a non-trivial destructor, declaring MediaTime variables no longer has potential side effects as far as the compiler is concerned and it can therefore print "unused variable" errors where that is the case. This patch marks one of such variable as intentionally unused, since it's only used in Debug and would otherwise break the Release build. Actually unused variables are also removed. * platform/graphics/cocoa/WebCoreDecompressionSession.mm: (WebCore::WebCoreDecompressionSession::imageForTime): * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::sourceBufferPrivateFastSeekTimeForMediaTime): * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::removeCodedFrames): Source/WTF: Despite all its convenience methods, at its core MediaTime is a rather trivial class with only integral members. Despite this, since it had a destructor declared, this made the class non-trivially destructible even if the implementation was empty, and therefore clang did not allow to use it for static variables unless done in form of a pointer. By removing the destructor this restriction is lifted and we don't need heap allocations for static MediaTime objects. Previous usages of heap allocation for static MediaTime objects have been rewritten to take advantage of this. Test coverage is provided by successful compilation without [-Werror,-Wexit-time-destructors] errors and existing tests. * wtf/MediaTime.cpp: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): (WTF::MediaTime::~MediaTime): Deleted. * wtf/MediaTime.h: Canonical link: https://commits.webkit.org/219059@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254200 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-01-08 15:57:03 +00:00
static const MediaTime time(-1, 1, NegativeInfinite | Valid);
return time;
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
}
const MediaTime& MediaTime::indefiniteTime()
{
[WTF] Allow MediaTime static constants https://bugs.webkit.org/show_bug.cgi?id=205723 Reviewed by Darin Adler. Source/WebCore: Since MediaTime no longer has a non-trivial destructor, declaring MediaTime variables no longer has potential side effects as far as the compiler is concerned and it can therefore print "unused variable" errors where that is the case. This patch marks one of such variable as intentionally unused, since it's only used in Debug and would otherwise break the Release build. Actually unused variables are also removed. * platform/graphics/cocoa/WebCoreDecompressionSession.mm: (WebCore::WebCoreDecompressionSession::imageForTime): * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::sourceBufferPrivateFastSeekTimeForMediaTime): * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::removeCodedFrames): Source/WTF: Despite all its convenience methods, at its core MediaTime is a rather trivial class with only integral members. Despite this, since it had a destructor declared, this made the class non-trivially destructible even if the implementation was empty, and therefore clang did not allow to use it for static variables unless done in form of a pointer. By removing the destructor this restriction is lifted and we don't need heap allocations for static MediaTime objects. Previous usages of heap allocation for static MediaTime objects have been rewritten to take advantage of this. Test coverage is provided by successful compilation without [-Werror,-Wexit-time-destructors] errors and existing tests. * wtf/MediaTime.cpp: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): (WTF::MediaTime::~MediaTime): Deleted. * wtf/MediaTime.h: Canonical link: https://commits.webkit.org/219059@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254200 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-01-08 15:57:03 +00:00
static const MediaTime time(0, 1, Indefinite | Valid);
return time;
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
}
MediaTime MediaTime::toTimeScale(uint32_t timeScale, RoundingFlags flags) const
{
MediaTime result = *this;
result.setTimeScale(timeScale, flags);
return result;
}
void MediaTime::setTimeScale(uint32_t timeScale, RoundingFlags flags)
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
{
[WTF] MediaTime should support round-tripping from and to doubles. https://bugs.webkit.org/show_bug.cgi?id=139248 Reviewed by Eric Carlson. Source/WebCore: Check whether the MediaTime's underlying data is floating point before converting to a CMTime or QTTime. * platform/graphics/avfoundation/MediaTimeAVFoundation.cpp: (WebCore::toCMTime): * platform/graphics/mac/MediaTimeQTKit.mm: (WebCore::toQTTime): Source/WTF: MediaTimes should be able to return precisely the same double value as was used when the MediaTime was created, so long as that MediaTime was not modified in a non-destructive way. This will allow API which accepts floating-point values to return the exact same value when asked, but still be able to store that value as a MediaTime. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): Added; store the floating-point value in a union. (WTF::MediaTime::createWithDouble): Ditto. (WTF::MediaTime::toFloat): If the value is a double, just return it. (WTF::MediaTime::toDouble): Ditto. (WTF::MediaTime::operator+): Special case when one or both sides are doubles. (WTF::MediaTime::operator-): Ditto. (WTF::MediaTime::operator*): Ditto. (WTF::MediaTime::compare): Ditto. (WTF::abs): Ditto. (WTF::MediaTime::setTimeScale): Convert the MediaTime from a double. Tools: Add API tests for new features of MediaTime. Update the LLDB python provider to correctly display the MediaTimes after this change. * TestWebKitAPI/Tests/WTF/MediaTime.cpp: (WTF::operator<<): (TestWebKitAPI::TEST): * lldb/lldb_webkit.py: (WTFMediaTime_SummaryProvider): (WTFMediaTimeProvider.timeValueAsDouble): (WTFMediaTimeProvider.isIndefinite): (WTFMediaTimeProvider): (WTFMediaTimeProvider.hasDoubleValue): Canonical link: https://commits.webkit.org/157162@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@176863 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-12-05 20:51:02 +00:00
if (hasDoubleValue()) {
*this = MediaTime::createWithDouble(m_timeValueAsDouble, timeScale);
return;
}
if (!timeScale) {
*this = m_timeValue < 0 ? negativeInfiniteTime() : positiveInfiniteTime();
[WTF] MediaTime should support round-tripping from and to doubles. https://bugs.webkit.org/show_bug.cgi?id=139248 Reviewed by Eric Carlson. Source/WebCore: Check whether the MediaTime's underlying data is floating point before converting to a CMTime or QTTime. * platform/graphics/avfoundation/MediaTimeAVFoundation.cpp: (WebCore::toCMTime): * platform/graphics/mac/MediaTimeQTKit.mm: (WebCore::toQTTime): Source/WTF: MediaTimes should be able to return precisely the same double value as was used when the MediaTime was created, so long as that MediaTime was not modified in a non-destructive way. This will allow API which accepts floating-point values to return the exact same value when asked, but still be able to store that value as a MediaTime. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): Added; store the floating-point value in a union. (WTF::MediaTime::createWithDouble): Ditto. (WTF::MediaTime::toFloat): If the value is a double, just return it. (WTF::MediaTime::toDouble): Ditto. (WTF::MediaTime::operator+): Special case when one or both sides are doubles. (WTF::MediaTime::operator-): Ditto. (WTF::MediaTime::operator*): Ditto. (WTF::MediaTime::compare): Ditto. (WTF::abs): Ditto. (WTF::MediaTime::setTimeScale): Convert the MediaTime from a double. Tools: Add API tests for new features of MediaTime. Update the LLDB python provider to correctly display the MediaTimes after this change. * TestWebKitAPI/Tests/WTF/MediaTime.cpp: (WTF::operator<<): (TestWebKitAPI::TEST): * lldb/lldb_webkit.py: (WTFMediaTime_SummaryProvider): (WTFMediaTimeProvider.timeValueAsDouble): (WTFMediaTimeProvider.isIndefinite): (WTFMediaTimeProvider): (WTFMediaTimeProvider.hasDoubleValue): Canonical link: https://commits.webkit.org/157162@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@176863 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-12-05 20:51:02 +00:00
return;
}
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
if (timeScale == m_timeScale)
return;
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
timeScale = std::min(MaximumTimeScale, timeScale);
#if HAVE(INT128_T)
__int128_t newValue = static_cast<__int128_t>(m_timeValue) * timeScale;
int64_t remainder = newValue % m_timeScale;
newValue = newValue / m_timeScale;
if (newValue < std::numeric_limits<int64_t>::min()) {
*this = negativeInfiniteTime();
return;
}
if (newValue > std::numeric_limits<int64_t>::max()) {
*this = positiveInfiniteTime();
return;
}
#else
int64_t newValue = m_timeValue / m_timeScale;
int64_t partialRemainder = (m_timeValue % m_timeScale) * timeScale;
int64_t remainder = partialRemainder % m_timeScale;
if (!safeMultiply<int64_t>(newValue, static_cast<int64_t>(timeScale), newValue)
|| !safeAdd(newValue, partialRemainder / m_timeScale, newValue)) {
*this = newValue < 0 ? negativeInfiniteTime() : positiveInfiniteTime();
return;
}
#endif
m_timeValue = newValue;
std::swap(m_timeScale, timeScale);
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
if (!remainder)
return;
m_timeFlags |= HasBeenRounded;
switch (flags) {
case RoundingFlags::HalfAwayFromZero:
if (static_cast<int64_t>(llabs(remainder)) * 2 >= static_cast<int64_t>(timeScale)) {
// round up (away from zero)
if (remainder < 0)
m_timeValue--;
else
m_timeValue++;
}
break;
case RoundingFlags::TowardZero:
break;
case RoundingFlags::AwayFromZero:
if (remainder < 0)
m_timeValue--;
else
m_timeValue++;
break;
case RoundingFlags::TowardPositiveInfinity:
if (remainder > 0)
m_timeValue++;
break;
case RoundingFlags::TowardNegativeInfinity:
if (remainder < 0)
m_timeValue--;
break;
}
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
}
2017-06-08 13:10:51 +00:00
void MediaTime::dump(PrintStream& out) const
[MSE] Appends of overlapping sample data do not clear existing samples properly. https://bugs.webkit.org/show_bug.cgi?id=133435 Reviewed by Darin Adler. Source/WebCore: Test: media/media-source/media-source-overlapping-append.html The MSE spec has a spec error in how it removes overlapping frames. The intention seems to be to check for overlapping samples only when the incoming sample increases the highest presentation time field. But due to a mismatch in the range of a sample, defined as [start, end), and the check, which treats the end as inclusive, the overlapping check is almost never run. Add the sample comparison logic to match [start, end) ranges, and rename the existing check to differentiate it from the new one: * Modules/mediasource/SampleMap.cpp: (WebCore::SamplePresentationTimeIsInsideRangeComparator::operator()): (WebCore::SamplePresentationTimeIsWithinRangeComparator::operator()): (WebCore::SampleMap::findSamplesBetweenPresentationTimes): (WebCore::SampleMap::findSamplesWithinPresentationRange): * Modules/mediasource/SampleMap.h: Update the overlapping check to occur whenever the highest presentation time increases, and update the logic within that check to catch all overlapping frames. * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment): (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): (WebCore::SourceBuffer::bufferedSamplesForTrackID): * Modules/mediasource/SourceBuffer.h: * WebCore.exp.in: Add a dump method to MediaSample so that samples can be easily converted to a string for testing. * platform/MediaSample.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::MediaSampleAVFObjC::presentationSize): (WebCore::MediaSampleAVFObjC::dump): Update the Mock MSE implementation to pass along a "generation" field, to aid in testing. * platform/mock/mediasource/MockBox.cpp: (WebCore::MockSampleBox::MockSampleBox): * platform/mock/mediasource/MockBox.h: * platform/mock/mediasource/MockSourceBufferPrivate.cpp: (WebCore::MockMediaSample::dump): Add a method to internals to dump the buffered samples to string. * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::bufferedSamplesForTrackID): * Modules/mediasource/SourceBuffer.h: * testing/Internals.cpp: (WebCore::Internals::bufferedSamplesForTrackID): * testing/Internals.h: * testing/Internals.idl: Source/WTF: Add a dump method to MediaTime, so that MediaTimes can be easily converted to strings (for logging purposes). * wtf/MediaTime.cpp: (WTF::MediaTime::dump): * wtf/MediaTime.h: LayoutTests: * media/media-source/media-source-overlapping-append-expected.txt: Added. * media/media-source/media-source-overlapping-append.html: Added. * media/media-source/mock-media-source.js: Canonical link: https://commits.webkit.org/151463@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@169523 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-06-02 05:16:46 +00:00
{
2017-06-08 13:10:51 +00:00
out.print("{");
if (!hasDoubleValue())
out.print(m_timeValue, "/", m_timeScale, " = ");
out.print(toDouble(), "}");
[MSE] Appends of overlapping sample data do not clear existing samples properly. https://bugs.webkit.org/show_bug.cgi?id=133435 Reviewed by Darin Adler. Source/WebCore: Test: media/media-source/media-source-overlapping-append.html The MSE spec has a spec error in how it removes overlapping frames. The intention seems to be to check for overlapping samples only when the incoming sample increases the highest presentation time field. But due to a mismatch in the range of a sample, defined as [start, end), and the check, which treats the end as inclusive, the overlapping check is almost never run. Add the sample comparison logic to match [start, end) ranges, and rename the existing check to differentiate it from the new one: * Modules/mediasource/SampleMap.cpp: (WebCore::SamplePresentationTimeIsInsideRangeComparator::operator()): (WebCore::SamplePresentationTimeIsWithinRangeComparator::operator()): (WebCore::SampleMap::findSamplesBetweenPresentationTimes): (WebCore::SampleMap::findSamplesWithinPresentationRange): * Modules/mediasource/SampleMap.h: Update the overlapping check to occur whenever the highest presentation time increases, and update the logic within that check to catch all overlapping frames. * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment): (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): (WebCore::SourceBuffer::bufferedSamplesForTrackID): * Modules/mediasource/SourceBuffer.h: * WebCore.exp.in: Add a dump method to MediaSample so that samples can be easily converted to a string for testing. * platform/MediaSample.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::MediaSampleAVFObjC::presentationSize): (WebCore::MediaSampleAVFObjC::dump): Update the Mock MSE implementation to pass along a "generation" field, to aid in testing. * platform/mock/mediasource/MockBox.cpp: (WebCore::MockSampleBox::MockSampleBox): * platform/mock/mediasource/MockBox.h: * platform/mock/mediasource/MockSourceBufferPrivate.cpp: (WebCore::MockMediaSample::dump): Add a method to internals to dump the buffered samples to string. * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::bufferedSamplesForTrackID): * Modules/mediasource/SourceBuffer.h: * testing/Internals.cpp: (WebCore::Internals::bufferedSamplesForTrackID): * testing/Internals.h: * testing/Internals.idl: Source/WTF: Add a dump method to MediaTime, so that MediaTimes can be easily converted to strings (for logging purposes). * wtf/MediaTime.cpp: (WTF::MediaTime::dump): * wtf/MediaTime.h: LayoutTests: * media/media-source/media-source-overlapping-append-expected.txt: Added. * media/media-source/media-source-overlapping-append.html: Added. * media/media-source/mock-media-source.js: Canonical link: https://commits.webkit.org/151463@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@169523 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-06-02 05:16:46 +00:00
}
String MediaTime::toString() const
{
Remove StringBuilder::appendLiteral https://bugs.webkit.org/show_bug.cgi?id=226137 Reviewed by Chris Dumez. Source/JavaScriptCore: * API/tests/PingPongStackOverflowTest.cpp: (PingPongStackOverflowObject_hasInstance): Use append instead of appendLiteral. * bindings/ScriptFunctionCall.cpp: (Deprecated::ScriptCallArgumentHandler::appendArgument): Remove unnecessary cast from const char* to String, which defeats optimization and has no benefit. * bytecompiler/NodesCodegen.cpp: (JSC::ArrayPatternNode::toString const): Use append instead of appendLiteral. (JSC::RestParameterNode::toString const): Ditto. * heap/HeapSnapshotBuilder.cpp: (JSC::HeapSnapshotBuilder::json): Use append instead of appendLiteral. Removed unnecesary use of appendQuotedJSONString to append the result of snapshotTypeToString and edgeTypeToString, which return a const char* that never contains characters that require special quoting consideration, so can be appended efficiently with the normal append function. * inspector/agents/InspectorAuditAgent.cpp: (Inspector::InspectorAuditAgent::run): Use makeString instead of StringBuilder. * inspector/agents/InspectorConsoleAgent.cpp: Use auto for the result of makeString. * jsc.cpp: Use appned instead of appendLiteral. * parser/ParserArena.cpp: (JSC::IdentifierArena::makePrivateIdentifier): Use auto for the result of makeString. * runtime/ConsoleClient.cpp: (JSC::ConsoleClient::printConsoleMessage): Use append instead of appendLiteral. Also use variadic append when practical for better efficiency. (JSC::ConsoleClient::printConsoleMessageWithArguments): Ditto. * runtime/DateConversion.cpp: (JSC::formatDateTime): Ditto. * runtime/ErrorInstance.cpp: (JSC::ErrorInstance::sanitizedToString): Use makeString instead of StringBuilder. * runtime/ExceptionHelpers.cpp: (JSC::notAFunctionSourceAppender): Use append instead of appendLiteral. * runtime/IntlDateTimeFormat.cpp: (JSC::IntlDateTimeFormat::initializeDateTimeFormat): Ditto. * runtime/IntlNumberFormat.cpp: (JSC::IntlNumberFormat::initializeNumberFormat): Ditto. * runtime/JSCustomGetterFunction.cpp: (JSC::JSCustomGetterFunction::create): Use auto and cut down on reference count churn by using passing the StringImpl to makeString. * runtime/JSCustomSetterFunction.cpp: (JSC::JSCustomSetterFunction::create): Ditto. * runtime/JSGlobalObjectFunctions.cpp: Use more const and use variadic append for better efficiency. * runtime/JSONObject.cpp: (JSC::Stringifier::appendStringifiedValue): Use append instead of appendLiteral. (JSC::Stringifier::Holder::appendNextProperty): Ditto. * runtime/JSStringJoiner.h: Deleted unused appendLiteral function. Unrelated to StringBuilder::appendLiteral, but dead code. * runtime/Options.cpp: (JSC::Options::dumpOption): Use append instead of appendLiteral. * runtime/RegExpPrototype.cpp: (JSC::appendLineTerminatorEscape<UChar>): Ditto. * runtime/SamplingProfiler.cpp: (JSC::SamplingProfiler::reportTopFunctions): Use auto for the result of makeString. (JSC::SamplingProfiler::reportTopBytecodes): Ditto. * runtime/TypeProfiler.cpp: (JSC::TypeProfiler::typeInformationForExpressionAtOffset): Use append instead of appendLiteral. * runtime/TypeSet.cpp: (JSC::TypeSet::dumpTypes const): Use append instead of appendLiteral. (JSC::TypeSet::toJSONString const): Ditto. (JSC::StructureShape::propertyHash): Ditto. (JSC::StructureShape::toJSONString const): Ditto. Source/WebCore: * Modules/fetch/FetchBodyConsumer.cpp: (WebCore::packageFormData): Use auto for the result of makeString. * Modules/indexeddb/IDBKeyData.cpp: (WebCore::IDBKeyData::loggingString const): Use append instead of appendLiteral. * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord): Use auto for the result of makeString. * Modules/indexeddb/server/SQLiteIDBCursor.cpp: (WebCore::IDBServer::buildPreIndexStatement): Use makeString instead of StringBuilder. (WebCore::IDBServer::buildIndexStatement): Ditto. (WebCore::IDBServer::buildObjectStoreStatement): Ditto. * Modules/websockets/WebSocket.cpp: (WebCore::encodeProtocolString): Use append instead of appendLiteral. * Modules/websockets/WebSocketExtensionDispatcher.cpp: (WebCore::WebSocketExtensionDispatcher::appendAcceptedExtension): Ditto. * Modules/websockets/WebSocketHandshake.cpp: (WebCore::WebSocketHandshake::clientHandshakeMessage const): Use makeString instead of StringBuilder. (WebCore::WebSocketHandshake::clientHandshakeRequest const): Tweak to match the function above more closely, and use ASCIILiteral. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (formatForDebugger): Use makeString instead of StringBuilder. * contentextensions/CombinedURLFilters.cpp: (WebCore::ContentExtensions::prefixTreeVertexToString): Use append instead of appendLiteral. * css/CSSBasicShapes.cpp: (WebCore::buildCircleString): Ditto. (WebCore::buildEllipseString): Ditto. (WebCore::buildPathString): Ditto. (WebCore::buildPolygonString): Ditto. (WebCore::buildInsetString): Ditto. * css/CSSGradientValue.cpp: (WebCore::CSSLinearGradientValue::customCSSText const): Ditto. (WebCore::CSSRadialGradientValue::customCSSText const): Ditto. (WebCore::CSSConicGradientValue::customCSSText const): Ditto. * css/CSSGridIntegerRepeatValue.cpp: (WebCore::CSSGridIntegerRepeatValue::customCSSText const): Use makeString instead of StringBuilder. * css/CSSImageSetValue.cpp: (WebCore::CSSImageSetValue::customCSSText const): Use append instead of appendLiteral. * css/CSSImportRule.cpp: (WebCore::CSSImportRule::cssText const): Use makeString instead of StringBuilder. * css/CSSKeyframeRule.cpp: (WebCore::StyleRuleKeyframe::cssText const): Ditto. * css/CSSKeyframesRule.cpp: (WebCore::CSSKeyframesRule::cssText const): Use variadic append. * css/CSSLineBoxContainValue.cpp: (WebCore::CSSLineBoxContainValue::customCSSText const): Use append instead of appendLiteral. * css/CSSNamespaceRule.cpp: (WebCore::CSSNamespaceRule::cssText const): Ditto. * css/CSSPageRule.cpp: (WebCore::CSSPageRule::cssText const): Use makeString instead of StringBuilder. * css/CSSPaintImageValue.cpp: (WebCore::CSSPaintImageValue::customCSSText const): Ditto. * css/CSSPrimitiveValue.cpp: (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText const): Use append instead of appendLiteral. * css/CSSSelector.cpp: (WebCore::appendLangArgumentList): Use variadic append. (WebCore::CSSSelector::selectorText const): Ditto. Also use append instead of appendLiteral and make some improvements to cut down on allocations a little. * css/CSSSelectorList.cpp: (WebCore::CSSSelectorList::buildSelectorsText const): Use append instead of appendLiteral. * css/CSSStyleSheet.cpp: (WebCore::CSSStyleSheet::CSSStyleSheet): Moved more of the data member initialization to the class definition. (WebCore::CSSStyleSheet::addRule): Use makeString instead of StringBuilder. * css/CSSStyleSheet.h: Moved initialization here. * css/CSSTimingFunctionValue.cpp: (WebCore::CSSStepsTimingFunctionValue::customCSSText const): Use makeString instead of StringBuilder. (WebCore::CSSSpringTimingFunctionValue::customCSSText const): Ditto. * css/MediaList.cpp: (WebCore::MediaQuerySet::mediaText const): Use append instead of appendLiteral. * css/MediaQuery.cpp: (WebCore::MediaQuery::serialize const): Ditto. * css/MediaQueryExpression.cpp: (WebCore::MediaQueryExpression::serialize const): Use makeString instead of StringBuilder. * css/StyleProperties.cpp: (WebCore::StyleProperties::getLayeredShorthandValue const): Use append instead of appendLiteral. * css/parser/CSSParserToken.cpp: (WebCore::CSSParserToken::serialize const): Removed a lot of unnecessary braces. Use variadic append and append instead of appendLiteral. * dom/Document.cpp: (WebCore::Document::initSecurityContext): Use auto for the result of makeString. * dom/Element.cpp: (WebCore::appendAttributes): Use variadic append and append instead of appendLiteral. * dom/SecurityContext.cpp: (WebCore::SecurityContext::parseSandboxPolicy): Ditto. * editing/HTMLInterchange.cpp: (WebCore::convertHTMLTextToInterchangeFormat): Ditto. * editing/TextIterator.cpp: (WebCore::createSearcher): Use auto for the result of makeString. * editing/markup.cpp: (WebCore::StyledMarkupAccumulator::appendStyleNodeOpenTag): Use append instead of appendLiteral. (WebCore::StyledMarkupAccumulator::appendStartTag): Ditto. (WebCore::urlToMarkup): Ditto. * html/FormController.cpp: (WebCore::recordFormStructure): Ditto. * html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::reportValidity): Use auto for the result of makeString. * html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::validateInteractively): Ditto. * html/HTMLImageElement.cpp: (WebCore::HTMLImageElement::completeURLsInAttributeValue const): Use append insteaed of appendLiteral. * html/MediaElementSession.cpp: (WebCore::restrictionNames): Use auto for the result of makeString. * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::getUniformLocation): Ditto. * html/parser/HTMLTreeBuilder.cpp: (WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::takeRemaining): Ditto. * html/parser/XSSAuditorDelegate.cpp: (WebCore::buildConsoleError): Use makeString instead of StringBuilder. * html/track/TextTrackCue.cpp: (WebCore::TextTrackCue::rebuildDisplayTree): Ditto. * inspector/InspectorFrontendAPIDispatcher.cpp: (WebCore::expressionForEvaluatingCommand): Use append instead of appendLiteral. * inspector/InspectorOverlay.cpp: (WebCore::InspectorOverlay::drawElementTitle): Use auto for the result of makeString. * inspector/InspectorStyleSheet.cpp: (WebCore::InspectorStyleSheet::addRule): Use append instead of appendLiteral. * inspector/agents/InspectorApplicationCacheAgent.cpp: (WebCore::InspectorApplicationCacheAgent::buildObjectForApplicationCacheResource): Use makeString instead of StringBuilder. * inspector/agents/WebConsoleAgent.cpp: (WebCore::WebConsoleAgent::didReceiveResponse): Use auto for the result of makeString. (WebCore::WebConsoleAgent::didFailLoading): Ditto. * loader/MixedContentChecker.cpp: (WebCore::logWarning): Ditto (WebCore::MixedContentChecker::checkFormForMixedContent): Ditto * loader/PrivateClickMeasurement.cpp: (WebCore::makeValidURL): Added. Used for various cases below that all construct URLs in the same way with the same kinds of checks. Use makeString here instead of StringBuilder. (WebCore::attributionReportURL): Call makeValidURL. (WebCore::PrivateClickMeasurement::tokenSignatureURL const): Ditto. (WebCore::PrivateClickMeasurement::tokenPublicKeyURL const): Ditto. * loader/ResourceLoadStatistics.cpp: (WebCore::appendBoolean): Use append instead of appendLiteral. (WebCore::appendHashSet): Ditto. (WebCore::appendNavigatorAPIOptionSet): Ditto. (WebCore::appendScreenAPIOptionSet): Ditto. (WebCore::ResourceLoadStatistics::toString const): Ditto. * loader/WorkerThreadableLoader.cpp: (WebCore::WorkerThreadableLoader::loadResourceSynchronously): Use auto for the result of makeString. * page/DOMWindow.cpp: (WebCore::DOMWindow::postMessage): Ditto. * page/Frame.cpp: (WebCore::createRegExpForLabels): Use append instead of appendLiteral. Also tweak coding style a bit. * page/FrameView.cpp: (WebCore::FrameView::logMockScrollAnimatorMessage const): Use makeString instead of StringBuilder. * page/PageSerializer.cpp: (WebCore::PageSerializer::SerializerMarkupAccumulator::appendStartTag): Use append instead of appendLiteral. (WebCore::PageSerializer::serializeCSSStyleSheet): Ditto. (WebCore::PageSerializer::urlForBlankFrame): Use auto for the result of makeString. * page/PerformanceLoggingClient.cpp: (WebCore::PerformanceLoggingClient::synchronousScrollingReasonsAsString): Use makeString instead of StringBuilder. * page/cocoa/ResourceUsageOverlayCocoa.mm: (WebCore::ResourceUsageOverlay::platformDraw): Use auto for the result of makeString. * page/csp/ContentSecurityPolicy.cpp: (WebCore::consoleMessageForViolation): Use makeString instsead of StringBuilder. (WebCore::ContentSecurityPolicy::allowRunningOrDisplayingInsecureContent): Ditto. (WebCore::ContentSecurityPolicy::reportInvalidDirectiveValueCharacter const): Get rid of local variable for result of makeString. (WebCore::ContentSecurityPolicy::reportInvalidPathCharacter const): Ditto. (WebCore::ContentSecurityPolicy::reportInvalidSourceExpression const): Ditto. * page/csp/ContentSecurityPolicyDirectiveList.cpp: (WebCore::ContentSecurityPolicyDirectiveList::create): Get rid of local variable for result of makeString. * page/scrolling/ScrollingCoordinator.cpp: (WebCore::ScrollingCoordinator::synchronousScrollingReasonsAsText): Use makeString instead of StringBulder. * platform/Decimal.cpp: (WebCore::Decimal::toString const): Use append instead of appendLiteral. * platform/animation/TimingFunction.cpp: (WebCore::TimingFunction::createFromCSSText): Use makeString instead of StringBuilder. * platform/audio/HRTFElevation.cpp: (WebCore::HRTFElevation::calculateKernelsForAzimuthElevation): Use auto for the result of makeString. * platform/glib/UserAgentGLib.cpp: (WebCore::buildUserAgentString): Use append instead of appendLiteral. * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: (WebCore::InbandTextTrackPrivateAVF::processCueAttributes): Use append instead of appendLiteral. * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::recursiveCommitChanges): Got rid of local variable for result of makeString. (WebCore::GraphicsLayerCA::appendToUncommittedAnimations): Use auto for result of makeString. * platform/graphics/ca/TileController.cpp: (WebCore::TileController::tileRevalidationTimerFired): Update to use OptionSet. * platform/graphics/ca/TileGrid.cpp: (WebCore::validationPolicyAsString): Use OptionSet. (WebCore::TileGrid::setNeedsDisplayInRect): Use auto for iterator and range-based for loop. (WebCore::TileGrid::updateTileLayerProperties): Ditto. (WebCore::TileGrid::blankPixelCount const): Ditto. (WebCore::TileGrid::removeTiles): Use HashCountedSet. (WebCore::TileGrid::revalidateTiles): Use OptionSet. (WebCore::TileGrid::retainedTileBackingStoreMemory const): Use ranged-based for loop. (WebCore::TileGrid::drawTileMapContents const): Use range-based for loop and use writeIntegerToBuffer instead of String::number. (WebCore::TileGrid::platformCALayerRepaintCount const): Use HashCountedSet. (WebCore::TileGrid::platformCALayerIncrementRepaintCount): Ditto. This cuts us down from 3 hash table lookups to 1. (WebCore::TileGrid::removeUnparentedTilesNow): Removed local variable to make code a little tighter. * platform/graphics/ca/TileGrid.h: Use OptionSet and HashCountedSet. Removed some type names. * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm: (WebCore::PlatformCAFilters::setFiltersOnLayer): Use auto for reuslt of makeString. * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::drawText): Ditto. * platform/mock/ScrollAnimatorMock.cpp: (WebCore::ScrollAnimatorMock::scrollbarPrefix const): Added helper function for use below. (WebCore::ScrollAnimatorMock::mouseEnteredScrollbar const): Use makeString instead of StringBuilder. (WebCore::ScrollAnimatorMock::mouseExitedScrollbar const): Ditto. (WebCore::ScrollAnimatorMock::mouseIsDownInScrollbar const): Ditto. * platform/mock/ScrollAnimatorMock.h: Ditto. * platform/network/ProxyServer.cpp: (WebCore::appendProxyServerString): Use append instead of appendLiteral. (WebCore::toString): Ditto. * platform/network/ResourceResponseBase.cpp: (WebCore::ResourceResponseBase::sanitizeSuggestedFilename): Get rid of local variable with result of maekString in it. * platform/playstation/UserAgentPlayStation.cpp: (WebCore::platformForUAString): Deleted. No need for a global variable to hold the result of something called only once. (WebCore::platformVersionForUAString): Ditto. (WebCore::buildUserAgentString): Deleted. (WebCore::standardUserAgentStatic): Moved the logic from buildUserAgentString here, using makeString instead of StringBuilder. * platform/sql/SQLiteDatabase.cpp: (WebCore::SQLiteDatabase::open): Use auto for result of makeString. * platform/sql/SQLiteFileSystem.cpp: (WebCore::SQLiteFileSystem::deleteDatabaseFile): Ditto. * platform/text/DateTimeFormat.cpp: (WebCore::DateTimeFormat::quoteAndAppendLiteral): Use append instead of appendLiteral and StringView::substring instead of String::substring. * platform/win/ClipboardUtilitiesWin.cpp: (WebCore::replaceNewlinesWithWindowsStyleNewlines): Use append instead of appendLiteral. * platform/win/UserAgentWin.cpp: (WebCore::standardUserAgent): Use makeString instead of StringBuildeer. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::name const): Ditto. (WebCore::RenderLayer::debugDescription const): Ditto. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::logLayerInfo): Use append instead of appendLiteral. * rendering/RenderTreeAsText.cpp: (WebCore::quoteAndEscapeNonPrintables): Ditto. (WebCore::nodePosition): Ditto. * svg/SVGPathStringBuilder.cpp: (WebCore::SVGPathStringBuilder::moveTo): Ditto. (WebCore::SVGPathStringBuilder::lineTo): Ditto. (WebCore::SVGPathStringBuilder::lineToHorizontal): Ditto. (WebCore::SVGPathStringBuilder::lineToVertical): Ditto. (WebCore::SVGPathStringBuilder::curveToCubic): Ditto. (WebCore::SVGPathStringBuilder::curveToCubicSmooth): Ditto. (WebCore::SVGPathStringBuilder::curveToQuadratic): Ditto. (WebCore::SVGPathStringBuilder::curveToQuadraticSmooth): Ditto. (WebCore::SVGPathStringBuilder::arcTo): Ditto. (WebCore::SVGPathStringBuilder::closePath): Ditto. * testing/Internals.cpp: (WebCore::Internals::dumpMarkerRects): Ditto. (WebCore::appendOffsets): (WebCore::Internals::scrollSnapOffsets): Ditto. * workers/WorkerScriptLoader.cpp: (WebCore::WorkerScriptLoader::validateWorkerResponse): Use auto for reuslt of makeString. Source/WebKit: * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::ResourceLoadStatisticsDatabaseStore::ensureAndMakeDomainList): Use append instead of appendLiteral. (WebKit::domainsToString): Ditto. (WebKit::buildList): Ditto. (WebKit::ResourceLoadStatisticsDatabaseStore::findNotVeryPrevalentResources): Ditto. (WebKit::ResourceLoadStatisticsDatabaseStore::dumpResourceLoadStatistics): Ditto. (WebKit::appendBoolean): Ditto. (WebKit::appendNextEntry): Ditto. (WebKit::ResourceLoadStatisticsDatabaseStore::appendSubStatisticList const): Ditto. (WebKit::ResourceLoadStatisticsDatabaseStore::resourceToString const): Ditto. (WebKit::ResourceLoadStatisticsDatabaseStore::attributionToString): Ditto. (WebKit::ResourceLoadStatisticsDatabaseStore::privateClickMeasurementToString): Ditto. * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp: (WebKit::ResourceLoadStatisticsMemoryStore::dumpResourceLoadStatistics): Ditto. * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp: Ditto. (WebKit::domainsToString): Ditto. * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::create): Moved this here from the header. (WebKit::WebResourceLoadStatisticsStore::ThirdPartyDataForSpecificFirstParty::toString const): Ditto. (WebKit::WebResourceLoadStatisticsStore::ThirdPartyDataForSpecificFirstParty::encode const): Ditto. (WebKit::WebResourceLoadStatisticsStore::ThirdPartyDataForSpecificFirstParty::decode): Ditto. (WebKit::WebResourceLoadStatisticsStore::ThirdPartyDataForSpecificFirstParty::operator== const): Ditto. (WebKit::WebResourceLoadStatisticsStore::ThirdPartyData::toString const): Ditto. (WebKit::WebResourceLoadStatisticsStore::ThirdPartyData::encode const): Ditto. (WebKit::WebResourceLoadStatisticsStore::ThirdPartyData::decode): Ditto. (WebKit::WebResourceLoadStatisticsStore::ThirdPartyData::operator< const): Ditto. * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: Moved member functions of the nested structures into the implementation file and fixed the indentation of the structures to indicate the nesting. * NetworkProcess/NetworkLoadChecker.cpp: (WebKit::NetworkLoadChecker::continueCheckingRequest): Do not use a local variable for the reuslt of makeString. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::newTestingSession): Ditto. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::dumpContentsToFile): Use append instead of appendLiteral * NetworkProcess/cache/NetworkCacheEntry.cpp: (WebKit::NetworkCache::Entry::asJSON const): Ditto. * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::makeVersionedDirectoryPath): Do not use a local variable for the result of makeString. * NetworkProcess/soup/NetworkProcessSoup.cpp: (WebKit::buildAcceptLanguages): Use append instead of appendLiteral. * NetworkProcess/soup/WebSocketTaskSoup.cpp: (WebKit::WebSocketTask::acceptedExtensions const): Ditto. * NetworkProcess/webrtc/NetworkMDNSRegister.cpp: (WebKit::NetworkMDNSRegister::registerMDNSName): Use auto for the result of makeString. * Shared/WebMemorySampler.cpp: (WebKit::WebMemorySampler::writeHeaders): Ditto. * Shared/mac/AuxiliaryProcessMac.mm: (WebKit::initializeSandboxParameters): Do not use a local variable for the result of makeString. Also, take advantage of the support for concatenating an NSString instead of converting it to a WTF::String. * Shared/mac/WebMemorySampler.mac.mm: (WebKit::WebMemorySampler::sampleWebKit const): Use ASCIILiteral and remove explicit conversion to String. * UIProcess/API/glib/WebKitWebView.cpp: (webkitWebViewRunJavaScriptCallback): Use append instead of appendLiteral. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::fileCanBeAcceptedForUpload): Use auto for result of makeString. * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp: Use makeString instead of StringBuilder. * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::requestStorageSpace): Use auto for result of makeString. * UIProcess/WebBackForwardList.cpp: (WebKit::WebBackForwardList::loggingString): Use append instead of appendLiteral. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::processDidFinishLaunching): Use auto for result of makeString. (WebKit::WebProcessPool::startMemorySampler): Ditto. * WebProcess/WebPage/WebPage.cpp: (WebKit::dumpHistoryItem): Use append instead of appendLiteral. (WebKit::WebPage::getContentsAsString): Ditto. Source/WebKitLegacy: * WebCoreSupport/NetworkStorageSessionMap.cpp: (NetworkStorageSessionMap::switchToNewTestingSession): Do not use local for return value of makeString. Source/WebKitLegacy/mac: * WebView/WebHTMLRepresentation.mm: (regExpForLabels): Use append instead of appendLiteral. Also imrpove local variable names a bit. Source/WebKitLegacy/win: * AccessibleBase.cpp: (AccessibleBase::get_accKeyboardShortcut): Use append instead of appnedLiteral. * WebView.cpp: Ditto. Source/WTF: The optimization done by appendLiteral has minimal value and is something we can do without. It does not cut down the number of allocations, which is the main cost of the StringBuilder class. Getting rid of the differently named appendLiteral improves the design of the StringBuilder class for callers. Our goal is to get as close as possible to a single append function. If we decide we need an optimization for literals, we can come up with a different way that is compatible with append. For example, we could assume that any char array is a literal and check that at compile time in StringConcatenate; that optimization would work for both makeString and StringBuilder. Or we could use a strategy like ASCIILiteral. * wtf/FileSystem.cpp: (WTF::FileSystemImpl::encodeForFileName): Streamline logic, and use variadic append to make this more efficient. * wtf/JSONValues.cpp: (WTF::JSONImpl::Value::escapeString): Use append instead of appendLiteral. (WTF::JSONImpl::Value::writeJSON const): Ditto. * wtf/Logger.h: (WTF::Logger::log): Use auto for result of makeString. (WTF::Logger::logVerbose): Ditto. * wtf/MediaTime.cpp: (WTF::MediaTime::toString const): Use makeString instead of StringBuilder. * wtf/text/IntegerToStringConversion.h: Made lengthOfIntegerAsString a constexpr function so we can use it to compute the required size of arrays for conversion. Added using for both lengthOfIntegerAsString and writeIntegerToBuffer so we can use them without the WTF prefix as is customary for functions in WTF. * wtf/text/StringBuilder.h: (WTF::StringBuilder::appendLiteral): Deleted. * wtf/text/StringConcatenate.h: Added support for appending StringImpl&, StringImpl*, AtomStringImpl&, and AtomStringImpl*. Tools: * TestWebKitAPI/Tests/WTF/StringBuilder.cpp: Use append instead of appendLiteral. * TestWebKitAPI/Tests/WebCore/FileMonitor.cpp: (TestWebKitAPI::createCommand): Use makeString instead of StringBuilder. * TestWebKitAPI/Tests/WebCore/Logging.cpp: (TestWebKitAPI::TEST_F): Made lots of fixes to code inside #if TEST_OUTPUT, which hasn't compiled in a long time. Still not 100% there, but closer. * TestWebKitAPI/Tests/WebCore/TextCodec.cpp: (TestWebKitAPI::testDecode): Use append instead of appendLiteral. * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp: (WTR::AccessibilityUIElement::helpText const): Ditto. Canonical link: https://commits.webkit.org/238091@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277967 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-24 21:51:47 +00:00
const char* invalid = isInvalid() ? ", invalid" : "";
if (hasDoubleValue())
return makeString('{', toDouble(), invalid, '}');
return makeString('{', m_timeValue, '/', m_timeScale, " = ", toDouble(), invalid, '}');
}
[MSE] Convert debug-only logging to runtime logging https://bugs.webkit.org/show_bug.cgi?id=194348 <rdar://problem/47566449> Reviewed by Jer Noble. Source/WebCore: No new tests, this just changes existing logging. * Modules/mediasource/MediaSource.cpp: (WebCore::convertEnumerationToString): (WebCore::MediaSource::MediaSource): (WebCore::MediaSource::~MediaSource): (WebCore::MediaSource::setPrivateAndOpen): (WebCore::MediaSource::addedToRegistry): (WebCore::MediaSource::removedFromRegistry): (WebCore::MediaSource::durationChanged): (WebCore::MediaSource::seekToTime): (WebCore::MediaSource::completeSeek): (WebCore::MediaSource::setLiveSeekableRange): (WebCore::MediaSource::clearLiveSeekableRange): (WebCore::MediaSource::setDuration): (WebCore::MediaSource::setDurationInternal): (WebCore::MediaSource::setReadyState): (WebCore::MediaSource::endOfStream): (WebCore::MediaSource::streamEndedWithError): (WebCore::MediaSource::addSourceBuffer): (WebCore::MediaSource::removeSourceBuffer): (WebCore::MediaSource::isTypeSupported): (WebCore::MediaSource::detachFromElement): (WebCore::MediaSource::attachToElement): (WebCore::MediaSource::openIfInEndedState): (WebCore::MediaSource::suspend): (WebCore::MediaSource::resume): (WebCore::MediaSource::stop): (WebCore::MediaSource::onReadyStateChange): (WebCore::MediaSource::scheduleEvent): (WebCore::MediaSource::logChannel const): (WebCore::MediaSourceInternal::toString): Deleted. * Modules/mediasource/MediaSource.h: (WTF::LogArgument<WebCore::MediaSource::EndOfStreamError>::toString): (WTF::LogArgument<WebCore::MediaSource::ReadyState>::toString): * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::SourceBuffer): (WebCore::SourceBuffer::~SourceBuffer): (WebCore::SourceBuffer::remove): (WebCore::SourceBuffer::seekToTime): (WebCore::SourceBuffer::appendBufferInternal): (WebCore::SourceBuffer::sourceBufferPrivateAppendComplete): (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveRenderingError): (WebCore::removeSamplesFromTrackBuffer): (WebCore::SourceBuffer::removeCodedFrames): (WebCore::SourceBuffer::evictCodedFrames): (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment): (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): (WebCore::SourceBuffer::sourceBufferPrivateReenqueSamples): (WebCore::SourceBuffer::sourceBufferPrivateDidBecomeReadyForMoreSamples): (WebCore::SourceBuffer::provideMediaData): (WebCore::SourceBuffer::trySignalAllSamplesInTrackEnqueued): (WebCore::SourceBuffer::monitorBufferingRate): (WebCore::SourceBuffer::logChannel const): * Modules/mediasource/SourceBuffer.h: * dom/Document.cpp: (WebCore::messageSourceForWTFLogChannel): (WebCore::Document::didLogMessage): * html/HTMLMediaElement.cpp: (WebCore::convertEnumerationToString): (WebCore::HTMLMediaElement::scheduleCheckPlaybackTargetCompatability): (WebCore::HTMLMediaElement::selectMediaResource): (WebCore::HTMLMediaElement::loadResource): (WebCore::HTMLMediaElement::updateActiveTextTrackCues): (WebCore::HTMLMediaElement::scheduleConfigureTextTracks): (WebCore::HTMLMediaElement::scheduleMediaEngineWasUpdated): (WebCore::HTMLMediaElement::scheduleUpdatePlayState): (WebCore::HTMLMediaElement::scheduleUpdateMediaState): * platform/ContentType.cpp: (WebCore::ContentType::toJSONString const): * platform/ContentType.h: (WTF::LogArgument<WebCore::ContentType>::toString): * platform/MediaSample.h: (WebCore::MediaSample::toJSONString const): (WTF::LogArgument<WebCore::MediaSample>::toString): * platform/graphics/FloatSize.cpp: (WebCore::FloatSize::toJSONObject const): (WebCore::FloatSize::toJSONString const): * platform/graphics/FloatSize.h: (WTF::LogArgument<WebCore::FloatSize>::toString): * platform/graphics/MediaSourcePrivate.h: (WebCore::MediaSourcePrivate::mediaSourceLogIdentifier): (WTF::LogArgument<WebCore::MediaSourcePrivate::AddStatus>::toString): (WTF::LogArgument<WebCore::MediaSourcePrivate::EndOfStreamStatus>::toString): * platform/graphics/SourceBufferPrivate.h: (WebCore::SourceBufferPrivate::sourceBufferLogger const): (WebCore::SourceBufferPrivate::sourceBufferLogIdentifier): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::setMuted): (WebCore::MediaPlayerPrivateAVFoundationObjC::setClosedCaptionsVisible): (WebCore::MediaPlayerPrivateAVFoundationObjC::isCurrentPlaybackTargetWireless const): (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessVideoPlaybackDisabled const): (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessVideoPlaybackDisabled): (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget): (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldBufferData): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::mediaPlayerLogIdentifier): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::mediaPlayerLogger): (WTF::LogArgument<WebCore::MediaPlayerPrivateMediaSourceAVFObjC::SeekState>::toString): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::convertEnumerationToString): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::~MediaPlayerPrivateMediaSourceAVFObjC): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::play): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::playInternal): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pause): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pauseInternal): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVolume): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setMuted): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVisible): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitForSeekCompleted): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekCompleted): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setPreservesPitch): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableVideoFrame): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::updateAllRenderersHaveAvailableSamples): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationChanged): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setNaturalSize): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceAttached): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceDetached): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::attemptToDecryptWithInstance): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitingForKeyChanged): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::initializationDataEncountered): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setReadyState): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setNetworkState): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setShouldPlayToPlaybackTarget): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isCurrentPlaybackTargetWireless const): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::logChannel const): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample): * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h: * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm: (WebCore::MediaSampleAVFObjC::toJSONString const): * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h: * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm: (WebCore::MediaSourcePrivateAVFObjC::MediaSourcePrivateAVFObjC): (WebCore::MediaSourcePrivateAVFObjC::~MediaSourcePrivateAVFObjC): (WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer): (WebCore::MediaSourcePrivateAVFObjC::logChannel const): * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::bufferWasConsumedCallback): (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC): (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC): (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset): (WebCore::SourceBufferPrivateAVFObjC::didFailToParseStreamDataWithError): (WebCore::SourceBufferPrivateAVFObjC::processCodedFrame): (WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID): (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID): (WebCore::SourceBufferPrivateAVFObjC::append): (WebCore::SourceBufferPrivateAVFObjC::abort): (WebCore::SourceBufferPrivateAVFObjC::resetParserState): (WebCore::SourceBufferPrivateAVFObjC::removedFromMediaSource): (WebCore::SourceBufferPrivateAVFObjC::setReadyState): (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled): (WebCore::SourceBufferPrivateAVFObjC::setCDMSession): (WebCore::SourceBufferPrivateAVFObjC::setCDMInstance): (WebCore::SourceBufferPrivateAVFObjC::layerDidReceiveError): (WebCore::SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged): (WebCore::SourceBufferPrivateAVFObjC::flush): (WebCore::SourceBufferPrivateAVFObjC::flushVideo): (WebCore::SourceBufferPrivateAVFObjC::enqueueSample): (WebCore::SourceBufferPrivateAVFObjC::bufferWasConsumed): (WebCore::SourceBufferPrivateAVFObjC::setActive): (WebCore::SourceBufferPrivateAVFObjC::willSeek): (WebCore::SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples): (WebCore::SourceBufferPrivateAVFObjC::canSwitchToType): (WebCore::SourceBufferPrivateAVFObjC::setDecompressionSession): (WebCore::SourceBufferPrivateAVFObjC::logChannel const): Source/WTF: * wtf/LoggerHelper.h: (WTF::LoggerHelper::childLogIdentifier const): Helper to generate a log identifier for an object that is associated with another logging object. * wtf/MediaTime.cpp: (WTF::MediaTime::toJSONObject const): (WTF::MediaTime::toJSONString const): (WTF::MediaTimeRange::toJSONString const): (WTF::toJSONStringInternal): Deleted. * wtf/MediaTime.h: Canonical link: https://commits.webkit.org/208835@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241148 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-02-07 22:58:05 +00:00
Ref<JSON::Object> MediaTime::toJSONObject() const
Web Inspector: Optionally log WebKit log parameters as JSON https://bugs.webkit.org/show_bug.cgi?id=180529 <rdar://problem/35909462> Reviewed by Joseph Pecoraro. Source/JavaScriptCore: * inspector/ConsoleMessage.cpp: (Inspector::ConsoleMessage::ConsoleMessage): New constructor that takes a vector of JSON log values. Concatenate all adjacent strings to make logging cleaner. (Inspector::ConsoleMessage::addToFrontend): Process WebKit logging arguments. (Inspector::ConsoleMessage::scriptState const): * inspector/ConsoleMessage.h: * inspector/InjectedScript.cpp: (Inspector::InjectedScript::wrapJSONString const): Wrap JSON string log arguments. * inspector/InjectedScript.h: * inspector/InjectedScriptSource.js: (let.InjectedScript.prototype.wrapJSONString): Source/WebCore: * dom/Document.cpp: (WebCore::Document::didLogMessage):Update for API change. Don't check for main thread, that is already done in addConsoleMessage. * dom/Document.h: * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::updatePlayState): Cleanup logging. * html/track/DataCue.cpp: (WebCore::DataCue::toJSONString const): Serialize to JSON string. (WebCore::DataCue::toString const): Deleted. * html/track/DataCue.h: (WTF::LogArgument<WebCore::DataCue>::toString): * html/track/TextTrackCue.cpp: (WebCore::TextTrackCue::toJSON const): Ditto. (WebCore::TextTrackCue::toJSONString const): (WebCore::TextTrackCue::toString const): Deleted. * html/track/TextTrackCue.h: (WTF::LogArgument<WebCore::TextTrackCue>::toString): * html/track/TextTrackCueGeneric.cpp: (WebCore::TextTrackCueGeneric::toJSONString const): Ditto. (WebCore::TextTrackCueGeneric::toString const): Deleted. * html/track/TextTrackCueGeneric.h: (WTF::LogArgument<WebCore::TextTrackCueGeneric>::toString): * html/track/VTTCue.cpp: (WebCore::VTTCue::toJSONString const): Ditto. (WebCore::VTTCue::toString const): Deleted. * html/track/VTTCue.h: (WTF::LogArgument<WebCore::VTTCue>::toString): * platform/graphics/InbandTextTrackPrivateClient.h: (WebCore::GenericCueData::toJSONString const): Ditto. (WTF::LogArgument<WebCore::GenericCueData>::toString): (WebCore::GenericCueData::toString const): Deleted. * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: (WebCore::InbandTextTrackPrivateAVF::processAttributedStrings): Cleanup logging. (WebCore::InbandTextTrackPrivateAVF::removeCompletedCues): Ditto. (WebCore::InbandTextTrackPrivateAVF::processNativeSamples): Log the entire cue. (WebCore::InbandTextTrackPrivateAVF::readNativeSampleBuffer): Cleanup logging. * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: (WebCore::MediaPlayerPrivateAVFoundation::maxMediaTimeSeekable const): Don't log, it isn't interesting and happens frequently. (WebCore::MediaPlayerPrivateAVFoundation::minMediaTimeSeekable const): Ditto. * platform/graphics/iso/ISOVTTCue.cpp: (WebCore::ISOWebVTTCue::toJSONString const): Serialize to JSON string. * platform/graphics/iso/ISOVTTCue.h: (WTF::LogArgument<WebCore::ISOWebVTTCue>::toString): Ditto. Source/WTF: * wtf/Logger.h: (WTF::Logger::log): (WTF::LogArgument<Logger::LogSiteIdentifier>::toString): * wtf/MediaTime.cpp: (WTF::MediaTime::toJSONString const): Serialize to JSON string. * wtf/MediaTime.h: LayoutTests: * inspector/canvas/recording-2d-expected.txt: * inspector/canvas/recording-webgl-expected.txt: * inspector/canvas/recording-webgl-snapshots-expected.txt: Canonical link: https://commits.webkit.org/196579@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225764 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-12-12 00:41:54 +00:00
{
auto object = JSON::Object::create();
[MSE] Convert debug-only logging to runtime logging https://bugs.webkit.org/show_bug.cgi?id=194348 <rdar://problem/47566449> Reviewed by Jer Noble. Source/WebCore: No new tests, this just changes existing logging. * Modules/mediasource/MediaSource.cpp: (WebCore::convertEnumerationToString): (WebCore::MediaSource::MediaSource): (WebCore::MediaSource::~MediaSource): (WebCore::MediaSource::setPrivateAndOpen): (WebCore::MediaSource::addedToRegistry): (WebCore::MediaSource::removedFromRegistry): (WebCore::MediaSource::durationChanged): (WebCore::MediaSource::seekToTime): (WebCore::MediaSource::completeSeek): (WebCore::MediaSource::setLiveSeekableRange): (WebCore::MediaSource::clearLiveSeekableRange): (WebCore::MediaSource::setDuration): (WebCore::MediaSource::setDurationInternal): (WebCore::MediaSource::setReadyState): (WebCore::MediaSource::endOfStream): (WebCore::MediaSource::streamEndedWithError): (WebCore::MediaSource::addSourceBuffer): (WebCore::MediaSource::removeSourceBuffer): (WebCore::MediaSource::isTypeSupported): (WebCore::MediaSource::detachFromElement): (WebCore::MediaSource::attachToElement): (WebCore::MediaSource::openIfInEndedState): (WebCore::MediaSource::suspend): (WebCore::MediaSource::resume): (WebCore::MediaSource::stop): (WebCore::MediaSource::onReadyStateChange): (WebCore::MediaSource::scheduleEvent): (WebCore::MediaSource::logChannel const): (WebCore::MediaSourceInternal::toString): Deleted. * Modules/mediasource/MediaSource.h: (WTF::LogArgument<WebCore::MediaSource::EndOfStreamError>::toString): (WTF::LogArgument<WebCore::MediaSource::ReadyState>::toString): * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::SourceBuffer): (WebCore::SourceBuffer::~SourceBuffer): (WebCore::SourceBuffer::remove): (WebCore::SourceBuffer::seekToTime): (WebCore::SourceBuffer::appendBufferInternal): (WebCore::SourceBuffer::sourceBufferPrivateAppendComplete): (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveRenderingError): (WebCore::removeSamplesFromTrackBuffer): (WebCore::SourceBuffer::removeCodedFrames): (WebCore::SourceBuffer::evictCodedFrames): (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment): (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): (WebCore::SourceBuffer::sourceBufferPrivateReenqueSamples): (WebCore::SourceBuffer::sourceBufferPrivateDidBecomeReadyForMoreSamples): (WebCore::SourceBuffer::provideMediaData): (WebCore::SourceBuffer::trySignalAllSamplesInTrackEnqueued): (WebCore::SourceBuffer::monitorBufferingRate): (WebCore::SourceBuffer::logChannel const): * Modules/mediasource/SourceBuffer.h: * dom/Document.cpp: (WebCore::messageSourceForWTFLogChannel): (WebCore::Document::didLogMessage): * html/HTMLMediaElement.cpp: (WebCore::convertEnumerationToString): (WebCore::HTMLMediaElement::scheduleCheckPlaybackTargetCompatability): (WebCore::HTMLMediaElement::selectMediaResource): (WebCore::HTMLMediaElement::loadResource): (WebCore::HTMLMediaElement::updateActiveTextTrackCues): (WebCore::HTMLMediaElement::scheduleConfigureTextTracks): (WebCore::HTMLMediaElement::scheduleMediaEngineWasUpdated): (WebCore::HTMLMediaElement::scheduleUpdatePlayState): (WebCore::HTMLMediaElement::scheduleUpdateMediaState): * platform/ContentType.cpp: (WebCore::ContentType::toJSONString const): * platform/ContentType.h: (WTF::LogArgument<WebCore::ContentType>::toString): * platform/MediaSample.h: (WebCore::MediaSample::toJSONString const): (WTF::LogArgument<WebCore::MediaSample>::toString): * platform/graphics/FloatSize.cpp: (WebCore::FloatSize::toJSONObject const): (WebCore::FloatSize::toJSONString const): * platform/graphics/FloatSize.h: (WTF::LogArgument<WebCore::FloatSize>::toString): * platform/graphics/MediaSourcePrivate.h: (WebCore::MediaSourcePrivate::mediaSourceLogIdentifier): (WTF::LogArgument<WebCore::MediaSourcePrivate::AddStatus>::toString): (WTF::LogArgument<WebCore::MediaSourcePrivate::EndOfStreamStatus>::toString): * platform/graphics/SourceBufferPrivate.h: (WebCore::SourceBufferPrivate::sourceBufferLogger const): (WebCore::SourceBufferPrivate::sourceBufferLogIdentifier): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::setMuted): (WebCore::MediaPlayerPrivateAVFoundationObjC::setClosedCaptionsVisible): (WebCore::MediaPlayerPrivateAVFoundationObjC::isCurrentPlaybackTargetWireless const): (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessVideoPlaybackDisabled const): (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessVideoPlaybackDisabled): (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget): (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldBufferData): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::mediaPlayerLogIdentifier): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::mediaPlayerLogger): (WTF::LogArgument<WebCore::MediaPlayerPrivateMediaSourceAVFObjC::SeekState>::toString): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::convertEnumerationToString): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::~MediaPlayerPrivateMediaSourceAVFObjC): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::play): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::playInternal): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pause): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pauseInternal): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVolume): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setMuted): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVisible): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitForSeekCompleted): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekCompleted): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setPreservesPitch): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableVideoFrame): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::updateAllRenderersHaveAvailableSamples): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationChanged): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setNaturalSize): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceAttached): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceDetached): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::attemptToDecryptWithInstance): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitingForKeyChanged): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::initializationDataEncountered): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setReadyState): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setNetworkState): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setShouldPlayToPlaybackTarget): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isCurrentPlaybackTargetWireless const): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::logChannel const): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample): * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h: * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm: (WebCore::MediaSampleAVFObjC::toJSONString const): * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h: * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm: (WebCore::MediaSourcePrivateAVFObjC::MediaSourcePrivateAVFObjC): (WebCore::MediaSourcePrivateAVFObjC::~MediaSourcePrivateAVFObjC): (WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer): (WebCore::MediaSourcePrivateAVFObjC::logChannel const): * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::bufferWasConsumedCallback): (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC): (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC): (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset): (WebCore::SourceBufferPrivateAVFObjC::didFailToParseStreamDataWithError): (WebCore::SourceBufferPrivateAVFObjC::processCodedFrame): (WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID): (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID): (WebCore::SourceBufferPrivateAVFObjC::append): (WebCore::SourceBufferPrivateAVFObjC::abort): (WebCore::SourceBufferPrivateAVFObjC::resetParserState): (WebCore::SourceBufferPrivateAVFObjC::removedFromMediaSource): (WebCore::SourceBufferPrivateAVFObjC::setReadyState): (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled): (WebCore::SourceBufferPrivateAVFObjC::setCDMSession): (WebCore::SourceBufferPrivateAVFObjC::setCDMInstance): (WebCore::SourceBufferPrivateAVFObjC::layerDidReceiveError): (WebCore::SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged): (WebCore::SourceBufferPrivateAVFObjC::flush): (WebCore::SourceBufferPrivateAVFObjC::flushVideo): (WebCore::SourceBufferPrivateAVFObjC::enqueueSample): (WebCore::SourceBufferPrivateAVFObjC::bufferWasConsumed): (WebCore::SourceBufferPrivateAVFObjC::setActive): (WebCore::SourceBufferPrivateAVFObjC::willSeek): (WebCore::SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples): (WebCore::SourceBufferPrivateAVFObjC::canSwitchToType): (WebCore::SourceBufferPrivateAVFObjC::setDecompressionSession): (WebCore::SourceBufferPrivateAVFObjC::logChannel const): Source/WTF: * wtf/LoggerHelper.h: (WTF::LoggerHelper::childLogIdentifier const): Helper to generate a log identifier for an object that is associated with another logging object. * wtf/MediaTime.cpp: (WTF::MediaTime::toJSONObject const): (WTF::MediaTime::toJSONString const): (WTF::MediaTimeRange::toJSONString const): (WTF::toJSONStringInternal): Deleted. * wtf/MediaTime.h: Canonical link: https://commits.webkit.org/208835@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241148 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-02-07 22:58:05 +00:00
if (hasDoubleValue()) {
object->setDouble("value"_s, toDouble());
return object;
Web Inspector: Optionally log WebKit log parameters as JSON https://bugs.webkit.org/show_bug.cgi?id=180529 <rdar://problem/35909462> Reviewed by Joseph Pecoraro. Source/JavaScriptCore: * inspector/ConsoleMessage.cpp: (Inspector::ConsoleMessage::ConsoleMessage): New constructor that takes a vector of JSON log values. Concatenate all adjacent strings to make logging cleaner. (Inspector::ConsoleMessage::addToFrontend): Process WebKit logging arguments. (Inspector::ConsoleMessage::scriptState const): * inspector/ConsoleMessage.h: * inspector/InjectedScript.cpp: (Inspector::InjectedScript::wrapJSONString const): Wrap JSON string log arguments. * inspector/InjectedScript.h: * inspector/InjectedScriptSource.js: (let.InjectedScript.prototype.wrapJSONString): Source/WebCore: * dom/Document.cpp: (WebCore::Document::didLogMessage):Update for API change. Don't check for main thread, that is already done in addConsoleMessage. * dom/Document.h: * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::updatePlayState): Cleanup logging. * html/track/DataCue.cpp: (WebCore::DataCue::toJSONString const): Serialize to JSON string. (WebCore::DataCue::toString const): Deleted. * html/track/DataCue.h: (WTF::LogArgument<WebCore::DataCue>::toString): * html/track/TextTrackCue.cpp: (WebCore::TextTrackCue::toJSON const): Ditto. (WebCore::TextTrackCue::toJSONString const): (WebCore::TextTrackCue::toString const): Deleted. * html/track/TextTrackCue.h: (WTF::LogArgument<WebCore::TextTrackCue>::toString): * html/track/TextTrackCueGeneric.cpp: (WebCore::TextTrackCueGeneric::toJSONString const): Ditto. (WebCore::TextTrackCueGeneric::toString const): Deleted. * html/track/TextTrackCueGeneric.h: (WTF::LogArgument<WebCore::TextTrackCueGeneric>::toString): * html/track/VTTCue.cpp: (WebCore::VTTCue::toJSONString const): Ditto. (WebCore::VTTCue::toString const): Deleted. * html/track/VTTCue.h: (WTF::LogArgument<WebCore::VTTCue>::toString): * platform/graphics/InbandTextTrackPrivateClient.h: (WebCore::GenericCueData::toJSONString const): Ditto. (WTF::LogArgument<WebCore::GenericCueData>::toString): (WebCore::GenericCueData::toString const): Deleted. * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: (WebCore::InbandTextTrackPrivateAVF::processAttributedStrings): Cleanup logging. (WebCore::InbandTextTrackPrivateAVF::removeCompletedCues): Ditto. (WebCore::InbandTextTrackPrivateAVF::processNativeSamples): Log the entire cue. (WebCore::InbandTextTrackPrivateAVF::readNativeSampleBuffer): Cleanup logging. * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: (WebCore::MediaPlayerPrivateAVFoundation::maxMediaTimeSeekable const): Don't log, it isn't interesting and happens frequently. (WebCore::MediaPlayerPrivateAVFoundation::minMediaTimeSeekable const): Ditto. * platform/graphics/iso/ISOVTTCue.cpp: (WebCore::ISOWebVTTCue::toJSONString const): Serialize to JSON string. * platform/graphics/iso/ISOVTTCue.h: (WTF::LogArgument<WebCore::ISOWebVTTCue>::toString): Ditto. Source/WTF: * wtf/Logger.h: (WTF::Logger::log): (WTF::LogArgument<Logger::LogSiteIdentifier>::toString): * wtf/MediaTime.cpp: (WTF::MediaTime::toJSONString const): Serialize to JSON string. * wtf/MediaTime.h: LayoutTests: * inspector/canvas/recording-2d-expected.txt: * inspector/canvas/recording-webgl-expected.txt: * inspector/canvas/recording-webgl-snapshots-expected.txt: Canonical link: https://commits.webkit.org/196579@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225764 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-12-12 00:41:54 +00:00
}
if (isInvalid())
object->setBoolean("invalid"_s, true);
else if (isIndefinite())
[MSE] Convert debug-only logging to runtime logging https://bugs.webkit.org/show_bug.cgi?id=194348 <rdar://problem/47566449> Reviewed by Jer Noble. Source/WebCore: No new tests, this just changes existing logging. * Modules/mediasource/MediaSource.cpp: (WebCore::convertEnumerationToString): (WebCore::MediaSource::MediaSource): (WebCore::MediaSource::~MediaSource): (WebCore::MediaSource::setPrivateAndOpen): (WebCore::MediaSource::addedToRegistry): (WebCore::MediaSource::removedFromRegistry): (WebCore::MediaSource::durationChanged): (WebCore::MediaSource::seekToTime): (WebCore::MediaSource::completeSeek): (WebCore::MediaSource::setLiveSeekableRange): (WebCore::MediaSource::clearLiveSeekableRange): (WebCore::MediaSource::setDuration): (WebCore::MediaSource::setDurationInternal): (WebCore::MediaSource::setReadyState): (WebCore::MediaSource::endOfStream): (WebCore::MediaSource::streamEndedWithError): (WebCore::MediaSource::addSourceBuffer): (WebCore::MediaSource::removeSourceBuffer): (WebCore::MediaSource::isTypeSupported): (WebCore::MediaSource::detachFromElement): (WebCore::MediaSource::attachToElement): (WebCore::MediaSource::openIfInEndedState): (WebCore::MediaSource::suspend): (WebCore::MediaSource::resume): (WebCore::MediaSource::stop): (WebCore::MediaSource::onReadyStateChange): (WebCore::MediaSource::scheduleEvent): (WebCore::MediaSource::logChannel const): (WebCore::MediaSourceInternal::toString): Deleted. * Modules/mediasource/MediaSource.h: (WTF::LogArgument<WebCore::MediaSource::EndOfStreamError>::toString): (WTF::LogArgument<WebCore::MediaSource::ReadyState>::toString): * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::SourceBuffer): (WebCore::SourceBuffer::~SourceBuffer): (WebCore::SourceBuffer::remove): (WebCore::SourceBuffer::seekToTime): (WebCore::SourceBuffer::appendBufferInternal): (WebCore::SourceBuffer::sourceBufferPrivateAppendComplete): (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveRenderingError): (WebCore::removeSamplesFromTrackBuffer): (WebCore::SourceBuffer::removeCodedFrames): (WebCore::SourceBuffer::evictCodedFrames): (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment): (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): (WebCore::SourceBuffer::sourceBufferPrivateReenqueSamples): (WebCore::SourceBuffer::sourceBufferPrivateDidBecomeReadyForMoreSamples): (WebCore::SourceBuffer::provideMediaData): (WebCore::SourceBuffer::trySignalAllSamplesInTrackEnqueued): (WebCore::SourceBuffer::monitorBufferingRate): (WebCore::SourceBuffer::logChannel const): * Modules/mediasource/SourceBuffer.h: * dom/Document.cpp: (WebCore::messageSourceForWTFLogChannel): (WebCore::Document::didLogMessage): * html/HTMLMediaElement.cpp: (WebCore::convertEnumerationToString): (WebCore::HTMLMediaElement::scheduleCheckPlaybackTargetCompatability): (WebCore::HTMLMediaElement::selectMediaResource): (WebCore::HTMLMediaElement::loadResource): (WebCore::HTMLMediaElement::updateActiveTextTrackCues): (WebCore::HTMLMediaElement::scheduleConfigureTextTracks): (WebCore::HTMLMediaElement::scheduleMediaEngineWasUpdated): (WebCore::HTMLMediaElement::scheduleUpdatePlayState): (WebCore::HTMLMediaElement::scheduleUpdateMediaState): * platform/ContentType.cpp: (WebCore::ContentType::toJSONString const): * platform/ContentType.h: (WTF::LogArgument<WebCore::ContentType>::toString): * platform/MediaSample.h: (WebCore::MediaSample::toJSONString const): (WTF::LogArgument<WebCore::MediaSample>::toString): * platform/graphics/FloatSize.cpp: (WebCore::FloatSize::toJSONObject const): (WebCore::FloatSize::toJSONString const): * platform/graphics/FloatSize.h: (WTF::LogArgument<WebCore::FloatSize>::toString): * platform/graphics/MediaSourcePrivate.h: (WebCore::MediaSourcePrivate::mediaSourceLogIdentifier): (WTF::LogArgument<WebCore::MediaSourcePrivate::AddStatus>::toString): (WTF::LogArgument<WebCore::MediaSourcePrivate::EndOfStreamStatus>::toString): * platform/graphics/SourceBufferPrivate.h: (WebCore::SourceBufferPrivate::sourceBufferLogger const): (WebCore::SourceBufferPrivate::sourceBufferLogIdentifier): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::setMuted): (WebCore::MediaPlayerPrivateAVFoundationObjC::setClosedCaptionsVisible): (WebCore::MediaPlayerPrivateAVFoundationObjC::isCurrentPlaybackTargetWireless const): (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessVideoPlaybackDisabled const): (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessVideoPlaybackDisabled): (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget): (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldBufferData): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::mediaPlayerLogIdentifier): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::mediaPlayerLogger): (WTF::LogArgument<WebCore::MediaPlayerPrivateMediaSourceAVFObjC::SeekState>::toString): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::convertEnumerationToString): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::~MediaPlayerPrivateMediaSourceAVFObjC): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::play): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::playInternal): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pause): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pauseInternal): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVolume): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setMuted): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVisible): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitForSeekCompleted): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekCompleted): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setPreservesPitch): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableVideoFrame): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::updateAllRenderersHaveAvailableSamples): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationChanged): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setNaturalSize): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceAttached): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceDetached): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::attemptToDecryptWithInstance): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitingForKeyChanged): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::initializationDataEncountered): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setReadyState): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setNetworkState): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setShouldPlayToPlaybackTarget): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isCurrentPlaybackTargetWireless const): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::logChannel const): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample): * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h: * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm: (WebCore::MediaSampleAVFObjC::toJSONString const): * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h: * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm: (WebCore::MediaSourcePrivateAVFObjC::MediaSourcePrivateAVFObjC): (WebCore::MediaSourcePrivateAVFObjC::~MediaSourcePrivateAVFObjC): (WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer): (WebCore::MediaSourcePrivateAVFObjC::logChannel const): * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::bufferWasConsumedCallback): (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC): (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC): (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset): (WebCore::SourceBufferPrivateAVFObjC::didFailToParseStreamDataWithError): (WebCore::SourceBufferPrivateAVFObjC::processCodedFrame): (WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID): (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID): (WebCore::SourceBufferPrivateAVFObjC::append): (WebCore::SourceBufferPrivateAVFObjC::abort): (WebCore::SourceBufferPrivateAVFObjC::resetParserState): (WebCore::SourceBufferPrivateAVFObjC::removedFromMediaSource): (WebCore::SourceBufferPrivateAVFObjC::setReadyState): (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled): (WebCore::SourceBufferPrivateAVFObjC::setCDMSession): (WebCore::SourceBufferPrivateAVFObjC::setCDMInstance): (WebCore::SourceBufferPrivateAVFObjC::layerDidReceiveError): (WebCore::SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged): (WebCore::SourceBufferPrivateAVFObjC::flush): (WebCore::SourceBufferPrivateAVFObjC::flushVideo): (WebCore::SourceBufferPrivateAVFObjC::enqueueSample): (WebCore::SourceBufferPrivateAVFObjC::bufferWasConsumed): (WebCore::SourceBufferPrivateAVFObjC::setActive): (WebCore::SourceBufferPrivateAVFObjC::willSeek): (WebCore::SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples): (WebCore::SourceBufferPrivateAVFObjC::canSwitchToType): (WebCore::SourceBufferPrivateAVFObjC::setDecompressionSession): (WebCore::SourceBufferPrivateAVFObjC::logChannel const): Source/WTF: * wtf/LoggerHelper.h: (WTF::LoggerHelper::childLogIdentifier const): Helper to generate a log identifier for an object that is associated with another logging object. * wtf/MediaTime.cpp: (WTF::MediaTime::toJSONObject const): (WTF::MediaTime::toJSONString const): (WTF::MediaTimeRange::toJSONString const): (WTF::toJSONStringInternal): Deleted. * wtf/MediaTime.h: Canonical link: https://commits.webkit.org/208835@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241148 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-02-07 22:58:05 +00:00
object->setString("value"_s, "NaN"_s);
else if (isPositiveInfinite())
object->setString("value"_s, "POSITIVE_INFINITY"_s);
else if (isNegativeInfinite())
object->setString("value"_s, "NEGATIVE_INFINITY"_s);
else
object->setDouble("value"_s, toDouble());
object->setDouble("numerator"_s, static_cast<double>(m_timeValue));
object->setInteger("denominator"_s, m_timeScale);
object->setInteger("flags"_s, m_timeFlags);
return object;
}
String MediaTime::toJSONString() const
{
[MSE] Convert debug-only logging to runtime logging https://bugs.webkit.org/show_bug.cgi?id=194348 <rdar://problem/47566449> Reviewed by Jer Noble. Source/WebCore: No new tests, this just changes existing logging. * Modules/mediasource/MediaSource.cpp: (WebCore::convertEnumerationToString): (WebCore::MediaSource::MediaSource): (WebCore::MediaSource::~MediaSource): (WebCore::MediaSource::setPrivateAndOpen): (WebCore::MediaSource::addedToRegistry): (WebCore::MediaSource::removedFromRegistry): (WebCore::MediaSource::durationChanged): (WebCore::MediaSource::seekToTime): (WebCore::MediaSource::completeSeek): (WebCore::MediaSource::setLiveSeekableRange): (WebCore::MediaSource::clearLiveSeekableRange): (WebCore::MediaSource::setDuration): (WebCore::MediaSource::setDurationInternal): (WebCore::MediaSource::setReadyState): (WebCore::MediaSource::endOfStream): (WebCore::MediaSource::streamEndedWithError): (WebCore::MediaSource::addSourceBuffer): (WebCore::MediaSource::removeSourceBuffer): (WebCore::MediaSource::isTypeSupported): (WebCore::MediaSource::detachFromElement): (WebCore::MediaSource::attachToElement): (WebCore::MediaSource::openIfInEndedState): (WebCore::MediaSource::suspend): (WebCore::MediaSource::resume): (WebCore::MediaSource::stop): (WebCore::MediaSource::onReadyStateChange): (WebCore::MediaSource::scheduleEvent): (WebCore::MediaSource::logChannel const): (WebCore::MediaSourceInternal::toString): Deleted. * Modules/mediasource/MediaSource.h: (WTF::LogArgument<WebCore::MediaSource::EndOfStreamError>::toString): (WTF::LogArgument<WebCore::MediaSource::ReadyState>::toString): * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::SourceBuffer): (WebCore::SourceBuffer::~SourceBuffer): (WebCore::SourceBuffer::remove): (WebCore::SourceBuffer::seekToTime): (WebCore::SourceBuffer::appendBufferInternal): (WebCore::SourceBuffer::sourceBufferPrivateAppendComplete): (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveRenderingError): (WebCore::removeSamplesFromTrackBuffer): (WebCore::SourceBuffer::removeCodedFrames): (WebCore::SourceBuffer::evictCodedFrames): (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment): (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): (WebCore::SourceBuffer::sourceBufferPrivateReenqueSamples): (WebCore::SourceBuffer::sourceBufferPrivateDidBecomeReadyForMoreSamples): (WebCore::SourceBuffer::provideMediaData): (WebCore::SourceBuffer::trySignalAllSamplesInTrackEnqueued): (WebCore::SourceBuffer::monitorBufferingRate): (WebCore::SourceBuffer::logChannel const): * Modules/mediasource/SourceBuffer.h: * dom/Document.cpp: (WebCore::messageSourceForWTFLogChannel): (WebCore::Document::didLogMessage): * html/HTMLMediaElement.cpp: (WebCore::convertEnumerationToString): (WebCore::HTMLMediaElement::scheduleCheckPlaybackTargetCompatability): (WebCore::HTMLMediaElement::selectMediaResource): (WebCore::HTMLMediaElement::loadResource): (WebCore::HTMLMediaElement::updateActiveTextTrackCues): (WebCore::HTMLMediaElement::scheduleConfigureTextTracks): (WebCore::HTMLMediaElement::scheduleMediaEngineWasUpdated): (WebCore::HTMLMediaElement::scheduleUpdatePlayState): (WebCore::HTMLMediaElement::scheduleUpdateMediaState): * platform/ContentType.cpp: (WebCore::ContentType::toJSONString const): * platform/ContentType.h: (WTF::LogArgument<WebCore::ContentType>::toString): * platform/MediaSample.h: (WebCore::MediaSample::toJSONString const): (WTF::LogArgument<WebCore::MediaSample>::toString): * platform/graphics/FloatSize.cpp: (WebCore::FloatSize::toJSONObject const): (WebCore::FloatSize::toJSONString const): * platform/graphics/FloatSize.h: (WTF::LogArgument<WebCore::FloatSize>::toString): * platform/graphics/MediaSourcePrivate.h: (WebCore::MediaSourcePrivate::mediaSourceLogIdentifier): (WTF::LogArgument<WebCore::MediaSourcePrivate::AddStatus>::toString): (WTF::LogArgument<WebCore::MediaSourcePrivate::EndOfStreamStatus>::toString): * platform/graphics/SourceBufferPrivate.h: (WebCore::SourceBufferPrivate::sourceBufferLogger const): (WebCore::SourceBufferPrivate::sourceBufferLogIdentifier): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::setMuted): (WebCore::MediaPlayerPrivateAVFoundationObjC::setClosedCaptionsVisible): (WebCore::MediaPlayerPrivateAVFoundationObjC::isCurrentPlaybackTargetWireless const): (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessVideoPlaybackDisabled const): (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessVideoPlaybackDisabled): (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget): (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldBufferData): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::mediaPlayerLogIdentifier): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::mediaPlayerLogger): (WTF::LogArgument<WebCore::MediaPlayerPrivateMediaSourceAVFObjC::SeekState>::toString): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::convertEnumerationToString): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::~MediaPlayerPrivateMediaSourceAVFObjC): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::play): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::playInternal): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pause): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pauseInternal): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVolume): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setMuted): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVisible): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitForSeekCompleted): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekCompleted): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setPreservesPitch): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableVideoFrame): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::updateAllRenderersHaveAvailableSamples): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationChanged): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setNaturalSize): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceAttached): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceDetached): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::attemptToDecryptWithInstance): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitingForKeyChanged): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::initializationDataEncountered): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setReadyState): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setNetworkState): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setShouldPlayToPlaybackTarget): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isCurrentPlaybackTargetWireless const): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::logChannel const): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample): * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h: * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm: (WebCore::MediaSampleAVFObjC::toJSONString const): * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h: * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm: (WebCore::MediaSourcePrivateAVFObjC::MediaSourcePrivateAVFObjC): (WebCore::MediaSourcePrivateAVFObjC::~MediaSourcePrivateAVFObjC): (WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer): (WebCore::MediaSourcePrivateAVFObjC::logChannel const): * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::bufferWasConsumedCallback): (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC): (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC): (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset): (WebCore::SourceBufferPrivateAVFObjC::didFailToParseStreamDataWithError): (WebCore::SourceBufferPrivateAVFObjC::processCodedFrame): (WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID): (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID): (WebCore::SourceBufferPrivateAVFObjC::append): (WebCore::SourceBufferPrivateAVFObjC::abort): (WebCore::SourceBufferPrivateAVFObjC::resetParserState): (WebCore::SourceBufferPrivateAVFObjC::removedFromMediaSource): (WebCore::SourceBufferPrivateAVFObjC::setReadyState): (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled): (WebCore::SourceBufferPrivateAVFObjC::setCDMSession): (WebCore::SourceBufferPrivateAVFObjC::setCDMInstance): (WebCore::SourceBufferPrivateAVFObjC::layerDidReceiveError): (WebCore::SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged): (WebCore::SourceBufferPrivateAVFObjC::flush): (WebCore::SourceBufferPrivateAVFObjC::flushVideo): (WebCore::SourceBufferPrivateAVFObjC::enqueueSample): (WebCore::SourceBufferPrivateAVFObjC::bufferWasConsumed): (WebCore::SourceBufferPrivateAVFObjC::setActive): (WebCore::SourceBufferPrivateAVFObjC::willSeek): (WebCore::SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples): (WebCore::SourceBufferPrivateAVFObjC::canSwitchToType): (WebCore::SourceBufferPrivateAVFObjC::setDecompressionSession): (WebCore::SourceBufferPrivateAVFObjC::logChannel const): Source/WTF: * wtf/LoggerHelper.h: (WTF::LoggerHelper::childLogIdentifier const): Helper to generate a log identifier for an object that is associated with another logging object. * wtf/MediaTime.cpp: (WTF::MediaTime::toJSONObject const): (WTF::MediaTime::toJSONString const): (WTF::MediaTimeRange::toJSONString const): (WTF::toJSONStringInternal): Deleted. * wtf/MediaTime.h: Canonical link: https://commits.webkit.org/208835@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241148 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-02-07 22:58:05 +00:00
return toJSONObject()->toJSONString();
Web Inspector: Optionally log WebKit log parameters as JSON https://bugs.webkit.org/show_bug.cgi?id=180529 <rdar://problem/35909462> Reviewed by Joseph Pecoraro. Source/JavaScriptCore: * inspector/ConsoleMessage.cpp: (Inspector::ConsoleMessage::ConsoleMessage): New constructor that takes a vector of JSON log values. Concatenate all adjacent strings to make logging cleaner. (Inspector::ConsoleMessage::addToFrontend): Process WebKit logging arguments. (Inspector::ConsoleMessage::scriptState const): * inspector/ConsoleMessage.h: * inspector/InjectedScript.cpp: (Inspector::InjectedScript::wrapJSONString const): Wrap JSON string log arguments. * inspector/InjectedScript.h: * inspector/InjectedScriptSource.js: (let.InjectedScript.prototype.wrapJSONString): Source/WebCore: * dom/Document.cpp: (WebCore::Document::didLogMessage):Update for API change. Don't check for main thread, that is already done in addConsoleMessage. * dom/Document.h: * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::updatePlayState): Cleanup logging. * html/track/DataCue.cpp: (WebCore::DataCue::toJSONString const): Serialize to JSON string. (WebCore::DataCue::toString const): Deleted. * html/track/DataCue.h: (WTF::LogArgument<WebCore::DataCue>::toString): * html/track/TextTrackCue.cpp: (WebCore::TextTrackCue::toJSON const): Ditto. (WebCore::TextTrackCue::toJSONString const): (WebCore::TextTrackCue::toString const): Deleted. * html/track/TextTrackCue.h: (WTF::LogArgument<WebCore::TextTrackCue>::toString): * html/track/TextTrackCueGeneric.cpp: (WebCore::TextTrackCueGeneric::toJSONString const): Ditto. (WebCore::TextTrackCueGeneric::toString const): Deleted. * html/track/TextTrackCueGeneric.h: (WTF::LogArgument<WebCore::TextTrackCueGeneric>::toString): * html/track/VTTCue.cpp: (WebCore::VTTCue::toJSONString const): Ditto. (WebCore::VTTCue::toString const): Deleted. * html/track/VTTCue.h: (WTF::LogArgument<WebCore::VTTCue>::toString): * platform/graphics/InbandTextTrackPrivateClient.h: (WebCore::GenericCueData::toJSONString const): Ditto. (WTF::LogArgument<WebCore::GenericCueData>::toString): (WebCore::GenericCueData::toString const): Deleted. * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: (WebCore::InbandTextTrackPrivateAVF::processAttributedStrings): Cleanup logging. (WebCore::InbandTextTrackPrivateAVF::removeCompletedCues): Ditto. (WebCore::InbandTextTrackPrivateAVF::processNativeSamples): Log the entire cue. (WebCore::InbandTextTrackPrivateAVF::readNativeSampleBuffer): Cleanup logging. * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: (WebCore::MediaPlayerPrivateAVFoundation::maxMediaTimeSeekable const): Don't log, it isn't interesting and happens frequently. (WebCore::MediaPlayerPrivateAVFoundation::minMediaTimeSeekable const): Ditto. * platform/graphics/iso/ISOVTTCue.cpp: (WebCore::ISOWebVTTCue::toJSONString const): Serialize to JSON string. * platform/graphics/iso/ISOVTTCue.h: (WTF::LogArgument<WebCore::ISOWebVTTCue>::toString): Ditto. Source/WTF: * wtf/Logger.h: (WTF::Logger::log): (WTF::LogArgument<Logger::LogSiteIdentifier>::toString): * wtf/MediaTime.cpp: (WTF::MediaTime::toJSONString const): Serialize to JSON string. * wtf/MediaTime.h: LayoutTests: * inspector/canvas/recording-2d-expected.txt: * inspector/canvas/recording-webgl-expected.txt: * inspector/canvas/recording-webgl-snapshots-expected.txt: Canonical link: https://commits.webkit.org/196579@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225764 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-12-12 00:41:54 +00:00
}
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
MediaTime abs(const MediaTime& rhs)
{
if (rhs.isInvalid())
return MediaTime::invalidTime();
if (rhs.isNegativeInfinite() || rhs.isPositiveInfinite())
return MediaTime::positiveInfiniteTime();
[WTF] MediaTime should support round-tripping from and to doubles. https://bugs.webkit.org/show_bug.cgi?id=139248 Reviewed by Eric Carlson. Source/WebCore: Check whether the MediaTime's underlying data is floating point before converting to a CMTime or QTTime. * platform/graphics/avfoundation/MediaTimeAVFoundation.cpp: (WebCore::toCMTime): * platform/graphics/mac/MediaTimeQTKit.mm: (WebCore::toQTTime): Source/WTF: MediaTimes should be able to return precisely the same double value as was used when the MediaTime was created, so long as that MediaTime was not modified in a non-destructive way. This will allow API which accepts floating-point values to return the exact same value when asked, but still be able to store that value as a MediaTime. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): Added; store the floating-point value in a union. (WTF::MediaTime::createWithDouble): Ditto. (WTF::MediaTime::toFloat): If the value is a double, just return it. (WTF::MediaTime::toDouble): Ditto. (WTF::MediaTime::operator+): Special case when one or both sides are doubles. (WTF::MediaTime::operator-): Ditto. (WTF::MediaTime::operator*): Ditto. (WTF::MediaTime::compare): Ditto. (WTF::abs): Ditto. (WTF::MediaTime::setTimeScale): Convert the MediaTime from a double. Tools: Add API tests for new features of MediaTime. Update the LLDB python provider to correctly display the MediaTimes after this change. * TestWebKitAPI/Tests/WTF/MediaTime.cpp: (WTF::operator<<): (TestWebKitAPI::TEST): * lldb/lldb_webkit.py: (WTFMediaTime_SummaryProvider): (WTFMediaTimeProvider.timeValueAsDouble): (WTFMediaTimeProvider.isIndefinite): (WTFMediaTimeProvider): (WTFMediaTimeProvider.hasDoubleValue): Canonical link: https://commits.webkit.org/157162@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@176863 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-12-05 20:51:02 +00:00
if (rhs.hasDoubleValue())
return MediaTime::createWithDouble(fabs(rhs.m_timeValueAsDouble));
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
MediaTime val = rhs;
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
val.m_timeValue = std::abs(rhs.m_timeValue);
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
return val;
}
String MediaTimeRange::toJSONString() const
{
auto object = JSON::Object::create();
[MSE] Convert debug-only logging to runtime logging https://bugs.webkit.org/show_bug.cgi?id=194348 <rdar://problem/47566449> Reviewed by Jer Noble. Source/WebCore: No new tests, this just changes existing logging. * Modules/mediasource/MediaSource.cpp: (WebCore::convertEnumerationToString): (WebCore::MediaSource::MediaSource): (WebCore::MediaSource::~MediaSource): (WebCore::MediaSource::setPrivateAndOpen): (WebCore::MediaSource::addedToRegistry): (WebCore::MediaSource::removedFromRegistry): (WebCore::MediaSource::durationChanged): (WebCore::MediaSource::seekToTime): (WebCore::MediaSource::completeSeek): (WebCore::MediaSource::setLiveSeekableRange): (WebCore::MediaSource::clearLiveSeekableRange): (WebCore::MediaSource::setDuration): (WebCore::MediaSource::setDurationInternal): (WebCore::MediaSource::setReadyState): (WebCore::MediaSource::endOfStream): (WebCore::MediaSource::streamEndedWithError): (WebCore::MediaSource::addSourceBuffer): (WebCore::MediaSource::removeSourceBuffer): (WebCore::MediaSource::isTypeSupported): (WebCore::MediaSource::detachFromElement): (WebCore::MediaSource::attachToElement): (WebCore::MediaSource::openIfInEndedState): (WebCore::MediaSource::suspend): (WebCore::MediaSource::resume): (WebCore::MediaSource::stop): (WebCore::MediaSource::onReadyStateChange): (WebCore::MediaSource::scheduleEvent): (WebCore::MediaSource::logChannel const): (WebCore::MediaSourceInternal::toString): Deleted. * Modules/mediasource/MediaSource.h: (WTF::LogArgument<WebCore::MediaSource::EndOfStreamError>::toString): (WTF::LogArgument<WebCore::MediaSource::ReadyState>::toString): * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::SourceBuffer): (WebCore::SourceBuffer::~SourceBuffer): (WebCore::SourceBuffer::remove): (WebCore::SourceBuffer::seekToTime): (WebCore::SourceBuffer::appendBufferInternal): (WebCore::SourceBuffer::sourceBufferPrivateAppendComplete): (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveRenderingError): (WebCore::removeSamplesFromTrackBuffer): (WebCore::SourceBuffer::removeCodedFrames): (WebCore::SourceBuffer::evictCodedFrames): (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment): (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): (WebCore::SourceBuffer::sourceBufferPrivateReenqueSamples): (WebCore::SourceBuffer::sourceBufferPrivateDidBecomeReadyForMoreSamples): (WebCore::SourceBuffer::provideMediaData): (WebCore::SourceBuffer::trySignalAllSamplesInTrackEnqueued): (WebCore::SourceBuffer::monitorBufferingRate): (WebCore::SourceBuffer::logChannel const): * Modules/mediasource/SourceBuffer.h: * dom/Document.cpp: (WebCore::messageSourceForWTFLogChannel): (WebCore::Document::didLogMessage): * html/HTMLMediaElement.cpp: (WebCore::convertEnumerationToString): (WebCore::HTMLMediaElement::scheduleCheckPlaybackTargetCompatability): (WebCore::HTMLMediaElement::selectMediaResource): (WebCore::HTMLMediaElement::loadResource): (WebCore::HTMLMediaElement::updateActiveTextTrackCues): (WebCore::HTMLMediaElement::scheduleConfigureTextTracks): (WebCore::HTMLMediaElement::scheduleMediaEngineWasUpdated): (WebCore::HTMLMediaElement::scheduleUpdatePlayState): (WebCore::HTMLMediaElement::scheduleUpdateMediaState): * platform/ContentType.cpp: (WebCore::ContentType::toJSONString const): * platform/ContentType.h: (WTF::LogArgument<WebCore::ContentType>::toString): * platform/MediaSample.h: (WebCore::MediaSample::toJSONString const): (WTF::LogArgument<WebCore::MediaSample>::toString): * platform/graphics/FloatSize.cpp: (WebCore::FloatSize::toJSONObject const): (WebCore::FloatSize::toJSONString const): * platform/graphics/FloatSize.h: (WTF::LogArgument<WebCore::FloatSize>::toString): * platform/graphics/MediaSourcePrivate.h: (WebCore::MediaSourcePrivate::mediaSourceLogIdentifier): (WTF::LogArgument<WebCore::MediaSourcePrivate::AddStatus>::toString): (WTF::LogArgument<WebCore::MediaSourcePrivate::EndOfStreamStatus>::toString): * platform/graphics/SourceBufferPrivate.h: (WebCore::SourceBufferPrivate::sourceBufferLogger const): (WebCore::SourceBufferPrivate::sourceBufferLogIdentifier): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::setMuted): (WebCore::MediaPlayerPrivateAVFoundationObjC::setClosedCaptionsVisible): (WebCore::MediaPlayerPrivateAVFoundationObjC::isCurrentPlaybackTargetWireless const): (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessVideoPlaybackDisabled const): (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessVideoPlaybackDisabled): (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget): (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldBufferData): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::mediaPlayerLogIdentifier): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::mediaPlayerLogger): (WTF::LogArgument<WebCore::MediaPlayerPrivateMediaSourceAVFObjC::SeekState>::toString): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::convertEnumerationToString): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::~MediaPlayerPrivateMediaSourceAVFObjC): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::play): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::playInternal): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pause): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pauseInternal): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVolume): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setMuted): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVisible): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitForSeekCompleted): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekCompleted): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setPreservesPitch): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableVideoFrame): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::updateAllRenderersHaveAvailableSamples): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationChanged): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setNaturalSize): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceAttached): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceDetached): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::attemptToDecryptWithInstance): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitingForKeyChanged): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::initializationDataEncountered): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setReadyState): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setNetworkState): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setShouldPlayToPlaybackTarget): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isCurrentPlaybackTargetWireless const): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::logChannel const): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample): * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h: * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm: (WebCore::MediaSampleAVFObjC::toJSONString const): * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h: * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm: (WebCore::MediaSourcePrivateAVFObjC::MediaSourcePrivateAVFObjC): (WebCore::MediaSourcePrivateAVFObjC::~MediaSourcePrivateAVFObjC): (WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer): (WebCore::MediaSourcePrivateAVFObjC::logChannel const): * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::bufferWasConsumedCallback): (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC): (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC): (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset): (WebCore::SourceBufferPrivateAVFObjC::didFailToParseStreamDataWithError): (WebCore::SourceBufferPrivateAVFObjC::processCodedFrame): (WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID): (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID): (WebCore::SourceBufferPrivateAVFObjC::append): (WebCore::SourceBufferPrivateAVFObjC::abort): (WebCore::SourceBufferPrivateAVFObjC::resetParserState): (WebCore::SourceBufferPrivateAVFObjC::removedFromMediaSource): (WebCore::SourceBufferPrivateAVFObjC::setReadyState): (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled): (WebCore::SourceBufferPrivateAVFObjC::setCDMSession): (WebCore::SourceBufferPrivateAVFObjC::setCDMInstance): (WebCore::SourceBufferPrivateAVFObjC::layerDidReceiveError): (WebCore::SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged): (WebCore::SourceBufferPrivateAVFObjC::flush): (WebCore::SourceBufferPrivateAVFObjC::flushVideo): (WebCore::SourceBufferPrivateAVFObjC::enqueueSample): (WebCore::SourceBufferPrivateAVFObjC::bufferWasConsumed): (WebCore::SourceBufferPrivateAVFObjC::setActive): (WebCore::SourceBufferPrivateAVFObjC::willSeek): (WebCore::SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples): (WebCore::SourceBufferPrivateAVFObjC::canSwitchToType): (WebCore::SourceBufferPrivateAVFObjC::setDecompressionSession): (WebCore::SourceBufferPrivateAVFObjC::logChannel const): Source/WTF: * wtf/LoggerHelper.h: (WTF::LoggerHelper::childLogIdentifier const): Helper to generate a log identifier for an object that is associated with another logging object. * wtf/MediaTime.cpp: (WTF::MediaTime::toJSONObject const): (WTF::MediaTime::toJSONString const): (WTF::MediaTimeRange::toJSONString const): (WTF::toJSONStringInternal): Deleted. * wtf/MediaTime.h: Canonical link: https://commits.webkit.org/208835@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241148 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-02-07 22:58:05 +00:00
object->setObject("start"_s, start.toJSONObject());
object->setObject("end"_s, end.toJSONObject());
return object->toJSONString();
Support a rational time class for use by media elements. https://bugs.webkit.org/show_bug.cgi?id=88787 Source/JavaScriptCore: Re-export WTF::MediaTime from JavaScriptCore. Reviewed by Eric Carlson. * JavaScriptCore.order: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WTF: Reviewed by Eric Carlson. Add a new MediaTime class which implements rational math operations. Add common constructors and assignment operators: * wtf/MediaTime.cpp: Added. (WTF::MediaTime::MediaTime): (WTF::MediaTime::~MediaTime): (WTF::MediaTime::operator=): Add common math operators: * wtf/MediaTime.cpp: (WTF::MediaTime::operator+): (WTF::MediaTime::operator-): (WTF::MediaTime::operator<): (WTF::MediaTime::operator>): (WTF::MediaTime::operator==): (WTF::MediaTime::operator>=): (WTF::MediaTime::operator<=): Add functions to check the MeiaTime time type flags: * wtf/MediaTime.h: (WTF::MediaTime::isValid): (WTF::MediaTime::isInvalid): (WTF::MediaTime::hasBeenRounde): (WTF::MediaTime::isPositiveInfinite): (WTF::MediaTime::isNegativeInfinite): (WTF::MediaTime::isIndefinite): Add constants for commonly used MediaTime values: (WTF::MediaTime::zeroTime): (WTF::MediaTime::invalidTime): (WTF::MediaTime::positiveInfiniteTime): (WTF::MediaTime::negativeInfiniteTime): (WTF::MediaTime::indefiniteTime): Add explicit conversion functions to convert to and from floating point values. * wtf/MediaTime.cpp: (WTF::MediaTime::createWithFloat): (WTF::MediaTime::createWithDouble): (WTF::MediaTime::toFloat): (WTF::MediaTime::toDouble): Add some useful exported functions: * wtf/MediaTime.cpp: (WTF::MediaTime::compare): Master function for the comparison operators above. (WTF::MediaTime::setTimeScale): Rescale the time value to a new time scale. (WTF::abs): Return an absolute value for the current MediaTime. Static utility functions to implement the above: * wtf/MediaTime.cpp: (WTF::greatestCommonDivisor): (WTF::leastCommonMultiple): (WTF::signum): Windows-only implementations of isinf and signbit: * wtf/MediaTime.cpp: (std::isinf): (std::signbit): Add the new class to platform build files: * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: Tools: Add unit tests for the WTF::MediaTime class. Reviewed by Eric Carlson. * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/TestWebKitAPI.gypi: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Added. * TestWebKitAPI/win/TestWebKitAPI.vcproj: (WTF::operator<<): (TestWebKitAPI): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/110313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-27 16:31:07 +00:00
}
Streamline PODIntervalTree code and remove ValueToString https://bugs.webkit.org/show_bug.cgi?id=199782 Reviewed by Anders Carlsson. Source/WebCore: * dom/Element.cpp: Updated includes. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::ignoreTrackDisplayUpdateRequests const): Moved this function out of line so we don't have to include PODIntervalTree.h in the header. But also, it's only used inside this file. Also updated for m_cueData. (WebCore::HTMLMediaElement::updateActiveTextTrackCues): More of the same. (WebCore::HTMLMediaElement::textTrackAddCue): Ditto. (WebCore::HTMLMediaElement::textTrackRemoveCue): Ditto. (WebCore::HTMLMediaElement::currentlyActiveCues const): Ditto. * html/HTMLMediaElement.h: Changed to not include PODIntervalTree.h, which in turn includes PODRedBlackTree.h, to significantly cut down how many times we have to compile those headers. Moved some functions out of line. Made m_cueData to hold the two cue-related objects so they don't have to be defined in the header. Also removed ValueToString specializations. * html/track/TextTrackCue.cpp: (WebCore::operator<<): Added debug-only overload of TextStream operator. (WebCore::TextTrackCue::debugString const): Deleted. * html/track/TextTrackCue.h: Updated for the above. * html/track/VTTCue.h: Added comments about the incorrect implementation of isType for VTTCue. Tweaked formatting a bit as well. * platform/LayoutUnit.h: Removed ValueToString specialization. * platform/PODInterval.h: Use #pragma once. Removed inaccurate comments saying this works only with POD. Use TextStream instead of ValueToString. Added overloads to the constructor so we can do move semantics instead of copy semantics, slightly better for WeakPtr. Removed the toString function and added an overload of operator<< with TextStream. Use "{ }" instead of "0" as the default value for user data. * platform/PODIntervalTree.h: Removed unneeded includes and unusual default argument types for the templates. Changed setNeedsFullOrderingComparisons and node updating to use template arguments instead of virtual functions and runtime setters. This allowed removal of the constructor and the init function since the defaults take care of both. Removed the overload of the allOverlaps function that uses an out argument. Removed unneeded use of WTF_MAKE_NONCOPYABLE. Use "{ }" instead of 0 for the default value for user data. Changed the createInterval function to use move semantics. Changed the nextIntervalAfter function to just take a point, not require and interval and use its high point. The PODIntervalTree::updateNode function is replaced with the PODIntervalNodeUpdater::update function. Removed the ValueToString use and the overriding as well and replaced with TextStream use. * platform/PODRedBlackTree.h: Updated comments to reflect the fact that this is not specific to POD and uses TextStream. Also that the needsFullOrderingComparisons technique is now a template argument. Use pragma once. Added FIXME about a few major improvements we should make. (WebCore::PODRedBlackTree::~PODRedBlackTree): Made non-virtual since we use template arguments for polymorphism and don't need virtual functions too. (WebCore::PODRedBlackTree::clear): Rewrote to use a non-recursive algorithm to delete the tree nodes. (WebCore::PODRedBlackTree::add): Added an overload that takes an rvalue reference for move semantics. (WebCore::PODRedBlackTree::visitInorder const): Deleted. (WebCore::PODRedBlackTree::size const): Deleted. (WebCore::PODRedBlackTree::isEmpty const): Replaced the inefficiently implemented size function with this much faster function. Could have also made a more efficient size function, but no client needs it. (WebCore::PODRedBlackTree::setNeedsFullOrderingComparisons): Deleted. (WebCore::PODRedBlackTree::checkInvariants const): Made non-virtual since there is no need for polymorphism. (WebCore::PODRedBlackTree::Node::Node): Use rvalue reference and move semantics. (WebCore::PODRedBlackTree::Node::copyFrom): Deleted. (WebCore::PODRedBlackTree::Node::moveDataFrom): Use move instead of copy. Also removed the gratuitous use of virtual. (WebCore::PODRedBlackTree::updateNode): Made non-virtual and instead call through the NodeUpdaterType (actually more like "traits"). (WebCore::PODRedBlackTree::treeSearch const): Use template argument instead of data member. (WebCore::PODRedBlackTree::treeSuccessor): Made a static member function. (WebCore::PODRedBlackTree::treeMinimum): Ditto. (WebCore::PODRedBlackTree::treeSuccessorInPostOrder): Added. Useful when deleting the tree so we visit children before deleting the parent. (WebCore::PODRedBlackTree::deleteNode): Use moveDataFrom when moving the data from a node that we are about to delete. (WebCore::PODRedBlackTree::visitInorderImpl const): Deleted. (WebCore::PODRedBlackTree::markFree): Deleted. (WebCore::PODRedBlackTree::Counter): Deleted. (WebCore::PODRedBlackTree::dumpFromNode const): Use TextStream. * platform/graphics/FloatPolygon.cpp: (WebCore::FloatPolygon::FloatPolygon): Tweaked coding style a bit. (WebCore::FloatPolygon::overlappingEdges const): Changed to use a return value instead of an out argument. Also tweaked coding style a bit. (WebCore::FloatPolygonEdge::debugString const): Deleted. (WebCore::ooperator>>): Implemented TextStream overload. * platform/graphics/FloatPolygon.h: Updated for above, removed ValueToString specialization. * rendering/FloatingObjects.cpp: (WebCore::FloatingObject::debugString const): Deleted. (WebCore::operator<<): Implemented TextStream overload. * rendering/FloatingObjects.h: Ditto. Also removed include of PODIntervalTree.h and used a forward declaration instead. * rendering/RenderBlock.cpp: Updated includes. * rendering/RenderFragmentContainer.cpp: (WebCore::RenderFragmentContainer::debugString const): Deleted. (WebCore::operator<<): Implemented TextStream overload. * rendering/RenderFragmentContainer.h: Ditto. * rendering/RenderFragmentedFlow.cpp: (WebCore::RenderFragmentedFlow::FragmentSearchAdapter::FragmentSearchAdapter): Moved this class here from the header, moving the one function body that was already here up in the file. (WebCore::RenderFragmentedFlow::fragmentAtBlockOffset const): Refactored and tweaked code sequence a bit, did not change logic. (WebCore::RenderFragmentedFlow::updateFragmentsFragmentedFlowPortionRect): Tweaked code style a bit. * rendering/RenderFragmentedFlow.h: Moved FragmentSearchAdapter out of the header, and tweaked coding style a bit. Removed ValueToString specialization. * rendering/shapes/PolygonShape.cpp: (WebCore::PolygonShape::getExcludedInterval const): Updated to use the return value from the overlappingEdges function rather than an out argument. * rendering/updating/RenderTreeBuilder.cpp: Updated includes. * rendering/updating/RenderTreeBuilderFirstLetter.h: Updated forward declarations. * rendering/updating/RenderTreeBuilderMultiColumn.cpp: Updated includes. * rendering/updating/RenderTreePosition.h: Removed includes of RenderFragmentedFlow.h, RenderText.h, and RenderView.h, since none are needed by this header. * rendering/updating/RenderTreeUpdater.cpp: Updated includes. Source/WTF: * WTF.xcodeproj/project.pbxproj: Remove ValueToString.h. * wtf/CMakeLists.txt: Ditto. * wtf/MediaTime.cpp: (WTF::operator<<): Implement debug-only TextStream serialization based on toJSONString. * wtf/MediaTime.h: Ditto. * wtf/text/ValueToString.h: Removed. Canonical link: https://commits.webkit.org/218237@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@253290 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-12-09 17:12:48 +00:00
#ifndef NDEBUG
TextStream& operator<<(TextStream& stream, const MediaTime& time)
{
return stream << time.toJSONString();
}
#endif
}