<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[173318] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/173318">173318</a></dd>
<dt>Author</dt> <dd>jer.noble@apple.com</dd>
<dt>Date</dt> <dd>2014-09-05 11:38:59 -0700 (Fri, 05 Sep 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>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:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestshttptestsmediareloadafterdialoghtml">trunk/LayoutTests/http/tests/media/reload-after-dialog.html</a></li>
<li><a href="#trunkLayoutTestshttptestsmediavideoerroraborthtml">trunk/LayoutTests/http/tests/media/video-error-abort.html</a></li>
<li><a href="#trunkLayoutTestshttptestsmediavideothrottledloadcgi">trunk/LayoutTests/http/tests/media/video-throttled-load.cgi</a></li>
<li><a href="#trunkLayoutTestsplatformmacTestExpectations">trunk/LayoutTests/platform/mac/TestExpectations</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSCJSValueh">trunk/Source/JavaScriptCore/runtime/JSCJSValue.h</a></li>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtfMediaTimecpp">trunk/Source/WTF/wtf/MediaTime.cpp</a></li>
<li><a href="#trunkSourceWTFwtfMediaTimeh">trunk/Source/WTF/wtf/MediaTime.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesmediasourceMediaSourcecpp">trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediasourceMediaSourceh">trunk/Source/WebCore/Modules/mediasource/MediaSource.h</a></li>
<li><a href="#trunkSourceWebCoreModulesmediasourceSourceBuffercpp">trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediasourceSourceBufferh">trunk/Source/WebCore/Modules/mediasource/SourceBuffer.h</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDataCueCustomcpp">trunk/Source/WebCore/bindings/js/JSDataCueCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaElementcpp">trunk/Source/WebCore/html/HTMLMediaElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaElementh">trunk/Source/WebCore/html/HTMLMediaElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlMediaControllercpp">trunk/Source/WebCore/html/MediaController.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlMediaFragmentURIParsercpp">trunk/Source/WebCore/html/MediaFragmentURIParser.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlMediaFragmentURIParserh">trunk/Source/WebCore/html/MediaFragmentURIParser.h</a></li>
<li><a href="#trunkSourceWebCorehtmlTimeRangesh">trunk/Source/WebCore/html/TimeRanges.h</a></li>
<li><a href="#trunkSourceWebCorehtmltrackDataCuecpp">trunk/Source/WebCore/html/track/DataCue.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackDataCueh">trunk/Source/WebCore/html/track/DataCue.h</a></li>
<li><a href="#trunkSourceWebCorehtmltrackInbandDataTextTrackcpp">trunk/Source/WebCore/html/track/InbandDataTextTrack.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackInbandDataTextTrackh">trunk/Source/WebCore/html/track/InbandDataTextTrack.h</a></li>
<li><a href="#trunkSourceWebCorehtmltrackInbandGenericTextTrackcpp">trunk/Source/WebCore/html/track/InbandGenericTextTrack.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackInbandTextTrackcpp">trunk/Source/WebCore/html/track/InbandTextTrack.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackInbandTextTrackh">trunk/Source/WebCore/html/track/InbandTextTrack.h</a></li>
<li><a href="#trunkSourceWebCorehtmltrackTextTrackcpp">trunk/Source/WebCore/html/track/TextTrack.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackTextTrackh">trunk/Source/WebCore/html/track/TextTrack.h</a></li>
<li><a href="#trunkSourceWebCorehtmltrackTextTrackCuecpp">trunk/Source/WebCore/html/track/TextTrackCue.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackTextTrackCueh">trunk/Source/WebCore/html/track/TextTrackCue.h</a></li>
<li><a href="#trunkSourceWebCorehtmltrackTextTrackCueGenericcpp">trunk/Source/WebCore/html/track/TextTrackCueGeneric.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackTextTrackCueGenerich">trunk/Source/WebCore/html/track/TextTrackCueGeneric.h</a></li>
<li><a href="#trunkSourceWebCorehtmltrackTextTrackCueListcpp">trunk/Source/WebCore/html/track/TextTrackCueList.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackVTTCuecpp">trunk/Source/WebCore/html/track/VTTCue.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackVTTCueh">trunk/Source/WebCore/html/track/VTTCue.h</a></li>
<li><a href="#trunkSourceWebCorehtmltrackWebVTTParsercpp">trunk/Source/WebCore/html/track/WebVTTParser.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackWebVTTParserh">trunk/Source/WebCore/html/track/WebVTTParser.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsInbandTextTrackPrivateClienth">trunk/Source/WebCore/platform/graphics/InbandTextTrackPrivateClient.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsMediaPlayercpp">trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsMediaPlayerh">trunk/Source/WebCore/platform/graphics/MediaPlayer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsMediaPlayerPrivateh">trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsMediaSourcePrivateClienth">trunk/Source/WebCore/platform/graphics/MediaSourcePrivateClient.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsTrackPrivateBaseh">trunk/Source/WebCore/platform/graphics/TrackPrivateBase.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationInbandMetadataTextTrackPrivateAVFcpp">trunk/Source/WebCore/platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationInbandMetadataTextTrackPrivateAVFh">trunk/Source/WebCore/platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationInbandTextTrackPrivateAVFcpp">trunk/Source/WebCore/platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationInbandTextTrackPrivateAVFh">trunk/Source/WebCore/platform/graphics/avfoundation/InbandTextTrackPrivateAVF.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationMediaPlayerPrivateAVFoundationcpp">trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationMediaPlayerPrivateAVFoundationh">trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationcfMediaPlayerPrivateAVFoundationCFcpp">trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationcfMediaPlayerPrivateAVFoundationCFh">trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCh">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaSourceAVFObjCh">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaSourceAVFObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaSourcePrivateAVFObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcOutOfBandTextTrackPrivateAVFh">trunk/Source/WebCore/platform/graphics/avfoundation/objc/OutOfBandTextTrackPrivateAVF.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcSourceBufferPrivateAVFObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsgstreamerInbandMetadataTextTrackPrivateGStreamerh">trunk/Source/WebCore/platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsgstreamerMediaPlayerPrivateGStreamercpp">trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsgstreamerMediaSourceGStreamercpp">trunk/Source/WebCore/platform/graphics/gstreamer/MediaSourceGStreamer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacMediaPlayerPrivateQTKith">trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacMediaPlayerPrivateQTKitmm">trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmacPlatformClockCMmm">trunk/Source/WebCore/platform/mac/PlatformClockCM.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmockmediasourceMockMediaPlayerMediaSourcecpp">trunk/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmockmediasourceMockMediaPlayerMediaSourceh">trunk/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmockmediasourceMockMediaSourcePrivatecpp">trunk/Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmockmediasourceMockMediaSourcePrivateh">trunk/Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmockmediasourceMockSourceBufferPrivatecpp">trunk/Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacTiledCoreAnimationDrawingAreamm">trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationMediaTimeAVFoundationcpp">trunk/Source/WebCore/platform/graphics/avfoundation/MediaTimeAVFoundation.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationMediaTimeAVFoundationh">trunk/Source/WebCore/platform/graphics/avfoundation/MediaTimeAVFoundation.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacMediaTimeQTKith">trunk/Source/WebCore/platform/graphics/mac/MediaTimeQTKit.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacMediaTimeQTKitmm">trunk/Source/WebCore/platform/graphics/mac/MediaTimeQTKit.mm</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsplatformmacmediavideoseekpastendpausedexpectedtxt">trunk/LayoutTests/platform/mac/media/video-seek-past-end-paused-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreplatformmacMediaTimeMaccpp">trunk/Source/WebCore/platform/mac/MediaTimeMac.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmacMediaTimeMach">trunk/Source/WebCore/platform/mac/MediaTimeMac.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/LayoutTests/ChangeLog        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2014-06-10 Jer Noble <jer.noble@apple.com>
+
+ Refactoring: make MediaTime the primary time type for audiovisual times.
+ https://bugs.webkit.org/show_bug.cgi?id=133579
+
+ Reviewed by Eric Carlson.
+
+ 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:
+
</ins><span class="cx"> 2014-09-04 Alexey Proskuryakov <ap@apple.com>
</span><span class="cx">
</span><span class="cx"> platform/mac-wk2/tiled-drawing/scrolling/frames/frameset-nested-frame-scrollability.html is flakey
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsmediareloadafterdialoghtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/media/reload-after-dialog.html (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/media/reload-after-dialog.html        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/LayoutTests/http/tests/media/reload-after-dialog.html        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -46,7 +46,7 @@
</span><span class="cx">
</span><span class="cx"> findMediaElement();
</span><span class="cx"> var movie = findMediaFile("video", "../resources/test");
</span><del>- video.src = "http://127.0.0.1:8000/media/video-throttled-load.cgi?name=" + movie + "&throttle=100";
</del><ins>+ video.src = "http://127.0.0.1:8000/media/video-throttled-load.cgi?name=" + movie + "&throttle=100&nph=1";
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> </script>
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsmediavideoerroraborthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/media/video-error-abort.html (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/media/video-error-abort.html        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/LayoutTests/http/tests/media/video-error-abort.html        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -50,7 +50,7 @@
</span><span class="cx"> testExpected("video.error", null);
</span><span class="cx">
</span><span class="cx"> var movie = findMediaFile("video", "../resources/test");
</span><del>- video.src = "http://127.0.0.1:8000/media/video-throttled-load.cgi?name=" + movie + "&throttle=256";
</del><ins>+ video.src = "http://127.0.0.1:8000/media/video-throttled-load.cgi?name=" + movie + "&throttle=256&nph=1";
</ins><span class="cx"> }
</span><span class="cx"> </script>
</span><span class="cx"> </head>
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsmediavideothrottledloadcgi"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/media/video-throttled-load.cgi (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/media/video-throttled-load.cgi        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/LayoutTests/http/tests/media/video-throttled-load.cgi        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> if ($nph) {
</span><span class="cx"> # Handle HTTP Range requests.
</span><span class="cx"> my $httpContentRange;
</span><ins>+ my $httpContentLength;
</ins><span class="cx"> my $httpStatus;
</span><span class="cx">
</span><span class="cx"> if ($contentRange) {
</span><span class="lines">@@ -42,13 +43,15 @@
</span><span class="cx"> }
</span><span class="cx"> $httpStatus = "206 Partial Content";
</span><span class="cx"> $httpContentRange = "bytes " . $parsedRange[0] . "-" . $parsedRange[1] . "/" . $filesize;
</span><ins>+ $httpContentLength = $parsedRange[1] - $parsedRange[0] + 1;
</ins><span class="cx"> } else {
</span><span class="cx"> $httpStatus = "200 OK";
</span><ins>+ $httpContentLength = $filesize;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> print "Status: " . $httpStatus . "\n";
</span><span class="cx"> print "Connection: close\n";
</span><del>- print "Content-Length: " . $filesize . "\n";
</del><ins>+ print "Content-Length: " . $httpContentLength . "\n";
</ins><span class="cx"> print "Content-Type: " . $type . "\n";
</span><span class="cx"> print "Accept-Ranges: bytes\n";
</span><span class="cx"> if ($httpContentRange) {
</span><span class="lines">@@ -67,10 +70,12 @@
</span><span class="cx"> binmode FILE;
</span><span class="cx"> my ($data, $n);
</span><span class="cx"> my $total = $parsedRange[0];
</span><ins>+my $length = $parsedRange[1] - $parsedRange[0];
+my $chunkLength = $length < 1024 ? $length : 1024;
</ins><span class="cx">
</span><span class="cx"> seek(FILE, $parsedRange[0], 0);
</span><span class="cx">
</span><del>-while (($n = read FILE, $data, 1024) != 0) {
</del><ins>+while (($n = read FILE, $data, $chunkLength) != 0) {
</ins><span class="cx"> print $data;
</span><span class="cx">
</span><span class="cx"> $total += $n;
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/TestExpectations (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/TestExpectations        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/LayoutTests/platform/mac/TestExpectations        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -1401,3 +1401,6 @@
</span><span class="cx">
</span><span class="cx"> webkit.org/b/135160 media/track/track-in-band-subtitles-too-large.html [ Pass Failure ]
</span><span class="cx"> webkit.org/b/135160 media/track/track-long-word-container-sizing.html [ Pass Failure ]
</span><ins>+
+webkit.org/b/136532 [ MountainLion ] media/audio-data-url.html [ Failure ]
+webkit.org/b/136532 [ MountainLion ] media/sources-fallback-codecs.html [ Failure ]
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacmediavideoseekpastendpausedexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/platform/mac/media/video-seek-past-end-paused-expected.txt (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/media/video-seek-past-end-paused-expected.txt        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/LayoutTests/platform/mac/media/video-seek-past-end-paused-expected.txt        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -1,19 +0,0 @@
</span><del>-
-Test that seeking a paused video past its end sets currentTime to duration and leaves the video paused.
-
-EVENT(canplaythrough)
-EXPECTED (video.paused == 'true') OK
-EXPECTED (video.ended == 'false') OK
-RUN(video.play())
-
-EXPECTED (video.paused == 'false') OK
-EXPECTED (mediaElement.currentTime > '0') OK
-
-EXPECTED (video.paused == 'true') OK
-
-EXPECTED (video.paused == 'true') OK
-EXPECTED (mediaElement.currentTime == 'mediaElement.duration'), OBSERVED '6.026666666666666' FAIL
-EXPECTED (video.ended == 'true'), OBSERVED 'false' FAIL
-
-END OF TEST
-
</del></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/JavaScriptCore/ChangeLog        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2014-06-06 Jer Noble <jer.noble@apple.com>
+
+ Refactoring: make MediaTime the primary time type for audiovisual times.
+ https://bugs.webkit.org/show_bug.cgi?id=133579
+
+ Reviewed by Eric Carlson.
+
+ Add a utility function which converts a MediaTime to a JSNumber.
+
+ * runtime/JSCJSValue.h:
+ (JSC::jsNumber):
+
</ins><span class="cx"> 2014-09-04 Michael Saboff <msaboff@apple.com>
</span><span class="cx">
</span><span class="cx"> ARM: Add more coverage to ARMv7 disassembler
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSCJSValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSCJSValue.h (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSCJSValue.h        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/JavaScriptCore/runtime/JSCJSValue.h        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> #include <wtf/HashMap.h>
</span><span class="cx"> #include <wtf/HashTraits.h>
</span><span class="cx"> #include <wtf/MathExtras.h>
</span><ins>+#include <wtf/MediaTime.h>
</ins><span class="cx"> #include <wtf/StdLibExtras.h>
</span><span class="cx"> #include <wtf/TriState.h>
</span><span class="cx">
</span><span class="lines">@@ -472,6 +473,11 @@
</span><span class="cx"> return JSValue(d);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ALWAYS_INLINE JSValue jsNumber(MediaTime t)
+{
+ return jsNumber(t.toDouble());
+}
+
</ins><span class="cx"> ALWAYS_INLINE JSValue jsNumber(char i)
</span><span class="cx"> {
</span><span class="cx"> return JSValue(i);
</span></span></pre></div>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WTF/ChangeLog        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2014-06-06 Jer Noble <jer.noble@apple.com>
+
+ Refactoring: make MediaTime the primary time type for audiovisual times.
+ https://bugs.webkit.org/show_bug.cgi?id=133579
+
+ Reviewed by Eric Carlson.
+
+ 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:
+
</ins><span class="cx"> 2014-09-04 Geoffrey Garen <ggaren@apple.com>
</span><span class="cx">
</span><span class="cx"> Do the bmalloc.
</span></span></pre></div>
<a id="trunkSourceWTFwtfMediaTimecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/MediaTime.cpp (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/MediaTime.cpp        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WTF/wtf/MediaTime.cpp        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -219,6 +219,25 @@
</span><span class="cx"> return a;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+MediaTime MediaTime::operator-() const
+{
+ if (isInvalid())
+ return invalidTime();
+
+ if (isIndefinite())
+ return indefiniteTime();
+
+ if (isPositiveInfinite())
+ return negativeInfiniteTime();
+
+ if (isNegativeInfinite())
+ return positiveInfiniteTime();
+
+ MediaTime negativeTime = *this;
+ negativeTime.m_timeValue = -negativeTime.m_timeValue;
+ return negativeTime;
+}
+
</ins><span class="cx"> MediaTime MediaTime::operator*(int32_t rhs) const
</span><span class="cx"> {
</span><span class="cx"> if (isInvalid())
</span><span class="lines">@@ -283,6 +302,16 @@
</span><span class="cx"> return compare(rhs) <= EqualTo;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+bool MediaTime::operator!() const
+{
+ return compare(zeroTime()) == EqualTo;
+}
+
+MediaTime::operator bool() const
+{
+ return compare(zeroTime()) != EqualTo;
+}
+
</ins><span class="cx"> MediaTime::ComparisonFlags MediaTime::compare(const MediaTime& rhs) const
</span><span class="cx"> {
</span><span class="cx"> if ((isPositiveInfinite() && rhs.isPositiveInfinite())
</span></span></pre></div>
<a id="trunkSourceWTFwtfMediaTimeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/MediaTime.h (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/MediaTime.h        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WTF/wtf/MediaTime.h        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -67,6 +67,7 @@
</span><span class="cx"> MediaTime& operator-=(const MediaTime& rhs) { return *this = *this - rhs; }
</span><span class="cx"> MediaTime operator+(const MediaTime& rhs) const;
</span><span class="cx"> MediaTime operator-(const MediaTime& rhs) const;
</span><ins>+ MediaTime operator-() const;
</ins><span class="cx"> MediaTime operator*(int32_t) const;
</span><span class="cx"> bool operator<(const MediaTime& rhs) const;
</span><span class="cx"> bool operator>(const MediaTime& rhs) const;
</span><span class="lines">@@ -74,6 +75,8 @@
</span><span class="cx"> bool operator==(const MediaTime& rhs) const;
</span><span class="cx"> bool operator>=(const MediaTime& rhs) const;
</span><span class="cx"> bool operator<=(const MediaTime& rhs) const;
</span><ins>+ bool operator!() const;
+ explicit operator bool() const;
</ins><span class="cx">
</span><span class="cx"> typedef enum {
</span><span class="cx"> LessThan = -1,
</span><span class="lines">@@ -101,6 +104,12 @@
</span><span class="cx">
</span><span class="cx"> void dump(PrintStream& out) const;
</span><span class="cx">
</span><ins>+ // Make the following casts errors:
+ operator double() const = delete;
+ MediaTime(double) = delete;
+ operator int() const = delete;
+ MediaTime(int) = delete;
+
</ins><span class="cx"> friend WTF_EXPORT_PRIVATE MediaTime abs(const MediaTime& rhs);
</span><span class="cx"> private:
</span><span class="cx"> static const int32_t DefaultTimeScale = 10000000;
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/ChangeLog        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -1,3 +1,295 @@
</span><ins>+2014-06-06 Jer Noble <jer.noble@apple.com>
+
+ Refactoring: make MediaTime the primary time type for audiovisual times.
+ https://bugs.webkit.org/show_bug.cgi?id=133579
+
+ Reviewed by Eric Carlson.
+
+ 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):
+
</ins><span class="cx"> 2014-09-05 Antti Koivisto <antti@apple.com>
</span><span class="cx">
</span><span class="cx"> REGRESSION(r173272): Two blob tests failing on WK1
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediasourceMediaSourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -76,7 +76,7 @@
</span><span class="cx"> MediaSource::MediaSource(ScriptExecutionContext& context)
</span><span class="cx"> : ActiveDOMObject(&context)
</span><span class="cx"> , m_mediaElement(0)
</span><del>- , m_duration(std::numeric_limits<double>::quiet_NaN())
</del><ins>+ , m_duration(MediaTime::invalidTime())
</ins><span class="cx"> , m_pendingSeekTime(MediaTime::invalidTime())
</span><span class="cx"> , m_readyState(closedKeyword())
</span><span class="cx"> , m_asyncEventQueue(*this)
</span><span class="lines">@@ -128,58 +128,56 @@
</span><span class="cx"> unsetPendingActivity(this);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-double MediaSource::duration() const
</del><ins>+MediaTime MediaSource::duration() const
</ins><span class="cx"> {
</span><span class="cx"> return m_duration;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-double MediaSource::currentTime() const
</del><ins>+MediaTime MediaSource::currentTime() const
</ins><span class="cx"> {
</span><del>- return m_mediaElement ? m_mediaElement->currentTime() : 0;
</del><ins>+ return m_mediaElement ? m_mediaElement->currentMediaTime() : MediaTime::zeroTime();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> std::unique_ptr<PlatformTimeRanges> MediaSource::buffered() const
</span><span class="cx"> {
</span><span class="cx"> // Implements MediaSource algorithm for HTMLMediaElement.buffered.
</span><span class="cx"> // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html#htmlmediaelement-extensions
</span><del>- Vector<RefPtr<TimeRanges>> ranges = activeRanges();
</del><ins>+ Vector<PlatformTimeRanges> activeRanges = this->activeRanges();
</ins><span class="cx">
</span><span class="cx"> // 1. If activeSourceBuffers.length equals 0 then return an empty TimeRanges object and abort these steps.
</span><del>- if (ranges.isEmpty())
</del><ins>+ if (activeRanges.isEmpty())
</ins><span class="cx"> return PlatformTimeRanges::create();
</span><span class="cx">
</span><span class="cx"> // 2. Let active ranges be the ranges returned by buffered for each SourceBuffer object in activeSourceBuffers.
</span><span class="cx"> // 3. Let highest end time be the largest range end time in the active ranges.
</span><del>- double highestEndTime = -1;
- for (size_t i = 0; i < ranges.size(); ++i) {
- unsigned length = ranges[i]->length();
</del><ins>+ MediaTime highestEndTime = MediaTime::zeroTime();
+ for (auto& ranges : activeRanges) {
+ unsigned length = ranges.length();
</ins><span class="cx"> if (length)
</span><del>- highestEndTime = std::max(highestEndTime, ranges[i]->end(length - 1, ASSERT_NO_EXCEPTION));
</del><ins>+ highestEndTime = std::max(highestEndTime, ranges.end(length - 1));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Return an empty range if all ranges are empty.
</span><del>- if (highestEndTime < 0)
</del><ins>+ if (!highestEndTime)
</ins><span class="cx"> return PlatformTimeRanges::create();
</span><span class="cx">
</span><span class="cx"> // 4. Let intersection ranges equal a TimeRange object containing a single range from 0 to highest end time.
</span><del>- RefPtr<TimeRanges> intersectionRanges = TimeRanges::create(0, highestEndTime);
</del><ins>+ PlatformTimeRanges intersectionRanges(MediaTime::zeroTime(), highestEndTime);
</ins><span class="cx">
</span><span class="cx"> // 5. For each SourceBuffer object in activeSourceBuffers run the following steps:
</span><span class="cx"> bool ended = readyState() == endedKeyword();
</span><del>- for (size_t i = 0; i < ranges.size(); ++i) {
</del><ins>+ for (auto& sourceRanges : activeRanges) {
</ins><span class="cx"> // 5.1 Let source ranges equal the ranges returned by the buffered attribute on the current SourceBuffer.
</span><del>- TimeRanges* sourceRanges = ranges[i].get();
-
</del><span class="cx"> // 5.2 If readyState is "ended", then set the end time on the last range in source ranges to highest end time.
</span><del>- if (ended && sourceRanges->length())
- sourceRanges->add(sourceRanges->start(sourceRanges->length() - 1, ASSERT_NO_EXCEPTION), highestEndTime);
</del><ins>+ if (ended && sourceRanges.length())
+ sourceRanges.add(sourceRanges.start(sourceRanges.length() - 1), highestEndTime);
</ins><span class="cx">
</span><span class="cx"> // 5.3 Let new intersection ranges equal the the intersection between the intersection ranges and the source ranges.
</span><span class="cx"> // 5.4 Replace the ranges in intersection ranges with the new intersection ranges.
</span><del>- intersectionRanges->intersectWith(*sourceRanges);
</del><ins>+ intersectionRanges.intersectWith(sourceRanges);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- return PlatformTimeRanges::create(intersectionRanges->ranges());
</del><ins>+ return PlatformTimeRanges::create(intersectionRanges);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void MediaSource::seekToTime(const MediaTime& time)
</span><span class="lines">@@ -343,10 +341,10 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // 4. Run the duration change algorithm with new duration set to the value being assigned to this attribute.
</span><del>- setDurationInternal(duration);
</del><ins>+ setDurationInternal(MediaTime::createWithDouble(duration));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void MediaSource::setDurationInternal(double duration)
</del><ins>+void MediaSource::setDurationInternal(const MediaTime& duration)
</ins><span class="cx"> {
</span><span class="cx"> // Duration Change Algorithm
</span><span class="cx"> // https://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html#duration-change-algorithm
</span><span class="lines">@@ -356,14 +354,14 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> // 2. Set old duration to the current value of duration.
</span><del>- double oldDuration = m_duration;
</del><ins>+ MediaTime oldDuration = m_duration;
</ins><span class="cx">
</span><span class="cx"> // 3. Update duration to new duration.
</span><span class="cx"> m_duration = duration;
</span><span class="cx">
</span><span class="cx"> // 4. If the new duration is less than old duration, then call remove(new duration, old duration)
</span><span class="cx"> // on all objects in sourceBuffers.
</span><del>- if (!isnan(oldDuration) && duration < oldDuration) {
</del><ins>+ if (!oldDuration.isValid() && duration < oldDuration) {
</ins><span class="cx"> for (auto& sourceBuffer : *m_sourceBuffers)
</span><span class="cx"> sourceBuffer->remove(duration, oldDuration, IGNORE_EXCEPTION);
</span><span class="cx"> }
</span><span class="lines">@@ -376,7 +374,7 @@
</span><span class="cx"> // NOTE: Assume UA is able to partially render audio frames.
</span><span class="cx">
</span><span class="cx"> // 6. Update the media controller duration to new duration and run the HTMLMediaElement duration change algorithm.
</span><del>- LOG(MediaSource, "MediaSource::setDurationInternal(%p) - duration(%g)", this, duration);
</del><ins>+ LOG(MediaSource, "MediaSource::setDurationInternal(%p) - duration(%g)", this, duration.toDouble());
</ins><span class="cx"> m_private->durationChanged();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -390,7 +388,7 @@
</span><span class="cx"> if (state == closedKeyword()) {
</span><span class="cx"> m_private.clear();
</span><span class="cx"> m_mediaElement = 0;
</span><del>- m_duration = std::numeric_limits<double>::quiet_NaN();
</del><ins>+ m_duration = MediaTime::invalidTime();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (oldState == state)
</span><span class="lines">@@ -446,10 +444,10 @@
</span><span class="cx"> // ↳ If error is not set, is null, or is an empty string
</span><span class="cx"> // 1. Run the duration change algorithm with new duration set to the highest end time reported by
</span><span class="cx"> // the buffered attribute across all SourceBuffer objects in sourceBuffers.
</span><del>- double maxEndTime = 0;
</del><ins>+ MediaTime maxEndTime;
</ins><span class="cx"> for (auto& sourceBuffer : *m_sourceBuffers) {
</span><span class="cx"> if (auto length = sourceBuffer->buffered()->length())
</span><del>- maxEndTime = std::max(sourceBuffer->buffered()->end(length - 1, IGNORE_EXCEPTION), maxEndTime);
</del><ins>+ maxEndTime = std::max(sourceBuffer->buffered()->ranges().end(length - 1), maxEndTime);
</ins><span class="cx"> }
</span><span class="cx"> setDurationInternal(maxEndTime);
</span><span class="cx">
</span><span class="lines">@@ -814,12 +812,11 @@
</span><span class="cx"> scheduleEvent(eventNames().sourcecloseEvent);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-Vector<RefPtr<TimeRanges>> MediaSource::activeRanges() const
</del><ins>+Vector<PlatformTimeRanges> MediaSource::activeRanges() const
</ins><span class="cx"> {
</span><del>- Vector<RefPtr<TimeRanges>> activeRanges(m_activeSourceBuffers->length());
- for (size_t i = 0, length = m_activeSourceBuffers->length(); i < length; ++i)
- activeRanges[i] = m_activeSourceBuffers->item(i)->buffered(ASSERT_NO_EXCEPTION);
-
</del><ins>+ Vector<PlatformTimeRanges> activeRanges(m_activeSourceBuffers->length());
+ for (auto& sourceBuffer : *m_activeSourceBuffers)
+ activeRanges.append(sourceBuffer->buffered()->ranges());
</ins><span class="cx"> return activeRanges;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediasourceMediaSourceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediasource/MediaSource.h (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediasource/MediaSource.h        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/Modules/mediasource/MediaSource.h        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -72,7 +72,7 @@
</span><span class="cx">
</span><span class="cx"> // MediaSourcePrivateClient
</span><span class="cx"> virtual void setPrivateAndOpen(PassRef<MediaSourcePrivate>) override;
</span><del>- virtual double duration() const override;
</del><ins>+ virtual MediaTime duration() const override;
</ins><span class="cx"> virtual std::unique_ptr<PlatformTimeRanges> buffered() const override;
</span><span class="cx"> virtual void seekToTime(const MediaTime&) override;
</span><span class="cx">
</span><span class="lines">@@ -83,8 +83,8 @@
</span><span class="cx"> void completeSeek();
</span><span class="cx">
</span><span class="cx"> void setDuration(double, ExceptionCode&);
</span><del>- void setDurationInternal(double);
- double currentTime() const;
</del><ins>+ void setDurationInternal(const MediaTime&);
+ MediaTime currentTime() const;
</ins><span class="cx"> const AtomicString& readyState() const { return m_readyState; }
</span><span class="cx"> void setReadyState(const AtomicString&);
</span><span class="cx"> void endOfStream(ExceptionCode&);
</span><span class="lines">@@ -119,7 +119,7 @@
</span><span class="cx"> explicit MediaSource(ScriptExecutionContext&);
</span><span class="cx">
</span><span class="cx"> void onReadyStateChange(const AtomicString& oldState, const AtomicString& newState);
</span><del>- Vector<RefPtr<TimeRanges>> activeRanges() const;
</del><ins>+ Vector<PlatformTimeRanges> activeRanges() const;
</ins><span class="cx">
</span><span class="cx"> RefPtr<SourceBufferPrivate> createSourceBufferPrivate(const ContentType&, ExceptionCode&);
</span><span class="cx"> void scheduleEvent(const AtomicString& eventName);
</span><span class="lines">@@ -133,7 +133,7 @@
</span><span class="cx"> RefPtr<SourceBufferList> m_sourceBuffers;
</span><span class="cx"> RefPtr<SourceBufferList> m_activeSourceBuffers;
</span><span class="cx"> HTMLMediaElement* m_mediaElement;
</span><del>- double m_duration;
</del><ins>+ MediaTime m_duration;
</ins><span class="cx"> MediaTime m_pendingSeekTime;
</span><span class="cx"> AtomicString m_readyState;
</span><span class="cx"> GenericEventQueue m_asyncEventQueue;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediasourceSourceBuffercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -241,12 +241,17 @@
</span><span class="cx">
</span><span class="cx"> void SourceBuffer::remove(double start, double end, ExceptionCode& ec)
</span><span class="cx"> {
</span><del>- LOG(MediaSource, "SourceBuffer::remove(%p) - start(%lf), end(%lf)", this, start, end);
</del><ins>+ remove(MediaTime::createWithDouble(start), MediaTime::createWithDouble(end), ec);
+}
</ins><span class="cx">
</span><ins>+void SourceBuffer::remove(const MediaTime& start, const MediaTime& end, ExceptionCode& ec)
+{
+ LOG(MediaSource, "SourceBuffer::remove(%p) - start(%lf), end(%lf)", this, start.toDouble(), end.toDouble());
+
</ins><span class="cx"> // Section 3.2 remove() method steps.
</span><span class="cx"> // 1. If start is negative or greater than duration, then throw an InvalidAccessError exception and abort these steps.
</span><span class="cx"> // 2. If end is less than or equal to start, then throw an InvalidAccessError exception and abort these steps.
</span><del>- if (start < 0 || (m_source && (std::isnan(m_source->duration()) || start > m_source->duration())) || end <= start) {
</del><ins>+ if (start < MediaTime::zeroTime() || (m_source && (!m_source->duration().isValid() || start > m_source->duration())) || end <= start) {
</ins><span class="cx"> ec = INVALID_ACCESS_ERR;
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="lines">@@ -271,8 +276,8 @@
</span><span class="cx"> scheduleEvent(eventNames().updatestartEvent);
</span><span class="cx">
</span><span class="cx"> // 8. Return control to the caller and run the rest of the steps asynchronously.
</span><del>- m_pendingRemoveStart = MediaTime::createWithDouble(start);
- m_pendingRemoveEnd = MediaTime::createWithDouble(end);
</del><ins>+ m_pendingRemoveStart = start;
+ m_pendingRemoveEnd = end;
</ins><span class="cx"> m_removeTimer.startOneShot(0);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -513,7 +518,7 @@
</span><span class="cx"> if (m_source)
</span><span class="cx"> m_source->monitorSourceBuffers();
</span><span class="cx">
</span><del>- MediaTime currentMediaTime = MediaTime::createWithDouble(m_source->currentTime());
</del><ins>+ MediaTime currentMediaTime = m_source->currentTime();
</ins><span class="cx"> for (auto& trackBufferPair : m_trackBufferMap) {
</span><span class="cx"> TrackBuffer& trackBuffer = trackBufferPair.value;
</span><span class="cx"> const AtomicString& trackID = trackBufferPair.key;
</span><span class="lines">@@ -606,8 +611,8 @@
</span><span class="cx"> // https://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html#sourcebuffer-coded-frame-removal
</span><span class="cx">
</span><span class="cx"> // 1. Let start be the starting presentation timestamp for the removal range.
</span><del>- MediaTime durationMediaTime = MediaTime::createWithDouble(m_source->duration());
- MediaTime currentMediaTime = MediaTime::createWithDouble(m_source->currentTime());
</del><ins>+ MediaTime durationMediaTime = m_source->duration();
+ MediaTime currentMediaTime = m_source->currentTime();
</ins><span class="cx">
</span><span class="cx"> // 2. Let end be the end presentation timestamp for the removal range.
</span><span class="cx"> // 3. For each track buffer in this source buffer, run the following steps:
</span><span class="lines">@@ -713,11 +718,11 @@
</span><span class="cx"> // NOTE: begin by removing data from the beginning of the buffered ranges, 30 seconds at
</span><span class="cx"> // a time, up to 30 seconds before currentTime.
</span><span class="cx"> MediaTime thirtySeconds = MediaTime(30, 1);
</span><del>- MediaTime currentTime = MediaTime::createWithDouble(m_source->currentTime());
</del><ins>+ MediaTime currentTime = m_source->currentTime();
</ins><span class="cx"> MediaTime maximumRangeEnd = currentTime - thirtySeconds;
</span><span class="cx">
</span><span class="cx"> #if !LOG_DISABLED
</span><del>- LOG(MediaSource, "SourceBuffer::evictCodedFrames(%p) - currentTime = %lf, require %zu bytes, maximum buffer size is %zu", this, m_source->currentTime(), extraMemoryCost() + newDataSize, maximumBufferSize);
</del><ins>+ LOG(MediaSource, "SourceBuffer::evictCodedFrames(%p) - currentTime = %lf, require %zu bytes, maximum buffer size is %zu", this, m_source->currentTime().toDouble(), extraMemoryCost() + newDataSize, maximumBufferSize);
</ins><span class="cx"> size_t initialBufferedSize = extraMemoryCost();
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="lines">@@ -753,7 +758,7 @@
</span><span class="cx">
</span><span class="cx"> MediaTime minimumRangeStart = currentTime + thirtySeconds;
</span><span class="cx">
</span><del>- rangeEnd = MediaTime::createWithDouble(m_source->duration());
</del><ins>+ rangeEnd = m_source->duration();
</ins><span class="cx"> rangeStart = rangeEnd - thirtySeconds;
</span><span class="cx"> while (rangeStart > minimumRangeStart) {
</span><span class="cx">
</span><span class="lines">@@ -868,13 +873,13 @@
</span><span class="cx"> // 3.5.7 Initialization Segment Received
</span><span class="cx"> // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html#sourcebuffer-init-segment-received
</span><span class="cx"> // 1. Update the duration attribute if it currently equals NaN:
</span><del>- if (std::isnan(m_source->duration())) {
</del><ins>+ if (m_source->duration().isInvalid()) {
</ins><span class="cx"> // ↳ If the initialization segment contains a duration:
</span><span class="cx"> // Run the duration change algorithm with new duration set to the duration in the initialization segment.
</span><span class="cx"> // ↳ Otherwise:
</span><span class="cx"> // Run the duration change algorithm with new duration set to positive Infinity.
</span><span class="cx"> MediaTime newDuration = segment.duration.isValid() ? segment.duration : MediaTime::positiveInfiniteTime();
</span><del>- m_source->setDurationInternal(newDuration.toDouble());
</del><ins>+ m_source->setDurationInternal(newDuration);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // 2. If the initialization segment has no audio, video, or text tracks, then run the end of stream
</span><span class="lines">@@ -1186,7 +1191,7 @@
</span><span class="cx"> // FIXME: add support for "sequence" mode
</span><span class="cx">
</span><span class="cx"> // 1.5 If timestampOffset is not 0, then run the following steps:
</span><del>- if (m_timestampOffset != MediaTime::zeroTime()) {
</del><ins>+ if (m_timestampOffset) {
</ins><span class="cx"> // 1.5.1 Add timestampOffset to the presentation timestamp.
</span><span class="cx"> presentationTimestamp += m_timestampOffset;
</span><span class="cx">
</span><span class="lines">@@ -1366,7 +1371,7 @@
</span><span class="cx">
</span><span class="cx"> // Only force the TrackBuffer to re-enqueue if the removed ranges overlap with enqueued and possibly
</span><span class="cx"> // not yet displayed samples.
</span><del>- MediaTime currentMediaTime = MediaTime::createWithDouble(m_source->currentTime());
</del><ins>+ MediaTime currentMediaTime = m_source->currentTime();
</ins><span class="cx"> if (currentMediaTime < trackBuffer.lastEnqueuedPresentationTime) {
</span><span class="cx"> PlatformTimeRanges possiblyEnqueuedRanges(currentMediaTime, trackBuffer.lastEnqueuedPresentationTime);
</span><span class="cx"> possiblyEnqueuedRanges.intersectWith(erasedRanges->ranges());
</span><span class="lines">@@ -1375,7 +1380,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> erasedRanges->invert();
</span><del>- m_buffered->intersectWith(*erasedRanges.get());
</del><ins>+ m_buffered->intersectWith(*erasedRanges);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // 1.17 If spliced audio frame is set:
</span><span class="lines">@@ -1420,8 +1425,8 @@
</span><span class="cx">
</span><span class="cx"> // 5. If the media segment contains data beyond the current duration, then run the duration change algorithm with new
</span><span class="cx"> // duration set to the maximum of the current duration and the highest end timestamp reported by HTMLMediaElement.buffered.
</span><del>- if (highestPresentationEndTimestamp().toDouble() > m_source->duration())
- m_source->setDurationInternal(highestPresentationEndTimestamp().toDouble());
</del><ins>+ if (highestPresentationEndTimestamp() > m_source->duration())
+ m_source->setDurationInternal(highestPresentationEndTimestamp());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool SourceBuffer::hasAudio() const
</span><span class="lines">@@ -1674,7 +1679,7 @@
</span><span class="cx"> std::unique_ptr<PlatformTimeRanges> virtualRanges = PlatformTimeRanges::create(m_buffered->ranges());
</span><span class="cx"> if (m_source->isEnded()) {
</span><span class="cx"> MediaTime start = virtualRanges->maximumBufferedTime();
</span><del>- MediaTime end = MediaTime::createWithDouble(m_source->duration());
</del><ins>+ MediaTime end = m_source->duration();
</ins><span class="cx"> if (start <= end)
</span><span class="cx"> virtualRanges->add(start, end);
</span><span class="cx"> }
</span><span class="lines">@@ -1686,8 +1691,8 @@
</span><span class="cx"> if (isRemoved() || !m_buffered->length())
</span><span class="cx"> return false;
</span><span class="cx">
</span><del>- MediaTime currentTime = MediaTime::createWithDouble(m_source->currentTime());
- MediaTime duration = MediaTime::createWithDouble(m_source->duration());
</del><ins>+ MediaTime currentTime = m_source->currentTime();
+ MediaTime duration = m_source->duration();
</ins><span class="cx"> if (currentTime >= duration)
</span><span class="cx"> return true;
</span><span class="cx">
</span><span class="lines">@@ -1704,8 +1709,8 @@
</span><span class="cx"> if (!ranges->length())
</span><span class="cx"> return false;
</span><span class="cx">
</span><del>- MediaTime currentTime = MediaTime::createWithDouble(m_source->currentTime());
- MediaTime duration = MediaTime::createWithDouble(m_source->duration());
</del><ins>+ MediaTime currentTime = m_source->currentTime();
+ MediaTime duration = m_source->duration();
</ins><span class="cx"> if (currentTime >= duration)
</span><span class="cx"> return true;
</span><span class="cx">
</span><span class="lines">@@ -1737,8 +1742,8 @@
</span><span class="cx"> return true;
</span><span class="cx">
</span><span class="cx"> // Add up all the time yet to be buffered.
</span><del>- MediaTime currentTime = MediaTime::createWithDouble(m_source->currentTime());
- MediaTime duration = MediaTime::createWithDouble(m_source->duration());
</del><ins>+ MediaTime currentTime = m_source->currentTime();
+ MediaTime duration = m_source->duration();
</ins><span class="cx">
</span><span class="cx"> std::unique_ptr<PlatformTimeRanges> unbufferedRanges = bufferedAccountingForEndOfStream();
</span><span class="cx"> unbufferedRanges->invert();
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediasourceSourceBufferh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediasource/SourceBuffer.h (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediasource/SourceBuffer.h        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/Modules/mediasource/SourceBuffer.h        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -75,6 +75,7 @@
</span><span class="cx"> void appendBuffer(PassRefPtr<ArrayBufferView> data, ExceptionCode&);
</span><span class="cx"> void abort(ExceptionCode&);
</span><span class="cx"> void remove(double start, double end, ExceptionCode&);
</span><ins>+ void remove(const MediaTime&, const MediaTime&, ExceptionCode&);
</ins><span class="cx">
</span><span class="cx"> void abortIfUpdating();
</span><span class="cx"> void removedFromMediaSource();
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -8537,6 +8537,7 @@
</span><span class="cx"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
</span><span class="cx"> </ClCompile>
</span><span class="cx"> <ClCompile Include="..\platform\graphics\avfoundation\MediaPlayerPrivateAVFoundation.cpp" />
</span><ins>+ <ClCompile Include="..\platform\graphics\avfoundation\MediaTimeAVFoundation.cpp" />
</ins><span class="cx"> <ClCompile Include="..\platform\graphics\avfoundation\cf\MediaPlayerPrivateAVFoundationCF.cpp" />
</span><span class="cx"> <ClCompile Include="..\platform\network\AuthenticationChallengeBase.cpp" />
</span><span class="cx"> <ClCompile Include="..\platform\network\BlobData.cpp" />
</span><span class="lines">@@ -19751,6 +19752,7 @@
</span><span class="cx"> <ClInclude Include="..\platform\graphics\ca\win\PlatformCALayerWinInternal.h" />
</span><span class="cx"> <ClInclude Include="..\platform\graphics\ca\win\WKCACFViewLayerTreeHost.h" />
</span><span class="cx"> <ClInclude Include="..\platform\graphics\avfoundation\MediaPlayerPrivateAVFoundation.h" />
</span><ins>+ <ClInclude Include="..\platform\graphics\avfoundation\MediaTimeAVFoundation.h" />
</ins><span class="cx"> <ClInclude Include="..\platform\graphics\avfoundation\cf\AVFoundationCFSoftLinking.h" />
</span><span class="cx"> <ClInclude Include="..\platform\graphics\avfoundation\cf\CoreMediaSoftLinking.h" />
</span><span class="cx"> <ClInclude Include="..\platform\graphics\avfoundation\cf\MediaPlayerPrivateAVFoundationCF.h" />
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -5608,12 +5608,14 @@
</span><span class="cx">                 CD54DE4B17469C6D005E5B36 /* AudioSessionMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD54DE4917469C6D005E5B36 /* AudioSessionMac.cpp */; };
</span><span class="cx">                 CD5596911475B678001D0BD0 /* AudioFileReaderIOS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD55968F1475B678001D0BD0 /* AudioFileReaderIOS.cpp */; };
</span><span class="cx">                 CD5596921475B678001D0BD0 /* AudioFileReaderIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = CD5596901475B678001D0BD0 /* AudioFileReaderIOS.h */; };
</span><ins>+                CD60C0C6193E87C7003C656B /* MediaTimeQTKit.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD60C0C4193E87C7003C656B /* MediaTimeQTKit.mm */; };
+                CD60C0C7193E87C7003C656B /* MediaTimeQTKit.h in Headers */ = {isa = PBXBuildFile; fileRef = CD60C0C5193E87C7003C656B /* MediaTimeQTKit.h */; };
</ins><span class="cx">                 CD61FE671794AADB004101EB /* MediaSourceRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B1A942E115B5CE2200D525D1 /* MediaSourceRegistry.cpp */; };
</span><span class="cx">                 CD61FE681794AADB004101EB /* MediaSourceRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = B1A942E215B5CE2200D525D1 /* MediaSourceRegistry.h */; };
</span><span class="cx">                 CD641EB31818F5ED00EE4C41 /* MediaSourcePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = CD641EB11818F5ED00EE4C41 /* MediaSourcePrivate.h */; };
</span><span class="cx">                 CD641EB41818F5ED00EE4C41 /* SourceBufferPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = CD641EB21818F5ED00EE4C41 /* SourceBufferPrivate.h */; };
</span><del>-                CD641EBF1819B36000EE4C41 /* MediaTimeMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD641EBD1819B35900EE4C41 /* MediaTimeMac.cpp */; };
-                CD641EC01819B36000EE4C41 /* MediaTimeMac.h in Headers */ = {isa = PBXBuildFile; fileRef = CD641EBE1819B35900EE4C41 /* MediaTimeMac.h */; };
</del><ins>+                CD641EBF1819B36000EE4C41 /* MediaTimeAVFoundation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD641EBD1819B35900EE4C41 /* MediaTimeAVFoundation.cpp */; };
+                CD641EC01819B36000EE4C41 /* MediaTimeAVFoundation.h in Headers */ = {isa = PBXBuildFile; fileRef = CD641EBE1819B35900EE4C41 /* MediaTimeAVFoundation.h */; };
</ins><span class="cx">                 CD7DBB2818CA19A400C11066 /* CSSGridLineNamesValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD7DBB2618CA11FF00C11066 /* CSSGridLineNamesValue.cpp */; };
</span><span class="cx">                 CD7DBB2918CA19C600C11066 /* CSSGridLineNamesValue.h in Headers */ = {isa = PBXBuildFile; fileRef = CD7DBB2718CA11FF00C11066 /* CSSGridLineNamesValue.h */; };
</span><span class="cx">                 CD7E05221651C28200C1201F /* WebCoreAVFResourceLoader.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD7E05211651A84100C1201F /* WebCoreAVFResourceLoader.mm */; };
</span><span class="lines">@@ -13019,10 +13021,12 @@
</span><span class="cx">                 CD54DE4917469C6D005E5B36 /* AudioSessionMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AudioSessionMac.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 CD55968F1475B678001D0BD0 /* AudioFileReaderIOS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AudioFileReaderIOS.cpp; path = ios/AudioFileReaderIOS.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 CD5596901475B678001D0BD0 /* AudioFileReaderIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AudioFileReaderIOS.h; path = ios/AudioFileReaderIOS.h; sourceTree = "<group>"; };
</span><ins>+                CD60C0C4193E87C7003C656B /* MediaTimeQTKit.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MediaTimeQTKit.mm; sourceTree = "<group>"; };
+                CD60C0C5193E87C7003C656B /* MediaTimeQTKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaTimeQTKit.h; sourceTree = "<group>"; };
</ins><span class="cx">                 CD641EB11818F5ED00EE4C41 /* MediaSourcePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaSourcePrivate.h; sourceTree = "<group>"; };
</span><span class="cx">                 CD641EB21818F5ED00EE4C41 /* SourceBufferPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SourceBufferPrivate.h; sourceTree = "<group>"; };
</span><del>-                CD641EBD1819B35900EE4C41 /* MediaTimeMac.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = MediaTimeMac.cpp; sourceTree = "<group>"; };
-                CD641EBE1819B35900EE4C41 /* MediaTimeMac.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MediaTimeMac.h; sourceTree = "<group>"; };
</del><ins>+                CD641EBD1819B35900EE4C41 /* MediaTimeAVFoundation.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = MediaTimeAVFoundation.cpp; sourceTree = "<group>"; };
+                CD641EBE1819B35900EE4C41 /* MediaTimeAVFoundation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MediaTimeAVFoundation.h; sourceTree = "<group>"; };
</ins><span class="cx">                 CD641EC7181ED60100EE4C41 /* MediaSample.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MediaSample.h; sourceTree = "<group>"; };
</span><span class="cx">                 CD7DBB2618CA11FF00C11066 /* CSSGridLineNamesValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSGridLineNamesValue.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 CD7DBB2718CA11FF00C11066 /* CSSGridLineNamesValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSGridLineNamesValue.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -14475,6 +14479,8 @@
</span><span class="cx">                                 07B442D5166C70B000556CAD /* InbandTextTrackPrivateAVF.h */,
</span><span class="cx">                                 076F0D0912B8192700C26AA4 /* MediaPlayerPrivateAVFoundation.cpp */,
</span><span class="cx">                                 076F0D0A12B8192700C26AA4 /* MediaPlayerPrivateAVFoundation.h */,
</span><ins>+                                CD641EBD1819B35900EE4C41 /* MediaTimeAVFoundation.cpp */,
+                                CD641EBE1819B35900EE4C41 /* MediaTimeAVFoundation.h */,
</ins><span class="cx">                                 CD336F6317FA0A4D00DDDCD0 /* VideoTrackPrivateAVF.h */,
</span><span class="cx">                         );
</span><span class="cx">                         path = avfoundation;
</span><span class="lines">@@ -16363,8 +16369,6 @@
</span><span class="cx">                                 06E81EEB0AB5DA9700C87837 /* LocalCurrentGraphicsContext.mm */,
</span><span class="cx">                                 BC25B528131C6D3900180E10 /* LocalizedStringsMac.cpp */,
</span><span class="cx">                                 1402645D0AFDC19B005919E2 /* LoggingMac.mm */,
</span><del>-                                CD641EBD1819B35900EE4C41 /* MediaTimeMac.cpp */,
-                                CD641EBE1819B35900EE4C41 /* MediaTimeMac.h */,
</del><span class="cx">                                 BC772C5D0C4EB3440083285F /* MIMETypeRegistryMac.mm */,
</span><span class="cx">                                 93500F3113FDE3BE0099EC24 /* NSScrollerImpDetails.h */,
</span><span class="cx">                                 52F52E1014A0134F00ACC397 /* NSScrollerImpDetails.mm */,
</span><span class="lines">@@ -20270,6 +20274,8 @@
</span><span class="cx">                                 49FFBF3E11C93EE3006A7118 /* WebGLLayer.mm */,
</span><span class="cx">                                 0FCF332B0F2B9A25004B6795 /* WebLayer.h */,
</span><span class="cx">                                 0FCF332A0F2B9A25004B6795 /* WebLayer.mm */,
</span><ins>+                                CD60C0C4193E87C7003C656B /* MediaTimeQTKit.mm */,
+                                CD60C0C5193E87C7003C656B /* MediaTimeQTKit.h */,
</ins><span class="cx">                         );
</span><span class="cx">                         path = mac;
</span><span class="cx">                         sourceTree = "<group>";
</span><span class="lines">@@ -25253,7 +25259,7 @@
</span><span class="cx">                                 076306D017E1478D005A7C4E /* MediaStreamTrackSourcesCallback.h in Headers */,
</span><span class="cx">                                 076306D317E1478D005A7C4E /* MediaStreamTrackSourcesRequest.h in Headers */,
</span><span class="cx">                                 076306E317E22A43005A7C4E /* MediaStreamTrackSourcesRequestClient.h in Headers */,
</span><del>-                                CD641EC01819B36000EE4C41 /* MediaTimeMac.h in Headers */,
</del><ins>+                                CD641EC01819B36000EE4C41 /* MediaTimeAVFoundation.h in Headers */,
</ins><span class="cx">                                 0705852117FDC140005F2BCB /* MediaTrackConstraint.h in Headers */,
</span><span class="cx">                                 0705852417FDC140005F2BCB /* MediaTrackConstraints.h in Headers */,
</span><span class="cx">                                 0705852917FDE02C005F2BCB /* MediaTrackConstraintSet.h in Headers */,
</span><span class="lines">@@ -25628,6 +25634,7 @@
</span><span class="cx">                                 436708E912D9CA4B00044234 /* RenderSVGTransformableContainer.h in Headers */,
</span><span class="cx">                                 0854B01D1255E4E600B9CDD0 /* RenderSVGTSpan.h in Headers */,
</span><span class="cx">                                 436708EB12D9CA4B00044234 /* RenderSVGViewportContainer.h in Headers */,
</span><ins>+                                CD60C0C7193E87C7003C656B /* MediaTimeQTKit.h in Headers */,
</ins><span class="cx">                                 A8DF4AEB0980C42C0052981B /* RenderTable.h in Headers */,
</span><span class="cx">                                 6ED878C5147493F4004C3597 /* RenderTableCaption.h in Headers */,
</span><span class="cx">                                 A8DF4AE90980C42C0052981B /* RenderTableCell.h in Headers */,
</span><span class="lines">@@ -28784,7 +28791,7 @@
</span><span class="cx">                                 078E090317D14CEE00420AA1 /* MediaStreamTrackEvent.cpp in Sources */,
</span><span class="cx">                                 07FFDE68181AED420072D409 /* MediaStreamTrackPrivate.cpp in Sources */,
</span><span class="cx">                                 076306D217E1478D005A7C4E /* MediaStreamTrackSourcesRequest.cpp in Sources */,
</span><del>-                                CD641EBF1819B36000EE4C41 /* MediaTimeMac.cpp in Sources */,
</del><ins>+                                CD641EBF1819B36000EE4C41 /* MediaTimeAVFoundation.cpp in Sources */,
</ins><span class="cx">                                 0705853A17FE0770005F2BCB /* MediaTrackConstraint.cpp in Sources */,
</span><span class="cx">                                 0705852317FDC140005F2BCB /* MediaTrackConstraints.cpp in Sources */,
</span><span class="cx">                                 0705853817FE044F005F2BCB /* MediaTrackConstraintSet.cpp in Sources */,
</span><span class="lines">@@ -29320,6 +29327,7 @@
</span><span class="cx">                                 51E0BABC0DA5547100A9E417 /* StorageEvent.cpp in Sources */,
</span><span class="cx">                                 C5E9B67710697E1300C7BB1A /* StorageEventDispatcher.cpp in Sources */,
</span><span class="cx">                                 51E0BB390DA5ACB600A9E417 /* StorageMap.cpp in Sources */,
</span><ins>+                                CD60C0C6193E87C7003C656B /* MediaTimeQTKit.mm in Sources */,
</ins><span class="cx">                                 C50D0E820FF4272900AC2644 /* StorageNamespace.cpp in Sources */,
</span><span class="cx">                                 C55E38C010040D5D00A56BDB /* StorageNamespaceImpl.cpp in Sources */,
</span><span class="cx">                                 5D5975B419635F1100D00878 /* SystemVersion.mm in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDataCueCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDataCueCustom.cpp (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDataCueCustom.cpp        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/bindings/js/JSDataCueCustom.cpp        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -88,7 +88,7 @@
</span><span class="cx"> if (UNLIKELY(exec->hadException()))
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx">
</span><del>- object = DataCue::create(*context, startTime, endTime, data, type, ec);
</del><ins>+ object = DataCue::create(*context, MediaTime::createWithDouble(startTime), MediaTime::createWithDouble(endTime), data, type, ec);
</ins><span class="cx"> if (ec) {
</span><span class="cx"> setDOMException(exec, ec);
</span><span class="cx"> return JSValue::encode(JSValue());
</span><span class="lines">@@ -100,7 +100,7 @@
</span><span class="cx"> #if !ENABLE(DATACUE_VALUE)
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> #else
</span><del>- object = DataCue::create(*context, startTime, endTime, valueArgument, type);
</del><ins>+ object = DataCue::create(*context, MediaTime::createWithDouble(startTime), MediaTime::createWithDouble(endTime), valueArgument, type);
</ins><span class="cx"> return JSValue::encode(asObject(toJS(exec, castedThis->globalObject(), object.get())));
</span><span class="cx"> #endif
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.cpp        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -268,10 +268,9 @@
</span><span class="cx"> , m_readyStateMaximum(HAVE_NOTHING)
</span><span class="cx"> , m_volume(1.0f)
</span><span class="cx"> , m_volumeInitialized(false)
</span><del>- , m_lastSeekTime(0)
</del><span class="cx"> , m_previousProgressTime(std::numeric_limits<double>::max())
</span><span class="cx"> , m_clockTimeAtLastUpdateEvent(0)
</span><del>- , m_lastTimeUpdateEventMovieTime(std::numeric_limits<double>::max())
</del><ins>+ , m_lastTimeUpdateEventMovieTime(MediaTime::positiveInfiniteTime())
</ins><span class="cx"> , m_loadState(WaitingForSource)
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> , m_videoFullscreenGravity(MediaPlayer::VideoGravityResizeAspect)
</span><span class="lines">@@ -282,11 +281,8 @@
</span><span class="cx"> #if ENABLE(MEDIA_SOURCE)
</span><span class="cx"> , m_droppedVideoFrames(0)
</span><span class="cx"> #endif
</span><del>- , m_cachedTime(MediaPlayer::invalidTime())
</del><span class="cx"> , m_clockTimeAtLastCachedTimeUpdate(0)
</span><span class="cx"> , m_minimumClockTimeToUpdateCachedTime(0)
</span><del>- , m_fragmentStartTime(MediaPlayer::invalidTime())
- , m_fragmentEndTime(MediaPlayer::invalidTime())
</del><span class="cx"> , m_pendingActionFlags(0)
</span><span class="cx"> , m_actionAfterScan(Nothing)
</span><span class="cx"> , m_scanType(Scan)
</span><span class="lines">@@ -319,7 +315,7 @@
</span><span class="cx"> , m_tracksAreReady(true)
</span><span class="cx"> , m_haveVisibleTextTrack(false)
</span><span class="cx"> , m_processingPreferenceChange(false)
</span><del>- , m_lastTextTrackUpdateTime(-1)
</del><ins>+ , m_lastTextTrackUpdateTime(MediaTime(-1, 1))
</ins><span class="cx"> , m_captionDisplayMode(CaptionUserPreferences::Automatic)
</span><span class="cx"> , m_audioTracks(0)
</span><span class="cx"> , m_textTracks(0)
</span><span class="lines">@@ -938,7 +934,7 @@
</span><span class="cx"> updateMediaController();
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx"> if (RuntimeEnabledFeatures::sharedFeatures().webkitVideoTrackEnabled())
</span><del>- updateActiveTextTrackCues(0);
</del><ins>+ updateActiveTextTrackCues(MediaTime::zeroTime());
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -963,7 +959,7 @@
</span><span class="cx">
</span><span class="cx"> // FIXME: Investigate whether these can be moved into m_networkState != NETWORK_EMPTY block above
</span><span class="cx"> // so they are closer to the relevant spec steps.
</span><del>- m_lastSeekTime = 0;
</del><ins>+ m_lastSeekTime = MediaTime::zeroTime();
</ins><span class="cx">
</span><span class="cx"> // The spec doesn't say to block the load event until we actually run the asynchronous section
</span><span class="cx"> // algorithm, but do it now because we won't start that until after the timer fires and the
</span><span class="lines">@@ -1236,13 +1232,12 @@
</span><span class="cx"> return a->trackIndex() - b->trackIndex() < 0;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static bool eventTimeCueCompare(const std::pair<double, TextTrackCue*>& a,
- const std::pair<double, TextTrackCue*>& b)
</del><ins>+static bool eventTimeCueCompare(const std::pair<MediaTime, TextTrackCue*>& a, const std::pair<MediaTime, TextTrackCue*>& b)
</ins><span class="cx"> {
</span><span class="cx"> // 12 - Sort the tasks in events in ascending time order (tasks with earlier
</span><span class="cx"> // times first).
</span><span class="cx"> if (a.first != b.first)
</span><del>- return a.first - b.first < 0;
</del><ins>+ return a.first - b.first < MediaTime::zeroTime();
</ins><span class="cx">
</span><span class="cx"> // If the cues belong to different text tracks, it doesn't make sense to
</span><span class="cx"> // compare the two tracks by the relative cue order, so return the relative
</span><span class="lines">@@ -1262,7 +1257,7 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx">
</span><del>-void HTMLMediaElement::updateActiveTextTrackCues(double movieTime)
</del><ins>+void HTMLMediaElement::updateActiveTextTrackCues(const MediaTime& movieTime)
</ins><span class="cx"> {
</span><span class="cx"> // 4.8.10.8 Playing the media resource
</span><span class="cx">
</span><span class="lines">@@ -1300,7 +1295,7 @@
</span><span class="cx"> // 3 - Let last time be the current playback position at the time this
</span><span class="cx"> // algorithm was last run for this media element, if this is not the first
</span><span class="cx"> // time it has run.
</span><del>- double lastTime = m_lastTextTrackUpdateTime;
</del><ins>+ MediaTime lastTime = m_lastTextTrackUpdateTime;
</ins><span class="cx">
</span><span class="cx"> // 4 - If the current playback position has, since the last time this
</span><span class="cx"> // algorithm was run, only changed through its usual monotonic increase
</span><span class="lines">@@ -1308,13 +1303,13 @@
</span><span class="cx"> // cues whose start times are greater than or equal to last time and whose
</span><span class="cx"> // end times are less than or equal to the current playback position.
</span><span class="cx"> // Otherwise, let missed cues be an empty list.
</span><del>- if (lastTime >= 0 && m_lastSeekTime < movieTime) {
</del><ins>+ if (lastTime >= MediaTime::zeroTime() && m_lastSeekTime < movieTime) {
</ins><span class="cx"> CueList potentiallySkippedCues =
</span><span class="cx"> m_cueTree.allOverlaps(m_cueTree.createInterval(lastTime, movieTime));
</span><span class="cx">
</span><span class="cx"> for (size_t i = 0; i < potentiallySkippedCues.size(); ++i) {
</span><del>- double cueStartTime = potentiallySkippedCues[i].low();
- double cueEndTime = potentiallySkippedCues[i].high();
</del><ins>+ MediaTime cueStartTime = potentiallySkippedCues[i].low();
+ MediaTime cueEndTime = potentiallySkippedCues[i].high();
</ins><span class="cx">
</span><span class="cx"> // Consider cues that may have been missed since the last seek time.
</span><span class="cx"> if (cueStartTime > std::max(m_lastSeekTime, lastTime) && cueEndTime < movieTime)
</span><span class="lines">@@ -1382,7 +1377,7 @@
</span><span class="cx"> // 8 - Let events be a list of tasks, initially empty. Each task in this
</span><span class="cx"> // list will be associated with a text track, a text track cue, and a time,
</span><span class="cx"> // which are used to sort the list before the tasks are queued.
</span><del>- Vector<std::pair<double, TextTrackCue*>> eventTasks;
</del><ins>+ Vector<std::pair<MediaTime, TextTrackCue*>> eventTasks;
</ins><span class="cx">
</span><span class="cx"> // 8 - Let affected tracks be a list of text tracks, initially empty.
</span><span class="cx"> Vector<TextTrack*> affectedTracks;
</span><span class="lines">@@ -1390,7 +1385,7 @@
</span><span class="cx"> for (size_t i = 0; i < missedCuesSize; ++i) {
</span><span class="cx"> // 9 - For each text track cue in missed cues, prepare an event named enter
</span><span class="cx"> // for the TextTrackCue object with the text track cue start time.
</span><del>- eventTasks.append(std::make_pair(missedCues[i].data()->startTime(),
</del><ins>+ eventTasks.append(std::make_pair(missedCues[i].data()->startMediaTime(),
</ins><span class="cx"> missedCues[i].data()));
</span><span class="cx">
</span><span class="cx"> // 10 - For each text track [...] in missed cues, prepare an event
</span><span class="lines">@@ -1402,9 +1397,8 @@
</span><span class="cx"> // checked when these tasks are actually queued below. This doesn't
</span><span class="cx"> // affect sorting events before dispatch either, because the exit
</span><span class="cx"> // event has the same time as the enter event.
</span><del>- if (missedCues[i].data()->startTime() < missedCues[i].data()->endTime())
- eventTasks.append(std::make_pair(missedCues[i].data()->endTime(),
- missedCues[i].data()));
</del><ins>+ if (missedCues[i].data()->startMediaTime() < missedCues[i].data()->endMediaTime())
+ eventTasks.append(std::make_pair(missedCues[i].data()->endMediaTime(), missedCues[i].data()));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> for (size_t i = 0; i < previousCuesSize; ++i) {
</span><span class="lines">@@ -1412,7 +1406,7 @@
</span><span class="cx"> // track cue active flag set prepare an event named exit for the
</span><span class="cx"> // TextTrackCue object with the text track cue end time.
</span><span class="cx"> if (!currentCues.contains(previousCues[i]))
</span><del>- eventTasks.append(std::make_pair(previousCues[i].data()->endTime(),
</del><ins>+ eventTasks.append(std::make_pair(previousCues[i].data()->endMediaTime(),
</ins><span class="cx"> previousCues[i].data()));
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1421,7 +1415,7 @@
</span><span class="cx"> // text track cue active flag set, prepare an event named enter for the
</span><span class="cx"> // TextTrackCue object with the text track cue start time.
</span><span class="cx"> if (!previousCues.contains(currentCues[i]))
</span><del>- eventTasks.append(std::make_pair(currentCues[i].data()->startTime(),
</del><ins>+ eventTasks.append(std::make_pair(currentCues[i].data()->startMediaTime(),
</ins><span class="cx"> currentCues[i].data()));
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1449,7 +1443,7 @@
</span><span class="cx"> event->setTarget(eventTasks[i].second);
</span><span class="cx"> m_asyncEventQueue.enqueueEvent(event.release());
</span><span class="cx"> } else {
</span><del>- if (eventTasks[i].first == eventTasks[i].second->startTime())
</del><ins>+ if (eventTasks[i].first == eventTasks[i].second->startMediaTime())
</ins><span class="cx"> event = Event::create(eventNames().enterEvent, false, false);
</span><span class="cx"> else
</span><span class="cx"> event = Event::create(eventNames().exitEvent, false, false);
</span><span class="lines">@@ -1602,7 +1596,7 @@
</span><span class="cx"> ASSERT(m_ignoreTrackDisplayUpdate);
</span><span class="cx"> --m_ignoreTrackDisplayUpdate;
</span><span class="cx"> if (!m_ignoreTrackDisplayUpdate && m_inActiveDocument)
</span><del>- updateActiveTextTrackCues(currentTime());
</del><ins>+ updateActiveTextTrackCues(currentMediaTime());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void HTMLMediaElement::textTrackAddCues(TextTrack* track, const TextTrackCueList* cues)
</span><span class="lines">@@ -1622,28 +1616,31 @@
</span><span class="cx"> textTrackRemoveCue(cues->item(i)->track(), cues->item(i));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void HTMLMediaElement::textTrackAddCue(TextTrack* track, PassRefPtr<TextTrackCue> cue)
</del><ins>+void HTMLMediaElement::textTrackAddCue(TextTrack* track, PassRefPtr<TextTrackCue> prpCue)
</ins><span class="cx"> {
</span><span class="cx"> if (track->mode() == TextTrack::disabledKeyword())
</span><span class="cx"> return;
</span><span class="cx">
</span><ins>+ RefPtr<TextTrackCue> cue = prpCue;
+
</ins><span class="cx"> // Negative duration cues need be treated in the interval tree as
</span><span class="cx"> // zero-length cues.
</span><del>- double endTime = std::max(cue->startTime(), cue->endTime());
</del><ins>+ MediaTime endTime = std::max(cue->startMediaTime(), cue->endMediaTime());
</ins><span class="cx">
</span><del>- CueInterval interval = m_cueTree.createInterval(cue->startTime(), endTime, cue.get());
</del><ins>+ CueInterval interval = m_cueTree.createInterval(cue->startMediaTime(), endTime, cue.get());
</ins><span class="cx"> if (!m_cueTree.contains(interval))
</span><span class="cx"> m_cueTree.add(interval);
</span><del>- updateActiveTextTrackCues(currentTime());
</del><ins>+ updateActiveTextTrackCues(currentMediaTime());
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void HTMLMediaElement::textTrackRemoveCue(TextTrack*, PassRefPtr<TextTrackCue> cue)
</del><ins>+void HTMLMediaElement::textTrackRemoveCue(TextTrack*, PassRefPtr<TextTrackCue> prpCue)
</ins><span class="cx"> {
</span><ins>+ RefPtr<TextTrackCue> cue = prpCue;
</ins><span class="cx"> // Negative duration cues need to be treated in the interval tree as
</span><span class="cx"> // zero-length cues.
</span><del>- double endTime = std::max(cue->startTime(), cue->endTime());
</del><ins>+ MediaTime endTime = std::max(cue->startMediaTime(), cue->endMediaTime());
</ins><span class="cx">
</span><del>- CueInterval interval = m_cueTree.createInterval(cue->startTime(), endTime, cue.get());
</del><ins>+ CueInterval interval = m_cueTree.createInterval(cue->startMediaTime(), endTime, cue.get());
</ins><span class="cx"> m_cueTree.remove(interval);
</span><span class="cx">
</span><span class="cx"> #if ENABLE(WEBVTT_REGIONS)
</span><span class="lines">@@ -1662,7 +1659,7 @@
</span><span class="cx">
</span><span class="cx"> if (cue->isRenderable())
</span><span class="cx"> toVTTCue(cue.get())->removeDisplayTree();
</span><del>- updateActiveTextTrackCues(currentTime());
</del><ins>+ updateActiveTextTrackCues(currentMediaTime());
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(WEBVTT_REGIONS)
</span><span class="cx"> if (cue->isRenderable())
</span><span class="lines">@@ -2089,7 +2086,7 @@
</span><span class="cx"> updateMediaController();
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx"> if (RuntimeEnabledFeatures::sharedFeatures().webkitVideoTrackEnabled())
</span><del>- updateActiveTextTrackCues(currentTime());
</del><ins>+ updateActiveTextTrackCues(currentMediaTime());
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2242,7 +2239,7 @@
</span><span class="cx"> void HTMLMediaElement::rewind(double timeDelta)
</span><span class="cx"> {
</span><span class="cx"> LOG(Media, "HTMLMediaElement::rewind(%f)", timeDelta);
</span><del>- setCurrentTime(std::max(currentTime() - timeDelta, minTimeSeekable()));
</del><ins>+ setCurrentTime(std::max(currentMediaTime() - MediaTime::createWithDouble(timeDelta), minTimeSeekable()));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void HTMLMediaElement::returnToRealtime()
</span><span class="lines">@@ -2251,12 +2248,12 @@
</span><span class="cx"> setCurrentTime(maxTimeSeekable());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void HTMLMediaElement::addPlayedRange(double start, double end)
</del><ins>+void HTMLMediaElement::addPlayedRange(const MediaTime& start, const MediaTime& end)
</ins><span class="cx"> {
</span><del>- LOG(Media, "HTMLMediaElement::addPlayedRange(%f, %f)", start, end);
</del><ins>+ LOG(Media, "HTMLMediaElement::addPlayedRange(%s, %s)", toString(start).utf8().data(), toString(end).utf8().data());
</ins><span class="cx"> if (!m_playedTimeRanges)
</span><span class="cx"> m_playedTimeRanges = TimeRanges::create();
</span><del>- m_playedTimeRanges->add(start, end);
</del><ins>+ m_playedTimeRanges->ranges().add(start, end);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool HTMLMediaElement::supportsSave() const
</span><span class="lines">@@ -2280,7 +2277,12 @@
</span><span class="cx">
</span><span class="cx"> void HTMLMediaElement::fastSeek(double time)
</span><span class="cx"> {
</span><del>- LOG(Media, "HTMLMediaElement::fastSeek(%f)", time);
</del><ins>+ fastSeek(MediaTime::createWithDouble(time));
+}
+
+void HTMLMediaElement::fastSeek(const MediaTime& time)
+{
+ LOG(Media, "HTMLMediaElement::fastSeek(%s)", toString(time).utf8().data());
</ins><span class="cx"> // 4.7.10.9 Seeking
</span><span class="cx"> // 9. If the approximate-for-speed flag is set, adjust the new playback position to a value that will
</span><span class="cx"> // allow for playback to resume promptly. If new playback position before this step is before current
</span><span class="lines">@@ -2288,28 +2290,29 @@
</span><span class="cx"> // position. Similarly, if the new playback position before this step is after current playback position,
</span><span class="cx"> // then the adjusted new playback position must also be after the current playback position.
</span><span class="cx"> refreshCachedTime();
</span><del>- double delta = time - currentTime();
- double negativeTolerance = delta >= 0 ? delta : std::numeric_limits<double>::infinity();
- double positiveTolerance = delta < 0 ? -delta : std::numeric_limits<double>::infinity();
</del><ins>+ MediaTime delta = time - currentMediaTime();
+ MediaTime negativeTolerance = delta >= MediaTime::zeroTime() ? delta : MediaTime::positiveInfiniteTime();
+ MediaTime positiveTolerance = delta < MediaTime::zeroTime() ? -delta : MediaTime::positiveInfiniteTime();
</ins><span class="cx">
</span><span class="cx"> seekWithTolerance(time, negativeTolerance, positiveTolerance, true);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void HTMLMediaElement::seek(double time)
</del><ins>+void HTMLMediaElement::seek(const MediaTime& time)
</ins><span class="cx"> {
</span><del>- LOG(Media, "HTMLMediaElement::seek(%f)", time);
- seekWithTolerance(time, 0, 0, true);
</del><ins>+ LOG(Media, "HTMLMediaElement::seek(%s)", toString(time).utf8().data());
+ seekWithTolerance(time, MediaTime::zeroTime(), MediaTime::zeroTime(), true);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void HTMLMediaElement::seekInternal(double time)
</del><ins>+void HTMLMediaElement::seekInternal(const MediaTime& time)
</ins><span class="cx"> {
</span><del>- LOG(Media, "HTMLMediaElement::seekInternal(%f)", time);
- seekWithTolerance(time, 0, 0, false);
</del><ins>+ LOG(Media, "HTMLMediaElement::seekInternal(%s)", toString(time).utf8().data());
+ seekWithTolerance(time, MediaTime::zeroTime(), MediaTime::zeroTime(), false);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void HTMLMediaElement::seekWithTolerance(double time, double negativeTolerance, double positiveTolerance, bool fromDOM)
</del><ins>+void HTMLMediaElement::seekWithTolerance(const MediaTime& inTime, const MediaTime& negativeTolerance, const MediaTime& positiveTolerance, bool fromDOM)
</ins><span class="cx"> {
</span><span class="cx"> // 4.8.10.9 Seeking
</span><ins>+ MediaTime time = inTime;
</ins><span class="cx">
</span><span class="cx"> // 1 - Set the media element's show poster flag to false.
</span><span class="cx"> setDisplayMode(Video);
</span><span class="lines">@@ -2324,7 +2327,7 @@
</span><span class="cx">
</span><span class="cx"> // Get the current time before setting m_seeking, m_lastSeekTime is returned once it is set.
</span><span class="cx"> refreshCachedTime();
</span><del>- double now = currentTime();
</del><ins>+ MediaTime now = currentMediaTime();
</ins><span class="cx">
</span><span class="cx"> // 3 - If the element's seeking IDL attribute is true, then another instance of this algorithm is
</span><span class="cx"> // already running. Abort that other instance of the algorithm without waiting for the step that
</span><span class="lines">@@ -2360,18 +2363,18 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> ASSERT(m_pendingSeek);
</span><del>- double now = m_pendingSeek->now;
- double time = m_pendingSeek->targetTime;
- double negativeTolerance = m_pendingSeek->negativeTolerance;
- double positiveTolerance = m_pendingSeek->positiveTolerance;
</del><ins>+ MediaTime now = m_pendingSeek->now;
+ MediaTime time = m_pendingSeek->targetTime;
+ MediaTime negativeTolerance = m_pendingSeek->negativeTolerance;
+ MediaTime positiveTolerance = m_pendingSeek->positiveTolerance;
</ins><span class="cx"> m_pendingSeek = nullptr;
</span><span class="cx">
</span><span class="cx"> // 6 - If the new playback position is later than the end of the media resource, then let it be the end
</span><span class="cx"> // of the media resource instead.
</span><del>- time = std::min(time, duration());
</del><ins>+ time = std::min(time, durationMediaTime());
</ins><span class="cx">
</span><span class="cx"> // 7 - If the new playback position is less than the earliest possible position, let it be that position instead.
</span><del>- double earliestTime = m_player->startTime();
</del><ins>+ MediaTime earliestTime = m_player->startTime();
</ins><span class="cx"> time = std::max(time, earliestTime);
</span><span class="cx">
</span><span class="cx"> // Ask the media engine for the time value in the movie's time scale before comparing with current time. This
</span><span class="lines">@@ -2380,9 +2383,9 @@
</span><span class="cx"> // not generate a timechanged callback. This means m_seeking will never be cleared and we will never
</span><span class="cx"> // fire a 'seeked' event.
</span><span class="cx"> #if !LOG_DISABLED
</span><del>- double mediaTime = m_player->mediaTimeForTimeValue(time);
</del><ins>+ MediaTime mediaTime = m_player->mediaTimeForTimeValue(time);
</ins><span class="cx"> if (time != mediaTime)
</span><del>- LOG(Media, "HTMLMediaElement::seekTimerFired(%f) - media timeline equivalent is %f", time, mediaTime);
</del><ins>+ LOG(Media, "HTMLMediaElement::seekTimerFired(%s) - media timeline equivalent is %s", toString(time).utf8().data(), toString(mediaTime).utf8().data());
</ins><span class="cx"> #endif
</span><span class="cx"> time = m_player->mediaTimeForTimeValue(time);
</span><span class="cx">
</span><span class="lines">@@ -2413,7 +2416,7 @@
</span><span class="cx"> m_seeking = false;
</span><span class="cx"> return;
</span><span class="cx"> }
</span><del>- time = seekableRanges->nearest(time);
</del><ins>+ time = seekableRanges->ranges().nearest(time);
</ins><span class="cx">
</span><span class="cx"> m_sentEndEvent = false;
</span><span class="cx"> m_lastSeekTime = time;
</span><span class="lines">@@ -2475,7 +2478,7 @@
</span><span class="cx"> void HTMLMediaElement::refreshCachedTime() const
</span><span class="cx"> {
</span><span class="cx"> m_cachedTime = m_player->currentTime();
</span><del>- if (!m_cachedTime) {
</del><ins>+ if (!m_cachedTime) {
</ins><span class="cx"> // Do not use m_cachedTime until the media engine returns a non-zero value because we can't
</span><span class="cx"> // estimate current time until playback actually begins.
</span><span class="cx"> invalidateCachedTime();
</span><span class="lines">@@ -2488,7 +2491,7 @@
</span><span class="cx"> void HTMLMediaElement::invalidateCachedTime() const
</span><span class="cx"> {
</span><span class="cx"> #if !LOG_DISABLED
</span><del>- if (m_cachedTime != MediaPlayer::invalidTime())
</del><ins>+ if (m_cachedTime.isValid())
</ins><span class="cx"> LOG(Media, "HTMLMediaElement::invalidateCachedTime");
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="lines">@@ -2498,29 +2501,34 @@
</span><span class="cx"> static const double minimumTimePlayingBeforeCacheSnapshot = 0.5;
</span><span class="cx">
</span><span class="cx"> m_minimumClockTimeToUpdateCachedTime = monotonicallyIncreasingTime() + minimumTimePlayingBeforeCacheSnapshot;
</span><del>- m_cachedTime = MediaPlayer::invalidTime();
</del><ins>+ m_cachedTime = MediaTime::invalidTime();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // playback state
</span><span class="cx"> double HTMLMediaElement::currentTime() const
</span><span class="cx"> {
</span><ins>+ return currentMediaTime().toDouble();
+}
+
+MediaTime HTMLMediaElement::currentMediaTime() const
+{
</ins><span class="cx"> #if LOG_CACHED_TIME_WARNINGS
</span><del>- static const double minCachedDeltaForWarning = 0.01;
</del><ins>+ static const MediaTime minCachedDeltaForWarning = MediaTime::create(1, 100);
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> if (!m_player)
</span><del>- return 0;
</del><ins>+ return MediaTime::zeroTime();
</ins><span class="cx">
</span><span class="cx"> if (m_seeking) {
</span><del>- LOG(Media, "HTMLMediaElement::currentTime - seeking, returning %f", m_lastSeekTime);
</del><ins>+ LOG(Media, "HTMLMediaElement::currentTime - seeking, returning %s", toString(m_lastSeekTime).utf8().data());
</ins><span class="cx"> return m_lastSeekTime;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (m_cachedTime != MediaPlayer::invalidTime() && m_paused) {
</del><ins>+ if (m_cachedTime.isValid() && m_paused) {
</ins><span class="cx"> #if LOG_CACHED_TIME_WARNINGS
</span><del>- double delta = m_cachedTime - m_player->currentTime();
</del><ins>+ MediaTime delta = m_cachedTime - m_player->currentTime();
</ins><span class="cx"> if (delta > minCachedDeltaForWarning)
</span><del>- LOG(Media, "HTMLMediaElement::currentTime - WARNING, cached time is %f seconds off of media time when paused", delta);
</del><ins>+ LOG(Media, "HTMLMediaElement::currentTime - WARNING, cached time is %s seconds off of media time when paused", toString(delta).utf8().data());
</ins><span class="cx"> #endif
</span><span class="cx"> return m_cachedTime;
</span><span class="cx"> }
</span><span class="lines">@@ -2529,15 +2537,15 @@
</span><span class="cx"> double now = monotonicallyIncreasingTime();
</span><span class="cx"> double maximumDurationToCacheMediaTime = m_player->maximumDurationToCacheMediaTime();
</span><span class="cx">
</span><del>- if (maximumDurationToCacheMediaTime && m_cachedTime != MediaPlayer::invalidTime() && !m_paused && now > m_minimumClockTimeToUpdateCachedTime) {
</del><ins>+ if (maximumDurationToCacheMediaTime && m_cachedTime.isValid() && !m_paused && now > m_minimumClockTimeToUpdateCachedTime) {
</ins><span class="cx"> double clockDelta = now - m_clockTimeAtLastCachedTimeUpdate;
</span><span class="cx">
</span><span class="cx"> // Not too soon, use the cached time only if it hasn't expired.
</span><span class="cx"> if (clockDelta < maximumDurationToCacheMediaTime) {
</span><del>- double adjustedCacheTime = m_cachedTime + (effectivePlaybackRate() * clockDelta);
</del><ins>+ MediaTime adjustedCacheTime = m_cachedTime + MediaTime::createWithDouble(effectivePlaybackRate() * clockDelta);
</ins><span class="cx">
</span><span class="cx"> #if LOG_CACHED_TIME_WARNINGS
</span><del>- double delta = adjustedCacheTime - m_player->currentTime();
</del><ins>+ MediaTime delta = adjustedCacheTime - m_player->currentTime();
</ins><span class="cx"> if (delta > minCachedDeltaForWarning)
</span><span class="cx"> LOG(Media, "HTMLMediaElement::currentTime - WARNING, cached time is %f seconds off of media time when playing", delta);
</span><span class="cx"> #endif
</span><span class="lines">@@ -2548,21 +2556,26 @@
</span><span class="cx"> #if LOG_CACHED_TIME_WARNINGS
</span><span class="cx"> if (maximumDurationToCacheMediaTime && now > m_minimumClockTimeToUpdateCachedTime && m_cachedTime != MediaPlayer::invalidTime()) {
</span><span class="cx"> double clockDelta = now - m_clockTimeAtLastCachedTimeUpdate;
</span><del>- double delta = m_cachedTime + (effectivePlaybackRate() * clockDelta) - m_player->currentTime();
- LOG(Media, "HTMLMediaElement::currentTime - cached time was %f seconds off of media time when it expired", delta);
</del><ins>+ MediaTime delta = m_cachedTime + MediaTime::createWithDouble(effectivePlaybackRate() * clockDelta) - m_player->currentTime();
+ LOG(Media, "HTMLMediaElement::currentTime - cached time was %s seconds off of media time when it expired", toString(delta).utf8().data());
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> refreshCachedTime();
</span><span class="cx">
</span><del>- if (m_cachedTime == MediaPlayer::invalidTime())
- return 0;
</del><ins>+ if (m_cachedTime.isInvalid())
+ return MediaTime::zeroTime();
</ins><span class="cx">
</span><span class="cx"> return m_cachedTime;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void HTMLMediaElement::setCurrentTime(double time)
</span><span class="cx"> {
</span><ins>+ setCurrentTime(MediaTime::createWithDouble(time));
+}
+
+void HTMLMediaElement::setCurrentTime(const MediaTime& time)
+{
</ins><span class="cx"> if (m_mediaController)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="lines">@@ -2578,15 +2591,20 @@
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- seek(time);
</del><ins>+ seek(MediaTime::createWithDouble(time));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> double HTMLMediaElement::duration() const
</span><span class="cx"> {
</span><ins>+ return durationMediaTime().toDouble();
+}
+
+MediaTime HTMLMediaElement::durationMediaTime() const
+{
</ins><span class="cx"> if (m_player && m_readyState >= HAVE_METADATA)
</span><span class="cx"> return m_player->duration();
</span><span class="cx">
</span><del>- return std::numeric_limits<double>::quiet_NaN();
</del><ins>+ return MediaTime::invalidTime();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool HTMLMediaElement::paused() const
</span><span class="lines">@@ -2732,7 +2750,7 @@
</span><span class="cx"> scheduleDelayedAction(LoadMediaResource);
</span><span class="cx">
</span><span class="cx"> if (endedPlayback())
</span><del>- seekInternal(0);
</del><ins>+ seekInternal(MediaTime::zeroTime());
</ins><span class="cx">
</span><span class="cx"> if (m_mediaController)
</span><span class="cx"> m_mediaController->bringElementUpToSpeed(this);
</span><span class="lines">@@ -3104,8 +3122,8 @@
</span><span class="cx"> {
</span><span class="cx"> ASSERT(m_player);
</span><span class="cx">
</span><del>- if (m_fragmentEndTime != MediaPlayer::invalidTime() && currentTime() >= m_fragmentEndTime && effectivePlaybackRate() > 0) {
- m_fragmentEndTime = MediaPlayer::invalidTime();
</del><ins>+ if (m_fragmentEndTime.isValid() && currentMediaTime() >= m_fragmentEndTime && effectivePlaybackRate() > 0) {
+ m_fragmentEndTime = MediaTime::invalidTime();
</ins><span class="cx"> if (!m_mediaController && !m_paused) {
</span><span class="cx"> // changes paused to true and fires a simple event named pause at the media element.
</span><span class="cx"> pauseInternal();
</span><span class="lines">@@ -3122,7 +3140,7 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx"> if (RuntimeEnabledFeatures::sharedFeatures().webkitVideoTrackEnabled())
</span><del>- updateActiveTextTrackCues(currentTime());
</del><ins>+ updateActiveTextTrackCues(currentMediaTime());
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if ENABLE(MEDIA_SOURCE)
</span><span class="lines">@@ -3142,7 +3160,7 @@
</span><span class="cx">
</span><span class="cx"> // Some media engines make multiple "time changed" callbacks at the same time, but we only want one
</span><span class="cx"> // event at a given time so filter here
</span><del>- double movieTime = currentTime();
</del><ins>+ MediaTime movieTime = currentMediaTime();
</ins><span class="cx"> if (movieTime != m_lastTimeUpdateEventMovieTime) {
</span><span class="cx"> scheduleEvent(eventNames().timeupdateEvent);
</span><span class="cx"> m_clockTimeAtLastUpdateEvent = now;
</span><span class="lines">@@ -3159,9 +3177,9 @@
</span><span class="cx"> {
</span><span class="cx"> if (!m_player)
</span><span class="cx"> return 0;
</span><del>- double duration = m_player->duration();
</del><ins>+ MediaTime duration = m_player->duration();
</ins><span class="cx">
</span><del>- if (!duration || std::isinf(duration))
</del><ins>+ if (!duration || duration.isPositiveInfinite() || duration.isNegativeInfinite())
</ins><span class="cx"> return 0;
</span><span class="cx">
</span><span class="cx"> MediaTime buffered = MediaTime::zeroTime();
</span><span class="lines">@@ -3172,7 +3190,7 @@
</span><span class="cx"> MediaTime end = timeRanges->end(i, ignored);
</span><span class="cx"> buffered += end - start;
</span><span class="cx"> }
</span><del>- return buffered.toDouble() / duration;
</del><ins>+ return buffered.toDouble() / duration.toDouble();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="lines">@@ -4051,7 +4069,7 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx"> if (RuntimeEnabledFeatures::sharedFeatures().webkitVideoTrackEnabled())
</span><del>- updateActiveTextTrackCues(currentTime());
</del><ins>+ updateActiveTextTrackCues(currentMediaTime());
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> beginProcessingMediaPlayerCallback();
</span><span class="lines">@@ -4068,20 +4086,20 @@
</span><span class="cx"> else
</span><span class="cx"> scheduleTimeupdateEvent(false);
</span><span class="cx">
</span><del>- double now = currentTime();
- double dur = duration();
</del><ins>+ MediaTime now = currentMediaTime();
+ MediaTime dur = durationMediaTime();
</ins><span class="cx"> double playbackRate = effectivePlaybackRate();
</span><span class="cx">
</span><span class="cx"> // When the current playback position reaches the end of the media resource then the user agent must follow these steps:
</span><del>- if (!std::isnan(dur) && dur) {
</del><ins>+ if (dur.isValid() && dur) {
</ins><span class="cx"> // If the media element has a loop attribute specified and does not have a current media controller,
</span><span class="cx"> if (loop() && !m_mediaController && playbackRate > 0) {
</span><span class="cx"> m_sentEndEvent = false;
</span><span class="cx"> // then seek to the earliest possible position of the media resource and abort these steps when the direction of
</span><span class="cx"> // playback is forwards,
</span><span class="cx"> if (now >= dur)
</span><del>- seekInternal(0);
- } else if ((now <= 0 && playbackRate < 0) || (now >= dur && playbackRate > 0)) {
</del><ins>+ seekInternal(MediaTime::zeroTime());
+ } else if ((now <= MediaTime::zeroTime() && playbackRate < 0) || (now >= dur && playbackRate > 0)) {
</ins><span class="cx"> // If the media element does not have a current media controller, and the media element
</span><span class="cx"> // has still ended playback and paused is false,
</span><span class="cx"> if (!m_mediaController && !m_paused) {
</span><span class="lines">@@ -4148,8 +4166,8 @@
</span><span class="cx"> scheduleEvent(eventNames().durationchangeEvent);
</span><span class="cx"> mediaPlayerCharacteristicChanged(player);
</span><span class="cx">
</span><del>- double now = currentTime();
- double dur = duration();
</del><ins>+ MediaTime now = currentMediaTime();
+ MediaTime dur = durationMediaTime();
</ins><span class="cx"> if (now > dur)
</span><span class="cx"> seekInternal(dur);
</span><span class="cx">
</span><span class="lines">@@ -4326,7 +4344,7 @@
</span><span class="cx"> PassRefPtr<TimeRanges> HTMLMediaElement::played()
</span><span class="cx"> {
</span><span class="cx"> if (m_playing) {
</span><del>- double time = currentTime();
</del><ins>+ MediaTime time = currentMediaTime();
</ins><span class="cx"> if (time > m_lastSeekTime)
</span><span class="cx"> addPlayedRange(m_lastSeekTime, time);
</span><span class="cx"> }
</span><span class="lines">@@ -4378,8 +4396,8 @@
</span><span class="cx">
</span><span class="cx"> bool HTMLMediaElement::endedPlayback() const
</span><span class="cx"> {
</span><del>- double dur = duration();
- if (!m_player || std::isnan(dur))
</del><ins>+ MediaTime dur = durationMediaTime();
+ if (!m_player || !dur.isValid())
</ins><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> // 4.8.10.8 Playing the media resource
</span><span class="lines">@@ -4392,14 +4410,14 @@
</span><span class="cx"> // and the current playback position is the end of the media resource and the direction
</span><span class="cx"> // of playback is forwards, Either the media element does not have a loop attribute specified,
</span><span class="cx"> // or the media element has a current media controller.
</span><del>- double now = currentTime();
</del><ins>+ MediaTime now = currentMediaTime();
</ins><span class="cx"> if (effectivePlaybackRate() > 0)
</span><del>- return dur > 0 && now >= dur && (!loop() || m_mediaController);
</del><ins>+ return dur > MediaTime::zeroTime() && now >= dur && (!loop() || m_mediaController);
</ins><span class="cx">
</span><span class="cx"> // or the current playback position is the earliest possible position and the direction
</span><span class="cx"> // of playback is backwards
</span><span class="cx"> if (effectivePlaybackRate() < 0)
</span><del>- return now <= 0;
</del><ins>+ return now <= MediaTime::zeroTime();
</ins><span class="cx">
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="lines">@@ -4423,14 +4441,14 @@
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-double HTMLMediaElement::minTimeSeekable() const
</del><ins>+MediaTime HTMLMediaElement::minTimeSeekable() const
</ins><span class="cx"> {
</span><del>- return m_player ? m_player->minTimeSeekable() : 0;
</del><ins>+ return m_player ? m_player->minTimeSeekable() : MediaTime::zeroTime();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-double HTMLMediaElement::maxTimeSeekable() const
</del><ins>+MediaTime HTMLMediaElement::maxTimeSeekable() const
</ins><span class="cx"> {
</span><del>- return m_player ? m_player->maxTimeSeekable() : 0;
</del><ins>+ return m_player ? m_player->maxTimeSeekable() : MediaTime::zeroTime();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void HTMLMediaElement::updateVolume()
</span><span class="lines">@@ -4522,7 +4540,7 @@
</span><span class="cx">
</span><span class="cx"> m_playbackProgressTimer.stop();
</span><span class="cx"> m_playing = false;
</span><del>- double time = currentTime();
</del><ins>+ MediaTime time = currentMediaTime();
</ins><span class="cx"> if (time > m_lastSeekTime)
</span><span class="cx"> addPlayedRange(m_lastSeekTime, time);
</span><span class="cx">
</span><span class="lines">@@ -4602,7 +4620,7 @@
</span><span class="cx"> updateMediaController();
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx"> if (RuntimeEnabledFeatures::sharedFeatures().webkitVideoTrackEnabled())
</span><del>- updateActiveTextTrackCues(0);
</del><ins>+ updateActiveTextTrackCues(MediaTime::zeroTime());
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -5212,7 +5230,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (checkType == CheckTextTrackVisibility && m_haveVisibleTextTrack == haveVisibleTextTrack) {
</span><del>- updateActiveTextTrackCues(currentTime());
</del><ins>+ updateActiveTextTrackCues(currentMediaTime());
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -5236,7 +5254,7 @@
</span><span class="cx">
</span><span class="cx"> if (RuntimeEnabledFeatures::sharedFeatures().webkitVideoTrackEnabled()) {
</span><span class="cx"> updateTextTrackDisplay();
</span><del>- updateActiveTextTrackCues(currentTime());
</del><ins>+ updateActiveTextTrackCues(currentMediaTime());
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -5448,31 +5466,31 @@
</span><span class="cx"> void HTMLMediaElement::prepareMediaFragmentURI()
</span><span class="cx"> {
</span><span class="cx"> MediaFragmentURIParser fragmentParser(m_currentSrc);
</span><del>- double dur = duration();
</del><ins>+ MediaTime dur = durationMediaTime();
</ins><span class="cx">
</span><del>- double start = fragmentParser.startTime();
- if (start != MediaFragmentURIParser::invalidTimeValue() && start > 0) {
</del><ins>+ MediaTime start = fragmentParser.startTime();
+ if (start.isValid() && start > MediaTime::zeroTime()) {
</ins><span class="cx"> m_fragmentStartTime = start;
</span><span class="cx"> if (m_fragmentStartTime > dur)
</span><span class="cx"> m_fragmentStartTime = dur;
</span><span class="cx"> } else
</span><del>- m_fragmentStartTime = MediaPlayer::invalidTime();
</del><ins>+ m_fragmentStartTime = MediaTime::invalidTime();
</ins><span class="cx">
</span><del>- double end = fragmentParser.endTime();
- if (end != MediaFragmentURIParser::invalidTimeValue() && end > 0 && end > m_fragmentStartTime) {
</del><ins>+ MediaTime end = fragmentParser.endTime();
+ if (end.isValid() && end > MediaTime::zeroTime() && (!m_fragmentStartTime.isValid() || end > m_fragmentStartTime)) {
</ins><span class="cx"> m_fragmentEndTime = end;
</span><span class="cx"> if (m_fragmentEndTime > dur)
</span><span class="cx"> m_fragmentEndTime = dur;
</span><span class="cx"> } else
</span><del>- m_fragmentEndTime = MediaPlayer::invalidTime();
</del><ins>+ m_fragmentEndTime = MediaTime::invalidTime();
</ins><span class="cx">
</span><del>- if (m_fragmentStartTime != MediaPlayer::invalidTime() && m_readyState < HAVE_FUTURE_DATA)
</del><ins>+ if (m_fragmentStartTime.isValid() && m_readyState < HAVE_FUTURE_DATA)
</ins><span class="cx"> prepareToPlay();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void HTMLMediaElement::applyMediaFragmentURI()
</span><span class="cx"> {
</span><del>- if (m_fragmentStartTime != MediaPlayer::invalidTime()) {
</del><ins>+ if (m_fragmentStartTime.isValid()) {
</ins><span class="cx"> m_sentEndEvent = false;
</span><span class="cx"> seek(m_fragmentStartTime);
</span><span class="cx"> }
</span><span class="lines">@@ -5735,7 +5753,7 @@
</span><span class="cx"> m_droppedVideoFrames + m_player->totalVideoFrames(),
</span><span class="cx"> m_droppedVideoFrames + m_player->droppedVideoFrames(),
</span><span class="cx"> m_player->corruptedVideoFrames(),
</span><del>- m_player->totalFrameDelay());
</del><ins>+ m_player->totalFrameDelay().toDouble());
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.h (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.h        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/html/HTMLMediaElement.h        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -84,7 +84,7 @@
</span><span class="cx"> class VideoTrackList;
</span><span class="cx"> class VideoTrackPrivate;
</span><span class="cx">
</span><del>-typedef PODIntervalTree<double, TextTrackCue*> CueIntervalTree;
</del><ins>+typedef PODIntervalTree<MediaTime, TextTrackCue*> CueIntervalTree;
</ins><span class="cx"> typedef CueIntervalTree::IntervalType CueInterval;
</span><span class="cx"> typedef Vector<CueInterval> CueList;
</span><span class="cx"> #endif
</span><span class="lines">@@ -176,6 +176,13 @@
</span><span class="cx"> virtual void setDefaultPlaybackRate(double) override;
</span><span class="cx"> WEBCORE_EXPORT virtual double playbackRate() const override;
</span><span class="cx"> virtual void setPlaybackRate(double) override;
</span><ins>+
+// MediaTime versions of playback state
+ MediaTime currentMediaTime() const;
+ void setCurrentTime(const MediaTime&);
+ MediaTime durationMediaTime() const;
+ void fastSeek(const MediaTime&);
+
</ins><span class="cx"> void updatePlaybackRate();
</span><span class="cx"> bool webkitPreservesPitch() const;
</span><span class="cx"> void setWebkitPreservesPitch(bool);
</span><span class="lines">@@ -586,12 +593,12 @@
</span><span class="cx"> void startProgressEventTimer();
</span><span class="cx"> void stopPeriodicTimers();
</span><span class="cx">
</span><del>- void seek(double time);
- void seekInternal(double time);
- void seekWithTolerance(double time, double negativeTolerance, double positiveTolerance, bool fromDOM);
</del><ins>+ void seek(const MediaTime&);
+ void seekInternal(const MediaTime&);
+ void seekWithTolerance(const MediaTime&, const MediaTime& negativeTolerance, const MediaTime& positiveTolerance, bool fromDOM);
</ins><span class="cx"> void finishSeek();
</span><span class="cx"> void checkIfSeekNeeded();
</span><del>- void addPlayedRange(double start, double end);
</del><ins>+ void addPlayedRange(const MediaTime& start, const MediaTime& end);
</ins><span class="cx">
</span><span class="cx"> void scheduleTimeupdateEvent(bool periodicEvent);
</span><span class="cx"> void scheduleEvent(const AtomicString& eventName);
</span><span class="lines">@@ -612,7 +619,7 @@
</span><span class="cx"> URL selectNextSourceChild(ContentType*, String* keySystem, InvalidURLAction);
</span><span class="cx">
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><del>- void updateActiveTextTrackCues(double);
</del><ins>+ void updateActiveTextTrackCues(const MediaTime&);
</ins><span class="cx"> HTMLTrackElement* showingTrackWithSameKind(HTMLTrackElement*) const;
</span><span class="cx">
</span><span class="cx"> enum ReconfigureMode {
</span><span class="lines">@@ -643,8 +650,8 @@
</span><span class="cx"> bool pausedForUserInteraction() const;
</span><span class="cx"> bool couldPlayIfEnoughData() const;
</span><span class="cx">
</span><del>- double minTimeSeekable() const;
- double maxTimeSeekable() const;
</del><ins>+ MediaTime minTimeSeekable() const;
+ MediaTime maxTimeSeekable() const;
</ins><span class="cx">
</span><span class="cx"> // Pauses playback without changing any states or generating events
</span><span class="cx"> void setPausedInternal(bool);
</span><span class="lines">@@ -720,23 +727,23 @@
</span><span class="cx"> RefPtr<MediaError> m_error;
</span><span class="cx">
</span><span class="cx"> struct PendingSeek {
</span><del>- PendingSeek(double now, double targetTime, double negativeTolerance, double positiveTolerance)
</del><ins>+ PendingSeek(const MediaTime& now, const MediaTime& targetTime, const MediaTime& negativeTolerance, const MediaTime& positiveTolerance)
</ins><span class="cx"> : now(now)
</span><span class="cx"> , targetTime(targetTime)
</span><span class="cx"> , negativeTolerance(negativeTolerance)
</span><span class="cx"> , positiveTolerance(positiveTolerance)
</span><span class="cx"> {
</span><span class="cx"> }
</span><del>- double now;
- double targetTime;
- double negativeTolerance;
- double positiveTolerance;
</del><ins>+ MediaTime now;
+ MediaTime targetTime;
+ MediaTime negativeTolerance;
+ MediaTime positiveTolerance;
</ins><span class="cx"> };
</span><span class="cx"> std::unique_ptr<PendingSeek> m_pendingSeek;
</span><span class="cx">
</span><span class="cx"> double m_volume;
</span><span class="cx"> bool m_volumeInitialized;
</span><del>- double m_lastSeekTime;
</del><ins>+ MediaTime m_lastSeekTime;
</ins><span class="cx">
</span><span class="cx"> unsigned m_previousProgress;
</span><span class="cx"> double m_previousProgressTime;
</span><span class="lines">@@ -745,7 +752,7 @@
</span><span class="cx"> double m_clockTimeAtLastUpdateEvent;
</span><span class="cx">
</span><span class="cx"> // The last time a timeupdate event was sent in movie time.
</span><del>- double m_lastTimeUpdateEventMovieTime;
</del><ins>+ MediaTime m_lastTimeUpdateEventMovieTime;
</ins><span class="cx">
</span><span class="cx"> // Loading state.
</span><span class="cx"> enum LoadState { WaitingForSource, LoadingFromSrcAttr, LoadingFromSourceElement };
</span><span class="lines">@@ -774,12 +781,12 @@
</span><span class="cx"> unsigned long m_droppedVideoFrames;
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>- mutable double m_cachedTime;
</del><ins>+ mutable MediaTime m_cachedTime;
</ins><span class="cx"> mutable double m_clockTimeAtLastCachedTimeUpdate;
</span><span class="cx"> mutable double m_minimumClockTimeToUpdateCachedTime;
</span><span class="cx">
</span><del>- double m_fragmentStartTime;
- double m_fragmentEndTime;
</del><ins>+ MediaTime m_fragmentStartTime;
+ MediaTime m_fragmentEndTime;
</ins><span class="cx">
</span><span class="cx"> typedef unsigned PendingActionFlags;
</span><span class="cx"> PendingActionFlags m_pendingActionFlags;
</span><span class="lines">@@ -834,7 +841,7 @@
</span><span class="cx"> bool m_processingPreferenceChange : 1;
</span><span class="cx">
</span><span class="cx"> String m_subtitleTrackLanguage;
</span><del>- float m_lastTextTrackUpdateTime;
</del><ins>+ MediaTime m_lastTextTrackUpdateTime;
</ins><span class="cx">
</span><span class="cx"> CaptionUserPreferences::CaptionDisplayMode m_captionDisplayMode;
</span><span class="cx">
</span><span class="lines">@@ -897,7 +904,7 @@
</span><span class="cx"> String text;
</span><span class="cx"> if (cue->isRenderable())
</span><span class="cx"> text = toVTTCue(cue)->text();
</span><del>- return String::format("%p id=%s interval=%f-->%f cue=%s)", cue, cue->id().utf8().data(), cue->startTime(), cue->endTime(), text.utf8().data());
</del><ins>+ return String::format("%p id=%s interval=%s-->%s cue=%s)", cue, cue->id().utf8().data(), toString(cue->startTime()).utf8().data(), toString(cue->endTime()).utf8().data(), text.utf8().data());
</ins><span class="cx"> }
</span><span class="cx"> };
</span><span class="cx"> #endif
</span><span class="lines">@@ -910,6 +917,16 @@
</span><span class="cx">
</span><span class="cx"> NODE_TYPE_CASTS(HTMLMediaElement)
</span><span class="cx">
</span><ins>+#ifndef NDEBUG
+template<>
+struct ValueToString<MediaTime> {
+ static String string(const MediaTime& time)
+ {
+ return toString(time);
+ }
+};
+#endif
+
</ins><span class="cx"> } //namespace
</span><span class="cx">
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlMediaControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/MediaController.cpp (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/MediaController.cpp        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/html/MediaController.cpp        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -171,7 +171,7 @@
</span><span class="cx">
</span><span class="cx"> // Seek each slaved media element to the new playback position relative to the media element timeline.
</span><span class="cx"> for (size_t index = 0; index < m_mediaElements.size(); ++index)
</span><del>- m_mediaElements[index]->seek(time);
</del><ins>+ m_mediaElements[index]->seek(MediaTime::createWithDouble(time));
</ins><span class="cx">
</span><span class="cx"> scheduleTimeupdateEvent();
</span><span class="cx"> }
</span><span class="lines">@@ -479,7 +479,7 @@
</span><span class="cx"> // When the user agent is to bring a media element up to speed with its new media controller,
</span><span class="cx"> // it must seek that media element to the MediaController's media controller position relative
</span><span class="cx"> // to the media element's timeline.
</span><del>- element->seekInternal(currentTime());
</del><ins>+ element->seekInternal(MediaTime::createWithDouble(currentTime()));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool MediaController::isBlocked() const
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlMediaFragmentURIParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/MediaFragmentURIParser.cpp (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/MediaFragmentURIParser.cpp        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/html/MediaFragmentURIParser.cpp        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -70,32 +70,27 @@
</span><span class="cx"> return digits.toString();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-double MediaFragmentURIParser::invalidTimeValue()
-{
- return MediaPlayer::invalidTime();
-}
-
</del><span class="cx"> MediaFragmentURIParser::MediaFragmentURIParser(const URL& url)
</span><span class="cx"> : m_url(url)
</span><span class="cx"> , m_timeFormat(None)
</span><del>- , m_startTime(MediaPlayer::invalidTime())
- , m_endTime(MediaPlayer::invalidTime())
</del><ins>+ , m_startTime(MediaTime::invalidTime())
+ , m_endTime(MediaTime::invalidTime())
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-double MediaFragmentURIParser::startTime()
</del><ins>+MediaTime MediaFragmentURIParser::startTime()
</ins><span class="cx"> {
</span><span class="cx"> if (!m_url.isValid())
</span><del>- return MediaPlayer::invalidTime();
</del><ins>+ return MediaTime::invalidTime();
</ins><span class="cx"> if (m_timeFormat == None)
</span><span class="cx"> parseTimeFragment();
</span><span class="cx"> return m_startTime;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-double MediaFragmentURIParser::endTime()
</del><ins>+MediaTime MediaFragmentURIParser::endTime()
</ins><span class="cx"> {
</span><span class="cx"> if (!m_url.isValid())
</span><del>- return MediaPlayer::invalidTime();
</del><ins>+ return MediaTime::invalidTime();
</ins><span class="cx"> if (m_timeFormat == None)
</span><span class="cx"> parseTimeFragment();
</span><span class="cx"> return m_endTime;
</span><span class="lines">@@ -184,8 +179,8 @@
</span><span class="cx"> // in the same format. The format is specified by name, followed by a colon (:), with npt: being
</span><span class="cx"> // the default.
</span><span class="cx">
</span><del>- double start = MediaPlayer::invalidTime();
- double end = MediaPlayer::invalidTime();
</del><ins>+ MediaTime start = MediaTime::invalidTime();
+ MediaTime end = MediaTime::invalidTime();
</ins><span class="cx"> if (parseNPTFragment(fragment.second.characters8(), fragment.second.length(), start, end)) {
</span><span class="cx"> m_startTime = start;
</span><span class="cx"> m_endTime = end;
</span><span class="lines">@@ -202,7 +197,7 @@
</span><span class="cx"> m_fragments.clear();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool MediaFragmentURIParser::parseNPTFragment(const LChar* timeString, unsigned length, double& startTime, double& endTime)
</del><ins>+bool MediaFragmentURIParser::parseNPTFragment(const LChar* timeString, unsigned length, MediaTime& startTime, MediaTime& endTime)
</ins><span class="cx"> {
</span><span class="cx"> unsigned offset = 0;
</span><span class="cx"> if (length >= nptIdentiferLength && timeString[0] == 'n' && timeString[1] == 'p' && timeString[2] == 't' && timeString[3] == ':')
</span><span class="lines">@@ -215,7 +210,7 @@
</span><span class="cx"> // If a single number only is given, this corresponds to the begin time except if it is preceded
</span><span class="cx"> // by a comma that would in this case indicate the end time.
</span><span class="cx"> if (timeString[offset] == ',')
</span><del>- startTime = 0;
</del><ins>+ startTime = MediaTime::zeroTime();
</ins><span class="cx"> else {
</span><span class="cx"> if (!parseNPTTime(timeString, length, offset, startTime))
</span><span class="cx"> return false;
</span><span class="lines">@@ -241,7 +236,7 @@
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool MediaFragmentURIParser::parseNPTTime(const LChar* timeString, unsigned length, unsigned& offset, double& time)
</del><ins>+bool MediaFragmentURIParser::parseNPTTime(const LChar* timeString, unsigned length, unsigned& offset, MediaTime& time)
</ins><span class="cx"> {
</span><span class="cx"> enum Mode { minutes, hours };
</span><span class="cx"> Mode mode = minutes;
</span><span class="lines">@@ -271,17 +266,17 @@
</span><span class="cx"> String digits1 = collectDigits(timeString, length, offset);
</span><span class="cx"> int value1 = digits1.toInt();
</span><span class="cx"> if (offset >= length || timeString[offset] == ',') {
</span><del>- time = value1;
</del><ins>+ time = MediaTime::createWithDouble(value1);
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- double fraction = 0;
</del><ins>+ MediaTime fraction;
</ins><span class="cx"> if (timeString[offset] == '.') {
</span><span class="cx"> if (offset == length)
</span><span class="cx"> return true;
</span><span class="cx"> String digits = collectFraction(timeString, length, offset);
</span><del>- fraction = digits.toDouble();
- time = value1 + fraction;
</del><ins>+ fraction = MediaTime::createWithDouble(digits.toDouble());
+ time = MediaTime::createWithDouble(value1) + fraction;
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -318,9 +313,9 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (offset < length && timeString[offset] == '.')
</span><del>- fraction = collectFraction(timeString, length, offset).toDouble();
</del><ins>+ fraction = MediaTime::createWithDouble(collectFraction(timeString, length, offset).toDouble());
</ins><span class="cx">
</span><del>- time = (value1 * secondsPerHour) + (value2 * secondsPerMinute) + value3 + fraction;
</del><ins>+ time = MediaTime::createWithDouble((value1 * secondsPerHour) + (value2 * secondsPerMinute) + value3) + fraction;
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlMediaFragmentURIParserh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/MediaFragmentURIParser.h (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/MediaFragmentURIParser.h        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/html/MediaFragmentURIParser.h        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #if ENABLE(VIDEO)
</span><span class="cx">
</span><span class="cx"> #include "URL.h"
</span><ins>+#include <wtf/MediaTime.h>
</ins><span class="cx"> #include <wtf/Vector.h>
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -40,24 +41,22 @@
</span><span class="cx">
</span><span class="cx"> MediaFragmentURIParser(const URL&);
</span><span class="cx">
</span><del>- double startTime();
- double endTime();
</del><ins>+ MediaTime startTime();
+ MediaTime endTime();
</ins><span class="cx">
</span><del>- static double invalidTimeValue();
-
</del><span class="cx"> private:
</span><span class="cx">
</span><span class="cx"> void parseFragments();
</span><span class="cx">
</span><span class="cx"> enum TimeFormat { None, Invalid, NormalPlayTime, SMPTETimeCode, WallClockTimeCode };
</span><span class="cx"> void parseTimeFragment();
</span><del>- bool parseNPTFragment(const LChar*, unsigned length, double& startTime, double& endTime);
- bool parseNPTTime(const LChar*, unsigned length, unsigned& offset, double& time);
</del><ins>+ bool parseNPTFragment(const LChar*, unsigned length, MediaTime& startTime, MediaTime& endTime);
+ bool parseNPTTime(const LChar*, unsigned length, unsigned& offset, MediaTime&);
</ins><span class="cx">
</span><span class="cx"> URL m_url;
</span><span class="cx"> TimeFormat m_timeFormat;
</span><del>- double m_startTime;
- double m_endTime;
</del><ins>+ MediaTime m_startTime;
+ MediaTime m_endTime;
</ins><span class="cx"> Vector<std::pair<String, String>> m_fragments;
</span><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlTimeRangesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/TimeRanges.h (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/TimeRanges.h        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/html/TimeRanges.h        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -60,6 +60,7 @@
</span><span class="cx"> double totalDuration() const;
</span><span class="cx">
</span><span class="cx"> const PlatformTimeRanges& ranges() const { return m_ranges; }
</span><ins>+ PlatformTimeRanges& ranges() { return m_ranges; }
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> WEBCORE_EXPORT explicit TimeRanges();
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackDataCuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/DataCue.cpp (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/DataCue.cpp        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/html/track/DataCue.cpp        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -36,28 +36,28 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-DataCue::DataCue(ScriptExecutionContext& context, double start, double end, ArrayBuffer* data, const String& type, ExceptionCode& ec)
</del><ins>+DataCue::DataCue(ScriptExecutionContext& context, const MediaTime& start, const MediaTime& end, ArrayBuffer* data, const String& type, ExceptionCode& ec)
</ins><span class="cx"> : TextTrackCue(context, start, end)
</span><span class="cx"> , m_type(type)
</span><span class="cx"> {
</span><span class="cx"> setData(data, ec);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-DataCue::DataCue(ScriptExecutionContext& context, double start, double end, const void* data, unsigned length)
</del><ins>+DataCue::DataCue(ScriptExecutionContext& context, const MediaTime& start, const MediaTime& end, const void* data, unsigned length)
</ins><span class="cx"> : TextTrackCue(context, start, end)
</span><span class="cx"> {
</span><span class="cx"> m_data = ArrayBuffer::create(data, length);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(DATACUE_VALUE)
</span><del>-DataCue::DataCue(ScriptExecutionContext& context, double start, double end, PassRefPtr<SerializedPlatformRepresentation> platformValue, const String& type)
</del><ins>+DataCue::DataCue(ScriptExecutionContext& context, const MediaTime& start, const MediaTime& end, PassRefPtr<SerializedPlatformRepresentation> platformValue, const String& type)
</ins><span class="cx"> : TextTrackCue(context, start, end)
</span><span class="cx"> , m_type(type)
</span><span class="cx"> , m_platformValue(platformValue)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-DataCue::DataCue(ScriptExecutionContext& context, double start, double end, JSC::JSValue value, const String& type)
</del><ins>+DataCue::DataCue(ScriptExecutionContext& context, const MediaTime& start, const MediaTime& end, JSC::JSValue value, const String& type)
</ins><span class="cx"> : TextTrackCue(context, start, end)
</span><span class="cx"> , m_type(type)
</span><span class="cx"> , m_value(value)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackDataCueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/DataCue.h (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/DataCue.h        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/html/track/DataCue.h        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> #include "TextTrackCue.h"
</span><span class="cx"> #include <runtime/ArrayBuffer.h>
</span><span class="cx"> #include <runtime/JSCInlines.h>
</span><ins>+#include <wtf/MediaTime.h>
</ins><span class="cx"> #include <wtf/RefCounted.h>
</span><span class="cx">
</span><span class="cx"> #if ENABLE(DATACUE_VALUE)
</span><span class="lines">@@ -44,28 +45,28 @@
</span><span class="cx">
</span><span class="cx"> class DataCue : public TextTrackCue {
</span><span class="cx"> public:
</span><del>- static PassRefPtr<DataCue> create(ScriptExecutionContext& context, double start, double end, ArrayBuffer* data, ExceptionCode& ec)
</del><ins>+ static PassRefPtr<DataCue> create(ScriptExecutionContext& context, const MediaTime& start, const MediaTime& end, ArrayBuffer* data, ExceptionCode& ec)
</ins><span class="cx"> {
</span><span class="cx"> return adoptRef(new DataCue(context, start, end, data, emptyString(), ec));
</span><span class="cx"> }
</span><span class="cx">
</span><del>- static PassRefPtr<DataCue> create(ScriptExecutionContext& context, double start, double end, const void* data, unsigned length)
</del><ins>+ static PassRefPtr<DataCue> create(ScriptExecutionContext& context, const MediaTime& start, const MediaTime& end, const void* data, unsigned length)
</ins><span class="cx"> {
</span><span class="cx"> return adoptRef(new DataCue(context, start, end, data, length));
</span><span class="cx"> }
</span><span class="cx">
</span><del>- static PassRefPtr<DataCue> create(ScriptExecutionContext& context, double start, double end, ArrayBuffer* data, const String& type, ExceptionCode& ec)
</del><ins>+ static PassRefPtr<DataCue> create(ScriptExecutionContext& context, const MediaTime& start, const MediaTime& end, ArrayBuffer* data, const String& type, ExceptionCode& ec)
</ins><span class="cx"> {
</span><span class="cx"> return adoptRef(new DataCue(context, start, end, data, type, ec));
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(DATACUE_VALUE)
</span><del>- static PassRefPtr<DataCue> create(ScriptExecutionContext& context, double start, double end, PassRefPtr<SerializedPlatformRepresentation> platformValue, const String& type)
</del><ins>+ static PassRefPtr<DataCue> create(ScriptExecutionContext& context, const MediaTime& start, const MediaTime& end, PassRefPtr<SerializedPlatformRepresentation> platformValue, const String& type)
</ins><span class="cx"> {
</span><span class="cx"> return adoptRef(new DataCue(context, start, end, platformValue, type));
</span><span class="cx"> }
</span><span class="cx">
</span><del>- static PassRefPtr<DataCue> create(ScriptExecutionContext& context, double start, double end, JSC::JSValue value, const String& type)
</del><ins>+ static PassRefPtr<DataCue> create(ScriptExecutionContext& context, const MediaTime& start, const MediaTime& end, JSC::JSValue value, const String& type)
</ins><span class="cx"> {
</span><span class="cx"> return adoptRef(new DataCue(context, start, end, value, type));
</span><span class="cx"> }
</span><span class="lines">@@ -94,11 +95,11 @@
</span><span class="cx"> virtual bool doesExtendCue(const TextTrackCue&) const override;
</span><span class="cx">
</span><span class="cx"> protected:
</span><del>- DataCue(ScriptExecutionContext&, double start, double end, ArrayBuffer*, const String&, ExceptionCode&);
- DataCue(ScriptExecutionContext&, double start, double end, const void*, unsigned);
</del><ins>+ DataCue(ScriptExecutionContext&, const MediaTime& start, const MediaTime& end, ArrayBuffer*, const String&, ExceptionCode&);
+ DataCue(ScriptExecutionContext&, const MediaTime& start, const MediaTime& end, const void*, unsigned);
</ins><span class="cx"> #if ENABLE(DATACUE_VALUE)
</span><del>- DataCue(ScriptExecutionContext&, double start, double end, PassRefPtr<SerializedPlatformRepresentation>, const String&);
- DataCue(ScriptExecutionContext&, double start, double end, JSC::JSValue, const String&);
</del><ins>+ DataCue(ScriptExecutionContext&, const MediaTime& start, const MediaTime& end, PassRefPtr<SerializedPlatformRepresentation>, const String&);
+ DataCue(ScriptExecutionContext&, const MediaTime& start, const MediaTime& end, JSC::JSValue, const String&);
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> private:
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackInbandDataTextTrackcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/InbandDataTextTrack.cpp (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/InbandDataTextTrack.cpp        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/html/track/InbandDataTextTrack.cpp        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -52,14 +52,14 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void InbandDataTextTrack::addDataCue(InbandTextTrackPrivate*, double start, double end, const void* data, unsigned length)
</del><ins>+void InbandDataTextTrack::addDataCue(InbandTextTrackPrivate*, const MediaTime& start, const MediaTime& end, const void* data, unsigned length)
</ins><span class="cx"> {
</span><span class="cx"> RefPtr<DataCue> cue = DataCue::create(*scriptExecutionContext(), start, end, data, length);
</span><span class="cx"> addCue(cue.release(), ASSERT_NO_EXCEPTION);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(DATACUE_VALUE)
</span><del>-void InbandDataTextTrack::addDataCue(InbandTextTrackPrivate*, double start, double end, PassRefPtr<SerializedPlatformRepresentation> prpPlatformValue, const String& type)
</del><ins>+void InbandDataTextTrack::addDataCue(InbandTextTrackPrivate*, const MediaTime& start, const MediaTime& end, PassRefPtr<SerializedPlatformRepresentation> prpPlatformValue, const String& type)
</ins><span class="cx"> {
</span><span class="cx"> RefPtr<SerializedPlatformRepresentation> platformValue = prpPlatformValue;
</span><span class="cx"> if (m_incompleteCueMap.find(platformValue.get()) != m_incompleteCueMap.end())
</span><span class="lines">@@ -67,20 +67,22 @@
</span><span class="cx">
</span><span class="cx"> RefPtr<DataCue> cue = DataCue::create(*scriptExecutionContext(), start, end, platformValue, type);
</span><span class="cx"> if (hasCue(cue.get(), TextTrackCue::IgnoreDuration)) {
</span><del>- LOG(Media, "InbandDataTextTrack::addDataCue ignoring already added cue: start=%.2f, end=%.2f\n", cue->startTime(), cue->endTime());
</del><ins>+ LOG(Media, "InbandDataTextTrack::addDataCue ignoring already added cue: start=%s, end=%s\n", toString(cue->startTime()).utf8().data(), toString(cue->endTime()).utf8().data());
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (std::isinf(end) && mediaElement()) {
- cue->setEndTime(mediaElement()->duration(), IGNORE_EXCEPTION);
</del><ins>+ if (end.isPositiveInfinite() && mediaElement()) {
+ cue->setEndTime(mediaElement()->durationMediaTime());
</ins><span class="cx"> m_incompleteCueMap.add(platformValue, cue);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> addCue(cue.release(), ASSERT_NO_EXCEPTION);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void InbandDataTextTrack::updateDataCue(InbandTextTrackPrivate*, double start, double end, PassRefPtr<SerializedPlatformRepresentation> prpPlatformValue)
</del><ins>+void InbandDataTextTrack::updateDataCue(InbandTextTrackPrivate*, const MediaTime& start, const MediaTime& inEnd, PassRefPtr<SerializedPlatformRepresentation> prpPlatformValue)
</ins><span class="cx"> {
</span><ins>+ MediaTime end = inEnd;
+
</ins><span class="cx"> RefPtr<SerializedPlatformRepresentation> platformValue = prpPlatformValue;
</span><span class="cx"> auto iter = m_incompleteCueMap.find(platformValue.get());
</span><span class="cx"> if (iter == m_incompleteCueMap.end())
</span><span class="lines">@@ -92,20 +94,20 @@
</span><span class="cx">
</span><span class="cx"> cue->willChange();
</span><span class="cx">
</span><del>- if (std::isinf(end) && mediaElement())
- end = mediaElement()->duration();
</del><ins>+ if (end.isPositiveInfinite() && mediaElement())
+ end = mediaElement()->durationMediaTime();
</ins><span class="cx"> else
</span><span class="cx"> m_incompleteCueMap.remove(platformValue.get());
</span><span class="cx">
</span><del>- LOG(Media, "InbandDataTextTrack::updateDataCue: was start=%.2f, end=%.2f, will be start=%.2f, end=%.2f\n", cue->startTime(), cue->endTime(), start, end);
</del><ins>+ LOG(Media, "InbandDataTextTrack::updateDataCue: was start=%s, end=%s, will be start=%s, end=%s\n", toString(cue->startTime()).utf8().data(), toString(cue->endTime()).utf8().data(), toString(start).utf8().data(), toString(end).utf8().data());
</ins><span class="cx">
</span><del>- cue->setStartTime(start, IGNORE_EXCEPTION);
- cue->setEndTime(end, IGNORE_EXCEPTION);
</del><ins>+ cue->setStartTime(start);
+ cue->setEndTime(end);
</ins><span class="cx">
</span><span class="cx"> cue->didChange();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void InbandDataTextTrack::removeDataCue(InbandTextTrackPrivate*, double, double, PassRefPtr<SerializedPlatformRepresentation> prpPlatformValue)
</del><ins>+void InbandDataTextTrack::removeDataCue(InbandTextTrackPrivate*, const MediaTime&, const MediaTime&, PassRefPtr<SerializedPlatformRepresentation> prpPlatformValue)
</ins><span class="cx"> {
</span><span class="cx"> RefPtr<SerializedPlatformRepresentation> platformValue = prpPlatformValue;
</span><span class="cx"> auto iter = m_incompleteCueMap.find(platformValue.get());
</span><span class="lines">@@ -114,7 +116,7 @@
</span><span class="cx">
</span><span class="cx"> RefPtr<DataCue> cue = iter->value;
</span><span class="cx"> if (cue) {
</span><del>- LOG(Media, "InbandDataTextTrack::removeDataCue removing cue: start=%.2f, end=%.2f\n", cue->startTime(), cue->endTime());
</del><ins>+ LOG(Media, "InbandDataTextTrack::removeDataCue removing cue: start=%s, end=%s\n", toString(cue->startTime()).utf8().data(), toString(cue->endTime()).utf8().data());
</ins><span class="cx"> removeCue(cue.get(), IGNORE_EXCEPTION);
</span><span class="cx"> }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackInbandDataTextTrackh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/InbandDataTextTrack.h (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/InbandDataTextTrack.h        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/html/track/InbandDataTextTrack.h        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -50,12 +50,12 @@
</span><span class="cx"> private:
</span><span class="cx"> InbandDataTextTrack(ScriptExecutionContext*, TextTrackClient*, PassRefPtr<InbandTextTrackPrivate>);
</span><span class="cx">
</span><del>- virtual void addDataCue(InbandTextTrackPrivate*, double start, double end, const void*, unsigned) override;
</del><ins>+ virtual void addDataCue(InbandTextTrackPrivate*, const MediaTime& start, const MediaTime& end, const void*, unsigned) override;
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(DATACUE_VALUE)
</span><del>- virtual void addDataCue(InbandTextTrackPrivate*, double start, double end, PassRefPtr<SerializedPlatformRepresentation>, const String&) override;
- virtual void updateDataCue(InbandTextTrackPrivate*, double start, double end, PassRefPtr<SerializedPlatformRepresentation>) override;
- virtual void removeDataCue(InbandTextTrackPrivate*, double start, double end, PassRefPtr<SerializedPlatformRepresentation>) override;
</del><ins>+ virtual void addDataCue(InbandTextTrackPrivate*, const MediaTime& start, const MediaTime& end, PassRefPtr<SerializedPlatformRepresentation>, const String&) override;
+ virtual void updateDataCue(InbandTextTrackPrivate*, const MediaTime& start, const MediaTime& end, PassRefPtr<SerializedPlatformRepresentation>) override;
+ virtual void removeDataCue(InbandTextTrackPrivate*, const MediaTime& start, const MediaTime& end, PassRefPtr<SerializedPlatformRepresentation>) override;
</ins><span class="cx"> virtual void removeCue(TextTrackCue*, ExceptionCode&) override;
</span><span class="cx">
</span><span class="cx"> HashMap<RefPtr<SerializedPlatformRepresentation>, RefPtr<DataCue>> m_incompleteCueMap;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackInbandGenericTextTrackcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/InbandGenericTextTrack.cpp (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/InbandGenericTextTrack.cpp        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/html/track/InbandGenericTextTrack.cpp        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -110,11 +110,11 @@
</span><span class="cx"> {
</span><span class="cx"> cue->willChange();
</span><span class="cx">
</span><del>- cue->setStartTime(cueData->startTime(), IGNORE_EXCEPTION);
- double endTime = cueData->endTime();
- if (std::isinf(endTime) && mediaElement())
- endTime = mediaElement()->duration();
- cue->setEndTime(endTime, IGNORE_EXCEPTION);
</del><ins>+ cue->setStartTime(cueData->startTime());
+ MediaTime endTime = cueData->endTime();
+ if (endTime.isPositiveInfinite() && mediaElement())
+ endTime = mediaElement()->durationMediaTime();
+ cue->setEndTime(endTime);
</ins><span class="cx"> cue->setText(cueData->content());
</span><span class="cx"> cue->setId(cueData->id());
</span><span class="cx"> cue->setBaseFontSizeRelativeToVideoHeight(cueData->baseFontSize());
</span><span class="lines">@@ -156,11 +156,11 @@
</span><span class="cx"> RefPtr<TextTrackCueGeneric> cue = TextTrackCueGeneric::create(*scriptExecutionContext(), cueData->startTime(), cueData->endTime(), cueData->content());
</span><span class="cx"> updateCueFromCueData(cue.get(), cueData.get());
</span><span class="cx"> if (hasCue(cue.get(), TextTrackCue::IgnoreDuration)) {
</span><del>- LOG(Media, "InbandGenericTextTrack::addGenericCue ignoring already added cue: start=%.2f, end=%.2f, content=\"%s\"\n", cueData->startTime(), cueData->endTime(), cueData->content().utf8().data());
</del><ins>+ LOG(Media, "InbandGenericTextTrack::addGenericCue ignoring already added cue: start=%s, end=%s, content=\"%s\"\n", toString(cueData->startTime()).utf8().data(), toString(cueData->endTime()).utf8().data(), cueData->content().utf8().data());
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- LOG(Media, "InbandGenericTextTrack::addGenericCue added cue: start=%.2f, end=%.2f, content=\"%s\"\n", cueData->startTime(), cueData->endTime(), cueData->content().utf8().data());
</del><ins>+ LOG(Media, "InbandGenericTextTrack::addGenericCue added cue: start=%.2f, end=%.2f, content=\"%s\"\n", cueData->startTime().toDouble(), cueData->endTime().toDouble(), cueData->content().utf8().data());
</ins><span class="cx">
</span><span class="cx"> if (cueData->status() != GenericCueData::Complete)
</span><span class="cx"> m_cueMap.add(cueData.get(), cue.get());
</span><span class="lines">@@ -184,10 +184,10 @@
</span><span class="cx"> {
</span><span class="cx"> RefPtr<TextTrackCueGeneric> cue = m_cueMap.find(cueData);
</span><span class="cx"> if (cue) {
</span><del>- LOG(Media, "InbandGenericTextTrack::removeGenericCue removing cue: start=%.2f, end=%.2f, content=\"%s\"\n", cueData->startTime(), cueData->endTime(), cueData->content().utf8().data());
</del><ins>+ LOG(Media, "InbandGenericTextTrack::removeGenericCue removing cue: start=%s, end=%s, content=\"%s\"\n", toString(cueData->startTime()).utf8().data(), toString(cueData->endTime()).utf8().data(), cueData->content().utf8().data());
</ins><span class="cx"> removeCue(cue.get(), IGNORE_EXCEPTION);
</span><span class="cx"> } else {
</span><del>- LOG(Media, "InbandGenericTextTrack::removeGenericCue UNABLE to find cue: start=%.2f, end=%.2f, content=\"%s\"\n", cueData->startTime(), cueData->endTime(), cueData->content().utf8().data());
</del><ins>+ LOG(Media, "InbandGenericTextTrack::removeGenericCue UNABLE to find cue: start=%.2f, end=%.2f, content=\"%s\"\n", cueData->startTime().toDouble(), cueData->endTime().toDouble(), cueData->content().utf8().data());
</ins><span class="cx"> m_cueMap.remove(cueData);
</span><span class="cx"> }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackInbandTextTrackcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/InbandTextTrack.cpp (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/InbandTextTrack.cpp        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/html/track/InbandTextTrack.cpp        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -213,10 +213,10 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-double InbandTextTrack::startTimeVariance() const
</del><ins>+MediaTime InbandTextTrack::startTimeVariance() const
</ins><span class="cx"> {
</span><span class="cx"> if (!m_private)
</span><del>- return false;
</del><ins>+ return MediaTime::zeroTime();
</ins><span class="cx">
</span><span class="cx"> return m_private->startTimeVariance();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackInbandTextTrackh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/InbandTextTrack.h (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/InbandTextTrack.h        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/html/track/InbandTextTrack.h        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -69,12 +69,12 @@
</span><span class="cx"> virtual void languageChanged(TrackPrivateBase*, const AtomicString&) override;
</span><span class="cx"> virtual void willRemove(TrackPrivateBase*) override;
</span><span class="cx">
</span><del>- virtual void addDataCue(InbandTextTrackPrivate*, double, double, const void*, unsigned) override { ASSERT_NOT_REACHED(); }
</del><ins>+ virtual void addDataCue(InbandTextTrackPrivate*, const MediaTime&, const MediaTime&, const void*, unsigned) override { ASSERT_NOT_REACHED(); }
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(DATACUE_VALUE)
</span><del>- virtual void addDataCue(InbandTextTrackPrivate*, double, double, PassRefPtr<SerializedPlatformRepresentation>, const String&) override { ASSERT_NOT_REACHED(); }
- virtual void updateDataCue(InbandTextTrackPrivate*, double, double, PassRefPtr<SerializedPlatformRepresentation>) override { ASSERT_NOT_REACHED(); }
- virtual void removeDataCue(InbandTextTrackPrivate*, double, double, PassRefPtr<SerializedPlatformRepresentation>) override { ASSERT_NOT_REACHED(); }
</del><ins>+ virtual void addDataCue(InbandTextTrackPrivate*, const MediaTime&, const MediaTime&, PassRefPtr<SerializedPlatformRepresentation>, const String&) override { ASSERT_NOT_REACHED(); }
+ virtual void updateDataCue(InbandTextTrackPrivate*, const MediaTime&, const MediaTime&, PassRefPtr<SerializedPlatformRepresentation>) override { ASSERT_NOT_REACHED(); }
+ virtual void removeDataCue(InbandTextTrackPrivate*, const MediaTime&, const MediaTime&, PassRefPtr<SerializedPlatformRepresentation>) override { ASSERT_NOT_REACHED(); }
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> virtual void addGenericCue(InbandTextTrackPrivate*, PassRefPtr<GenericCueData>) override { ASSERT_NOT_REACHED(); }
</span><span class="lines">@@ -85,7 +85,7 @@
</span><span class="cx"> virtual void parseWebVTTCueData(InbandTextTrackPrivate*, const char*, unsigned) override { ASSERT_NOT_REACHED(); }
</span><span class="cx"> virtual void parseWebVTTCueData(InbandTextTrackPrivate*, const ISOWebVTTCue&) override { ASSERT_NOT_REACHED(); }
</span><span class="cx">
</span><del>- virtual double startTimeVariance() const;
</del><ins>+ virtual MediaTime startTimeVariance() const;
</ins><span class="cx">
</span><span class="cx"> #if USE(PLATFORM_TEXT_TRACK_MENU)
</span><span class="cx"> virtual InbandTextTrackPrivate* privateTrack() override { return m_private.get(); }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackTextTrackcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/TextTrack.cpp (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/TextTrack.cpp        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/html/track/TextTrack.cpp        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -294,7 +294,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // TODO(93143): Add spec-compliant behavior for negative time values.
</span><del>- if (std::isnan(cue->startTime()) || std::isnan(cue->endTime()) || cue->startTime() < 0 || cue->endTime() < 0)
</del><ins>+ if (!cue->startMediaTime().isValid() || !cue->endMediaTime().isValid() || cue->startMediaTime() < MediaTime::zeroTime() || cue->endMediaTime() < MediaTime::zeroTime())
</ins><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> // 4.8.10.12.5 Text track API
</span><span class="lines">@@ -485,7 +485,7 @@
</span><span class="cx">
</span><span class="cx"> bool TextTrack::hasCue(TextTrackCue* cue, TextTrackCue::CueMatchRules match)
</span><span class="cx"> {
</span><del>- if (cue->startTime() < 0 || cue->endTime() < 0)
</del><ins>+ if (cue->startMediaTime() < MediaTime::zeroTime() || cue->endMediaTime() < MediaTime::zeroTime())
</ins><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> if (!m_cues || !m_cues->length())
</span><span class="lines">@@ -522,7 +522,7 @@
</span><span class="cx"> if (!existingCue)
</span><span class="cx"> return false;
</span><span class="cx">
</span><del>- if (cue->startTime() > (existingCue->startTime() + startTimeVariance()))
</del><ins>+ if (cue->startMediaTime() > (existingCue->startMediaTime() + startTimeVariance()))
</ins><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> if (existingCue->isEqual(*cue, match))
</span><span class="lines">@@ -532,7 +532,7 @@
</span><span class="cx">
</span><span class="cx"> size_t index = (searchStart + searchEnd) / 2;
</span><span class="cx"> existingCue = m_cues->item(index);
</span><del>- if ((cue->startTime() + startTimeVariance()) < existingCue->startTime() || (match != TextTrackCue::IgnoreDuration && cue->hasEquivalentStartTime(*existingCue) && cue->endTime() > existingCue->endTime()))
</del><ins>+ if ((cue->startMediaTime() + startTimeVariance()) < existingCue->startMediaTime() || (match != TextTrackCue::IgnoreDuration && cue->hasEquivalentStartTime(*existingCue) && cue->endMediaTime() > existingCue->endMediaTime()))
</ins><span class="cx"> searchEnd = index;
</span><span class="cx"> else
</span><span class="cx"> searchStart = index + 1;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackTextTrackh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/TextTrack.h (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/TextTrack.h        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/html/track/TextTrack.h        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -158,7 +158,7 @@
</span><span class="cx">
</span><span class="cx"> virtual bool isInband() const { return false; }
</span><span class="cx">
</span><del>- virtual double startTimeVariance() const { return 0; }
</del><ins>+ virtual MediaTime startTimeVariance() const { return MediaTime::zeroTime(); }
</ins><span class="cx">
</span><span class="cx"> using RefCounted<TrackBase>::ref;
</span><span class="cx"> using RefCounted<TrackBase>::deref;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackTextTrackCuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/TextTrackCue.cpp (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/TextTrackCue.cpp        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/html/track/TextTrackCue.cpp        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -60,10 +60,15 @@
</span><span class="cx">
</span><span class="cx"> PassRefPtr<TextTrackCue> TextTrackCue::create(ScriptExecutionContext& context, double start, double end, const String& content)
</span><span class="cx"> {
</span><ins>+ return create(context, MediaTime::createWithDouble(start), MediaTime::createWithDouble(end), content);
+}
+
+PassRefPtr<TextTrackCue> TextTrackCue::create(ScriptExecutionContext& context, const MediaTime& start, const MediaTime& end, const String& content)
+{
</ins><span class="cx"> return VTTCue::create(context, start, end, content);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-TextTrackCue::TextTrackCue(ScriptExecutionContext& context, double start, double end)
</del><ins>+TextTrackCue::TextTrackCue(ScriptExecutionContext& context, const MediaTime& start, const MediaTime& end)
</ins><span class="cx"> : m_startTime(start)
</span><span class="cx"> , m_endTime(end)
</span><span class="cx"> , m_cueIndex(invalidCueIndex)
</span><span class="lines">@@ -128,9 +133,14 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // TODO(93143): Add spec-compliant behavior for negative time values.
</span><del>- if (m_startTime == value || value < 0)
</del><ins>+ if (m_startTime.toDouble() == value || value < 0)
</ins><span class="cx"> return;
</span><span class="cx">
</span><ins>+ setStartTime(MediaTime::createWithDouble(value));
+}
+
+void TextTrackCue::setStartTime(const MediaTime& value)
+{
</ins><span class="cx"> willChange();
</span><span class="cx"> m_startTime = value;
</span><span class="cx"> didChange();
</span><span class="lines">@@ -145,9 +155,14 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // TODO(93143): Add spec-compliant behavior for negative time values.
</span><del>- if (m_endTime == value || value < 0)
</del><ins>+ if (m_endTime.toDouble() == value || value < 0)
</ins><span class="cx"> return;
</span><span class="cx">
</span><ins>+ setEndTime(MediaTime::createWithDouble(value));
+}
+
+void TextTrackCue::setEndTime(const MediaTime& value)
+{
</ins><span class="cx"> willChange();
</span><span class="cx"> m_endTime = value;
</span><span class="cx"> didChange();
</span><span class="lines">@@ -199,7 +214,7 @@
</span><span class="cx">
</span><span class="cx"> bool TextTrackCue::isOrderedBefore(const TextTrackCue* other) const
</span><span class="cx"> {
</span><del>- return startTime() < other->startTime() || (startTime() == other->startTime() && endTime() > other->endTime());
</del><ins>+ return startMediaTime() < other->startMediaTime() || (startMediaTime() == other->startMediaTime() && endMediaTime() > other->endMediaTime());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool TextTrackCue::cueContentsMatch(const TextTrackCue& cue) const
</span><span class="lines">@@ -218,7 +233,7 @@
</span><span class="cx"> if (cueType() != cue.cueType())
</span><span class="cx"> return false;
</span><span class="cx">
</span><del>- if (match != IgnoreDuration && endTime() != cue.endTime())
</del><ins>+ if (match != IgnoreDuration && endMediaTime() != cue.endMediaTime())
</ins><span class="cx"> return false;
</span><span class="cx"> if (!hasEquivalentStartTime(cue))
</span><span class="cx"> return false;
</span><span class="lines">@@ -230,13 +245,13 @@
</span><span class="cx">
</span><span class="cx"> bool TextTrackCue::hasEquivalentStartTime(const TextTrackCue& cue) const
</span><span class="cx"> {
</span><del>- double startTimeVariance = 0;
</del><ins>+ MediaTime startTimeVariance = MediaTime::zeroTime();
</ins><span class="cx"> if (track())
</span><span class="cx"> startTimeVariance = track()->startTimeVariance();
</span><span class="cx"> else if (cue.track())
</span><span class="cx"> startTimeVariance = cue.track()->startTimeVariance();
</span><span class="cx">
</span><del>- return std::abs(std::abs(startTime()) - std::abs(cue.startTime())) <= startTimeVariance;
</del><ins>+ return abs(abs(startMediaTime()) - abs(cue.startMediaTime())) <= startTimeVariance;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool TextTrackCue::doesExtendCue(const TextTrackCue& cue) const
</span><span class="lines">@@ -244,7 +259,7 @@
</span><span class="cx"> if (!cueContentsMatch(cue))
</span><span class="cx"> return false;
</span><span class="cx">
</span><del>- if (endTime() != cue.startTime())
</del><ins>+ if (endMediaTime() != cue.startMediaTime())
</ins><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> return true;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackTextTrackCueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/TextTrackCue.h (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/TextTrackCue.h        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/html/track/TextTrackCue.h        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx">
</span><span class="cx"> #include "EventTarget.h"
</span><span class="cx"> #include "HTMLElement.h"
</span><ins>+#include <wtf/MediaTime.h>
</ins><span class="cx"> #include <wtf/RefCounted.h>
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -45,6 +46,7 @@
</span><span class="cx"> class TextTrackCue : public RefCounted<TextTrackCue>, public EventTargetWithInlineData {
</span><span class="cx"> public:
</span><span class="cx"> static PassRefPtr<TextTrackCue> create(ScriptExecutionContext&, double start, double end, const String& content);
</span><ins>+ static PassRefPtr<TextTrackCue> create(ScriptExecutionContext&, const MediaTime& start, const MediaTime& end, const String& content);
</ins><span class="cx">
</span><span class="cx"> static const AtomicString& cueShadowPseudoId()
</span><span class="cx"> {
</span><span class="lines">@@ -60,10 +62,14 @@
</span><span class="cx"> const String& id() const { return m_id; }
</span><span class="cx"> void setId(const String&);
</span><span class="cx">
</span><del>- double startTime() const { return m_startTime; }
</del><ins>+ MediaTime startMediaTime() const { return m_startTime; }
+ double startTime() const { return startMediaTime().toDouble(); }
+ void setStartTime(const MediaTime&);
</ins><span class="cx"> void setStartTime(double, ExceptionCode&);
</span><span class="cx">
</span><del>- double endTime() const { return m_endTime; }
</del><ins>+ MediaTime endMediaTime() const { return m_endTime; }
+ double endTime() const { return endMediaTime().toDouble(); }
+ void setEndTime(const MediaTime&);
</ins><span class="cx"> void setEndTime(double, ExceptionCode&);
</span><span class="cx">
</span><span class="cx"> bool pauseOnExit() const { return m_pauseOnExit; }
</span><span class="lines">@@ -112,7 +118,7 @@
</span><span class="cx"> using RefCounted<TextTrackCue>::deref;
</span><span class="cx">
</span><span class="cx"> protected:
</span><del>- TextTrackCue(ScriptExecutionContext&, double start, double end);
</del><ins>+ TextTrackCue(ScriptExecutionContext&, const MediaTime& start, const MediaTime& end);
</ins><span class="cx">
</span><span class="cx"> Document& ownerDocument() { return toDocument(m_scriptExecutionContext); }
</span><span class="cx">
</span><span class="lines">@@ -122,8 +128,8 @@
</span><span class="cx"> virtual void derefEventTarget() override final { deref(); }
</span><span class="cx">
</span><span class="cx"> String m_id;
</span><del>- double m_startTime;
- double m_endTime;
</del><ins>+ MediaTime m_startTime;
+ MediaTime m_endTime;
</ins><span class="cx"> int m_cueIndex;
</span><span class="cx"> int m_processingCueChanges;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackTextTrackCueGenericcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/TextTrackCueGeneric.cpp (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/TextTrackCueGeneric.cpp        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/html/track/TextTrackCueGeneric.cpp        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -144,7 +144,7 @@
</span><span class="cx"> setInlineStyleProperty(CSSPropertyWhiteSpace, CSSValuePreWrap);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-TextTrackCueGeneric::TextTrackCueGeneric(ScriptExecutionContext& context, double start, double end, const String& content)
</del><ins>+TextTrackCueGeneric::TextTrackCueGeneric(ScriptExecutionContext& context, const MediaTime& start, const MediaTime& end, const String& content)
</ins><span class="cx"> : VTTCue(context, start, end, content)
</span><span class="cx"> , m_baseFontSizeRelativeToVideoHeight(0)
</span><span class="cx"> , m_fontSizeMultiplier(0)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackTextTrackCueGenerich"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/TextTrackCueGeneric.h (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/TextTrackCueGeneric.h        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/html/track/TextTrackCueGeneric.h        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -38,7 +38,7 @@
</span><span class="cx"> // A "generic" cue is a non-WebVTT cue, so it is not positioned/sized with the WebVTT logic.
</span><span class="cx"> class TextTrackCueGeneric final : public VTTCue {
</span><span class="cx"> public:
</span><del>- static PassRefPtr<TextTrackCueGeneric> create(ScriptExecutionContext& context, double start, double end, const String& content)
</del><ins>+ static PassRefPtr<TextTrackCueGeneric> create(ScriptExecutionContext& context, const MediaTime& start, const MediaTime& end, const String& content)
</ins><span class="cx"> {
</span><span class="cx"> return adoptRef(new TextTrackCueGeneric(context, start, end, content));
</span><span class="cx"> }
</span><span class="lines">@@ -82,7 +82,7 @@
</span><span class="cx"> virtual bool isOrderedBefore(const TextTrackCue*) const override;
</span><span class="cx"> virtual bool isPositionedAbove(const TextTrackCue*) const override;
</span><span class="cx">
</span><del>- TextTrackCueGeneric(ScriptExecutionContext&, double start, double end, const String&);
</del><ins>+ TextTrackCueGeneric(ScriptExecutionContext&, const MediaTime& start, const MediaTime& end, const String&);
</ins><span class="cx">
</span><span class="cx"> Color m_foregroundColor;
</span><span class="cx"> Color m_backgroundColor;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackTextTrackCueListcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/TextTrackCueList.cpp (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/TextTrackCueList.cpp        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/html/track/TextTrackCueList.cpp        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -77,8 +77,8 @@
</span><span class="cx">
</span><span class="cx"> bool TextTrackCueList::add(PassRefPtr<TextTrackCue> cue)
</span><span class="cx"> {
</span><del>- ASSERT(cue->startTime() >= 0);
- ASSERT(cue->endTime() >= 0);
</del><ins>+ ASSERT(cue->startMediaTime() >= MediaTime::zeroTime());
+ ASSERT(cue->endMediaTime() >= MediaTime::zeroTime());
</ins><span class="cx">
</span><span class="cx"> return add(cue, 0, m_list.size());
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackVTTCuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/VTTCue.cpp (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/VTTCue.cpp        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/html/track/VTTCue.cpp        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -247,17 +247,12 @@
</span><span class="cx"> return cueBackdropShadowPseudoId;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-PassRefPtr<VTTCue> VTTCue::create(ScriptExecutionContext& context, double start, double end, const String& content)
-{
- return adoptRef(new VTTCue(context, start, end, content));
-}
-
</del><span class="cx"> PassRefPtr<VTTCue> VTTCue::create(ScriptExecutionContext& context, const WebVTTCueData& data)
</span><span class="cx"> {
</span><span class="cx"> return adoptRef(new VTTCue(context, data));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-VTTCue::VTTCue(ScriptExecutionContext& context, double start, double end, const String& content)
</del><ins>+VTTCue::VTTCue(ScriptExecutionContext& context, const MediaTime& start, const MediaTime& end, const String& content)
</ins><span class="cx"> : TextTrackCue(context, start, end)
</span><span class="cx"> , m_content(content)
</span><span class="cx"> {
</span><span class="lines">@@ -265,12 +260,12 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> VTTCue::VTTCue(ScriptExecutionContext& context, const WebVTTCueData& cueData)
</span><del>- : TextTrackCue(context, 0, 0)
</del><ins>+ : TextTrackCue(context, MediaTime::zeroTime(), MediaTime::zeroTime())
</ins><span class="cx"> {
</span><span class="cx"> initialize(context);
</span><span class="cx"> setText(cueData.content());
</span><del>- setStartTime(cueData.startTime(), IGNORE_EXCEPTION);
- setEndTime(cueData.endTime(), IGNORE_EXCEPTION);
</del><ins>+ setStartTime(cueData.startTime());
+ setEndTime(cueData.endTime());
</ins><span class="cx"> setId(cueData.id());
</span><span class="cx"> setCueSettings(cueData.settings());
</span><span class="cx"> m_originalStartTime = cueData.originalStartTime();
</span><span class="lines">@@ -300,7 +295,7 @@
</span><span class="cx"> m_snapToLines = true;
</span><span class="cx"> m_displayTreeShouldChange = true;
</span><span class="cx"> m_notifyRegion = true;
</span><del>- m_originalStartTime = 0;
</del><ins>+ m_originalStartTime = MediaTime::zeroTime();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> PassRefPtr<VTTCueBox> VTTCue::createDisplayTree()
</span><span class="lines">@@ -751,18 +746,18 @@
</span><span class="cx"> m_displayPosition.first = m_computedLinePosition;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void VTTCue::markFutureAndPastNodes(ContainerNode* root, double previousTimestamp, double movieTime)
</del><ins>+void VTTCue::markFutureAndPastNodes(ContainerNode* root, const MediaTime& previousTimestamp, const MediaTime& movieTime)
</ins><span class="cx"> {
</span><span class="cx"> DEPRECATED_DEFINE_STATIC_LOCAL(const String, timestampTag, (ASCIILiteral("timestamp")));
</span><span class="cx">
</span><span class="cx"> bool isPastNode = true;
</span><del>- double currentTimestamp = previousTimestamp;
</del><ins>+ MediaTime currentTimestamp = previousTimestamp;
</ins><span class="cx"> if (currentTimestamp > movieTime)
</span><span class="cx"> isPastNode = false;
</span><span class="cx">
</span><span class="cx"> for (Node* child = root->firstChild(); child; child = NodeTraversal::next(child, root)) {
</span><span class="cx"> if (child->nodeName() == timestampTag) {
</span><del>- double currentTimestamp;
</del><ins>+ MediaTime currentTimestamp;
</ins><span class="cx"> bool check = WebVTTParser::collectTimeStamp(child->nodeValue(), currentTimestamp);
</span><span class="cx"> ASSERT_UNUSED(check, check);
</span><span class="cx">
</span><span class="lines">@@ -780,7 +775,7 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void VTTCue::updateDisplayTree(double movieTime)
</del><ins>+void VTTCue::updateDisplayTree(const MediaTime& movieTime)
</ins><span class="cx"> {
</span><span class="cx"> // The display tree may contain WebVTT timestamp objects representing
</span><span class="cx"> // timestamps (processing instructions), along with displayable nodes.
</span><span class="lines">@@ -796,7 +791,7 @@
</span><span class="cx"> if (!referenceTree)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- markFutureAndPastNodes(referenceTree.get(), startTime(), movieTime);
</del><ins>+ markFutureAndPastNodes(referenceTree.get(), startMediaTime(), movieTime);
</ins><span class="cx"> m_cueHighlightBox->appendChild(referenceTree);
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackVTTCueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/VTTCue.h (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/VTTCue.h        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/html/track/VTTCue.h        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -74,7 +74,16 @@
</span><span class="cx">
</span><span class="cx"> class VTTCue : public TextTrackCue {
</span><span class="cx"> public:
</span><del>- static PassRefPtr<VTTCue> create(ScriptExecutionContext&, double start, double end, const String&);
</del><ins>+ static PassRefPtr<VTTCue> create(ScriptExecutionContext& context, double start, double end, const String& content)
+ {
+ return create(context, MediaTime::createWithDouble(start), MediaTime::createWithDouble(end), content);
+ }
+
+ static PassRefPtr<VTTCue> create(ScriptExecutionContext& context, const MediaTime& start, const MediaTime& end, const String& content)
+ {
+ return adoptRef(new VTTCue(context, start, end, content));
+ }
+
</ins><span class="cx"> static PassRefPtr<VTTCue> create(ScriptExecutionContext&, const WebVTTCueData&);
</span><span class="cx">
</span><span class="cx"> static const AtomicString& cueBackdropShadowPseudoId();
</span><span class="lines">@@ -120,9 +129,9 @@
</span><span class="cx"> VTTCueBox* getDisplayTree(const IntSize& videoSize, int fontSize);
</span><span class="cx"> HTMLSpanElement* element() const { return m_cueHighlightBox.get(); }
</span><span class="cx">
</span><del>- void updateDisplayTree(double);
</del><ins>+ void updateDisplayTree(const MediaTime&);
</ins><span class="cx"> void removeDisplayTree();
</span><del>- void markFutureAndPastNodes(ContainerNode*, double, double);
</del><ins>+ void markFutureAndPastNodes(ContainerNode*, const MediaTime&, const MediaTime&);
</ins><span class="cx">
</span><span class="cx"> int calculateComputedLinePosition();
</span><span class="cx"> std::pair<double, double> getPositionCoordinates() const;
</span><span class="lines">@@ -164,7 +173,7 @@
</span><span class="cx"> virtual void didChange() override;
</span><span class="cx">
</span><span class="cx"> protected:
</span><del>- VTTCue(ScriptExecutionContext&, double start, double end, const String& content);
</del><ins>+ VTTCue(ScriptExecutionContext&, const MediaTime& start, const MediaTime& end, const String& content);
</ins><span class="cx"> VTTCue(ScriptExecutionContext&, const WebVTTCueData&);
</span><span class="cx">
</span><span class="cx"> virtual PassRefPtr<VTTCueBox> createDisplayTree();
</span><span class="lines">@@ -215,7 +224,7 @@
</span><span class="cx"> int m_displaySize;
</span><span class="cx"> std::pair<float, float> m_displayPosition;
</span><span class="cx">
</span><del>- double m_originalStartTime;
</del><ins>+ MediaTime m_originalStartTime;
</ins><span class="cx">
</span><span class="cx"> bool m_snapToLines : 1;
</span><span class="cx"> bool m_displayTreeShouldChange : 1;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackWebVTTParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/WebVTTParser.cpp (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/WebVTTParser.cpp        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/html/track/WebVTTParser.cpp        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -89,8 +89,6 @@
</span><span class="cx"> : m_scriptExecutionContext(context)
</span><span class="cx"> , m_state(Initial)
</span><span class="cx"> , m_decoder(TextResourceDecoder::create("text/plain", UTF8Encoding()))
</span><del>- , m_currentStartTime(0)
- , m_currentEndTime(0)
</del><span class="cx"> , m_client(client)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="lines">@@ -128,15 +126,15 @@
</span><span class="cx"> {
</span><span class="cx"> RefPtr<WebVTTCueData> cue = WebVTTCueData::create();
</span><span class="cx">
</span><del>- double startTime = data.presentationTime().toDouble();
</del><ins>+ MediaTime startTime = data.presentationTime();
</ins><span class="cx"> cue->setStartTime(startTime);
</span><del>- cue->setEndTime(startTime + data.duration().toDouble());
</del><ins>+ cue->setEndTime(startTime + data.duration());
</ins><span class="cx">
</span><span class="cx"> cue->setContent(data.cueText());
</span><span class="cx"> cue->setId(data.id());
</span><span class="cx"> cue->setSettings(data.settings());
</span><span class="cx">
</span><del>- double originalStartTime;
</del><ins>+ MediaTime originalStartTime;
</ins><span class="cx"> if (WebVTTParser::collectTimeStamp(data.originalStartTime(), originalStartTime))
</span><span class="cx"> cue->setOriginalStartTime(originalStartTime);
</span><span class="cx">
</span><span class="lines">@@ -437,8 +435,8 @@
</span><span class="cx"> {
</span><span class="cx"> m_currentId = emptyString();
</span><span class="cx"> m_currentSettings = emptyString();
</span><del>- m_currentStartTime = 0;
- m_currentEndTime = 0;
</del><ins>+ m_currentStartTime = MediaTime::zeroTime();
+ m_currentEndTime = MediaTime::zeroTime();
</ins><span class="cx"> m_currentContent.clear();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -465,7 +463,7 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-bool WebVTTParser::collectTimeStamp(const String& line, double& timeStamp)
</del><ins>+bool WebVTTParser::collectTimeStamp(const String& line, MediaTime& timeStamp)
</ins><span class="cx"> {
</span><span class="cx"> if (line.isEmpty())
</span><span class="cx"> return false;
</span><span class="lines">@@ -474,7 +472,7 @@
</span><span class="cx"> return collectTimeStamp(input, timeStamp);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool WebVTTParser::collectTimeStamp(VTTScanner& input, double& timeStamp)
</del><ins>+bool WebVTTParser::collectTimeStamp(VTTScanner& input, MediaTime& timeStamp)
</ins><span class="cx"> {
</span><span class="cx"> // Collect a WebVTT timestamp (5.3 WebVTT cue timings and settings parsing.)
</span><span class="cx"> // Steps 1 - 4 - Initial checks, let most significant units be minutes.
</span><span class="lines">@@ -514,7 +512,7 @@
</span><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> // Steps 18 - 19 - Calculate result.
</span><del>- timeStamp = (value1 * secondsPerHour) + (value2 * secondsPerMinute) + value3 + (value4 * secondsPerMillisecond);
</del><ins>+ timeStamp = MediaTime::createWithDouble((value1 * secondsPerHour) + (value2 * secondsPerMinute) + value3 + (value4 * secondsPerMillisecond));
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -611,7 +609,7 @@
</span><span class="cx"> }
</span><span class="cx"> case WebVTTTokenTypes::TimestampTag: {
</span><span class="cx"> String charactersString = m_token.characters();
</span><del>- double parsedTimeStamp;
</del><ins>+ MediaTime parsedTimeStamp;
</ins><span class="cx"> if (WebVTTParser::collectTimeStamp(charactersString, parsedTimeStamp))
</span><span class="cx"> m_currentNode->parserAppendChild(ProcessingInstruction::create(document, "timestamp", charactersString));
</span><span class="cx"> break;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackWebVTTParserh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/WebVTTParser.h (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/WebVTTParser.h        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/html/track/WebVTTParser.h        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -42,6 +42,7 @@
</span><span class="cx"> #include "VTTRegion.h"
</span><span class="cx"> #include "WebVTTTokenizer.h"
</span><span class="cx"> #include <memory>
</span><ins>+#include <wtf/MediaTime.h>
</ins><span class="cx"> #include <wtf/text/StringBuilder.h>
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -69,11 +70,11 @@
</span><span class="cx"> static PassRefPtr<WebVTTCueData> create() { return adoptRef(new WebVTTCueData()); }
</span><span class="cx"> virtual ~WebVTTCueData() { }
</span><span class="cx">
</span><del>- double startTime() const { return m_startTime; }
- void setStartTime(double startTime) { m_startTime = startTime; }
</del><ins>+ MediaTime startTime() const { return m_startTime; }
+ void setStartTime(const MediaTime& startTime) { m_startTime = startTime; }
</ins><span class="cx">
</span><del>- double endTime() const { return m_endTime; }
- void setEndTime(double endTime) { m_endTime = endTime; }
</del><ins>+ MediaTime endTime() const { return m_endTime; }
+ void setEndTime(const MediaTime& endTime) { m_endTime = endTime; }
</ins><span class="cx">
</span><span class="cx"> String id() const { return m_id; }
</span><span class="cx"> void setId(String id) { m_id = id; }
</span><span class="lines">@@ -84,20 +85,15 @@
</span><span class="cx"> String settings() const { return m_settings; }
</span><span class="cx"> void setSettings(String settings) { m_settings = settings; }
</span><span class="cx">
</span><del>- double originalStartTime() const { return m_originalStartTime; }
- void setOriginalStartTime(double time) { m_originalStartTime = time; }
</del><ins>+ MediaTime originalStartTime() const { return m_originalStartTime; }
+ void setOriginalStartTime(const MediaTime& time) { m_originalStartTime = time; }
</ins><span class="cx">
</span><span class="cx"> private:
</span><del>- WebVTTCueData()
- : m_startTime(0)
- , m_endTime(0)
- , m_originalStartTime(0)
- {
- }
</del><ins>+ WebVTTCueData() { }
</ins><span class="cx">
</span><del>- double m_startTime;
- double m_endTime;
- double m_originalStartTime;
</del><ins>+ MediaTime m_startTime;
+ MediaTime m_endTime;
+ MediaTime m_originalStartTime;
</ins><span class="cx"> String m_id;
</span><span class="cx"> String m_content;
</span><span class="cx"> String m_settings;
</span><span class="lines">@@ -137,7 +133,7 @@
</span><span class="cx"> // U+0020 SPACE characters or U+0009 CHARACTER TABULATION (tab) characters.
</span><span class="cx"> return c == ' ' || c == '\t';
</span><span class="cx"> }
</span><del>- static bool collectTimeStamp(const String&, double&);
</del><ins>+ static bool collectTimeStamp(const String&, MediaTime&);
</ins><span class="cx">
</span><span class="cx"> // Useful functions for parsing percentage settings.
</span><span class="cx"> static bool parseFloatPercentageValue(VTTScanner& valueScanner, float&);
</span><span class="lines">@@ -183,13 +179,13 @@
</span><span class="cx"> void createNewRegion(const String& headerValue);
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>- static bool collectTimeStamp(VTTScanner& input, double& timeStamp);
</del><ins>+ static bool collectTimeStamp(VTTScanner& input, MediaTime& timeStamp);
</ins><span class="cx">
</span><span class="cx"> BufferedLineReader m_lineReader;
</span><span class="cx"> RefPtr<TextResourceDecoder> m_decoder;
</span><span class="cx"> String m_currentId;
</span><del>- double m_currentStartTime;
- double m_currentEndTime;
</del><ins>+ MediaTime m_currentStartTime;
+ MediaTime m_currentEndTime;
</ins><span class="cx"> StringBuilder m_currentContent;
</span><span class="cx"> String m_currentSettings;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsInbandTextTrackPrivateClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/InbandTextTrackPrivateClient.h (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/InbandTextTrackPrivateClient.h        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/platform/graphics/InbandTextTrackPrivateClient.h        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx">
</span><span class="cx"> #include "Color.h"
</span><span class="cx"> #include "TrackPrivateBase.h"
</span><ins>+#include <wtf/MediaTime.h>
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(DATACUE_VALUE)
</span><span class="cx"> #include "SerializedPlatformRepresentation.h"
</span><span class="lines">@@ -46,11 +47,11 @@
</span><span class="cx"> static PassRefPtr<GenericCueData> create() { return adoptRef(new GenericCueData()); }
</span><span class="cx"> virtual ~GenericCueData() { }
</span><span class="cx">
</span><del>- double startTime() const { return m_startTime; }
- void setStartTime(double startTime) { m_startTime = startTime; }
</del><ins>+ MediaTime startTime() const { return m_startTime; }
+ void setStartTime(const MediaTime& startTime) { m_startTime = startTime; }
</ins><span class="cx">
</span><del>- double endTime() const { return m_endTime; }
- void setEndTime(double endTime) { m_endTime = endTime; }
</del><ins>+ MediaTime endTime() const { return m_endTime; }
+ void setEndTime(const MediaTime& endTime) { m_endTime = endTime; }
</ins><span class="cx">
</span><span class="cx"> String id() const { return m_id; }
</span><span class="cx"> void setId(String id) { m_id = id; }
</span><span class="lines">@@ -106,9 +107,7 @@
</span><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> GenericCueData()
</span><del>- : m_startTime(0)
- , m_endTime(0)
- , m_line(-1)
</del><ins>+ : m_line(-1)
</ins><span class="cx"> , m_position(-1)
</span><span class="cx"> , m_size(-1)
</span><span class="cx"> , m_align(None)
</span><span class="lines">@@ -118,8 +117,8 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>- double m_startTime;
- double m_endTime;
</del><ins>+ MediaTime m_startTime;
+ MediaTime m_endTime;
</ins><span class="cx"> String m_id;
</span><span class="cx"> String m_content;
</span><span class="cx"> double m_line;
</span><span class="lines">@@ -169,12 +168,12 @@
</span><span class="cx"> public:
</span><span class="cx"> virtual ~InbandTextTrackPrivateClient() { }
</span><span class="cx">
</span><del>- virtual void addDataCue(InbandTextTrackPrivate*, double start, double end, const void*, unsigned) = 0;
</del><ins>+ virtual void addDataCue(InbandTextTrackPrivate*, const MediaTime& start, const MediaTime& end, const void*, unsigned) = 0;
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(DATACUE_VALUE)
</span><del>- virtual void addDataCue(InbandTextTrackPrivate*, double start, double end, PassRefPtr<SerializedPlatformRepresentation>, const String&) = 0;
- virtual void updateDataCue(InbandTextTrackPrivate*, double start, double end, PassRefPtr<SerializedPlatformRepresentation>) = 0;
- virtual void removeDataCue(InbandTextTrackPrivate*, double start, double end, PassRefPtr<SerializedPlatformRepresentation>) = 0;
</del><ins>+ virtual void addDataCue(InbandTextTrackPrivate*, const MediaTime& start, const MediaTime& end, PassRefPtr<SerializedPlatformRepresentation>, const String&) = 0;
+ virtual void updateDataCue(InbandTextTrackPrivate*, const MediaTime& start, const MediaTime& end, PassRefPtr<SerializedPlatformRepresentation>) = 0;
+ virtual void removeDataCue(InbandTextTrackPrivate*, const MediaTime& start, const MediaTime& end, PassRefPtr<SerializedPlatformRepresentation>) = 0;
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> virtual void addGenericCue(InbandTextTrackPrivate*, PassRefPtr<GenericCueData>) = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsMediaPlayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -517,34 +517,34 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-double MediaPlayer::duration() const
</del><ins>+MediaTime MediaPlayer::duration() const
</ins><span class="cx"> {
</span><del>- return m_private->durationDouble();
</del><ins>+ return m_private->durationMediaTime();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-double MediaPlayer::startTime() const
</del><ins>+MediaTime MediaPlayer::startTime() const
</ins><span class="cx"> {
</span><del>- return m_private->startTimeDouble();
</del><ins>+ return m_private->startTime();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-double MediaPlayer::initialTime() const
</del><ins>+MediaTime MediaPlayer::initialTime() const
</ins><span class="cx"> {
</span><span class="cx"> return m_private->initialTime();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-double MediaPlayer::currentTime() const
</del><ins>+MediaTime MediaPlayer::currentTime() const
</ins><span class="cx"> {
</span><del>- return m_private->currentTimeDouble();
</del><ins>+ return m_private->currentMediaTime();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void MediaPlayer::seekWithTolerance(double time, double negativeTolerance, double positiveTolerance)
</del><ins>+void MediaPlayer::seekWithTolerance(const MediaTime& time, const MediaTime& negativeTolerance, const MediaTime& positiveTolerance)
</ins><span class="cx"> {
</span><span class="cx"> m_private->seekWithTolerance(time, negativeTolerance, positiveTolerance);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void MediaPlayer::seek(double time)
</del><ins>+void MediaPlayer::seek(const MediaTime& time)
</ins><span class="cx"> {
</span><del>- m_private->seekDouble(time);
</del><ins>+ m_private->seek(time);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool MediaPlayer::paused() const
</span><span class="lines">@@ -722,14 +722,14 @@
</span><span class="cx"> return m_private->seekable();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-double MediaPlayer::maxTimeSeekable()
</del><ins>+MediaTime MediaPlayer::maxTimeSeekable()
</ins><span class="cx"> {
</span><del>- return m_private->maxTimeSeekableDouble();
</del><ins>+ return m_private->maxMediaTimeSeekable();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-double MediaPlayer::minTimeSeekable()
</del><ins>+MediaTime MediaPlayer::minTimeSeekable()
</ins><span class="cx"> {
</span><del>- return m_private->minTimeSeekable();
</del><ins>+ return m_private->minMediaTimeSeekable();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool MediaPlayer::didLoadingProgress()
</span><span class="lines">@@ -950,9 +950,9 @@
</span><span class="cx"> return m_private->movieLoadType();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-double MediaPlayer::mediaTimeForTimeValue(double timeValue) const
</del><ins>+MediaTime MediaPlayer::mediaTimeForTimeValue(const MediaTime& timeValue) const
</ins><span class="cx"> {
</span><del>- return m_private->mediaTimeForTimeValueDouble(timeValue);
</del><ins>+ return m_private->mediaTimeForTimeValue(timeValue);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> double MediaPlayer::maximumDurationToCacheMediaTime() const
</span><span class="lines">@@ -1367,10 +1367,10 @@
</span><span class="cx"> return m_private->corruptedVideoFrames();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-double MediaPlayer::totalFrameDelay()
</del><ins>+MediaTime MediaPlayer::totalFrameDelay()
</ins><span class="cx"> {
</span><span class="cx"> if (!m_private)
</span><del>- return 0;
</del><ins>+ return MediaTime::zeroTime();
</ins><span class="cx">
</span><span class="cx"> return m_private->totalFrameDelay();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsMediaPlayerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.h (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/MediaPlayer.h        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.h        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -366,15 +366,14 @@
</span><span class="cx"> bool seeking() const;
</span><span class="cx">
</span><span class="cx"> static double invalidTime() { return -1.0;}
</span><del>- double duration() const;
- double currentTime() const;
- void seek(double time);
- void seekWithTolerance(double time, double negativeTolerance, double positiveTolerance);
</del><ins>+ MediaTime duration() const;
+ MediaTime currentTime() const;
+ void seek(const MediaTime&);
+ void seekWithTolerance(const MediaTime&, const MediaTime& negativeTolerance, const MediaTime& positiveTolerance);
</ins><span class="cx">
</span><del>- double startTime() const;
</del><ins>+ MediaTime startTime() const;
+ MediaTime initialTime() const;
</ins><span class="cx">
</span><del>- double initialTime() const;
-
</del><span class="cx"> double rate() const;
</span><span class="cx"> void setRate(double);
</span><span class="cx">
</span><span class="lines">@@ -383,8 +382,8 @@
</span><span class="cx">
</span><span class="cx"> std::unique_ptr<PlatformTimeRanges> buffered();
</span><span class="cx"> std::unique_ptr<PlatformTimeRanges> seekable();
</span><del>- double minTimeSeekable();
- double maxTimeSeekable();
</del><ins>+ MediaTime minTimeSeekable();
+ MediaTime maxTimeSeekable();
</ins><span class="cx">
</span><span class="cx"> bool didLoadingProgress();
</span><span class="cx">
</span><span class="lines">@@ -506,7 +505,7 @@
</span><span class="cx">
</span><span class="cx"> bool didPassCORSAccessCheck() const;
</span><span class="cx">
</span><del>- double mediaTimeForTimeValue(double) const;
</del><ins>+ MediaTime mediaTimeForTimeValue(const MediaTime&) const;
</ins><span class="cx">
</span><span class="cx"> double maximumDurationToCacheMediaTime() const;
</span><span class="cx">
</span><span class="lines">@@ -582,7 +581,7 @@
</span><span class="cx"> unsigned long totalVideoFrames();
</span><span class="cx"> unsigned long droppedVideoFrames();
</span><span class="cx"> unsigned long corruptedVideoFrames();
</span><del>- double totalFrameDelay();
</del><ins>+ MediaTime totalFrameDelay();
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> bool shouldWaitForResponseToAuthenticationChallenge(const AuthenticationChallenge&);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsMediaPlayerPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -82,21 +82,22 @@
</span><span class="cx">
</span><span class="cx"> virtual float duration() const { return 0; }
</span><span class="cx"> virtual double durationDouble() const { return duration(); }
</span><ins>+ virtual MediaTime durationMediaTime() const { return MediaTime::createWithDouble(durationDouble()); }
</ins><span class="cx">
</span><span class="cx"> virtual float currentTime() const { return 0; }
</span><span class="cx"> virtual double currentTimeDouble() const { return currentTime(); }
</span><ins>+ virtual MediaTime currentMediaTime() const { return MediaTime::createWithDouble(currentTimeDouble()); }
</ins><span class="cx">
</span><span class="cx"> virtual void seek(float) { }
</span><span class="cx"> virtual void seekDouble(double time) { seek(time); }
</span><del>- virtual void seekWithTolerance(double time, double, double) { seekDouble(time); }
</del><ins>+ virtual void seek(const MediaTime& time) { seekDouble(time.toDouble()); }
+ virtual void seekWithTolerance(const MediaTime& time, const MediaTime&, const MediaTime&) { seek(time); }
</ins><span class="cx">
</span><span class="cx"> virtual bool seeking() const = 0;
</span><span class="cx">
</span><del>- virtual float startTime() const { return 0; }
- virtual double startTimeDouble() const { return startTime(); }
</del><ins>+ virtual MediaTime startTime() const { return MediaTime::zeroTime(); }
+ virtual MediaTime initialTime() const { return MediaTime::zeroTime(); }
</ins><span class="cx">
</span><del>- virtual double initialTime() const { return 0; }
-
</del><span class="cx"> virtual void setRate(float) { }
</span><span class="cx"> virtual void setRateDouble(double rate) { setRate(rate); }
</span><span class="cx">
</span><span class="lines">@@ -122,10 +123,11 @@
</span><span class="cx"> virtual MediaPlayer::NetworkState networkState() const = 0;
</span><span class="cx"> virtual MediaPlayer::ReadyState readyState() const = 0;
</span><span class="cx">
</span><del>- virtual std::unique_ptr<PlatformTimeRanges> seekable() const { return maxTimeSeekableDouble() ? PlatformTimeRanges::create(MediaTime::createWithDouble(minTimeSeekable()), MediaTime::createWithDouble(maxTimeSeekableDouble())) : PlatformTimeRanges::create(); }
</del><ins>+ virtual std::unique_ptr<PlatformTimeRanges> seekable() const { return maxMediaTimeSeekable() == MediaTime::zeroTime() ? PlatformTimeRanges::create() : PlatformTimeRanges::create(minMediaTimeSeekable(), maxMediaTimeSeekable()); }
</ins><span class="cx"> virtual float maxTimeSeekable() const { return 0; }
</span><del>- virtual double maxTimeSeekableDouble() const { return maxTimeSeekable(); }
</del><ins>+ virtual MediaTime maxMediaTimeSeekable() const { return MediaTime::createWithDouble(maxTimeSeekable()); }
</ins><span class="cx"> virtual double minTimeSeekable() const { return 0; }
</span><ins>+ virtual MediaTime minMediaTimeSeekable() const { return MediaTime::createWithDouble(minTimeSeekable()); }
</ins><span class="cx"> virtual std::unique_ptr<PlatformTimeRanges> buffered() const = 0;
</span><span class="cx">
</span><span class="cx"> virtual bool didLoadingProgress() const = 0;
</span><span class="lines">@@ -188,8 +190,7 @@
</span><span class="cx">
</span><span class="cx"> // Time value in the movie's time scale. It is only necessary to override this if the media
</span><span class="cx"> // engine uses rational numbers to represent media time.
</span><del>- virtual float mediaTimeForTimeValue(float timeValue) const { return timeValue; }
- virtual double mediaTimeForTimeValueDouble(double timeValue) const { return timeValue; }
</del><ins>+ virtual MediaTime mediaTimeForTimeValue(const MediaTime& timeValue) const { return timeValue; }
</ins><span class="cx">
</span><span class="cx"> // Overide this if it is safe for HTMLMediaElement to cache movie time and report
</span><span class="cx"> // 'currentTime' as [cached time + elapsed wall time]. Returns the maximum wall time
</span><span class="lines">@@ -249,7 +250,7 @@
</span><span class="cx"> virtual unsigned long totalVideoFrames() { return 0; }
</span><span class="cx"> virtual unsigned long droppedVideoFrames() { return 0; }
</span><span class="cx"> virtual unsigned long corruptedVideoFrames() { return 0; }
</span><del>- virtual double totalFrameDelay() { return 0; }
</del><ins>+ virtual MediaTime totalFrameDelay() { return MediaTime::zeroTime(); }
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if ENABLE(AVF_CAPTIONS)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsMediaSourcePrivateClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/MediaSourcePrivateClient.h (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/MediaSourcePrivateClient.h        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/platform/graphics/MediaSourcePrivateClient.h        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -40,7 +40,7 @@
</span><span class="cx"> virtual ~MediaSourcePrivateClient() { }
</span><span class="cx">
</span><span class="cx"> virtual void setPrivateAndOpen(PassRef<MediaSourcePrivate>) = 0;
</span><del>- virtual double duration() const = 0;
</del><ins>+ virtual MediaTime duration() const = 0;
</ins><span class="cx"> virtual std::unique_ptr<PlatformTimeRanges> buffered() const = 0;
</span><span class="cx"> virtual void seekToTime(const MediaTime&) = 0;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsTrackPrivateBaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/TrackPrivateBase.h (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/TrackPrivateBase.h        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/platform/graphics/TrackPrivateBase.h        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #define TrackPrivateBase_h
</span><span class="cx">
</span><span class="cx"> #include <wtf/Forward.h>
</span><ins>+#include <wtf/MediaTime.h>
</ins><span class="cx"> #include <wtf/Noncopyable.h>
</span><span class="cx"> #include <wtf/RefCounted.h>
</span><span class="cx"> #include <wtf/text/AtomicString.h>
</span><span class="lines">@@ -61,7 +62,7 @@
</span><span class="cx">
</span><span class="cx"> virtual int trackIndex() const { return 0; }
</span><span class="cx">
</span><del>- virtual double startTimeVariance() const { return 0; }
</del><ins>+ virtual MediaTime startTimeVariance() const { return MediaTime::zeroTime(); }
</ins><span class="cx">
</span><span class="cx"> void willBeRemoved()
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationInbandMetadataTextTrackPrivateAVFcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -47,7 +47,6 @@
</span><span class="cx"> : InbandTextTrackPrivate(cueFormat)
</span><span class="cx"> , m_kind(kind)
</span><span class="cx"> , m_id(id)
</span><del>- , m_currentCueStartTime(0)
</del><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -56,7 +55,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(DATACUE_VALUE)
</span><del>-void InbandMetadataTextTrackPrivateAVF::addDataCue(double start, double end, PassRefPtr<SerializedPlatformRepresentation> prpCueData, const String& type)
</del><ins>+void InbandMetadataTextTrackPrivateAVF::addDataCue(const MediaTime& start, const MediaTime& end, PassRefPtr<SerializedPlatformRepresentation> prpCueData, const String& type)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(cueFormat() == Data);
</span><span class="cx"> if (!client())
</span><span class="lines">@@ -64,42 +63,42 @@
</span><span class="cx">
</span><span class="cx"> RefPtr<SerializedPlatformRepresentation> cueData = prpCueData;
</span><span class="cx"> m_currentCueStartTime = start;
</span><del>- if (end == std::numeric_limits<double>::infinity())
</del><ins>+ if (end.isPositiveInfinite())
</ins><span class="cx"> m_incompleteCues.append(new IncompleteMetaDataCue(start, cueData));
</span><span class="cx"> client()->addDataCue(this, start, end, cueData, type);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes(double time)
</del><ins>+void InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes(const MediaTime& time)
</ins><span class="cx"> {
</span><span class="cx"> if (time >= m_currentCueStartTime) {
</span><span class="cx"> for (size_t i = 0; i < m_incompleteCues.size(); i++) {
</span><span class="cx"> IncompleteMetaDataCue* partialCue = m_incompleteCues[i];
</span><span class="cx">
</span><del>- LOG(Media, "InbandMetadataTextTrackPrivateAVF::addDataCue(%p) - updating cue: start=%.2f, end=%.2f", this, partialCue->startTime(), time);
</del><ins>+ LOG(Media, "InbandMetadataTextTrackPrivateAVF::addDataCue(%p) - updating cue: start=%s, end=%s", this, toString(partialCue->startTime()).utf8().data(), toString(time).utf8().data());
</ins><span class="cx"> client()->updateDataCue(this, partialCue->startTime(), time, partialCue->cueData());
</span><span class="cx"> }
</span><span class="cx"> } else
</span><del>- LOG(Media, "InbandMetadataTextTrackPrivateAVF::addDataCue negative length cue(s) ignored: start=%.2f, end=%.2f\n", m_currentCueStartTime, time);
</del><ins>+ LOG(Media, "InbandMetadataTextTrackPrivateAVF::addDataCue negative length cue(s) ignored: start=%s, end=%s\n", toString(m_currentCueStartTime).utf8().data(), toString(time).utf8().data());
</ins><span class="cx">
</span><span class="cx"> m_incompleteCues.resize(0);
</span><del>- m_currentCueStartTime = 0;
</del><ins>+ m_currentCueStartTime = MediaTime::zeroTime();
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> void InbandMetadataTextTrackPrivateAVF::flushPartialCues()
</span><span class="cx"> {
</span><span class="cx"> if (m_currentCueStartTime && m_incompleteCues.size())
</span><del>- LOG(Media, "InbandMetadataTextTrackPrivateAVF::resetCueValues flushing incomplete data for cues: start=%.2f\n", m_currentCueStartTime);
</del><ins>+ LOG(Media, "InbandMetadataTextTrackPrivateAVF::resetCueValues flushing incomplete data for cues: start=%s\n", toString(m_currentCueStartTime).utf8().data());
</ins><span class="cx">
</span><span class="cx"> if (client()) {
</span><span class="cx"> for (size_t i = 0; i < m_incompleteCues.size(); i++) {
</span><span class="cx"> IncompleteMetaDataCue* partialCue = m_incompleteCues[i];
</span><del>- client()->removeDataCue(this, partialCue->startTime(), std::numeric_limits<double>::infinity(), partialCue->cueData());
</del><ins>+ client()->removeDataCue(this, partialCue->startTime(), MediaTime::positiveInfiniteTime(), partialCue->cueData());
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> m_incompleteCues.resize(0);
</span><del>- m_currentCueStartTime = 0;
</del><ins>+ m_currentCueStartTime = MediaTime::zeroTime();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationInbandMetadataTextTrackPrivateAVFh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -35,7 +35,7 @@
</span><span class="cx"> #if ENABLE(DATACUE_VALUE)
</span><span class="cx"> class IncompleteMetaDataCue {
</span><span class="cx"> public:
</span><del>- IncompleteMetaDataCue(double time, PassRefPtr<SerializedPlatformRepresentation> cueData)
</del><ins>+ IncompleteMetaDataCue(const MediaTime& time, PassRefPtr<SerializedPlatformRepresentation> cueData)
</ins><span class="cx"> : m_cueData(cueData)
</span><span class="cx"> , m_startTime(time)
</span><span class="cx"> {
</span><span class="lines">@@ -43,11 +43,11 @@
</span><span class="cx"> ~IncompleteMetaDataCue() { }
</span><span class="cx">
</span><span class="cx"> RefPtr<SerializedPlatformRepresentation> cueData() const { return m_cueData; }
</span><del>- double startTime() const { return m_startTime; }
</del><ins>+ MediaTime startTime() const { return m_startTime; }
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> RefPtr<SerializedPlatformRepresentation> m_cueData;
</span><del>- double m_startTime;
</del><ins>+ MediaTime m_startTime;
</ins><span class="cx"> };
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="lines">@@ -63,8 +63,8 @@
</span><span class="cx"> void setInBandMetadataTrackDispatchType(const AtomicString& value) { m_inBandMetadataTrackDispatchType = value; }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(DATACUE_VALUE)
</span><del>- void addDataCue(double start, double end, PassRefPtr<SerializedPlatformRepresentation>, const String&);
- void updatePendingCueEndTimes(double);
</del><ins>+ void addDataCue(const MediaTime& start, const MediaTime& end, PassRefPtr<SerializedPlatformRepresentation>, const String&);
+ void updatePendingCueEndTimes(const MediaTime&);
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> void flushPartialCues();
</span><span class="lines">@@ -75,7 +75,7 @@
</span><span class="cx"> Kind m_kind;
</span><span class="cx"> AtomicString m_id;
</span><span class="cx"> AtomicString m_inBandMetadataTrackDispatchType;
</span><del>- double m_currentCueStartTime;
</del><ins>+ MediaTime m_currentCueStartTime;
</ins><span class="cx"> #if ENABLE(DATACUE_VALUE)
</span><span class="cx"> Vector<IncompleteMetaDataCue*> m_incompleteCues;
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationInbandTextTrackPrivateAVFcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> #include "ISOVTTCue.h"
</span><span class="cx"> #include "InbandTextTrackPrivateClient.h"
</span><span class="cx"> #include "Logging.h"
</span><ins>+#include "MediaTimeAVFoundation.h"
</ins><span class="cx"> #include "SoftLinking.h"
</span><span class="cx"> #include <CoreMedia/CoreMedia.h>
</span><span class="cx"> #include <runtime/ArrayBuffer.h>
</span><span class="lines">@@ -46,10 +47,6 @@
</span><span class="cx"> #include <wtf/unicode/CharacterNames.h>
</span><span class="cx">
</span><span class="cx"> #if !PLATFORM(WIN)
</span><del>-#include "MediaTimeMac.h"
-#endif
-
-#if !PLATFORM(WIN)
</del><span class="cx"> #define SOFT_LINK_AVF_FRAMEWORK(Lib) SOFT_LINK_FRAMEWORK_OPTIONAL(Lib)
</span><span class="cx"> #define SOFT_LINK_AVF_POINTER(Lib, Name, Type) SOFT_LINK_POINTER_OPTIONAL(Lib, Name, Type)
</span><span class="cx"> #else
</span><span class="lines">@@ -420,7 +417,7 @@
</span><span class="cx"> cueData.setContent(content.toString());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void InbandTextTrackPrivateAVF::processCue(CFArrayRef attributedStrings, CFArrayRef nativeSamples, double time)
</del><ins>+void InbandTextTrackPrivateAVF::processCue(CFArrayRef attributedStrings, CFArrayRef nativeSamples, const MediaTime& time)
</ins><span class="cx"> {
</span><span class="cx"> if (!client())
</span><span class="cx"> return;
</span><span class="lines">@@ -429,9 +426,9 @@
</span><span class="cx"> processNativeSamples(nativeSamples, time);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void InbandTextTrackPrivateAVF::processAttributedStrings(CFArrayRef attributedStrings, double time)
</del><ins>+void InbandTextTrackPrivateAVF::processAttributedStrings(CFArrayRef attributedStrings, const MediaTime& time)
</ins><span class="cx"> {
</span><del>- LOG(Media, "InbandTextTrackPrivateAVF::processAttributedStrings - %li attributed strings at time %.2f\n", attributedStrings ? CFArrayGetCount(attributedStrings) : 0, time);
</del><ins>+ LOG(Media, "InbandTextTrackPrivateAVF::processCue - %li cues at time %s\n", attributedStrings ? CFArrayGetCount(attributedStrings) : 0, toString(time).utf8().data());
</ins><span class="cx">
</span><span class="cx"> Vector<RefPtr<GenericCueData>> arrivingCues;
</span><span class="cx"> if (attributedStrings) {
</span><span class="lines">@@ -450,14 +447,14 @@
</span><span class="cx"> arrivingCues.append(cueData);
</span><span class="cx">
</span><span class="cx"> cueData->setStartTime(time);
</span><del>- cueData->setEndTime(std::numeric_limits<double>::infinity());
</del><ins>+ cueData->setEndTime(MediaTime::positiveInfiniteTime());
</ins><span class="cx">
</span><span class="cx"> // AVFoundation cue "position" is to the center of the text so adjust relative to the edge because we will use it to
</span><span class="cx"> // set CSS "left".
</span><span class="cx"> if (cueData->position() >= 0 && cueData->size() > 0)
</span><span class="cx"> cueData->setPosition(cueData->position() - cueData->size() / 2);
</span><span class="cx">
</span><del>- LOG(Media, "InbandTextTrackPrivateAVF::processCue(%p) - considering cue (\"%s\") for time = %.2f, position = %.2f, line = %.2f", this, cueData->content().utf8().data(), cueData->startTime(), cueData->position(), cueData->line());
</del><ins>+ LOG(Media, "InbandTextTrackPrivateAVF::processCue(%p) - considering cue (\"%s\") for time = %s, position = %.2f, line = %.2f", this, cueData->content().utf8().data(), toString(cueData->startTime()).utf8().data(), cueData->position(), cueData->line());
</ins><span class="cx">
</span><span class="cx"> cueData->setStatus(GenericCueData::Partial);
</span><span class="cx"> }
</span><span class="lines">@@ -475,7 +472,7 @@
</span><span class="cx"> if (!arrivingCue->doesExtendCueData(*cueData))
</span><span class="cx"> nonExtensionCues.append(arrivingCue);
</span><span class="cx"> else
</span><del>- LOG(Media, "InbandTextTrackPrivateAVF::processCue(%p) - found an extension cue (\"%s\") for time = %.2f, end = %.2f, position = %.2f, line = %.2f", this, arrivingCue->content().utf8().data(), arrivingCue->startTime(), arrivingCue->endTime(), arrivingCue->position(), arrivingCue->line());
</del><ins>+ LOG(Media, "InbandTextTrackPrivateAVF::processCue(%p) - found an extension cue (\"%s\") for time = %.2f, end = %.2f, position = %.2f, line = %.2f", this, arrivingCue->content().utf8().data(), arrivingCue->startTime().toDouble(), arrivingCue->endTime().toDouble(), arrivingCue->position(), arrivingCue->line());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool currentCueIsExtended = (arrivingCues.size() != nonExtensionCues.size());
</span><span class="lines">@@ -489,16 +486,16 @@
</span><span class="cx"> cueData->setEndTime(m_currentCueEndTime);
</span><span class="cx"> cueData->setStatus(GenericCueData::Complete);
</span><span class="cx">
</span><del>- LOG(Media, "InbandTextTrackPrivateAVF::processCue(%p) - updating cue \"%s\": start=%.2f, end=%.2f", this, cueData->content().utf8().data(), cueData->startTime(), m_currentCueEndTime);
</del><ins>+ LOG(Media, "InbandTextTrackPrivateAVF::processCue(%p) - updating cue \"%s\": start=%.2f, end=%.2f", this, cueData->content().utf8().data(), cueData->startTime().toDouble(), m_currentCueEndTime.toDouble());
</ins><span class="cx"> client()->updateGenericCue(this, cueData.get());
</span><span class="cx"> } else {
</span><span class="cx"> // We have to assume that the implicit duration is invalid for cues delivered during a seek because the AVF decode pipeline may not
</span><span class="cx"> // see every cue, so DO NOT update cue duration while seeking.
</span><del>- LOG(Media, "InbandTextTrackPrivateAVF::processCue(%p) - ignoring cue delivered during seek: start=%.2f, end=%.2f, content=\"%s\"", this, cueData->startTime(), m_currentCueEndTime, cueData->content().utf8().data());
</del><ins>+ LOG(Media, "InbandTextTrackPrivateAVF::processCue(%p) - ignoring cue delivered during seek: start=%s, end=%s, content=\"%s\"", this, toString(cueData->startTime()).utf8().data(), toString(m_currentCueEndTime).utf8().data(), cueData->content().utf8().data());
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> } else
</span><del>- LOG(Media, "InbandTextTrackPrivateAVF::processCue negative length cue(s) ignored: start=%.2f, end=%.2f\n", m_currentCueStartTime, m_currentCueEndTime);
</del><ins>+ LOG(Media, "InbandTextTrackPrivateAVF::processCue negative length cue(s) ignored: start=%s, end=%s\n", toString(m_currentCueStartTime).utf8().data(), toString(m_currentCueEndTime).utf8().data());
</ins><span class="cx">
</span><span class="cx"> removeCompletedCues();
</span><span class="cx"> }
</span><span class="lines">@@ -512,7 +509,7 @@
</span><span class="cx">
</span><span class="cx"> m_cues.append(cueData);
</span><span class="cx">
</span><del>- LOG(Media, "InbandTextTrackPrivateAVF::processCue(%p) - adding cue \"%s\" for time = %.2f, end = %.2f, position = %.2f, line = %.2f", this, cueData->content().utf8().data(), cueData->startTime(), cueData->endTime(), cueData->position(), cueData->line());
</del><ins>+ LOG(Media, "InbandTextTrackPrivateAVF::processCue(%p) - adding cue \"%s\" for time = %.2f, end = %.2f, position = %.2f, line = %.2f", this, cueData->content().utf8().data(), cueData->startTime().toDouble(), cueData->endTime().toDouble(), cueData->position(), cueData->line());
</ins><span class="cx">
</span><span class="cx"> client()->addGenericCue(this, cueData.release());
</span><span class="cx"> }
</span><span class="lines">@@ -543,7 +540,7 @@
</span><span class="cx"> if (m_cues[currentCue]->status() != GenericCueData::Complete)
</span><span class="cx"> continue;
</span><span class="cx">
</span><del>- LOG(Media, "InbandTextTrackPrivateAVF::removeCompletedCues(%p) - removing cue \"%s\": start=%.2f, end=%.2f", this, m_cues[currentCue]->content().utf8().data(), m_cues[currentCue]->startTime(), m_cues[currentCue]->endTime());
</del><ins>+ LOG(Media, "InbandTextTrackPrivateAVF::removeCompletedCues(%p) - removing cue \"%s\": start=%.2f, end=%.2f", this, m_cues[currentCue]->content().utf8().data(), m_cues[currentCue]->startTime().toDouble(), m_cues[currentCue]->endTime().toDouble());
</ins><span class="cx">
</span><span class="cx"> m_cues.remove(currentCue);
</span><span class="cx"> }
</span><span class="lines">@@ -552,14 +549,14 @@
</span><span class="cx"> if (m_cues.isEmpty())
</span><span class="cx"> m_pendingCueStatus = None;
</span><span class="cx">
</span><del>- m_currentCueStartTime = 0;
- m_currentCueEndTime = 0;
</del><ins>+ m_currentCueStartTime = MediaTime::zeroTime();
+ m_currentCueEndTime = MediaTime::zeroTime();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void InbandTextTrackPrivateAVF::resetCueValues()
</span><span class="cx"> {
</span><span class="cx"> if (m_currentCueEndTime && m_cues.size())
</span><del>- LOG(Media, "InbandTextTrackPrivateAVF::resetCueValues flushing data for cues: start=%.2f\n", m_currentCueStartTime);
</del><ins>+ LOG(Media, "InbandTextTrackPrivateAVF::resetCueValues flushing data for cues: start=%s\n", toString(m_currentCueStartTime).utf8().data());
</ins><span class="cx">
</span><span class="cx"> if (client()) {
</span><span class="cx"> for (size_t i = 0; i < m_cues.size(); i++)
</span><span class="lines">@@ -568,8 +565,8 @@
</span><span class="cx">
</span><span class="cx"> m_cues.resize(0);
</span><span class="cx"> m_pendingCueStatus = None;
</span><del>- m_currentCueStartTime = 0;
- m_currentCueEndTime = 0;
</del><ins>+ m_currentCueStartTime = MediaTime::zeroTime();
+ m_currentCueEndTime = MediaTime::zeroTime();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void InbandTextTrackPrivateAVF::setMode(InbandTextTrackPrivate::Mode newMode)
</span><span class="lines">@@ -586,7 +583,7 @@
</span><span class="cx"> m_owner->trackModeChanged();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void InbandTextTrackPrivateAVF::processNativeSamples(CFArrayRef nativeSamples, double presentationTime)
</del><ins>+void InbandTextTrackPrivateAVF::processNativeSamples(CFArrayRef nativeSamples, const MediaTime& presentationTime)
</ins><span class="cx"> {
</span><span class="cx"> if (!nativeSamples)
</span><span class="cx"> return;
</span><span class="lines">@@ -595,7 +592,7 @@
</span><span class="cx"> if (!count)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- LOG(Media, "InbandTextTrackPrivateAVF::processNativeSamples - %li sample buffers at time %.2f\n", count, presentationTime);
</del><ins>+ LOG(Media, "InbandTextTrackPrivateAVF::processNativeSamples - %li sample buffers at time %.2f\n", count, presentationTime.toDouble());
</ins><span class="cx">
</span><span class="cx"> for (CFIndex i = 0; i < count; i++) {
</span><span class="cx">
</span><span class="lines">@@ -632,11 +629,7 @@
</span><span class="cx"> LOG(Media, "InbandTextTrackPrivateAVF::processNativeSamples(%p) - chunk type = '%s', size = %zu", this, type.utf8().data(), boxLength);
</span><span class="cx">
</span><span class="cx"> if (type == ISOWebVTTCue::boxType()) {
</span><del>-#if !PLATFORM(WIN)
- ISOWebVTTCue cueData = ISOWebVTTCue(MediaTime::createWithDouble(presentationTime), toMediaTime(timingInfo.duration), buffer.get());
-#else
- ISOWebVTTCue cueData = ISOWebVTTCue(MediaTime::createWithDouble(presentationTime), MediaTime::createWithDouble(CMTimeGetSeconds(timingInfo.duration)), buffer.get());
-#endif
</del><ins>+ ISOWebVTTCue cueData = ISOWebVTTCue(presentationTime, toMediaTime(timingInfo.duration), buffer.get());
</ins><span class="cx"> LOG(Media, " sample presentation time = %.2f, duration = %.2f", cueData.presentationTime().toDouble(), cueData.duration().toDouble());
</span><span class="cx"> LOG(Media, " id = \"%s\", settings = \"%s\", cue text = \"%s\"", cueData.id().utf8().data(), cueData.settings().utf8().data(), cueData.cueText().utf8().data());
</span><span class="cx"> LOG(Media, " sourceID = \"%s\", originalStartTime = \"%s\"", cueData.sourceID().utf8().data(), cueData.originalStartTime().utf8().data());
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationInbandTextTrackPrivateAVFh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/InbandTextTrackPrivateAVF.h (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/InbandTextTrackPrivateAVF.h        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/InbandTextTrackPrivateAVF.h        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -55,7 +55,7 @@
</span><span class="cx"> bool hasBeenReported() const { return m_hasBeenReported; }
</span><span class="cx"> void setHasBeenReported(bool reported) { m_hasBeenReported = reported; }
</span><span class="cx">
</span><del>- virtual void processCue(CFArrayRef attributedStrings, CFArrayRef nativeSamples, double);
</del><ins>+ virtual void processCue(CFArrayRef attributedStrings, CFArrayRef nativeSamples, const MediaTime&);
</ins><span class="cx"> virtual void resetCueValues();
</span><span class="cx">
</span><span class="cx"> void beginSeeking();
</span><span class="lines">@@ -68,19 +68,19 @@
</span><span class="cx"> InBand
</span><span class="cx"> };
</span><span class="cx"> virtual Category textTrackCategory() const = 0;
</span><del>-
- virtual double startTimeVariance() const override { return 0.25; }
-
</del><ins>+
+ virtual MediaTime startTimeVariance() const override { return MediaTime(1, 4); }
+
</ins><span class="cx"> protected:
</span><span class="cx"> InbandTextTrackPrivateAVF(AVFInbandTrackParent*, CueFormat);
</span><span class="cx">
</span><span class="cx"> void processCueAttributes(CFAttributedStringRef, GenericCueData&);
</span><del>- void processAttributedStrings(CFArrayRef, double);
- void processNativeSamples(CFArrayRef, double);
</del><ins>+ void processAttributedStrings(CFArrayRef, const MediaTime&);
+ void processNativeSamples(CFArrayRef, const MediaTime&);
</ins><span class="cx"> void removeCompletedCues();
</span><span class="cx">
</span><del>- double m_currentCueStartTime;
- double m_currentCueEndTime;
</del><ins>+ MediaTime m_currentCueStartTime;
+ MediaTime m_currentCueEndTime;
</ins><span class="cx">
</span><span class="cx"> Vector<RefPtr<GenericCueData>> m_cues;
</span><span class="cx"> AVFInbandTrackParent* m_owner;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationMediaPlayerPrivateAVFoundationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -58,12 +58,9 @@
</span><span class="cx"> , m_networkState(MediaPlayer::Empty)
</span><span class="cx"> , m_readyState(MediaPlayer::HaveNothing)
</span><span class="cx"> , m_preload(MediaPlayer::Auto)
</span><del>- , m_cachedMaxTimeLoaded(0)
- , m_cachedMaxTimeSeekable(0)
- , m_cachedMinTimeSeekable(0)
- , m_cachedDuration(MediaPlayer::invalidTime())
- , m_reportedDuration(MediaPlayer::invalidTime())
- , m_maxTimeLoadedAtLastDidLoadingProgress(MediaPlayer::invalidTime())
</del><ins>+ , m_cachedDuration(MediaTime::invalidTime())
+ , m_reportedDuration(MediaTime::invalidTime())
+ , m_maxTimeLoadedAtLastDidLoadingProgress(MediaTime::invalidTime())
</ins><span class="cx"> , m_requestedRate(1)
</span><span class="cx"> , m_delayCallbacks(0)
</span><span class="cx"> , m_delayCharacteristicsChangedNotification(0)
</span><span class="lines">@@ -245,37 +242,29 @@
</span><span class="cx"> platformPause();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-float MediaPlayerPrivateAVFoundation::duration() const
</del><ins>+MediaTime MediaPlayerPrivateAVFoundation::durationMediaTime() const
</ins><span class="cx"> {
</span><del>- return narrowPrecisionToFloat(durationDouble());
-}
-
-double MediaPlayerPrivateAVFoundation::durationDouble() const
-{
- if (m_cachedDuration != MediaPlayer::invalidTime())
</del><ins>+ if (m_cachedDuration.isValid())
</ins><span class="cx"> return m_cachedDuration;
</span><span class="cx">
</span><del>- double duration = platformDuration();
- if (!duration || duration == MediaPlayer::invalidTime())
- return 0;
</del><ins>+ MediaTime duration = platformDuration();
+ if (!duration || duration.isInvalid())
+ return MediaTime::zeroTime();
</ins><span class="cx">
</span><span class="cx"> m_cachedDuration = duration;
</span><del>- LOG(Media, "MediaPlayerPrivateAVFoundation::duration(%p) - caching %g", this, m_cachedDuration);
</del><ins>+ LOG(Media, "MediaPlayerPrivateAVFoundation::duration(%p) - caching %s", this, toString(m_cachedDuration).utf8().data());
</ins><span class="cx"> return m_cachedDuration;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-float MediaPlayerPrivateAVFoundation::currentTime() const
</del><ins>+void MediaPlayerPrivateAVFoundation::seek(const MediaTime& time)
</ins><span class="cx"> {
</span><del>- return narrowPrecisionToFloat(currentTimeDouble());
</del><ins>+ seekWithTolerance(time, MediaTime::zeroTime(), MediaTime::zeroTime());
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void MediaPlayerPrivateAVFoundation::seek(float time)
</del><ins>+void MediaPlayerPrivateAVFoundation::seekWithTolerance(const MediaTime& mediaTime, const MediaTime& negativeTolerance, const MediaTime& positiveTolerance)
</ins><span class="cx"> {
</span><del>- seekWithTolerance(time, 0, 0);
-}
</del><ins>+ MediaTime time = mediaTime;
</ins><span class="cx">
</span><del>-void MediaPlayerPrivateAVFoundation::seekWithTolerance(double time, double negativeTolerance, double positiveTolerance)
-{
</del><span class="cx"> if (m_seeking) {
</span><span class="cx"> LOG(Media, "MediaPlayerPrivateAVFoundation::seekWithTolerance(%p) - save pending seek", this);
</span><span class="cx"> m_pendingSeek = [this, time, negativeTolerance, positiveTolerance]() {
</span><span class="lines">@@ -288,16 +277,16 @@
</span><span class="cx"> if (!metaDataAvailable())
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- if (time > durationDouble())
- time = durationDouble();
</del><ins>+ if (time > durationMediaTime())
+ time = durationMediaTime();
</ins><span class="cx">
</span><del>- if (currentTimeDouble() == time)
</del><ins>+ if (currentMediaTime() == time)
</ins><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> if (currentTextTrack())
</span><span class="cx"> currentTextTrack()->beginSeeking();
</span><span class="cx">
</span><del>- LOG(Media, "MediaPlayerPrivateAVFoundation::seek(%p) - seeking to %f", this, time);
</del><ins>+ LOG(Media, "MediaPlayerPrivateAVFoundation::seek(%p) - seeking to %s", this, toString(time).utf8().data());
</ins><span class="cx">
</span><span class="cx"> seekToTime(time, negativeTolerance, positiveTolerance);
</span><span class="cx"> }
</span><span class="lines">@@ -407,34 +396,34 @@
</span><span class="cx"> return PlatformTimeRanges::create(*m_cachedLoadedTimeRanges);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-double MediaPlayerPrivateAVFoundation::maxTimeSeekableDouble() const
</del><ins>+MediaTime MediaPlayerPrivateAVFoundation::maxMediaTimeSeekable() const
</ins><span class="cx"> {
</span><span class="cx"> if (!metaDataAvailable())
</span><del>- return 0;
</del><ins>+ return MediaTime::zeroTime();
</ins><span class="cx">
</span><span class="cx"> if (!m_cachedMaxTimeSeekable)
</span><span class="cx"> m_cachedMaxTimeSeekable = platformMaxTimeSeekable();
</span><span class="cx">
</span><del>- LOG(Media, "MediaPlayerPrivateAVFoundation::maxTimeSeekable(%p) - returning %f", this, m_cachedMaxTimeSeekable);
</del><ins>+ LOG(Media, "MediaPlayerPrivateAVFoundation::maxTimeSeekable(%p) - returning %s", this, toString(m_cachedMaxTimeSeekable).utf8().data());
</ins><span class="cx"> return m_cachedMaxTimeSeekable;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-double MediaPlayerPrivateAVFoundation::minTimeSeekable() const
</del><ins>+MediaTime MediaPlayerPrivateAVFoundation::minMediaTimeSeekable() const
</ins><span class="cx"> {
</span><span class="cx"> if (!metaDataAvailable())
</span><del>- return 0;
</del><ins>+ return MediaTime::zeroTime();
</ins><span class="cx">
</span><span class="cx"> if (!m_cachedMinTimeSeekable)
</span><span class="cx"> m_cachedMinTimeSeekable = platformMinTimeSeekable();
</span><span class="cx">
</span><del>- LOG(Media, "MediaPlayerPrivateAVFoundation::minTimeSeekable(%p) - returning %f", this, m_cachedMinTimeSeekable);
</del><ins>+ LOG(Media, "MediaPlayerPrivateAVFoundation::minTimeSeekable(%p) - returning %s", this, toString(m_cachedMinTimeSeekable).utf8().data());
</ins><span class="cx"> return m_cachedMinTimeSeekable;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-float MediaPlayerPrivateAVFoundation::maxTimeLoaded() const
</del><ins>+MediaTime MediaPlayerPrivateAVFoundation::maxTimeLoaded() const
</ins><span class="cx"> {
</span><span class="cx"> if (!metaDataAvailable())
</span><del>- return 0;
</del><ins>+ return MediaTime::zeroTime();
</ins><span class="cx">
</span><span class="cx"> if (!m_cachedMaxTimeLoaded)
</span><span class="cx"> m_cachedMaxTimeLoaded = platformMaxTimeLoaded();
</span><span class="lines">@@ -446,7 +435,7 @@
</span><span class="cx"> {
</span><span class="cx"> if (!duration() || !totalBytes())
</span><span class="cx"> return false;
</span><del>- float currentMaxTimeLoaded = maxTimeLoaded();
</del><ins>+ MediaTime currentMaxTimeLoaded = maxTimeLoaded();
</ins><span class="cx"> bool didLoadingProgress = currentMaxTimeLoaded != m_maxTimeLoadedAtLastDidLoadingProgress;
</span><span class="cx"> m_maxTimeLoadedAtLastDidLoadingProgress = currentMaxTimeLoaded;
</span><span class="cx">
</span><span class="lines">@@ -545,7 +534,7 @@
</span><span class="cx"> FALLTHROUGH;
</span><span class="cx">
</span><span class="cx"> case MediaPlayerAVPlayerItemStatusPlaybackBufferEmpty:
</span><del>- if (maxTimeLoaded() > currentTime())
</del><ins>+ if (maxTimeLoaded() > currentMediaTime())
</ins><span class="cx"> m_readyState = MediaPlayer::HaveFutureData;
</span><span class="cx"> else
</span><span class="cx"> m_readyState = MediaPlayer::HaveCurrentData;
</span><span class="lines">@@ -557,7 +546,7 @@
</span><span class="cx"> else if (itemStatus == MediaPlayerAVPlayerItemStatusFailed)
</span><span class="cx"> m_networkState = MediaPlayer::DecodeError;
</span><span class="cx"> else if (itemStatus != MediaPlayerAVPlayerItemStatusPlaybackBufferFull && itemStatus >= MediaPlayerAVPlayerItemStatusReadyToPlay)
</span><del>- m_networkState = (maxTimeLoaded() == duration()) ? MediaPlayer::Loaded : MediaPlayer::Loading;
</del><ins>+ m_networkState = (maxTimeLoaded() == durationMediaTime()) ? MediaPlayer::Loaded : MediaPlayer::Loading;
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -640,19 +629,19 @@
</span><span class="cx"> void MediaPlayerPrivateAVFoundation::loadedTimeRangesChanged()
</span><span class="cx"> {
</span><span class="cx"> m_cachedLoadedTimeRanges = nullptr;
</span><del>- m_cachedMaxTimeLoaded = 0;
</del><ins>+ m_cachedMaxTimeLoaded = MediaTime::zeroTime();
</ins><span class="cx"> invalidateCachedDuration();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void MediaPlayerPrivateAVFoundation::seekableTimeRangesChanged()
</span><span class="cx"> {
</span><del>- m_cachedMaxTimeSeekable = 0;
- m_cachedMinTimeSeekable = 0;
</del><ins>+ m_cachedMaxTimeSeekable = MediaTime::zeroTime();
+ m_cachedMinTimeSeekable = MediaTime::zeroTime();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void MediaPlayerPrivateAVFoundation::timeChanged(double time)
</del><ins>+void MediaPlayerPrivateAVFoundation::timeChanged(const MediaTime& time)
</ins><span class="cx"> {
</span><del>- LOG(Media, "MediaPlayerPrivateAVFoundation::timeChanged(%p) - time = %f", this, time);
</del><ins>+ LOG(Media, "MediaPlayerPrivateAVFoundation::timeChanged(%p) - time = %s", this, toString(time).utf8().data());
</ins><span class="cx"> UNUSED_PARAM(time);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -683,8 +672,8 @@
</span><span class="cx"> {
</span><span class="cx"> // Hang onto the current time and use it as duration from now on since we are definitely at
</span><span class="cx"> // the end of the movie. Do this because the initial duration is sometimes an estimate.
</span><del>- double now = currentTimeDouble();
- if (now > 0)
</del><ins>+ MediaTime now = currentMediaTime();
+ if (now > MediaTime::zeroTime())
</ins><span class="cx"> m_cachedDuration = now;
</span><span class="cx">
</span><span class="cx"> updateStates();
</span><span class="lines">@@ -695,13 +684,13 @@
</span><span class="cx"> {
</span><span class="cx"> LOG(Media, "MediaPlayerPrivateAVFoundation::invalidateCachedDuration(%p)", this);
</span><span class="cx">
</span><del>- m_cachedDuration = MediaPlayer::invalidTime();
</del><ins>+ m_cachedDuration = MediaTime::invalidTime();
</ins><span class="cx">
</span><span class="cx"> // For some media files, reported duration is estimated and updated as media is loaded
</span><span class="cx"> // so report duration changed when the estimate is upated.
</span><del>- float duration = this->duration();
</del><ins>+ MediaTime duration = this->durationMediaTime();
</ins><span class="cx"> if (duration != m_reportedDuration) {
</span><del>- if (m_reportedDuration != MediaPlayer::invalidTime())
</del><ins>+ if (m_reportedDuration.isValid())
</ins><span class="cx"> m_player->durationChanged();
</span><span class="cx"> m_reportedDuration = duration;
</span><span class="cx"> }
</span><span class="lines">@@ -772,7 +761,7 @@
</span><span class="cx"> m_mainThreadCallPending = false;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void MediaPlayerPrivateAVFoundation::scheduleMainThreadNotification(Notification::Type type, double time)
</del><ins>+void MediaPlayerPrivateAVFoundation::scheduleMainThreadNotification(Notification::Type type, const MediaTime& time)
</ins><span class="cx"> {
</span><span class="cx"> scheduleMainThreadNotification(Notification(type, time));
</span><span class="cx"> }
</span><span class="lines">@@ -959,11 +948,11 @@
</span><span class="cx">
</span><span class="cx"> size_t MediaPlayerPrivateAVFoundation::extraMemoryCost() const
</span><span class="cx"> {
</span><del>- double duration = durationDouble();
</del><ins>+ MediaTime duration = this->durationMediaTime();
</ins><span class="cx"> if (!duration)
</span><span class="cx"> return 0;
</span><span class="cx">
</span><del>- unsigned long long extra = totalBytes() * buffered()->totalDuration().toDouble() / duration;
</del><ins>+ unsigned long long extra = totalBytes() * buffered()->totalDuration().toDouble() / duration.toDouble();
</ins><span class="cx"> return static_cast<unsigned>(extra);
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationMediaPlayerPrivateAVFoundationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -53,7 +53,7 @@
</span><span class="cx"> virtual void rateChanged();
</span><span class="cx"> virtual void loadedTimeRangesChanged();
</span><span class="cx"> virtual void seekableTimeRangesChanged();
</span><del>- virtual void timeChanged(double);
</del><ins>+ virtual void timeChanged(const MediaTime&);
</ins><span class="cx"> virtual void seekCompleted(bool);
</span><span class="cx"> virtual void didEnd();
</span><span class="cx"> virtual void contentsNeedsDisplay() { }
</span><span class="lines">@@ -96,12 +96,11 @@
</span><span class="cx">
</span><span class="cx"> Notification()
</span><span class="cx"> : m_type(None)
</span><del>- , m_time(0)
</del><span class="cx"> , m_finished(false)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>- Notification(Type type, double time)
</del><ins>+ Notification(Type type, const MediaTime& time)
</ins><span class="cx"> : m_type(type)
</span><span class="cx"> , m_time(time)
</span><span class="cx"> , m_finished(false)
</span><span class="lines">@@ -110,14 +109,12 @@
</span><span class="cx">
</span><span class="cx"> Notification(Type type, bool finished)
</span><span class="cx"> : m_type(type)
</span><del>- , m_time(0)
</del><span class="cx"> , m_finished(finished)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> Notification(std::function<void ()> function)
</span><span class="cx"> : m_type(FunctionType)
</span><del>- , m_time(0)
</del><span class="cx"> , m_finished(false)
</span><span class="cx"> , m_function(function)
</span><span class="cx"> {
</span><span class="lines">@@ -125,19 +122,19 @@
</span><span class="cx">
</span><span class="cx"> Type type() { return m_type; }
</span><span class="cx"> bool isValid() { return m_type != None; }
</span><del>- double time() { return m_time; }
</del><ins>+ MediaTime time() { return m_time; }
</ins><span class="cx"> bool finished() { return m_finished; }
</span><span class="cx"> std::function<void ()>& function() { return m_function; }
</span><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> Type m_type;
</span><del>- double m_time;
</del><ins>+ MediaTime m_time;
</ins><span class="cx"> bool m_finished;
</span><span class="cx"> std::function<void ()> m_function;
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> void scheduleMainThreadNotification(Notification);
</span><del>- void scheduleMainThreadNotification(Notification::Type, double time = 0);
</del><ins>+ void scheduleMainThreadNotification(Notification::Type, const MediaTime& = MediaTime::zeroTime());
</ins><span class="cx"> void scheduleMainThreadNotification(Notification::Type, bool completed);
</span><span class="cx"> void dispatchNotification();
</span><span class="cx"> void clearMainThreadPendingFlag();
</span><span class="lines">@@ -169,12 +166,10 @@
</span><span class="cx"> virtual bool hasVideo() const override { return m_cachedHasVideo; }
</span><span class="cx"> virtual bool hasAudio() const override { return m_cachedHasAudio; }
</span><span class="cx"> virtual void setVisible(bool) override;
</span><del>- virtual float duration() const override;
- virtual double durationDouble() const override;
- virtual float currentTime() const override;
- virtual double currentTimeDouble() const = 0;
- virtual void seek(float) override;
- virtual void seekWithTolerance(double, double, double) override;
</del><ins>+ virtual MediaTime durationMediaTime() const override;
+ virtual MediaTime currentMediaTime() const = 0;
+ virtual void seek(const MediaTime&) override;
+ virtual void seekWithTolerance(const MediaTime&, const MediaTime&, const MediaTime&) override;
</ins><span class="cx"> virtual bool seeking() const override;
</span><span class="cx"> virtual void setRate(float) override;
</span><span class="cx"> virtual bool paused() const override;
</span><span class="lines">@@ -183,8 +178,8 @@
</span><span class="cx"> virtual void setClosedCaptionsVisible(bool) = 0;
</span><span class="cx"> virtual MediaPlayer::NetworkState networkState() const override { return m_networkState; }
</span><span class="cx"> virtual MediaPlayer::ReadyState readyState() const override { return m_readyState; }
</span><del>- virtual double maxTimeSeekableDouble() const override;
- virtual double minTimeSeekable() const override;
</del><ins>+ virtual MediaTime maxMediaTimeSeekable() const override;
+ virtual MediaTime minMediaTimeSeekable() const override;
</ins><span class="cx"> virtual std::unique_ptr<PlatformTimeRanges> buffered() const override;
</span><span class="cx"> virtual bool didLoadingProgress() const override;
</span><span class="cx"> virtual void setSize(const IntSize&) override;
</span><span class="lines">@@ -199,7 +194,6 @@
</span><span class="cx">
</span><span class="cx"> virtual MediaPlayer::MovieLoadType movieLoadType() const;
</span><span class="cx"> virtual void prepareForRendering();
</span><del>- virtual float mediaTimeForTimeValue(float) const = 0;
</del><span class="cx">
</span><span class="cx"> virtual bool supportsFullscreen() const;
</span><span class="cx"> virtual bool supportsScanning() const { return true; }
</span><span class="lines">@@ -238,13 +232,13 @@
</span><span class="cx"> virtual void checkPlayability() = 0;
</span><span class="cx"> virtual void updateRate() = 0;
</span><span class="cx"> virtual float rate() const = 0;
</span><del>- virtual void seekToTime(double time, double negativeTolerance, double positiveTolerance) = 0;
</del><ins>+ virtual void seekToTime(const MediaTime&, const MediaTime& negativeTolerance, const MediaTime& positiveTolerance) = 0;
</ins><span class="cx"> virtual unsigned long long totalBytes() const = 0;
</span><span class="cx"> virtual std::unique_ptr<PlatformTimeRanges> platformBufferedTimeRanges() const = 0;
</span><del>- virtual double platformMaxTimeSeekable() const = 0;
- virtual double platformMinTimeSeekable() const = 0;
- virtual float platformMaxTimeLoaded() const = 0;
- virtual double platformDuration() const = 0;
</del><ins>+ virtual MediaTime platformMaxTimeSeekable() const = 0;
+ virtual MediaTime platformMinTimeSeekable() const = 0;
+ virtual MediaTime platformMaxTimeLoaded() const = 0;
+ virtual MediaTime platformDuration() const = 0;
</ins><span class="cx">
</span><span class="cx"> virtual void beginLoadingMetadata() = 0;
</span><span class="cx"> virtual void tracksChanged() = 0;
</span><span class="lines">@@ -282,7 +276,7 @@
</span><span class="cx">
</span><span class="cx"> bool metaDataAvailable() const { return m_readyState >= MediaPlayer::HaveMetadata; }
</span><span class="cx"> float requestedRate() const { return m_requestedRate; }
</span><del>- float maxTimeLoaded() const;
</del><ins>+ MediaTime maxTimeLoaded() const;
</ins><span class="cx"> bool isReadyForVideoSetup() const;
</span><span class="cx"> virtual void setUpVideoRendering();
</span><span class="cx"> virtual void tearDownVideoRendering();
</span><span class="lines">@@ -328,12 +322,12 @@
</span><span class="cx"> MediaPlayer::Preload m_preload;
</span><span class="cx">
</span><span class="cx"> IntSize m_cachedNaturalSize;
</span><del>- mutable float m_cachedMaxTimeLoaded;
- mutable double m_cachedMaxTimeSeekable;
- mutable double m_cachedMinTimeSeekable;
- mutable double m_cachedDuration;
- float m_reportedDuration;
- mutable float m_maxTimeLoadedAtLastDidLoadingProgress;
</del><ins>+ mutable MediaTime m_cachedMaxTimeLoaded;
+ mutable MediaTime m_cachedMaxTimeSeekable;
+ mutable MediaTime m_cachedMinTimeSeekable;
+ mutable MediaTime m_cachedDuration;
+ MediaTime m_reportedDuration;
+ mutable MediaTime m_maxTimeLoadedAtLastDidLoadingProgress;
</ins><span class="cx"> float m_requestedRate;
</span><span class="cx"> mutable int m_delayCallbacks;
</span><span class="cx"> int m_delayCharacteristicsChangedNotification;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationMediaTimeAVFoundationcppfromrev173317trunkSourceWebCoreplatformmacMediaTimeMaccpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/graphics/avfoundation/MediaTimeAVFoundation.cpp (from rev 173317, trunk/Source/WebCore/platform/mac/MediaTimeMac.cpp) (0 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/MediaTimeAVFoundation.cpp         (rev 0)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/MediaTimeAVFoundation.cpp        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -0,0 +1,73 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "MediaTimeAVFoundation.h"
+
+#if USE(AVFOUNDATION)
+
+namespace WebCore {
+
+static bool CMTimeHasFlags(const CMTime& cmTime, uint32_t flags)
+{
+ return (cmTime.flags & flags) == flags;
+}
+
+MediaTime toMediaTime(const CMTime& cmTime)
+{
+ uint32_t flags = 0;
+ if (CMTimeHasFlags(cmTime, kCMTimeFlags_Valid))
+ flags |= MediaTime::Valid;
+ if (CMTimeHasFlags(cmTime, kCMTimeFlags_Valid | kCMTimeFlags_HasBeenRounded))
+ flags |= MediaTime::HasBeenRounded;
+ if (CMTimeHasFlags(cmTime, kCMTimeFlags_Valid | kCMTimeFlags_PositiveInfinity))
+ flags |= MediaTime::PositiveInfinite;
+ if (CMTimeHasFlags(cmTime, kCMTimeFlags_Valid | kCMTimeFlags_NegativeInfinity))
+ flags |= MediaTime::NegativeInfinite;
+ if (CMTimeHasFlags(cmTime, kCMTimeFlags_Valid | kCMTimeFlags_Indefinite))
+ flags |= MediaTime::Indefinite;
+
+ return MediaTime(cmTime.value, cmTime.timescale, flags);
+}
+
+CMTime toCMTime(const MediaTime& mediaTime)
+{
+ CMTime time = {mediaTime.timeValue(), mediaTime.timeScale(), 0, 0};
+
+ if (mediaTime.isValid())
+ time.flags |= kCMTimeFlags_Valid;
+ if (mediaTime.hasBeenRounded())
+ time.flags |= kCMTimeFlags_HasBeenRounded;
+ if (mediaTime.isPositiveInfinite())
+ time.flags |= kCMTimeFlags_PositiveInfinity;
+ if (mediaTime.isNegativeInfinite())
+ time.flags |= kCMTimeFlags_NegativeInfinity;
+
+ return time;
+}
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationMediaTimeAVFoundationhfromrev173317trunkSourceWebCoreplatformmacMediaTimeMach"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/graphics/avfoundation/MediaTimeAVFoundation.h (from rev 173317, trunk/Source/WebCore/platform/mac/MediaTimeMac.h) (0 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/MediaTimeAVFoundation.h         (rev 0)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/MediaTimeAVFoundation.h        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -0,0 +1,43 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef MediaTimeAVFoundation_h
+#define MediaTimeAVFoundation_h
+
+#if USE(AVFOUNDATION)
+
+#include <CoreMedia/CMTime.h>
+#include <wtf/MediaTime.h>
+
+namespace WebCore {
+
+CMTime toCMTime(const MediaTime&);
+MediaTime toMediaTime(const CMTime&);
+
+}
+
+#endif
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationcfMediaPlayerPrivateAVFoundationCFcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -42,6 +42,7 @@
</span><span class="cx"> #else
</span><span class="cx"> #include "InbandTextTrackPrivateLegacyAVCF.h"
</span><span class="cx"> #endif
</span><ins>+#include "MediaTimeAVFoundation.h"
</ins><span class="cx"> #include "URL.h"
</span><span class="cx"> #include "Logging.h"
</span><span class="cx"> #include "PlatformCALayerWin.h"
</span><span class="lines">@@ -106,7 +107,7 @@
</span><span class="cx">
</span><span class="cx"> void createImageGenerator();
</span><span class="cx"> void destroyImageGenerator();
</span><del>- RetainPtr<CGImageRef> createImageForTimeInRect(float, const IntRect&);
</del><ins>+ RetainPtr<CGImageRef> createImageForTimeInRect(const MediaTime&, const IntRect&);
</ins><span class="cx">
</span><span class="cx"> void createAssetForURL(const String& url, bool inheritURI);
</span><span class="cx"> void setAsset(AVCFURLAssetRef);
</span><span class="lines">@@ -117,7 +118,7 @@
</span><span class="cx"> void checkPlayability();
</span><span class="cx"> void beginLoadingMetadata();
</span><span class="cx">
</span><del>- void seekToTime(double, double, double);
</del><ins>+ void seekToTime(const MediaTime&, const MediaTime&, const MediaTime&);
</ins><span class="cx"> void updateVideoLayerGravity();
</span><span class="cx">
</span><span class="cx"> void setCurrentTextTrack(InbandTextTrackPrivateAVF*);
</span><span class="lines">@@ -569,10 +570,10 @@
</span><span class="cx"> setDelayCallbacks(false);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-double MediaPlayerPrivateAVFoundationCF::platformDuration() const
</del><ins>+MediaTime MediaPlayerPrivateAVFoundationCF::platformDuration() const
</ins><span class="cx"> {
</span><span class="cx"> if (!metaDataAvailable() || !avAsset(m_avfWrapper))
</span><del>- return 0;
</del><ins>+ return MediaTime::zeroTime();
</ins><span class="cx">
</span><span class="cx"> CMTime cmDuration;
</span><span class="cx">
</span><span class="lines">@@ -583,28 +584,28 @@
</span><span class="cx"> cmDuration = AVCFAssetGetDuration(avAsset(m_avfWrapper));
</span><span class="cx">
</span><span class="cx"> if (CMTIME_IS_NUMERIC(cmDuration))
</span><del>- return CMTimeGetSeconds(cmDuration);
</del><ins>+ return toMediaTime(cmDuration);
</ins><span class="cx">
</span><span class="cx"> if (CMTIME_IS_INDEFINITE(cmDuration))
</span><del>- return numeric_limits<double>::infinity();
</del><ins>+ return MediaTime::positiveInfiniteTime();
</ins><span class="cx">
</span><del>- LOG(Media, "MediaPlayerPrivateAVFoundationCF::platformDuration(%p) - invalid duration, returning %.0f", this, static_cast<float>(MediaPlayer::invalidTime()));
- return static_cast<float>(MediaPlayer::invalidTime());
</del><ins>+ LOG(Media, "MediaPlayerPrivateAVFoundationCF::platformDuration(%p) - invalid duration, returning %s", this, toString(MediaTime::invalidTime()).utf8().data());
+ return MediaTime::invalidTime();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-double MediaPlayerPrivateAVFoundationCF::currentTimeDouble() const
</del><ins>+MediaTime MediaPlayerPrivateAVFoundationCF::currentMediaTime() const
</ins><span class="cx"> {
</span><span class="cx"> if (!metaDataAvailable() || !avPlayerItem(m_avfWrapper))
</span><del>- return 0;
</del><ins>+ return MediaTime::zeroTime();
</ins><span class="cx">
</span><span class="cx"> CMTime itemTime = AVCFPlayerItemGetCurrentTime(avPlayerItem(m_avfWrapper));
</span><span class="cx"> if (CMTIME_IS_NUMERIC(itemTime))
</span><del>- return std::max(CMTimeGetSeconds(itemTime), 0.0);
</del><ins>+ return max(toMediaTime(itemTime), MediaTime::zeroTime());
</ins><span class="cx">
</span><del>- return 0;
</del><ins>+ return MediaTime::zeroTime();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void MediaPlayerPrivateAVFoundationCF::seekToTime(double time, double negativeTolerance, double positiveTolerance)
</del><ins>+void MediaPlayerPrivateAVFoundationCF::seekToTime(const MediaTime& time, const MediaTime& negativeTolerance, const MediaTime& positiveTolerance)
</ins><span class="cx"> {
</span><span class="cx"> if (!m_avfWrapper)
</span><span class="cx"> return;
</span><span class="lines">@@ -685,22 +686,22 @@
</span><span class="cx"> CMTime duration = CMTimeMakeFromDictionary(static_cast<CFDictionaryRef>(CFDictionaryGetValue(range, CMTimeRangeDurationKey())));
</span><span class="cx">
</span><span class="cx"> if (timeRangeIsValidAndNotEmpty(start, duration)) {
</span><del>- double rangeStart = CMTimeGetSeconds(start);
- double rangeEnd = rangeStart + CMTimeGetSeconds(duration);
- timeRanges->add(MediaTime::createWithDouble(rangeStart), MediaTime::createWithDouble(rangeEnd));
</del><ins>+ MediaTime rangeStart = toMediaTime(start);
+ MediaTime rangeEnd = rangeStart + toMediaTime(duration);
+ timeRanges->add(rangeStart, rangeEnd);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> return timeRanges;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-double MediaPlayerPrivateAVFoundationCF::platformMinTimeSeekable() const
</del><ins>+MediaTime MediaPlayerPrivateAVFoundationCF::platformMinTimeSeekable() const
</ins><span class="cx"> {
</span><span class="cx"> RetainPtr<CFArrayRef> seekableRanges = adoptCF(AVCFPlayerItemCopySeekableTimeRanges(avPlayerItem(m_avfWrapper)));
</span><span class="cx"> if (!seekableRanges)
</span><del>- return 0;
</del><ins>+ return MediaTime::zeroTime();
</ins><span class="cx">
</span><del>- double minTimeSeekable = std::numeric_limits<double>::infinity();
</del><ins>+ MediaTime minTimeSeekable = MediaTime::positiveInfiniteTime();
</ins><span class="cx"> bool hasValidRange = false;
</span><span class="cx"> CFIndex rangeCount = CFArrayGetCount(seekableRanges.get());
</span><span class="cx"> for (CFIndex i = 0; i < rangeCount; i++) {
</span><span class="lines">@@ -711,23 +712,23 @@
</span><span class="cx"> continue;
</span><span class="cx">
</span><span class="cx"> hasValidRange = true;
</span><del>- double startOfRange = CMTimeGetSeconds(start);
</del><ins>+ MediaTime startOfRange = toMediaTime(start);
</ins><span class="cx"> if (minTimeSeekable > startOfRange)
</span><span class="cx"> minTimeSeekable = startOfRange;
</span><span class="cx"> }
</span><del>- return hasValidRange ? minTimeSeekable : 0;
</del><ins>+ return hasValidRange ? minTimeSeekable : MediaTime::zeroTime();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-double MediaPlayerPrivateAVFoundationCF::platformMaxTimeSeekable() const
</del><ins>+MediaTime MediaPlayerPrivateAVFoundationCF::platformMaxTimeSeekable() const
</ins><span class="cx"> {
</span><span class="cx"> if (!avPlayerItem(m_avfWrapper))
</span><del>- return 0;
</del><ins>+ return MediaTime::zeroTime();
</ins><span class="cx">
</span><span class="cx"> RetainPtr<CFArrayRef> seekableRanges = adoptCF(AVCFPlayerItemCopySeekableTimeRanges(avPlayerItem(m_avfWrapper)));
</span><span class="cx"> if (!seekableRanges)
</span><del>- return 0;
</del><ins>+ return MediaTime::zeroTime();
</ins><span class="cx">
</span><del>- double maxTimeSeekable = 0;
</del><ins>+ MediaTime maxTimeSeekable;
</ins><span class="cx"> CFIndex rangeCount = CFArrayGetCount(seekableRanges.get());
</span><span class="cx"> for (CFIndex i = 0; i < rangeCount; i++) {
</span><span class="cx"> CFDictionaryRef range = static_cast<CFDictionaryRef>(CFArrayGetValueAtIndex(seekableRanges.get(), i));
</span><span class="lines">@@ -736,7 +737,7 @@
</span><span class="cx"> if (!timeRangeIsValidAndNotEmpty(start, duration))
</span><span class="cx"> continue;
</span><span class="cx">
</span><del>- double endOfRange = CMTimeGetSeconds(CMTimeAdd(start, duration));
</del><ins>+ MediaTime endOfRange = toMediaTime(CMTimeAdd(start, duration));
</ins><span class="cx"> if (maxTimeSeekable < endOfRange)
</span><span class="cx"> maxTimeSeekable = endOfRange;
</span><span class="cx"> }
</span><span class="lines">@@ -744,16 +745,16 @@
</span><span class="cx"> return maxTimeSeekable;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-float MediaPlayerPrivateAVFoundationCF::platformMaxTimeLoaded() const
</del><ins>+MediaTime MediaPlayerPrivateAVFoundationCF::platformMaxTimeLoaded() const
</ins><span class="cx"> {
</span><span class="cx"> if (!avPlayerItem(m_avfWrapper))
</span><del>- return 0;
</del><ins>+ return MediaTime::zeroTime();
</ins><span class="cx">
</span><span class="cx"> RetainPtr<CFArrayRef> loadedRanges = adoptCF(AVCFPlayerItemCopyLoadedTimeRanges(avPlayerItem(m_avfWrapper)));
</span><span class="cx"> if (!loadedRanges)
</span><del>- return 0;
</del><ins>+ return MediaTime::zeroTime();
</ins><span class="cx">
</span><del>- float maxTimeLoaded = 0;
</del><ins>+ MediaTime maxTimeLoaded;
</ins><span class="cx"> CFIndex rangeCount = CFArrayGetCount(loadedRanges.get());
</span><span class="cx"> for (CFIndex i = 0; i < rangeCount; i++) {
</span><span class="cx"> CFDictionaryRef range = static_cast<CFDictionaryRef>(CFArrayGetValueAtIndex(loadedRanges.get(), i));
</span><span class="lines">@@ -762,7 +763,7 @@
</span><span class="cx"> if (!timeRangeIsValidAndNotEmpty(start, duration))
</span><span class="cx"> continue;
</span><span class="cx">
</span><del>- float endOfRange = narrowPrecisionToFloat(CMTimeGetSeconds(CMTimeAdd(start, duration)));
</del><ins>+ MediaTime endOfRange = toMediaTime(CMTimeAdd(start, duration));
</ins><span class="cx"> if (maxTimeLoaded < endOfRange)
</span><span class="cx"> maxTimeLoaded = endOfRange;
</span><span class="cx"> }
</span><span class="lines">@@ -847,7 +848,7 @@
</span><span class="cx"> LOG(Media, "MediaPlayerPrivateAVFoundationCF::paint(%p)", this);
</span><span class="cx">
</span><span class="cx"> setDelayCallbacks(true);
</span><del>- RetainPtr<CGImageRef> image = m_avfWrapper->createImageForTimeInRect(currentTime(), rect);
</del><ins>+ RetainPtr<CGImageRef> image = m_avfWrapper->createImageForTimeInRect(currentMediaTime(), rect);
</ins><span class="cx"> if (image) {
</span><span class="cx"> context->save();
</span><span class="cx"> context->translate(rect.x(), rect.y() + rect.height());
</span><span class="lines">@@ -930,7 +931,7 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-float MediaPlayerPrivateAVFoundationCF::mediaTimeForTimeValue(float timeValue) const
</del><ins>+MediaTime MediaPlayerPrivateAVFoundationCF::mediaTimeForTimeValue(const MediaTime& timeValue) const
</ins><span class="cx"> {
</span><span class="cx"> if (!metaDataAvailable())
</span><span class="cx"> return timeValue;
</span><span class="lines">@@ -1692,12 +1693,12 @@
</span><span class="cx"> self->m_owner->scheduleMainThreadNotification(MediaPlayerPrivateAVFoundation::Notification::SeekCompleted, static_cast<bool>(finished));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void AVFWrapper::seekToTime(double time, double negativeTolerance, double positiveTolerance)
</del><ins>+void AVFWrapper::seekToTime(const MediaTime& time, const MediaTime& negativeTolerance, const MediaTime& positiveTolerance)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(avPlayerItem());
</span><del>- CMTime cmTime = CMTimeMakeWithSeconds(time, 600);
- CMTime cmBefore = CMTimeMakeWithSeconds(negativeTolerance, 600);
- CMTime cmAfter = CMTimeMakeWithSeconds(positiveTolerance, 600);
</del><ins>+ CMTime cmTime = toCMTime(time);
+ CMTime cmBefore = toCMTime(negativeTolerance);
+ CMTime cmAfter = toCMTime(positiveTolerance);
</ins><span class="cx"> AVCFPlayerItemSeekToTimeWithToleranceAndCompletionCallback(avPlayerItem(), cmTime, cmBefore, cmAfter, &seekCompletedCallback, callbackContext());
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1705,10 +1706,10 @@
</span><span class="cx"> struct LegibleOutputData {
</span><span class="cx"> RetainPtr<CFArrayRef> m_attributedStrings;
</span><span class="cx"> RetainPtr<CFArrayRef> m_samples;
</span><del>- double m_time;
</del><ins>+ MediaTime m_time;
</ins><span class="cx"> void* m_context;
</span><span class="cx">
</span><del>- LegibleOutputData(CFArrayRef strings, CFArrayRef samples, double time, void* context)
</del><ins>+ LegibleOutputData(CFArrayRef strings, CFArrayRef samples, const MediaTime &time, void* context)
</ins><span class="cx"> : m_attributedStrings(strings), m_samples(samples), m_time(time), m_context(context)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="lines">@@ -1751,7 +1752,7 @@
</span><span class="cx">
</span><span class="cx"> ASSERT(legibleOutput == self->m_legibleOutput);
</span><span class="cx">
</span><del>- auto legibleOutputData = std::make_unique<LegibleOutputData>(attributedStrings, nativeSampleBuffers, CMTimeGetSeconds(itemTime), context);
</del><ins>+ auto legibleOutputData = std::make_unique<LegibleOutputData>(attributedStrings, nativeSampleBuffers, toMediaTime(itemTime), context);
</ins><span class="cx">
</span><span class="cx"> dispatch_async_f(dispatch_get_main_queue(), legibleOutputData.release(), processCue);
</span><span class="cx"> }
</span><span class="lines">@@ -1948,7 +1949,7 @@
</span><span class="cx"> m_imageGenerator = 0;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-RetainPtr<CGImageRef> AVFWrapper::createImageForTimeInRect(float time, const IntRect& rect)
</del><ins>+RetainPtr<CGImageRef> AVFWrapper::createImageForTimeInRect(const MediaTime& time, const IntRect& rect)
</ins><span class="cx"> {
</span><span class="cx"> if (!m_imageGenerator)
</span><span class="cx"> return 0;
</span><span class="lines">@@ -1958,7 +1959,7 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> AVCFAssetImageGeneratorSetMaximumSize(m_imageGenerator.get(), CGSize(rect.size()));
</span><del>- RetainPtr<CGImageRef> rawimage = adoptCF(AVCFAssetImageGeneratorCopyCGImageAtTime(m_imageGenerator.get(), CMTimeMakeWithSeconds(time, 600), 0, 0));
</del><ins>+ RetainPtr<CGImageRef> rawimage = adoptCF(AVCFAssetImageGeneratorCopyCGImageAtTime(m_imageGenerator.get(), toCMTime(time), 0, 0));
</ins><span class="cx"> RetainPtr<CGImageRef> image = adoptCF(CGImageCreateCopyWithColorSpace(rawimage.get(), adoptCF(CGColorSpaceCreateDeviceRGB()).get()));
</span><span class="cx">
</span><span class="cx"> #if !LOG_DISABLED
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationcfMediaPlayerPrivateAVFoundationCFh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -73,14 +73,14 @@
</span><span class="cx"> virtual void platformSetVisible(bool);
</span><span class="cx"> virtual void platformPlay();
</span><span class="cx"> virtual void platformPause();
</span><del>- virtual double currentTimeDouble() const override;
</del><ins>+ virtual MediaTime currentMediaTime() const override;
</ins><span class="cx"> virtual void setVolume(float);
</span><span class="cx"> virtual void setClosedCaptionsVisible(bool);
</span><span class="cx"> virtual void paint(GraphicsContext*, const IntRect&);
</span><span class="cx"> virtual void paintCurrentFrameInContext(GraphicsContext*, const IntRect&);
</span><span class="cx"> virtual PlatformLayer* platformLayer() const;
</span><span class="cx"> virtual bool supportsAcceleratedRendering() const { return true; }
</span><del>- virtual float mediaTimeForTimeValue(float) const;
</del><ins>+ virtual MediaTime mediaTimeForTimeValue(const MediaTime&) const;
</ins><span class="cx">
</span><span class="cx"> virtual void createAVPlayer();
</span><span class="cx"> virtual void createAVPlayerItem();
</span><span class="lines">@@ -91,13 +91,13 @@
</span><span class="cx"> virtual void checkPlayability();
</span><span class="cx"> virtual void updateRate();
</span><span class="cx"> virtual float rate() const;
</span><del>- virtual void seekToTime(double time, double negativeTolerance, double positiveTolerance);
</del><ins>+ virtual void seekToTime(const MediaTime&, const MediaTime& negativeTolerance, const MediaTime& positiveTolerance);
</ins><span class="cx"> virtual unsigned long long totalBytes() const;
</span><span class="cx"> virtual std::unique_ptr<PlatformTimeRanges> platformBufferedTimeRanges() const;
</span><del>- virtual double platformMinTimeSeekable() const;
- virtual double platformMaxTimeSeekable() const;
- virtual double platformDuration() const;
- virtual float platformMaxTimeLoaded() const;
</del><ins>+ virtual MediaTime platformMinTimeSeekable() const;
+ virtual MediaTime platformMaxTimeSeekable() const;
+ virtual MediaTime platformDuration() const;
+ virtual MediaTime platformMaxTimeLoaded() const;
</ins><span class="cx"> virtual void beginLoadingMetadata();
</span><span class="cx"> virtual void sizeChanged();
</span><span class="cx"> virtual bool requiresImmediateCompositing() const override;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -76,7 +76,7 @@
</span><span class="cx">
</span><span class="cx"> #if HAVE(AVFOUNDATION_MEDIA_SELECTION_GROUP)
</span><span class="cx"> RetainPtr<AVPlayerItem> playerItem() const { return m_avPlayerItem; }
</span><del>- void processCue(NSArray *, NSArray *, double);
</del><ins>+ void processCue(NSArray *, NSArray *, const MediaTime&);
</ins><span class="cx"> void flushCues();
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="lines">@@ -103,9 +103,9 @@
</span><span class="cx"> void tracksDidChange(RetainPtr<NSArray>);
</span><span class="cx"> void hasEnabledAudioDidChange(bool);
</span><span class="cx"> void presentationSizeDidChange(FloatSize);
</span><del>- void durationDidChange(double);
</del><ins>+ void durationDidChange(const MediaTime&);
</ins><span class="cx"> void rateDidChange(double);
</span><del>- void metadataDidArrive(RetainPtr<NSArray>, double);
</del><ins>+ void metadataDidArrive(RetainPtr<NSArray>, const MediaTime&);
</ins><span class="cx"> void firstFrameAvailableDidChange(bool);
</span><span class="cx"> void trackEnabledDidChange(bool);
</span><span class="cx"> void canPlayFastReverseDidChange(bool);
</span><span class="lines">@@ -146,7 +146,7 @@
</span><span class="cx"> virtual void platformSetVisible(bool);
</span><span class="cx"> virtual void platformPlay();
</span><span class="cx"> virtual void platformPause();
</span><del>- virtual double currentTimeDouble() const override;
</del><ins>+ virtual MediaTime currentMediaTime() const override;
</ins><span class="cx"> virtual void setVolume(float);
</span><span class="cx"> virtual void setClosedCaptionsVisible(bool);
</span><span class="cx"> virtual void paint(GraphicsContext*, const IntRect&);
</span><span class="lines">@@ -163,7 +163,7 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> virtual bool supportsAcceleratedRendering() const { return true; }
</span><del>- virtual float mediaTimeForTimeValue(float) const;
</del><ins>+ virtual MediaTime mediaTimeForTimeValue(const MediaTime&) const;
</ins><span class="cx"> virtual double maximumDurationToCacheMediaTime() const { return 5; }
</span><span class="cx">
</span><span class="cx"> virtual void createAVPlayer();
</span><span class="lines">@@ -176,13 +176,13 @@
</span><span class="cx"> virtual void checkPlayability();
</span><span class="cx"> virtual void updateRate();
</span><span class="cx"> virtual float rate() const;
</span><del>- virtual void seekToTime(double time, double negativeTolerance, double positiveTolerance);
</del><ins>+ virtual void seekToTime(const MediaTime&, const MediaTime& negativeTolerance, const MediaTime& positiveTolerance);
</ins><span class="cx"> virtual unsigned long long totalBytes() const;
</span><span class="cx"> virtual std::unique_ptr<PlatformTimeRanges> platformBufferedTimeRanges() const;
</span><del>- virtual double platformMinTimeSeekable() const;
- virtual double platformMaxTimeSeekable() const;
- virtual double platformDuration() const;
- virtual float platformMaxTimeLoaded() const;
</del><ins>+ virtual MediaTime platformMinTimeSeekable() const;
+ virtual MediaTime platformMaxTimeSeekable() const;
+ virtual MediaTime platformDuration() const;
+ virtual MediaTime platformMaxTimeLoaded() const;
</ins><span class="cx"> virtual void beginLoadingMetadata();
</span><span class="cx"> virtual void sizeChanged();
</span><span class="cx">
</span><span class="lines">@@ -329,7 +329,7 @@
</span><span class="cx"> RetainPtr<NSArray> m_cachedTracks;
</span><span class="cx"> RetainPtr<NSArray> m_currentMetaData;
</span><span class="cx"> FloatSize m_cachedPresentationSize;
</span><del>- double m_cachedDuration;
</del><ins>+ MediaTime m_cachedDuration;
</ins><span class="cx"> double m_cachedRate;
</span><span class="cx"> mutable long long m_cachedTotalBytes;
</span><span class="cx"> unsigned m_pendingStatusChanges;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -46,7 +46,7 @@
</span><span class="cx"> #import "OutOfBandTextTrackPrivateAVF.h"
</span><span class="cx"> #import "URL.h"
</span><span class="cx"> #import "Logging.h"
</span><del>-#import "MediaTimeMac.h"
</del><ins>+#import "MediaTimeAVFoundation.h"
</ins><span class="cx"> #import "PlatformTimeRanges.h"
</span><span class="cx"> #import "SecurityOrigin.h"
</span><span class="cx"> #import "SerializedPlatformRepresentationMac.h"
</span><span class="lines">@@ -399,7 +399,6 @@
</span><span class="cx"> , m_loaderDelegate(adoptNS([[WebCoreAVFLoaderDelegate alloc] initWithCallback:this]))
</span><span class="cx"> #endif
</span><span class="cx"> , m_currentTextTrack(0)
</span><del>- , m_cachedDuration(MediaPlayer::invalidTime())
</del><span class="cx"> , m_cachedRate(0)
</span><span class="cx"> , m_cachedTotalBytes(0)
</span><span class="cx"> , m_pendingStatusChanges(0)
</span><span class="lines">@@ -494,7 +493,7 @@
</span><span class="cx"> m_cachedLoadedRanges = nullptr;
</span><span class="cx"> m_cachedHasEnabledAudio = false;
</span><span class="cx"> m_cachedPresentationSize = FloatSize();
</span><del>- m_cachedDuration = 0;
</del><ins>+ m_cachedDuration = MediaTime::zeroTime();
</ins><span class="cx">
</span><span class="cx"> for (AVPlayerItemTrack *track in m_cachedTracks.get())
</span><span class="cx"> [track removeObserver:m_objcObserver.get() forKeyPath:@"enabled"];
</span><span class="lines">@@ -1130,12 +1129,12 @@
</span><span class="cx"> setDelayCallbacks(false);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-double MediaPlayerPrivateAVFoundationObjC::platformDuration() const
</del><ins>+MediaTime MediaPlayerPrivateAVFoundationObjC::platformDuration() const
</ins><span class="cx"> {
</span><span class="cx"> // Do not ask the asset for duration before it has been loaded or it will fetch the
</span><span class="cx"> // answer synchronously.
</span><span class="cx"> if (!m_avAsset || assetStatus() < MediaPlayerAVAssetStatusLoaded)
</span><del>- return MediaPlayer::invalidTime();
</del><ins>+ return MediaTime::invalidTime();
</ins><span class="cx">
</span><span class="cx"> CMTime cmDuration;
</span><span class="cx">
</span><span class="lines">@@ -1143,32 +1142,31 @@
</span><span class="cx"> if (m_avPlayerItem && playerItemStatus() >= MediaPlayerAVPlayerItemStatusReadyToPlay)
</span><span class="cx"> cmDuration = [m_avPlayerItem.get() duration];
</span><span class="cx"> else
</span><del>- cmDuration= [m_avAsset.get() duration];
</del><ins>+ cmDuration = [m_avAsset.get() duration];
</ins><span class="cx">
</span><span class="cx"> if (CMTIME_IS_NUMERIC(cmDuration))
</span><del>- return CMTimeGetSeconds(cmDuration);
</del><ins>+ return toMediaTime(cmDuration);
</ins><span class="cx">
</span><del>- if (CMTIME_IS_INDEFINITE(cmDuration)) {
- return std::numeric_limits<double>::infinity();
- }
</del><ins>+ if (CMTIME_IS_INDEFINITE(cmDuration))
+ return MediaTime::positiveInfiniteTime();
</ins><span class="cx">
</span><del>- LOG(Media, "MediaPlayerPrivateAVFoundationObjC::platformDuration(%p) - invalid duration, returning %.0f", this, MediaPlayer::invalidTime());
- return MediaPlayer::invalidTime();
</del><ins>+ LOG(Media, "MediaPlayerPrivateAVFoundationObjC::platformDuration(%p) - invalid duration, returning %.0f", this, toString(MediaTime::invalidTime()).utf8().data());
+ return MediaTime::invalidTime();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-double MediaPlayerPrivateAVFoundationObjC::currentTimeDouble() const
</del><ins>+MediaTime MediaPlayerPrivateAVFoundationObjC::currentMediaTime() const
</ins><span class="cx"> {
</span><span class="cx"> if (!metaDataAvailable() || !m_avPlayerItem)
</span><del>- return 0;
</del><ins>+ return MediaTime::zeroTime();
</ins><span class="cx">
</span><span class="cx"> CMTime itemTime = [m_avPlayerItem.get() currentTime];
</span><span class="cx"> if (CMTIME_IS_NUMERIC(itemTime))
</span><del>- return std::max(CMTimeGetSeconds(itemTime), 0.0);
</del><ins>+ return std::max(toMediaTime(itemTime), MediaTime::zeroTime());
</ins><span class="cx">
</span><del>- return 0;
</del><ins>+ return MediaTime::zeroTime();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void MediaPlayerPrivateAVFoundationObjC::seekToTime(double time, double negativeTolerance, double positiveTolerance)
</del><ins>+void MediaPlayerPrivateAVFoundationObjC::seekToTime(const MediaTime& time, const MediaTime& negativeTolerance, const MediaTime& positiveTolerance)
</ins><span class="cx"> {
</span><span class="cx"> // setCurrentTime generates several event callbacks, update afterwards.
</span><span class="cx"> setDelayCallbacks(true);
</span><span class="lines">@@ -1176,9 +1174,9 @@
</span><span class="cx"> if (m_metadataTrack)
</span><span class="cx"> m_metadataTrack->flushPartialCues();
</span><span class="cx">
</span><del>- CMTime cmTime = CMTimeMakeWithSeconds(time, 600);
- CMTime cmBefore = CMTimeMakeWithSeconds(negativeTolerance, 600);
- CMTime cmAfter = CMTimeMakeWithSeconds(positiveTolerance, 600);
</del><ins>+ CMTime cmTime = toCMTime(time);
+ CMTime cmBefore = toCMTime(negativeTolerance);
+ CMTime cmAfter = toCMTime(positiveTolerance);
</ins><span class="cx">
</span><span class="cx"> auto weakThis = createWeakPtr();
</span><span class="cx">
</span><span class="lines">@@ -1249,12 +1247,12 @@
</span><span class="cx"> return timeRanges;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-double MediaPlayerPrivateAVFoundationObjC::platformMinTimeSeekable() const
</del><ins>+MediaTime MediaPlayerPrivateAVFoundationObjC::platformMinTimeSeekable() const
</ins><span class="cx"> {
</span><span class="cx"> if (!m_cachedSeekableRanges || ![m_cachedSeekableRanges count])
</span><del>- return 0;
</del><ins>+ return MediaTime::zeroTime();
</ins><span class="cx">
</span><del>- double minTimeSeekable = std::numeric_limits<double>::infinity();
</del><ins>+ MediaTime minTimeSeekable = MediaTime::positiveInfiniteTime();
</ins><span class="cx"> bool hasValidRange = false;
</span><span class="cx"> for (NSValue *thisRangeValue in m_cachedSeekableRanges.get()) {
</span><span class="cx"> CMTimeRange timeRange = [thisRangeValue CMTimeRangeValue];
</span><span class="lines">@@ -1262,32 +1260,32 @@
</span><span class="cx"> continue;
</span><span class="cx">
</span><span class="cx"> hasValidRange = true;
</span><del>- double startOfRange = CMTimeGetSeconds(timeRange.start);
</del><ins>+ MediaTime startOfRange = toMediaTime(timeRange.start);
</ins><span class="cx"> if (minTimeSeekable > startOfRange)
</span><span class="cx"> minTimeSeekable = startOfRange;
</span><span class="cx"> }
</span><del>- return hasValidRange ? minTimeSeekable : 0;
</del><ins>+ return hasValidRange ? minTimeSeekable : MediaTime::zeroTime();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-double MediaPlayerPrivateAVFoundationObjC::platformMaxTimeSeekable() const
</del><ins>+MediaTime MediaPlayerPrivateAVFoundationObjC::platformMaxTimeSeekable() const
</ins><span class="cx"> {
</span><span class="cx"> if (!m_cachedSeekableRanges)
</span><span class="cx"> m_cachedSeekableRanges = [m_avPlayerItem seekableTimeRanges];
</span><span class="cx">
</span><del>- double maxTimeSeekable = 0;
</del><ins>+ MediaTime maxTimeSeekable;
</ins><span class="cx"> for (NSValue *thisRangeValue in m_cachedSeekableRanges.get()) {
</span><span class="cx"> CMTimeRange timeRange = [thisRangeValue CMTimeRangeValue];
</span><span class="cx"> if (!CMTIMERANGE_IS_VALID(timeRange) || CMTIMERANGE_IS_EMPTY(timeRange))
</span><span class="cx"> continue;
</span><span class="cx">
</span><del>- double endOfRange = CMTimeGetSeconds(CMTimeRangeGetEnd(timeRange));
</del><ins>+ MediaTime endOfRange = toMediaTime(CMTimeRangeGetEnd(timeRange));
</ins><span class="cx"> if (maxTimeSeekable < endOfRange)
</span><span class="cx"> maxTimeSeekable = endOfRange;
</span><span class="cx"> }
</span><span class="cx"> return maxTimeSeekable;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-float MediaPlayerPrivateAVFoundationObjC::platformMaxTimeLoaded() const
</del><ins>+MediaTime MediaPlayerPrivateAVFoundationObjC::platformMaxTimeLoaded() const
</ins><span class="cx"> {
</span><span class="cx"> #if !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED <= 1080
</span><span class="cx"> // AVFoundation on Mountain Lion will occasionally not send a KVO notification
</span><span class="lines">@@ -1298,15 +1296,15 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> if (!m_cachedLoadedRanges)
</span><del>- return 0;
</del><ins>+ return MediaTime::zeroTime();
</ins><span class="cx">
</span><del>- float maxTimeLoaded = 0;
</del><ins>+ MediaTime maxTimeLoaded;
</ins><span class="cx"> for (NSValue *thisRangeValue in m_cachedLoadedRanges.get()) {
</span><span class="cx"> CMTimeRange timeRange = [thisRangeValue CMTimeRangeValue];
</span><span class="cx"> if (!CMTIMERANGE_IS_VALID(timeRange) || CMTIMERANGE_IS_EMPTY(timeRange))
</span><span class="cx"> continue;
</span><span class="cx">
</span><del>- float endOfRange = narrowPrecisionToFloat(CMTimeGetSeconds(CMTimeRangeGetEnd(timeRange)));
</del><ins>+ MediaTime endOfRange = toMediaTime(CMTimeRangeGetEnd(timeRange));
</ins><span class="cx"> if (maxTimeLoaded < endOfRange)
</span><span class="cx"> maxTimeLoaded = endOfRange;
</span><span class="cx"> }
</span><span class="lines">@@ -1592,7 +1590,7 @@
</span><span class="cx"> return AVFoundationLibrary() && CoreMediaLibrary();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-float MediaPlayerPrivateAVFoundationObjC::mediaTimeForTimeValue(float timeValue) const
</del><ins>+MediaTime MediaPlayerPrivateAVFoundationObjC::mediaTimeForTimeValue(const MediaTime& timeValue) const
</ins><span class="cx"> {
</span><span class="cx"> if (!metaDataAvailable())
</span><span class="cx"> return timeValue;
</span><span class="lines">@@ -2249,7 +2247,7 @@
</span><span class="cx"> player()->addTextTrack(m_metadataTrack);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void MediaPlayerPrivateAVFoundationObjC::processCue(NSArray *attributedStrings, NSArray *nativeSamples, double time)
</del><ins>+void MediaPlayerPrivateAVFoundationObjC::processCue(NSArray *attributedStrings, NSArray *nativeSamples, const MediaTime& time)
</ins><span class="cx"> {
</span><span class="cx"> if (!m_currentTextTrack)
</span><span class="cx"> return;
</span><span class="lines">@@ -2526,11 +2524,11 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-void MediaPlayerPrivateAVFoundationObjC::metadataDidArrive(RetainPtr<NSArray> metadata, double mediaTime)
</del><ins>+void MediaPlayerPrivateAVFoundationObjC::metadataDidArrive(RetainPtr<NSArray> metadata, const MediaTime& mediaTime)
</ins><span class="cx"> {
</span><span class="cx"> m_currentMetaData = metadata && ![metadata isKindOfClass:[NSNull class]] ? metadata : nil;
</span><span class="cx">
</span><del>- LOG(Media, "MediaPlayerPrivateAVFoundationObjC::metadataDidArrive(%p) - adding %i cues at time %.2f", this, m_currentMetaData ? static_cast<int>([m_currentMetaData.get() count]) : 0, mediaTime);
</del><ins>+ LOG(Media, "MediaPlayerPrivateAVFoundationObjC::metadataDidArrive(%p) - adding %i cues at time %s", this, m_currentMetaData ? static_cast<int>([m_currentMetaData.get() count]) : 0, toString(mediaTime).utf8().data());
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(DATACUE_VALUE)
</span><span class="cx"> if (seeking())
</span><span class="lines">@@ -2545,19 +2543,19 @@
</span><span class="cx"> processMetadataTrack();
</span><span class="cx">
</span><span class="cx"> // Set the duration of all incomplete cues before adding new ones.
</span><del>- double earliesStartTime = std::numeric_limits<double>::infinity();
</del><ins>+ MediaTime earliestStartTime = MediaTime::positiveInfiniteTime();
</ins><span class="cx"> for (AVMetadataItemType *item in m_currentMetaData.get()) {
</span><del>- double start = CMTimeGetSeconds(item.time);
- if (start < earliesStartTime)
- earliesStartTime = start;
</del><ins>+ MediaTime start = toMediaTime(item.time);
+ if (start < earliestStartTime)
+ earliestStartTime = start;
</ins><span class="cx"> }
</span><del>- m_metadataTrack->updatePendingCueEndTimes(earliesStartTime);
</del><ins>+ m_metadataTrack->updatePendingCueEndTimes(earliestStartTime);
</ins><span class="cx">
</span><span class="cx"> for (AVMetadataItemType *item in m_currentMetaData.get()) {
</span><del>- double start = CMTimeGetSeconds(item.time);
- double end = std::numeric_limits<double>::infinity();
</del><ins>+ MediaTime start = toMediaTime(item.time);
+ MediaTime end = MediaTime::positiveInfiniteTime();
</ins><span class="cx"> if (CMTIME_IS_VALID(item.duration))
</span><del>- end = start + CMTimeGetSeconds(item.duration);
</del><ins>+ end = start + toMediaTime(item.duration);
</ins><span class="cx">
</span><span class="cx"> AtomicString type = nullAtom;
</span><span class="cx"> if (item.keySpace)
</span><span class="lines">@@ -2599,7 +2597,7 @@
</span><span class="cx"> updateStates();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void MediaPlayerPrivateAVFoundationObjC::durationDidChange(double duration)
</del><ins>+void MediaPlayerPrivateAVFoundationObjC::durationDidChange(const MediaTime& duration)
</ins><span class="cx"> {
</span><span class="cx"> m_cachedDuration = duration;
</span><span class="cx">
</span><span class="lines">@@ -2768,12 +2766,12 @@
</span><span class="cx"> else if ([keyPath isEqualToString:@"presentationSize"])
</span><span class="cx"> function = WTF::bind(&MediaPlayerPrivateAVFoundationObjC::presentationSizeDidChange, m_callback, FloatSize([newValue sizeValue]));
</span><span class="cx"> else if ([keyPath isEqualToString:@"duration"])
</span><del>- function = WTF::bind(&MediaPlayerPrivateAVFoundationObjC::durationDidChange, m_callback, CMTimeGetSeconds([newValue CMTimeValue]));
</del><ins>+ function = WTF::bind(&MediaPlayerPrivateAVFoundationObjC::durationDidChange, m_callback, toMediaTime([newValue CMTimeValue]));
</ins><span class="cx"> else if ([keyPath isEqualToString:@"timedMetadata"] && newValue) {
</span><del>- double now = 0;
</del><ins>+ MediaTime now;
</ins><span class="cx"> CMTime itemTime = [(AVPlayerItemType *)object currentTime];
</span><span class="cx"> if (CMTIME_IS_NUMERIC(itemTime))
</span><del>- now = std::max(narrowPrecisionToFloat(CMTimeGetSeconds(itemTime)), 0.0f);
</del><ins>+ now = std::max(toMediaTime(itemTime), MediaTime::zeroTime());
</ins><span class="cx"> function = WTF::bind(&MediaPlayerPrivateAVFoundationObjC::metadataDidArrive, m_callback, RetainPtr<NSArray>(newValue), now);
</span><span class="cx"> } else if ([keyPath isEqualToString:@"canPlayFastReverse"])
</span><span class="cx"> function = WTF::bind(&MediaPlayerPrivateAVFoundationObjC::canPlayFastReverseDidChange, m_callback, [newValue boolValue]);
</span><span class="lines">@@ -2820,7 +2818,7 @@
</span><span class="cx"> MediaPlayerPrivateAVFoundationObjC* callback = strongSelf->m_callback;
</span><span class="cx"> if (!callback)
</span><span class="cx"> return;
</span><del>- callback->processCue(strongStrings.get(), strongSamples.get(), CMTimeGetSeconds(itemTime));
</del><ins>+ callback->processCue(strongStrings.get(), strongSamples.get(), toMediaTime(itemTime));
</ins><span class="cx"> });
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaSourceAVFObjCh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -119,18 +119,18 @@
</span><span class="cx">
</span><span class="cx"> virtual void setVisible(bool) override;
</span><span class="cx">
</span><del>- virtual double durationDouble() const override;
- virtual double currentTimeDouble() const override;
- virtual double startTimeDouble() const override;
- virtual double initialTime() const override;
</del><ins>+ virtual MediaTime durationMediaTime() const override;
+ virtual MediaTime currentMediaTime() const override;
+ virtual MediaTime startTime() const override;
+ virtual MediaTime initialTime() const override;
</ins><span class="cx">
</span><del>- virtual void seekWithTolerance(double time, double negativeThreshold, double positiveThreshold) override;
</del><ins>+ virtual void seekWithTolerance(const MediaTime&, const MediaTime& negativeThreshold, const MediaTime& positiveThreshold) override;
</ins><span class="cx"> virtual bool seeking() const override;
</span><span class="cx"> virtual void setRateDouble(double) override;
</span><span class="cx">
</span><span class="cx"> virtual std::unique_ptr<PlatformTimeRanges> seekable() const override;
</span><del>- virtual double maxTimeSeekableDouble() const override;
- virtual double minTimeSeekable() const override;
</del><ins>+ virtual MediaTime maxMediaTimeSeekable() const override;
+ virtual MediaTime minMediaTimeSeekable() const override;
</ins><span class="cx"> virtual std::unique_ptr<PlatformTimeRanges> buffered() const override;
</span><span class="cx">
</span><span class="cx"> virtual bool didLoadingProgress() const override;
</span><span class="lines">@@ -159,10 +159,8 @@
</span><span class="cx"> virtual unsigned long totalVideoFrames() override;
</span><span class="cx"> virtual unsigned long droppedVideoFrames() override;
</span><span class="cx"> virtual unsigned long corruptedVideoFrames() override;
</span><del>- virtual double totalFrameDelay() override;
</del><ins>+ virtual MediaTime totalFrameDelay() override;
</ins><span class="cx">
</span><del>- MediaTime currentMediaTime() const;
-
</del><span class="cx"> void ensureLayer();
</span><span class="cx"> void destroyLayer();
</span><span class="cx"> bool shouldBePlaying() const;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaSourceAVFObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx"> #import "Logging.h"
</span><span class="cx"> #import "MediaSourcePrivateAVFObjC.h"
</span><span class="cx"> #import "MediaSourcePrivateClient.h"
</span><del>-#import "MediaTimeMac.h"
</del><ins>+#import "MediaTimeAVFoundation.h"
</ins><span class="cx"> #import "PlatformClockCM.h"
</span><span class="cx"> #import "SoftLinking.h"
</span><span class="cx"> #import "WebCoreSystemInterface.h"
</span><span class="lines">@@ -377,9 +377,9 @@
</span><span class="cx"> // No-op.
</span><span class="cx"> }
</span><span class="cx">
</span><del>-double MediaPlayerPrivateMediaSourceAVFObjC::durationDouble() const
</del><ins>+MediaTime MediaPlayerPrivateMediaSourceAVFObjC::durationMediaTime() const
</ins><span class="cx"> {
</span><del>- return m_mediaSourcePrivate ? m_mediaSourcePrivate->duration().toDouble() : 0;
</del><ins>+ return m_mediaSourcePrivate ? m_mediaSourcePrivate->duration() : MediaTime::zeroTime();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> MediaTime MediaPlayerPrivateMediaSourceAVFObjC::currentMediaTime() const
</span><span class="lines">@@ -392,27 +392,22 @@
</span><span class="cx"> return synchronizerTime;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-double MediaPlayerPrivateMediaSourceAVFObjC::currentTimeDouble() const
</del><ins>+MediaTime MediaPlayerPrivateMediaSourceAVFObjC::startTime() const
</ins><span class="cx"> {
</span><del>- return currentMediaTime().toDouble();
</del><ins>+ return MediaTime::zeroTime();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-double MediaPlayerPrivateMediaSourceAVFObjC::startTimeDouble() const
</del><ins>+MediaTime MediaPlayerPrivateMediaSourceAVFObjC::initialTime() const
</ins><span class="cx"> {
</span><del>- return 0;
</del><ins>+ return MediaTime::zeroTime();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-double MediaPlayerPrivateMediaSourceAVFObjC::initialTime() const
</del><ins>+void MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance(const MediaTime& time, const MediaTime& negativeThreshold, const MediaTime& positiveThreshold)
</ins><span class="cx"> {
</span><del>- return 0;
-}
-
-void MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance(double time, double negativeThreshold, double positiveThreshold)
-{
</del><span class="cx"> LOG(MediaSource, "MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance(%p) - time(%s), negativeThreshold(%s), positiveThreshold(%s)", this, toString(time).utf8().data(), toString(negativeThreshold).utf8().data(), toString(positiveThreshold).utf8().data());
</span><span class="cx"> m_seeking = true;
</span><span class="cx"> auto weakThis = createWeakPtr();
</span><del>- m_pendingSeek = std::make_unique<PendingSeek>(MediaTime::createWithDouble(time), MediaTime::createWithDouble(negativeThreshold), MediaTime::createWithDouble(positiveThreshold));
</del><ins>+ m_pendingSeek = std::make_unique<PendingSeek>(time, negativeThreshold, positiveThreshold);
</ins><span class="cx">
</span><span class="cx"> if (m_seekTimer.isActive())
</span><span class="cx"> m_seekTimer.stop();
</span><span class="lines">@@ -435,7 +430,7 @@
</span><span class="cx"> if (!m_mediaSourcePrivate)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- if (pendingSeek->negativeThreshold == MediaTime::zeroTime() && pendingSeek->positiveThreshold == MediaTime::zeroTime())
</del><ins>+ if (!pendingSeek->negativeThreshold && !pendingSeek->positiveThreshold)
</ins><span class="cx"> m_lastSeekTime = pendingSeek->targetTime;
</span><span class="cx"> else
</span><span class="cx"> m_lastSeekTime = m_mediaSourcePrivate->fastSeekTimeForMediaTime(pendingSeek->targetTime, pendingSeek->positiveThreshold, pendingSeek->negativeThreshold);
</span><span class="lines">@@ -490,17 +485,17 @@
</span><span class="cx">
</span><span class="cx"> std::unique_ptr<PlatformTimeRanges> MediaPlayerPrivateMediaSourceAVFObjC::seekable() const
</span><span class="cx"> {
</span><del>- return PlatformTimeRanges::create(MediaTime::createWithDouble(minTimeSeekable()), MediaTime::createWithDouble(maxTimeSeekableDouble()));
</del><ins>+ return PlatformTimeRanges::create(minMediaTimeSeekable(), maxMediaTimeSeekable());
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-double MediaPlayerPrivateMediaSourceAVFObjC::maxTimeSeekableDouble() const
</del><ins>+MediaTime MediaPlayerPrivateMediaSourceAVFObjC::maxMediaTimeSeekable() const
</ins><span class="cx"> {
</span><del>- return durationDouble();
</del><ins>+ return durationMediaTime();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-double MediaPlayerPrivateMediaSourceAVFObjC::minTimeSeekable() const
</del><ins>+MediaTime MediaPlayerPrivateMediaSourceAVFObjC::minMediaTimeSeekable() const
</ins><span class="cx"> {
</span><del>- return startTimeDouble();
</del><ins>+ return startTime();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> std::unique_ptr<PlatformTimeRanges> MediaPlayerPrivateMediaSourceAVFObjC::buffered() const
</span><span class="lines">@@ -590,9 +585,9 @@
</span><span class="cx"> return [[m_sampleBufferDisplayLayer videoPerformanceMetrics] numberOfCorruptedVideoFrames];
</span><span class="cx"> }
</span><span class="cx">
</span><del>-double MediaPlayerPrivateMediaSourceAVFObjC::totalFrameDelay()
</del><ins>+MediaTime MediaPlayerPrivateMediaSourceAVFObjC::totalFrameDelay()
</ins><span class="cx"> {
</span><del>- return [[m_sampleBufferDisplayLayer videoPerformanceMetrics] totalFrameDelay];
</del><ins>+ return MediaTime::createWithDouble([[m_sampleBufferDisplayLayer videoPerformanceMetrics] totalFrameDelay]);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #pragma mark -
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaSourcePrivateAVFObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -94,7 +94,7 @@
</span><span class="cx">
</span><span class="cx"> MediaTime MediaSourcePrivateAVFObjC::duration()
</span><span class="cx"> {
</span><del>- return MediaTime::createWithDouble(m_client->duration());
</del><ins>+ return m_client->duration();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> std::unique_ptr<PlatformTimeRanges> MediaSourcePrivateAVFObjC::buffered()
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcOutOfBandTextTrackPrivateAVFh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/OutOfBandTextTrackPrivateAVF.h (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/OutOfBandTextTrackPrivateAVF.h        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/OutOfBandTextTrackPrivateAVF.h        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -41,7 +41,7 @@
</span><span class="cx"> return adoptRef(new OutOfBandTextTrackPrivateAVF(player, selection));
</span><span class="cx"> }
</span><span class="cx">
</span><del>- virtual void processCue(CFArrayRef, CFArrayRef, double) override { }
</del><ins>+ virtual void processCue(CFArrayRef, CFArrayRef, const MediaTime&) override { }
</ins><span class="cx"> virtual void resetCueValues() override { }
</span><span class="cx">
</span><span class="cx"> virtual Category textTrackCategory() const override { return OutOfBand; }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcSourceBufferPrivateAVFObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -34,7 +34,7 @@
</span><span class="cx"> #import "MediaPlayerPrivateMediaSourceAVFObjC.h"
</span><span class="cx"> #import "MediaSample.h"
</span><span class="cx"> #import "MediaSourcePrivateAVFObjC.h"
</span><del>-#import "MediaTimeMac.h"
</del><ins>+#import "MediaTimeAVFoundation.h"
</ins><span class="cx"> #import "NotImplemented.h"
</span><span class="cx"> #import "SoftLinking.h"
</span><span class="cx"> #import "SourceBufferPrivateClient.h"
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgstreamerInbandMetadataTextTrackPrivateGStreamerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -47,7 +47,7 @@
</span><span class="cx"> virtual AtomicString inBandMetadataTrackDispatchType() const override { return m_inBandMetadataTrackDispatchType; }
</span><span class="cx"> void setInBandMetadataTrackDispatchType(const AtomicString& value) { m_inBandMetadataTrackDispatchType = value; }
</span><span class="cx">
</span><del>- void addDataCue(double start, double end, const void* data, unsigned length)
</del><ins>+ void addDataCue(const MediaTime& start, const MediaTime& end, const void* data, unsigned length)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(cueFormat() == Data);
</span><span class="cx"> client()->addDataCue(this, start, end, data, length);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgstreamerMediaPlayerPrivateGStreamercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx"> #include <gst/pbutils/missing-plugins.h>
</span><span class="cx"> #include <limits>
</span><span class="cx"> #include <wtf/HexNumber.h>
</span><ins>+#include <wtf/MediaTime.h>
</ins><span class="cx"> #include <wtf/gobject/GUniquePtr.h>
</span><span class="cx"> #include <wtf/text/CString.h>
</span><span class="cx">
</span><span class="lines">@@ -1091,7 +1092,7 @@
</span><span class="cx"> gsize size;
</span><span class="cx"> const void* bytes = g_bytes_get_data(data.get(), &size);
</span><span class="cx">
</span><del>- track->addDataCue(currentTimeDouble(), currentTimeDouble(), bytes, size);
</del><ins>+ track->addDataCue(MediaTime::createWithDouble(currentTimeDouble()), MediaTime::createWithDouble(currentTimeDouble()), bytes, size);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="lines">@@ -1124,9 +1125,9 @@
</span><span class="cx"> gint64 start = -1, stop = -1;
</span><span class="cx"> gst_toc_entry_get_start_stop_times(entry, &start, &stop);
</span><span class="cx"> if (start != -1)
</span><del>- cue->setStartTime(static_cast<double>(start) / GST_SECOND);
</del><ins>+ cue->setStartTime(MediaTime(start, GST_SECOND));
</ins><span class="cx"> if (stop != -1)
</span><del>- cue->setEndTime(static_cast<double>(stop) / GST_SECOND);
</del><ins>+ cue->setEndTime(MediaTime(stop, GST_SECOND));
</ins><span class="cx">
</span><span class="cx"> GstTagList* tags = gst_toc_entry_get_tags(entry);
</span><span class="cx"> if (tags) {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgstreamerMediaSourceGStreamercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaSourceGStreamer.cpp (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaSourceGStreamer.cpp        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaSourceGStreamer.cpp        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -66,7 +66,7 @@
</span><span class="cx">
</span><span class="cx"> void MediaSourceGStreamer::durationChanged()
</span><span class="cx"> {
</span><del>- m_client->didReceiveDuration(m_mediaSource->duration());
</del><ins>+ m_client->didReceiveDuration(m_mediaSource->duration().toDouble());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void MediaSourceGStreamer::markEndOfStream(EndOfStreamStatus)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacMediaPlayerPrivateQTKith"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -104,9 +104,9 @@
</span><span class="cx"> bool paused() const;
</span><span class="cx"> bool seeking() const;
</span><span class="cx">
</span><del>- float duration() const;
- float currentTime() const;
- void seek(float time);
</del><ins>+ virtual MediaTime durationMediaTime() const override;
+ virtual MediaTime currentMediaTime() const override;
+ virtual void seek(const MediaTime&) override;
</ins><span class="cx">
</span><span class="cx"> void setRate(float);
</span><span class="cx"> void setVolume(float);
</span><span class="lines">@@ -121,7 +121,7 @@
</span><span class="cx"> MediaPlayer::ReadyState readyState() const { return m_readyState; }
</span><span class="cx">
</span><span class="cx"> std::unique_ptr<PlatformTimeRanges> buffered() const;
</span><del>- float maxTimeSeekable() const;
</del><ins>+ MediaTime maxMediaTimeSeekable() const;
</ins><span class="cx"> bool didLoadingProgress() const;
</span><span class="cx"> unsigned totalBytes() const;
</span><span class="cx">
</span><span class="lines">@@ -161,13 +161,11 @@
</span><span class="cx"> void createQTMovieLayer();
</span><span class="cx"> void destroyQTMovieLayer();
</span><span class="cx">
</span><del>- QTTime createQTTime(float time) const;
-
</del><span class="cx"> void updateStates();
</span><span class="cx"> void doSeek();
</span><span class="cx"> void cancelSeek();
</span><span class="cx"> void seekTimerFired(Timer<MediaPlayerPrivateQTKit>&);
</span><del>- float maxTimeLoaded() const;
</del><ins>+ MediaTime maxMediaTimeLoaded() const;
</ins><span class="cx"> void disableUnsupportedTracks();
</span><span class="cx">
</span><span class="cx"> void sawUnsupportedTracks();
</span><span class="lines">@@ -175,8 +173,6 @@
</span><span class="cx"> bool metaDataAvailable() const { return m_qtMovie && m_readyState >= MediaPlayer::HaveMetadata; }
</span><span class="cx">
</span><span class="cx"> bool isReadyForVideoSetup() const;
</span><del>-
- virtual float mediaTimeForTimeValue(float) const;
</del><span class="cx">
</span><span class="cx"> virtual double maximumDurationToCacheMediaTime() const { return 5; }
</span><span class="cx">
</span><span class="lines">@@ -192,7 +188,7 @@
</span><span class="cx"> RetainPtr<QTVideoRendererWebKitOnly> m_qtVideoRenderer;
</span><span class="cx"> RetainPtr<WebCoreMovieObserver> m_objcObserver;
</span><span class="cx"> String m_movieURL;
</span><del>- float m_seekTo;
</del><ins>+ MediaTime m_seekTo;
</ins><span class="cx"> Timer<MediaPlayerPrivateQTKit> m_seekTimer;
</span><span class="cx"> MediaPlayer::NetworkState m_networkState;
</span><span class="cx"> MediaPlayer::ReadyState m_readyState;
</span><span class="lines">@@ -200,9 +196,9 @@
</span><span class="cx"> FloatSize m_scaleFactor;
</span><span class="cx"> unsigned m_enabledTrackCount;
</span><span class="cx"> unsigned m_totalTrackCount;
</span><del>- float m_reportedDuration;
- float m_cachedDuration;
- float m_timeToRestore;
</del><ins>+ MediaTime m_reportedDuration;
+ MediaTime m_cachedDuration;
+ MediaTime m_timeToRestore;
</ins><span class="cx"> RetainPtr<QTMovieLayer> m_qtVideoLayer;
</span><span class="cx"> MediaPlayer::Preload m_preload;
</span><span class="cx"> bool m_startedPlaying;
</span><span class="lines">@@ -212,11 +208,11 @@
</span><span class="cx"> bool m_videoFrameHasDrawn;
</span><span class="cx"> bool m_isAllowedToRender;
</span><span class="cx"> bool m_privateBrowsing;
</span><del>- mutable float m_maxTimeLoadedAtLastDidLoadingProgress;
</del><ins>+ mutable MediaTime m_maxTimeLoadedAtLastDidLoadingProgress;
</ins><span class="cx"> #if DRAW_FRAME_RATE
</span><span class="cx"> int m_frameCountWhilePlaying;
</span><del>- double m_timeStartedPlaying;
- double m_timeStoppedPlaying;
</del><ins>+ MediaTime m_timeStartedPlaying;
+ MediaTime m_timeStoppedPlaying;
</ins><span class="cx"> #endif
</span><span class="cx"> mutable FloatSize m_cachedNaturalSize;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacMediaPlayerPrivateQTKitmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -38,6 +38,7 @@
</span><span class="cx"> #import "URL.h"
</span><span class="cx"> #import "Logging.h"
</span><span class="cx"> #import "MIMETypeRegistry.h"
</span><ins>+#import "MediaTimeQTKit.h"
</ins><span class="cx"> #import "PlatformLayer.h"
</span><span class="cx"> #import "PlatformTimeRanges.h"
</span><span class="cx"> #import "SecurityOrigin.h"
</span><span class="lines">@@ -96,6 +97,12 @@
</span><span class="cx"> SOFT_LINK_POINTER_OPTIONAL(QTKit, QTSecurityPolicyNoLocalToRemoteSiteAttribute, NSString *)
</span><span class="cx"> SOFT_LINK_POINTER_OPTIONAL(QTKit, QTSecurityPolicyNoRemoteToLocalSiteAttribute, NSString *)
</span><span class="cx">
</span><ins>+@interface QTMovie(WebKitExtras)
+- (QTTime)maxTimeLoaded;
+- (NSArray *)availableRanges;
+- (NSArray *)loadedRanges;
+@end
+
</ins><span class="cx"> #define QTMovie getQTMovieClass()
</span><span class="cx"> #define QTMovieView getQTMovieViewClass()
</span><span class="cx"> #define QTMovieLayer getQTMovieLayerClass()
</span><span class="lines">@@ -191,7 +198,7 @@
</span><span class="cx"> MediaPlayerPrivateQTKit::MediaPlayerPrivateQTKit(MediaPlayer* player)
</span><span class="cx"> : m_player(player)
</span><span class="cx"> , m_objcObserver(adoptNS([[WebCoreMovieObserver alloc] initWithCallback:this]))
</span><del>- , m_seekTo(-1)
</del><ins>+ , m_seekTo(MediaTime::invalidTime())
</ins><span class="cx"> , m_seekTimer(this, &MediaPlayerPrivateQTKit::seekTimerFired)
</span><span class="cx"> , m_networkState(MediaPlayer::Empty)
</span><span class="cx"> , m_readyState(MediaPlayer::HaveNothing)
</span><span class="lines">@@ -199,9 +206,9 @@
</span><span class="cx"> , m_scaleFactor(1, 1)
</span><span class="cx"> , m_enabledTrackCount(0)
</span><span class="cx"> , m_totalTrackCount(0)
</span><del>- , m_reportedDuration(-1)
- , m_cachedDuration(-1)
- , m_timeToRestore(-1)
</del><ins>+ , m_reportedDuration(MediaTime::invalidTime())
+ , m_cachedDuration(MediaTime::invalidTime())
+ , m_timeToRestore(MediaTime::invalidTime())
</ins><span class="cx"> , m_preload(MediaPlayer::Auto)
</span><span class="cx"> , m_startedPlaying(false)
</span><span class="cx"> , m_isStreaming(false)
</span><span class="lines">@@ -210,7 +217,6 @@
</span><span class="cx"> , m_videoFrameHasDrawn(false)
</span><span class="cx"> , m_isAllowedToRender(false)
</span><span class="cx"> , m_privateBrowsing(false)
</span><del>- , m_maxTimeLoadedAtLastDidLoadingProgress(0)
</del><span class="cx"> #if DRAW_FRAME_RATE
</span><span class="cx"> , m_frameCountWhilePlaying(0)
</span><span class="cx"> , m_timeStartedPlaying(0)
</span><span class="lines">@@ -610,14 +616,6 @@
</span><span class="cx"> || m_qtVideoRenderer;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-QTTime MediaPlayerPrivateQTKit::createQTTime(float time) const
-{
- if (!metaDataAvailable())
- return QTMakeTime(0, 600);
- long timeScale = [[m_qtMovie.get() attributeForKey:QTMovieTimeScaleAttribute] longValue];
- return QTMakeTime(lroundf(time * timeScale), timeScale);
-}
-
</del><span class="cx"> void MediaPlayerPrivateQTKit::resumeLoad()
</span><span class="cx"> {
</span><span class="cx"> if (!m_movieURL.isNull())
</span><span class="lines">@@ -713,31 +711,32 @@
</span><span class="cx"> [m_objcObserver.get() setDelayCallbacks:NO];
</span><span class="cx"> }
</span><span class="cx">
</span><del>-float MediaPlayerPrivateQTKit::duration() const
</del><ins>+MediaTime MediaPlayerPrivateQTKit::durationMediaTime() const
</ins><span class="cx"> {
</span><span class="cx"> if (!metaDataAvailable())
</span><del>- return 0;
</del><ins>+ return MediaTime::zeroTime();
</ins><span class="cx">
</span><del>- if (m_cachedDuration != MediaPlayer::invalidTime())
</del><ins>+ if (m_cachedDuration.isValid())
</ins><span class="cx"> return m_cachedDuration;
</span><span class="cx">
</span><span class="cx"> QTTime time = [m_qtMovie.get() duration];
</span><span class="cx"> if (time.flags == kQTTimeIsIndefinite)
</span><del>- return std::numeric_limits<float>::infinity();
- return static_cast<float>(time.timeValue) / time.timeScale;
</del><ins>+ return MediaTime::positiveInfiniteTime();
+ return toMediaTime(time);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-float MediaPlayerPrivateQTKit::currentTime() const
</del><ins>+MediaTime MediaPlayerPrivateQTKit::currentMediaTime() const
</ins><span class="cx"> {
</span><span class="cx"> if (!metaDataAvailable())
</span><del>- return 0;
</del><ins>+ return MediaTime::zeroTime();
</ins><span class="cx"> QTTime time = [m_qtMovie.get() currentTime];
</span><del>- return static_cast<float>(time.timeValue) / time.timeScale;
</del><ins>+ return toMediaTime(time);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void MediaPlayerPrivateQTKit::seek(float time)
</del><ins>+void MediaPlayerPrivateQTKit::seek(const MediaTime& inTime)
</ins><span class="cx"> {
</span><del>- LOG(Media, "MediaPlayerPrivateQTKit::seek(%p) - time %f", this, time);
</del><ins>+ MediaTime time = inTime;
+ LOG(Media, "MediaPlayerPrivateQTKit::seek(%p) - time %s", this, toString(time).utf8().data());
</ins><span class="cx"> // Nothing to do if we are already in the middle of a seek to the same time.
</span><span class="cx"> if (time == m_seekTo)
</span><span class="cx"> return;
</span><span class="lines">@@ -747,11 +746,11 @@
</span><span class="cx"> if (!metaDataAvailable())
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- if (time > duration())
- time = duration();
</del><ins>+ if (time > durationMediaTime())
+ time = durationMediaTime();
</ins><span class="cx">
</span><span class="cx"> m_seekTo = time;
</span><del>- if (maxTimeSeekable() >= m_seekTo)
</del><ins>+ if (maxMediaTimeSeekable() >= m_seekTo)
</ins><span class="cx"> doSeek();
</span><span class="cx"> else
</span><span class="cx"> m_seekTimer.start(0, 0.5f);
</span><span class="lines">@@ -759,7 +758,7 @@
</span><span class="cx">
</span><span class="cx"> void MediaPlayerPrivateQTKit::doSeek()
</span><span class="cx"> {
</span><del>- QTTime qttime = createQTTime(m_seekTo);
</del><ins>+ QTTime qttime = toQTTime(m_seekTo);
</ins><span class="cx"> // setCurrentTime generates several event callbacks, update afterwards
</span><span class="cx"> [m_objcObserver.get() setDelayCallbacks:YES];
</span><span class="cx"> float oldRate = [m_qtMovie.get() rate];
</span><span class="lines">@@ -769,8 +768,8 @@
</span><span class="cx"> [m_qtMovie.get() setCurrentTime:qttime];
</span><span class="cx">
</span><span class="cx"> // restore playback only if not at end, otherwise QTMovie will loop
</span><del>- float timeAfterSeek = currentTime();
- if (oldRate && timeAfterSeek < duration())
</del><ins>+ MediaTime timeAfterSeek = currentMediaTime();
+ if (oldRate && timeAfterSeek < durationMediaTime())
</ins><span class="cx"> [m_qtMovie.get() setRate:oldRate];
</span><span class="cx">
</span><span class="cx"> cancelSeek();
</span><span class="lines">@@ -780,20 +779,20 @@
</span><span class="cx"> void MediaPlayerPrivateQTKit::cancelSeek()
</span><span class="cx"> {
</span><span class="cx"> LOG(Media, "MediaPlayerPrivateQTKit::cancelSeek(%p)", this);
</span><del>- m_seekTo = -1;
</del><ins>+ m_seekTo = MediaTime::invalidTime();
</ins><span class="cx"> m_seekTimer.stop();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void MediaPlayerPrivateQTKit::seekTimerFired(Timer<MediaPlayerPrivateQTKit>&)
</span><span class="cx"> {
</span><del>- if (!metaDataAvailable()|| !seeking() || currentTime() == m_seekTo) {
</del><ins>+ if (!metaDataAvailable() || !seeking() || currentMediaTime() == m_seekTo) {
</ins><span class="cx"> cancelSeek();
</span><span class="cx"> updateStates();
</span><span class="cx"> m_player->timeChanged();
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (maxTimeSeekable() >= m_seekTo)
</del><ins>+ if (maxMediaTimeSeekable() >= m_seekTo)
</ins><span class="cx"> doSeek();
</span><span class="cx"> else {
</span><span class="cx"> MediaPlayer::NetworkState state = networkState();
</span><span class="lines">@@ -816,7 +815,7 @@
</span><span class="cx"> {
</span><span class="cx"> if (!metaDataAvailable())
</span><span class="cx"> return false;
</span><del>- return m_seekTo >= 0;
</del><ins>+ return m_seekTo >= MediaTime::zeroTime();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> IntSize MediaPlayerPrivateQTKit::naturalSize() const
</span><span class="lines">@@ -912,7 +911,7 @@
</span><span class="cx"> RetainPtr<NSDictionary> movieAttributes = adoptNS([[m_qtMovie.get() movieAttributes] mutableCopy]);
</span><span class="cx"> ASSERT(movieAttributes);
</span><span class="cx"> [movieAttributes.get() setValue:[NSNumber numberWithBool:preservesPitch] forKey:QTMovieRateChangesPreservePitchAttribute];
</span><del>- m_timeToRestore = currentTime();
</del><ins>+ m_timeToRestore = currentMediaTime();
</ins><span class="cx">
</span><span class="cx"> createQTMovie([movieAttributes.get() valueForKey:QTMovieURLAttribute], movieAttributes.get());
</span><span class="cx"> }
</span><span class="lines">@@ -920,36 +919,60 @@
</span><span class="cx"> std::unique_ptr<PlatformTimeRanges> MediaPlayerPrivateQTKit::buffered() const
</span><span class="cx"> {
</span><span class="cx"> auto timeRanges = PlatformTimeRanges::create();
</span><del>- float loaded = maxTimeLoaded();
- if (loaded > 0)
- timeRanges->add(MediaTime::zeroTime(), MediaTime::createWithDouble(loaded));
</del><ins>+ MediaTime loaded = maxMediaTimeLoaded();
+ if (loaded > MediaTime::zeroTime())
+ timeRanges->add(MediaTime::zeroTime(), loaded);
</ins><span class="cx"> return timeRanges;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-float MediaPlayerPrivateQTKit::maxTimeSeekable() const
</del><ins>+static MediaTime maxValueForTimeRanges(NSArray *ranges)
</ins><span class="cx"> {
</span><ins>+ if (!ranges)
+ return MediaTime::zeroTime();
+
+ MediaTime max;
+ for (NSValue *value in ranges) {
+ QTTimeRange range = [value QTTimeRangeValue];
+ if (!range.time.timeScale || !range.duration.timeScale)
+ continue;
+
+ MediaTime time = toMediaTime(range.time);
+ MediaTime duration = toMediaTime(range.duration);
+ if (time.isValid() && duration.isValid())
+ max = std::max(max, time + duration);
+ }
+
+ return max;
+}
+
+MediaTime MediaPlayerPrivateQTKit::maxMediaTimeSeekable() const
+{
</ins><span class="cx"> if (!metaDataAvailable())
</span><del>- return 0;
</del><ins>+ return MediaTime::zeroTime();
</ins><span class="cx">
</span><span class="cx"> // infinite duration means live stream
</span><del>- if (std::isinf(duration()))
- return 0;
</del><ins>+ if (durationMediaTime().isPositiveInfinite())
+ return MediaTime::zeroTime();
</ins><span class="cx">
</span><del>- return wkQTMovieMaxTimeSeekable(m_qtMovie.get());
</del><ins>+ NSArray* seekableRanges = [m_qtMovie availableRanges];
+
+ return maxValueForTimeRanges(seekableRanges);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-float MediaPlayerPrivateQTKit::maxTimeLoaded() const
</del><ins>+MediaTime MediaPlayerPrivateQTKit::maxMediaTimeLoaded() const
</ins><span class="cx"> {
</span><span class="cx"> if (!metaDataAvailable())
</span><del>- return 0;
- return wkQTMovieMaxTimeLoaded(m_qtMovie.get());
</del><ins>+ return MediaTime::zeroTime();
+ if ([m_qtMovie respondsToSelector:@selector(loadedRanges)])
+ return maxValueForTimeRanges([m_qtMovie loadedRanges]);
+ return toMediaTime([m_qtMovie maxTimeLoaded]);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool MediaPlayerPrivateQTKit::didLoadingProgress() const
</span><span class="cx"> {
</span><span class="cx"> if (!duration() || !totalBytes())
</span><span class="cx"> return false;
</span><del>- float currentMaxTimeLoaded = maxTimeLoaded();
</del><ins>+ MediaTime currentMaxTimeLoaded = maxMediaTimeLoaded();
</ins><span class="cx"> bool didLoadingProgress = currentMaxTimeLoaded != m_maxTimeLoadedAtLastDidLoadingProgress;
</span><span class="cx"> m_maxTimeLoadedAtLastDidLoadingProgress = currentMaxTimeLoaded;
</span><span class="cx"> return didLoadingProgress;
</span><span class="lines">@@ -1049,9 +1072,9 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // If this movie is reloading and we mean to restore the current time/rate, this might be the right time to do it.
</span><del>- if (loadState >= QTMovieLoadStateLoaded && oldNetworkState < MediaPlayer::Loaded && m_timeToRestore != MediaPlayer::invalidTime()) {
- QTTime qttime = createQTTime(m_timeToRestore);
- m_timeToRestore = MediaPlayer::invalidTime();
</del><ins>+ if (loadState >= QTMovieLoadStateLoaded && oldNetworkState < MediaPlayer::Loaded && m_timeToRestore.isValid()) {
+ QTTime qttime = toQTTime(m_timeToRestore);
+ m_timeToRestore = MediaTime::invalidTime();
</ins><span class="cx">
</span><span class="cx"> // Disable event callbacks from setCurrentTime for restoring time in a recreated video
</span><span class="cx"> [m_objcObserver.get() setDelayCallbacks:YES];
</span><span class="lines">@@ -1065,7 +1088,7 @@
</span><span class="cx"> // Note: QT indicates that we are fully loaded with QTMovieLoadStateComplete.
</span><span class="cx"> // However newer versions of QT do not, so we check maxTimeLoaded against duration.
</span><span class="cx"> if (!completelyLoaded && !m_isStreaming && metaDataAvailable())
</span><del>- completelyLoaded = maxTimeLoaded() == duration();
</del><ins>+ completelyLoaded = maxMediaTimeLoaded() == durationMediaTime();
</ins><span class="cx">
</span><span class="cx"> if (completelyLoaded) {
</span><span class="cx"> // "Loaded" is reserved for fully buffered movies, never the case when streaming
</span><span class="lines">@@ -1076,7 +1099,7 @@
</span><span class="cx"> m_networkState = MediaPlayer::Loading;
</span><span class="cx"> } else if (loadState >= QTMovieLoadStatePlayable) {
</span><span class="cx"> // FIXME: This might not work correctly in streaming case, <rdar://problem/5693967>
</span><del>- m_readyState = currentTime() < maxTimeLoaded() ? MediaPlayer::HaveFutureData : MediaPlayer::HaveCurrentData;
</del><ins>+ m_readyState = currentMediaTime() < maxMediaTimeLoaded() ? MediaPlayer::HaveFutureData : MediaPlayer::HaveCurrentData;
</ins><span class="cx"> m_networkState = MediaPlayer::Loading;
</span><span class="cx"> } else if (loadState >= QTMovieLoadStateLoaded) {
</span><span class="cx"> m_readyState = MediaPlayer::HaveMetadata;
</span><span class="lines">@@ -1094,7 +1117,7 @@
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- float loaded = maxTimeLoaded();
</del><ins>+ MediaTime loaded = maxMediaTimeLoaded();
</ins><span class="cx"> if (!loaded)
</span><span class="cx"> m_readyState = MediaPlayer::HaveNothing;
</span><span class="cx">
</span><span class="lines">@@ -1102,7 +1125,7 @@
</span><span class="cx"> m_networkState = MediaPlayer::FormatError;
</span><span class="cx"> else {
</span><span class="cx"> // FIXME: We should differentiate between load/network errors and decode errors <rdar://problem/5605692>
</span><del>- if (loaded > 0)
</del><ins>+ if (loaded > MediaTime::zeroTime())
</ins><span class="cx"> m_networkState = MediaPlayer::DecodeError;
</span><span class="cx"> else
</span><span class="cx"> m_readyState = MediaPlayer::HaveNothing;
</span><span class="lines">@@ -1126,9 +1149,9 @@
</span><span class="cx"> m_player->readyStateChanged();
</span><span class="cx">
</span><span class="cx"> if (loadState >= QTMovieLoadStateLoaded) {
</span><del>- float dur = duration();
</del><ins>+ MediaTime dur = durationMediaTime();
</ins><span class="cx"> if (dur != m_reportedDuration) {
</span><del>- if (m_reportedDuration != MediaPlayer::invalidTime())
</del><ins>+ if (m_reportedDuration.isValid())
</ins><span class="cx"> m_player->durationChanged();
</span><span class="cx"> m_reportedDuration = dur;
</span><span class="cx"> }
</span><span class="lines">@@ -1179,10 +1202,10 @@
</span><span class="cx"> // It may not be possible to seek to a specific time in a streamed movie. When seeking in a
</span><span class="cx"> // stream QuickTime sets the movie time to closest time possible and posts a timechanged
</span><span class="cx"> // notification. Update m_seekTo so we can detect when the seek completes.
</span><del>- if (m_seekTo != -1)
- m_seekTo = currentTime();
</del><ins>+ if (!m_seekTo.isValid())
+ m_seekTo = currentMediaTime();
</ins><span class="cx">
</span><del>- m_timeToRestore = MediaPlayer::invalidTime();
</del><ins>+ m_timeToRestore = MediaTime::invalidTime();
</ins><span class="cx"> updateStates();
</span><span class="cx"> m_player->timeChanged();
</span><span class="cx"> }
</span><span class="lines">@@ -1202,8 +1225,8 @@
</span><span class="cx"> // are at the end. Do this because QuickTime sometimes reports one time for duration and stops
</span><span class="cx"> // playback at another time, which causes problems in HTMLMediaElement. QTKit's 'ended' event
</span><span class="cx"> // fires when playing in reverse so don't update duration when at time zero!
</span><del>- float now = currentTime();
- if (now > 0)
</del><ins>+ MediaTime now = currentMediaTime();
+ if (now > MediaTime::zeroTime())
</ins><span class="cx"> m_cachedDuration = now;
</span><span class="cx">
</span><span class="cx"> updateStates();
</span><span class="lines">@@ -1647,15 +1670,6 @@
</span><span class="cx"> [m_qtMovie.get() setAttribute:[NSNumber numberWithBool:NO] forKey:@"QTMovieLimitReadAheadAttribute"];
</span><span class="cx"> }
</span><span class="cx">
</span><del>-float MediaPlayerPrivateQTKit::mediaTimeForTimeValue(float timeValue) const
-{
- if (!metaDataAvailable())
- return timeValue;
-
- QTTime qttime = createQTTime(timeValue);
- return static_cast<float>(qttime.timeValue) / qttime.timeScale;
-}
-
</del><span class="cx"> void MediaPlayerPrivateQTKit::setPrivateBrowsingMode(bool privateBrowsing)
</span><span class="cx"> {
</span><span class="cx"> m_privateBrowsing = privateBrowsing;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacMediaTimeQTKithfromrev173317trunkSourceWebCoreplatformgraphicsavfoundationobjcOutOfBandTextTrackPrivateAVFh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/graphics/mac/MediaTimeQTKit.h (from rev 173317, trunk/Source/WebCore/platform/graphics/avfoundation/objc/OutOfBandTextTrackPrivateAVF.h) (0 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/MediaTimeQTKit.h         (rev 0)
+++ trunk/Source/WebCore/platform/graphics/mac/MediaTimeQTKit.h        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -0,0 +1,43 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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.
+ */
+
+#ifndef MediaTimeQTKit_h
+#define MediaTimeQTKit_h
+
+#if PLATFORM(MAC)
+
+#include <QTKit/QTTime.h>
+#include <wtf/MediaTime.h>
+
+namespace WebCore {
+
+QTTime toQTTime(const MediaTime&);
+MediaTime toMediaTime(const QTTime&);
+
+}
+
+#endif
+
+#endif // MediaTimeQTKit_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacMediaTimeQTKitmmfromrev173317trunkSourceWebCoreplatformgraphicsavfoundationobjcOutOfBandTextTrackPrivateAVFh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/graphics/mac/MediaTimeQTKit.mm (from rev 173317, trunk/Source/WebCore/platform/graphics/avfoundation/objc/OutOfBandTextTrackPrivateAVF.h) (0 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/MediaTimeQTKit.mm         (rev 0)
+++ trunk/Source/WebCore/platform/graphics/mac/MediaTimeQTKit.mm        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -0,0 +1,64 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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"
+#include "MediaTimeQTKit.h"
+
+#if PLATFORM(MAC)
+
+#import "SoftLinking.h"
+#import <QTKit/QTTime.h>
+
+SOFT_LINK_FRAMEWORK(QTKit);
+SOFT_LINK_CONSTANT(QTKit, QTIndefiniteTime, QTTime);
+SOFT_LINK_CONSTANT(QTKit, QTZeroTime, QTTime);
+SOFT_LINK(QTKit, QTTimeCompare, NSComparisonResult, (QTTime time, QTTime otherTime), (time, otherTime));
+SOFT_LINK(QTKit, QTMakeTime, QTTime, (long long timeValue, long timeScale), (timeValue, timeScale));
+
+namespace WebCore {
+
+MediaTime toMediaTime(const QTTime& qtTime)
+{
+ if (qtTime.flags & kQTTimeIsIndefinite)
+ return MediaTime::indefiniteTime();
+ return MediaTime(qtTime.timeValue, qtTime.timeScale);
+}
+
+QTTime toQTTime(const MediaTime& mediaTime)
+{
+ if (mediaTime.isIndefinite() || mediaTime.isInvalid())
+ return getQTIndefiniteTime();
+ if (!mediaTime)
+ return getQTZeroTime();
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+ return QTMakeTime(mediaTime.timeValue(), mediaTime.timeScale());
+#pragma clang diagnostic pop
+}
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformmacMediaTimeMaccpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/mac/MediaTimeMac.cpp (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/MediaTimeMac.cpp        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/platform/mac/MediaTimeMac.cpp        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -1,68 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "MediaTimeMac.h"
-
-#if USE(COREMEDIA)
-
-namespace WebCore {
-
-MediaTime toMediaTime(const CMTime& cmTime)
-{
- uint32_t flags = 0;
- if (CMTIME_IS_VALID(cmTime))
- flags |= MediaTime::Valid;
- if (CMTIME_HAS_BEEN_ROUNDED(cmTime))
- flags |= MediaTime::HasBeenRounded;
- if (CMTIME_IS_POSITIVE_INFINITY(cmTime))
- flags |= MediaTime::PositiveInfinite;
- if (CMTIME_IS_NEGATIVE_INFINITY(cmTime))
- flags |= MediaTime::NegativeInfinite;
- if (CMTIME_IS_INDEFINITE(cmTime))
- flags |= MediaTime::Indefinite;
-
- return MediaTime(cmTime.value, cmTime.timescale, flags);
-}
-
-CMTime toCMTime(const MediaTime& mediaTime)
-{
- CMTime time = {mediaTime.timeValue(), mediaTime.timeScale(), 0, 0};
-
- if (mediaTime.isValid())
- time.flags |= kCMTimeFlags_Valid;
- if (mediaTime.hasBeenRounded())
- time.flags |= kCMTimeFlags_HasBeenRounded;
- if (mediaTime.isPositiveInfinite())
- time.flags |= kCMTimeFlags_PositiveInfinity;
- if (mediaTime.isNegativeInfinite())
- time.flags |= kCMTimeFlags_NegativeInfinity;
-
- return time;
-}
-
-}
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformmacMediaTimeMach"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/mac/MediaTimeMac.h (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/MediaTimeMac.h        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/platform/mac/MediaTimeMac.h        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -1,43 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef MediaTimeMac_h
-#define MediaTimeMac_h
-
-#if USE(COREMEDIA)
-
-#include <CoreMedia/CMTime.h>
-#include <wtf/MediaTime.h>
-
-namespace WebCore {
-
-CMTime toCMTime(const MediaTime&);
-MediaTime toMediaTime(const CMTime&);
-
-}
-
-#endif
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformmacPlatformClockCMmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/PlatformClockCM.mm (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/PlatformClockCM.mm        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/platform/mac/PlatformClockCM.mm        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -29,7 +29,7 @@
</span><span class="cx">
</span><span class="cx"> #import "PlatformClockCM.h"
</span><span class="cx">
</span><del>-#import "MediaTimeMac.h"
</del><ins>+#import "MediaTimeAVFoundation.h"
</ins><span class="cx"> #import "SoftLinking.h"
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> #import <CoreMedia/CMAudioClock.h>
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmockmediasourceMockMediaPlayerMediaSourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -159,9 +159,9 @@
</span><span class="cx"> return m_readyState;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-double MockMediaPlayerMediaSource::maxTimeSeekableDouble() const
</del><ins>+MediaTime MockMediaPlayerMediaSource::maxMediaTimeSeekable() const
</ins><span class="cx"> {
</span><del>- return m_duration.toDouble();
</del><ins>+ return m_duration;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> std::unique_ptr<PlatformTimeRanges> MockMediaPlayerMediaSource::buffered() const
</span><span class="lines">@@ -185,23 +185,23 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-double MockMediaPlayerMediaSource::currentTimeDouble() const
</del><ins>+MediaTime MockMediaPlayerMediaSource::currentMediaTime() const
</ins><span class="cx"> {
</span><del>- return m_currentTime.toDouble();
</del><ins>+ return m_currentTime;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-double MockMediaPlayerMediaSource::durationDouble() const
</del><ins>+MediaTime MockMediaPlayerMediaSource::durationMediaTime() const
</ins><span class="cx"> {
</span><del>- return m_mediaSourcePrivate ? m_mediaSourcePrivate->duration() : 0;
</del><ins>+ return m_mediaSourcePrivate ? m_mediaSourcePrivate->duration() : MediaTime::zeroTime();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void MockMediaPlayerMediaSource::seekWithTolerance(double time, double negativeTolerance, double positiveTolerance)
</del><ins>+void MockMediaPlayerMediaSource::seekWithTolerance(const MediaTime& time, const MediaTime& negativeTolerance, const MediaTime& positiveTolerance)
</ins><span class="cx"> {
</span><span class="cx"> if (!negativeTolerance && !positiveTolerance) {
</span><del>- m_currentTime = MediaTime::createWithDouble(time);
- m_mediaSourcePrivate->seekToTime(MediaTime::createWithDouble(time));
</del><ins>+ m_currentTime = time;
+ m_mediaSourcePrivate->seekToTime(time);
</ins><span class="cx"> } else
</span><del>- m_currentTime = m_mediaSourcePrivate->seekToTime(MediaTime::createWithDouble(time), MediaTime::createWithDouble(negativeTolerance), MediaTime::createWithDouble(positiveTolerance));
</del><ins>+ m_currentTime = m_mediaSourcePrivate->seekToTime(time, negativeTolerance, positiveTolerance);
</ins><span class="cx">
</span><span class="cx"> if (m_seekCompleted) {
</span><span class="cx"> m_player->timeChanged();
</span><span class="lines">@@ -285,9 +285,9 @@
</span><span class="cx"> return m_mediaSourcePrivate ? m_mediaSourcePrivate->corruptedVideoFrames() : 0;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-double MockMediaPlayerMediaSource::totalFrameDelay()
</del><ins>+MediaTime MockMediaPlayerMediaSource::totalFrameDelay()
</ins><span class="cx"> {
</span><del>- return m_mediaSourcePrivate ? m_mediaSourcePrivate->totalFrameDelay() : 0;
</del><ins>+ return m_mediaSourcePrivate ? m_mediaSourcePrivate->totalFrameDelay() : MediaTime::zeroTime();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmockmediasourceMockMediaPlayerMediaSourceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -71,18 +71,18 @@
</span><span class="cx"> virtual bool seeking() const override;
</span><span class="cx"> virtual bool paused() const override;
</span><span class="cx"> virtual MediaPlayer::NetworkState networkState() const override;
</span><del>- virtual double maxTimeSeekableDouble() const override;
</del><ins>+ virtual MediaTime maxMediaTimeSeekable() const override;
</ins><span class="cx"> virtual std::unique_ptr<PlatformTimeRanges> buffered() const override;
</span><span class="cx"> virtual bool didLoadingProgress() const override;
</span><span class="cx"> virtual void setSize(const IntSize&) override;
</span><span class="cx"> virtual void paint(GraphicsContext*, const IntRect&) override;
</span><del>- virtual double currentTimeDouble() const override;
- virtual double durationDouble() const override;
- virtual void seekWithTolerance(double time, double, double) override;
</del><ins>+ virtual MediaTime currentMediaTime() const override;
+ virtual MediaTime durationMediaTime() const override;
+ virtual void seekWithTolerance(const MediaTime&, const MediaTime&, const MediaTime&) override;
</ins><span class="cx"> virtual unsigned long totalVideoFrames() override;
</span><span class="cx"> virtual unsigned long droppedVideoFrames() override;
</span><span class="cx"> virtual unsigned long corruptedVideoFrames() override;
</span><del>- virtual double totalFrameDelay() override;
</del><ins>+ virtual MediaTime totalFrameDelay() override;
</ins><span class="cx">
</span><span class="cx"> MediaPlayer* m_player;
</span><span class="cx"> RefPtr<MockMediaSourcePrivate> m_mediaSourcePrivate;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmockmediasourceMockMediaSourcePrivatecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.cpp (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.cpp        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.cpp        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -50,7 +50,6 @@
</span><span class="cx"> , m_totalVideoFrames(0)
</span><span class="cx"> , m_droppedVideoFrames(0)
</span><span class="cx"> , m_corruptedVideoFrames(0)
</span><del>- , m_totalFrameDelay(0)
</del><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -87,7 +86,7 @@
</span><span class="cx"> m_sourceBuffers.remove(pos);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-double MockMediaSourcePrivate::duration()
</del><ins>+MediaTime MockMediaSourcePrivate::duration()
</ins><span class="cx"> {
</span><span class="cx"> return m_client->duration();
</span><span class="cx"> }
</span><span class="lines">@@ -99,7 +98,7 @@
</span><span class="cx">
</span><span class="cx"> void MockMediaSourcePrivate::durationChanged()
</span><span class="cx"> {
</span><del>- m_player->updateDuration(MediaTime::createWithDouble(duration()));
</del><ins>+ m_player->updateDuration(duration());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void MockMediaSourcePrivate::markEndOfStream(EndOfStreamStatus status)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmockmediasourceMockMediaSourcePrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.h (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.h        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.h        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -47,7 +47,7 @@
</span><span class="cx"> bool hasAudio() const;
</span><span class="cx"> bool hasVideo() const;
</span><span class="cx">
</span><del>- double duration();
</del><ins>+ MediaTime duration();
</ins><span class="cx"> std::unique_ptr<PlatformTimeRanges> buffered();
</span><span class="cx">
</span><span class="cx"> MockMediaPlayerMediaSource* player() const { return m_player; }
</span><span class="lines">@@ -58,12 +58,12 @@
</span><span class="cx"> unsigned long totalVideoFrames() const { return m_totalVideoFrames; }
</span><span class="cx"> unsigned long droppedVideoFrames() const { return m_droppedVideoFrames; }
</span><span class="cx"> unsigned long corruptedVideoFrames() const { return m_corruptedVideoFrames; }
</span><del>- double totalFrameDelay() const { return m_totalFrameDelay; }
</del><ins>+ MediaTime totalFrameDelay() const { return m_totalFrameDelay; }
</ins><span class="cx">
</span><span class="cx"> void incrementTotalVideoFrames() { ++m_totalVideoFrames; }
</span><span class="cx"> void incrementDroppedFrames() { ++m_droppedVideoFrames; }
</span><span class="cx"> void incrementCorruptedFrames() { ++m_corruptedVideoFrames; }
</span><del>- void incrementTotalFrameDelayBy(double delay) { m_totalFrameDelay += delay; }
</del><ins>+ void incrementTotalFrameDelayBy(const MediaTime& delay) { m_totalFrameDelay += delay; }
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> MockMediaSourcePrivate(MockMediaPlayerMediaSource*, MediaSourcePrivateClient*);
</span><span class="lines">@@ -92,7 +92,7 @@
</span><span class="cx"> unsigned long m_totalVideoFrames;
</span><span class="cx"> unsigned long m_droppedVideoFrames;
</span><span class="cx"> unsigned long m_corruptedVideoFrames;
</span><del>- double m_totalFrameDelay;
</del><ins>+ MediaTime m_totalFrameDelay;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmockmediasourceMockSourceBufferPrivatecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -238,7 +238,7 @@
</span><span class="cx"> if (box->isDropped())
</span><span class="cx"> m_mediaSource->incrementDroppedFrames();
</span><span class="cx"> if (box->isDelayed())
</span><del>- m_mediaSource->incrementTotalFrameDelayBy(1);
</del><ins>+ m_mediaSource->incrementTotalFrameDelayBy(MediaTime(1, 1));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool MockSourceBufferPrivate::hasVideo() const
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacTiledCoreAnimationDrawingAreamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm (173317 => 173318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm        2014-09-05 18:33:29 UTC (rev 173317)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm        2014-09-05 18:38:59 UTC (rev 173318)
</span><span class="lines">@@ -324,8 +324,8 @@
</span><span class="cx"> ASSERT(!m_isPaintingSuspended);
</span><span class="cx"> m_isPaintingSuspended = true;
</span><span class="cx">
</span><del>- [m_hostingLayer setValue:@YES forKey:@"NSCAViewRenderPaused"];
- [[NSNotificationCenter defaultCenter] postNotificationName:@"NSCAViewRenderDidPauseNotification" object:nil userInfo:[NSDictionary dictionaryWithObject:m_hostingLayer.get() forKey:@"layer"]];
</del><ins>+// [m_hostingLayer setValue:@YES forKey:@"NSCAViewRenderPaused"];
+// [[NSNotificationCenter defaultCenter] postNotificationName:@"NSCAViewRenderDidPauseNotification" object:nil userInfo:[NSDictionary dictionaryWithObject:m_hostingLayer.get() forKey:@"layer"]];
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void TiledCoreAnimationDrawingArea::resumePainting()
</span><span class="lines">@@ -337,8 +337,8 @@
</span><span class="cx"> }
</span><span class="cx"> m_isPaintingSuspended = false;
</span><span class="cx">
</span><del>- [m_hostingLayer setValue:@NO forKey:@"NSCAViewRenderPaused"];
- [[NSNotificationCenter defaultCenter] postNotificationName:@"NSCAViewRenderDidResumeNotification" object:nil userInfo:[NSDictionary dictionaryWithObject:m_hostingLayer.get() forKey:@"layer"]];
</del><ins>+// [m_hostingLayer setValue:@NO forKey:@"NSCAViewRenderPaused"];
+// [[NSNotificationCenter defaultCenter] postNotificationName:@"NSCAViewRenderDidResumeNotification" object:nil userInfo:[NSDictionary dictionaryWithObject:m_hostingLayer.get() forKey:@"layer"]];
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void TiledCoreAnimationDrawingArea::setExposedRect(const FloatRect& exposedRect)
</span></span></pre>
</div>
</div>
</body>
</html>