Changeset 148099 in webkit
- Timestamp:
- Apr 10, 2013, 9:25:14 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 32 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r148098 r148099 1 2013-04-10 Eric Carlson <eric.carlson@apple.com> 2 3 Update all float attributes in HTMLMediaElement to double 4 https://bugs.webkit.org/show_bug.cgi?id=113615 5 6 Reviewed by Geoffrey Garen 7 Patch by Aaron Colwell 8 9 No new tests. Primary behavior doesn't change. Just time, playbackRate, and volume precision. 10 All existing LayoutTests/media tests still pass. 11 12 * WebCore.exp.in: Remove function that no longer need to be exported. 13 14 * html/HTMLMediaElement.cpp: Change all float attributes to double. 15 * html/HTMLMediaElement.h: Ditto. 16 * html/HTMLMediaElement.idl: Ditto. 17 * html/MediaController.cpp: Ditto. 18 * html/MediaController.h: Ditto. 19 * html/MediaControllerInterface.h: Ditto. 20 * html/TimeRanges.cpp: Ditto. 21 * html/TimeRanges.idl: Ditto. 22 * html/shadow/MediaControlElementTypes.cpp: Ditto. 23 * html/shadow/MediaControlElementTypes.h: Ditto. 24 * html/shadow/MediaControlElements.cpp: Ditto. 25 * html/shadow/MediaControlElements.h: Ditto. 26 * html/shadow/MediaControls.cpp: Ditto. 27 * html/shadow/MediaControlsApple.cpp: Ditto. 28 * html/shadow/MediaControlsBlackBerry.cpp: Ditto. 29 * html/shadow/MediaControlsBlackBerry.h: Ditto. 30 * html/shadow/MediaControlsGtk.cpp: Ditto. 31 * html/track/TextTrackCue.cpp: Ditto. 32 * html/track/TextTrackCue.h: Ditto. 33 * platform/Clock.h: Ditto. 34 * platform/ClockGeneric.cpp: Ditto. 35 * platform/ClockGeneric.h: Ditto. 36 * platform/graphics/MediaPlayer.cpp: Ditto. 37 * platform/graphics/MediaPlayer.h: Ditto. 38 * platform/graphics/MediaPlayerPrivate.h: Ditto. 39 * platform/mac/PlatformClockCA.cpp: Ditto. 40 * platform/mac/PlatformClockCA.h: Ditto. 41 * platform/mac/PlatformClockCM.h: Ditto. 42 * platform/mac/PlatformClockCM.mm: Ditto. 43 1 44 2013-04-10 Patrick Gansterer <paroga@webkit.org> 2 45 -
trunk/Source/WebCore/WebCore.exp.in
r147952 r148099 2668 2668 __ZN7WebCore16HTMLMediaElement14beginScrubbingEv 2669 2669 __ZN7WebCore16HTMLMediaElement14exitFullscreenEv 2670 __ZN7WebCore16HTMLMediaElement14setCurrentTimeEfRi2671 2670 __ZN7WebCore16HTMLMediaElement15clearMediaCacheEv 2672 2671 __ZN7WebCore16HTMLMediaElement20getSitesInMediaCacheERN3WTF6VectorINS1_6StringELm0ENS1_15CrashOnOverflowEEE … … 2674 2673 __ZN7WebCore16HTMLMediaElement4playEv 2675 2674 __ZN7WebCore16HTMLMediaElement5pauseEv 2676 __ZN7WebCore16HTMLMediaElement6rewindEf2677 2675 __ZN7WebCore16HTMLMediaElement8setMutedEb 2678 __ZN7WebCore16HTMLMediaElement9setVolumeEfRi2679 2676 __ZNK7WebCore16HTMLMediaElement11currentTimeEv 2680 2677 __ZNK7WebCore16HTMLMediaElement13platformMediaEv -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r148050 r148099 253 253 , m_previousProgressTime(numeric_limits<double>::max()) 254 254 , m_lastTimeUpdateEventWallTime(0) 255 , m_lastTimeUpdateEventMovieTime(numeric_limits< float>::max())255 , m_lastTimeUpdateEventMovieTime(numeric_limits<double>::max()) 256 256 , m_loadState(WaitingForSource) 257 257 #if ENABLE(PLUGIN_PROXY_FOR_VIDEO) … … 1080 1080 1081 1081 1082 void HTMLMediaElement::updateActiveTextTrackCues( floatmovieTime)1082 void HTMLMediaElement::updateActiveTextTrackCues(double movieTime) 1083 1083 { 1084 1084 // 4.8.10.8 Playing the media resource … … 1115 1115 // algorithm was last run for this media element, if this is not the first 1116 1116 // time it has run. 1117 floatlastTime = m_lastTextTrackUpdateTime;1117 double lastTime = m_lastTextTrackUpdateTime; 1118 1118 1119 1119 // 4 - If the current playback position has, since the last time this … … 1128 1128 1129 1129 for (size_t i = 0; i < potentiallySkippedCues.size(); ++i) { 1130 floatcueStartTime = potentiallySkippedCues[i].low();1131 floatcueEndTime = potentiallySkippedCues[i].high();1130 double cueStartTime = potentiallySkippedCues[i].low(); 1131 double cueEndTime = potentiallySkippedCues[i].high(); 1132 1132 1133 1133 // Consider cues that may have been missed since the last seek time. … … 2010 2010 } 2011 2011 2012 void HTMLMediaElement::rewind( floattimeDelta)2012 void HTMLMediaElement::rewind(double timeDelta) 2013 2013 { 2014 2014 LOG(Media, "HTMLMediaElement::rewind(%f)", timeDelta); … … 2022 2022 } 2023 2023 2024 void HTMLMediaElement::addPlayedRange( float start, floatend)2024 void HTMLMediaElement::addPlayedRange(double start, double end) 2025 2025 { 2026 2026 LOG(Media, "HTMLMediaElement::addPlayedRange(%f, %f)", start, end); … … 2049 2049 } 2050 2050 2051 void HTMLMediaElement::seek( floattime, ExceptionCode& ec)2051 void HTMLMediaElement::seek(double time, ExceptionCode& ec) 2052 2052 { 2053 2053 LOG(Media, "HTMLMediaElement::seek(%f)", time); … … 2067 2067 // Get the current time before setting m_seeking, m_lastSeekTime is returned once it is set. 2068 2068 refreshCachedTime(); 2069 floatnow = currentTime();2069 double now = currentTime(); 2070 2070 2071 2071 // 2 - If the element's seeking IDL attribute is true, then another instance of this algorithm is … … 2083 2083 2084 2084 // 6 - If the new playback position is less than the earliest possible position, let it be that position instead. 2085 floatearliestTime = m_player->startTime();2085 double earliestTime = m_player->startTime(); 2086 2086 time = max(time, earliestTime); 2087 2087 … … 2092 2092 // fire a 'seeked' event. 2093 2093 #if !LOG_DISABLED 2094 floatmediaTime = m_player->mediaTimeForTimeValue(time);2094 double mediaTime = m_player->mediaTimeForTimeValue(time); 2095 2095 if (time != mediaTime) 2096 2096 LOG(Media, "HTMLMediaElement::seek(%f) - media timeline equivalent is %f", time, mediaTime); … … 2199 2199 2200 2200 // playback state 2201 floatHTMLMediaElement::currentTime() const2201 double HTMLMediaElement::currentTime() const 2202 2202 { 2203 2203 #if LOG_CACHED_TIME_WARNINGS … … 2215 2215 if (m_cachedTime != MediaPlayer::invalidTime() && m_paused) { 2216 2216 #if LOG_CACHED_TIME_WARNINGS 2217 floatdelta = m_cachedTime - m_player->currentTime();2217 double delta = m_cachedTime - m_player->currentTime(); 2218 2218 if (delta > minCachedDeltaForWarning) 2219 2219 LOG(Media, "HTMLMediaElement::currentTime - WARNING, cached time is %f seconds off of media time when paused", delta); … … 2231 2231 // Not too soon, use the cached time only if it hasn't expired. 2232 2232 if (wallClockDelta < maximumDurationToCacheMediaTime) { 2233 float adjustedCacheTime = static_cast<float>(m_cachedTime + (m_playbackRate * wallClockDelta));2233 double adjustedCacheTime = m_cachedTime + (m_playbackRate * wallClockDelta); 2234 2234 2235 2235 #if LOG_CACHED_TIME_WARNINGS 2236 floatdelta = adjustedCacheTime - m_player->currentTime();2236 double delta = adjustedCacheTime - m_player->currentTime(); 2237 2237 if (delta > minCachedDeltaForWarning) 2238 2238 LOG(Media, "HTMLMediaElement::currentTime - WARNING, cached time is %f seconds off of media time when playing", delta); … … 2245 2245 if (maximumDurationToCacheMediaTime && now > m_minimumWallClockTimeToCacheMediaTime && m_cachedTime != MediaPlayer::invalidTime()) { 2246 2246 double wallClockDelta = now - m_cachedTimeWallClockUpdateTime; 2247 floatdelta = m_cachedTime + (m_playbackRate * wallClockDelta) - m_player->currentTime();2247 double delta = m_cachedTime + (m_playbackRate * wallClockDelta) - m_player->currentTime(); 2248 2248 LOG(Media, "HTMLMediaElement::currentTime - cached time was %f seconds off of media time when it expired", delta); 2249 2249 } … … 2255 2255 } 2256 2256 2257 void HTMLMediaElement::setCurrentTime( floattime, ExceptionCode& ec)2257 void HTMLMediaElement::setCurrentTime(double time, ExceptionCode& ec) 2258 2258 { 2259 2259 if (m_mediaController) { … … 2264 2264 } 2265 2265 2266 floatHTMLMediaElement::startTime() const2266 double HTMLMediaElement::startTime() const 2267 2267 { 2268 2268 if (!m_player) … … 2282 2282 } 2283 2283 2284 floatHTMLMediaElement::duration() const2284 double HTMLMediaElement::duration() const 2285 2285 { 2286 2286 if (m_player && m_readyState >= HAVE_METADATA) 2287 2287 return m_player->duration(); 2288 2288 2289 return numeric_limits< float>::quiet_NaN();2289 return numeric_limits<double>::quiet_NaN(); 2290 2290 } 2291 2291 … … 2295 2295 } 2296 2296 2297 floatHTMLMediaElement::defaultPlaybackRate() const2297 double HTMLMediaElement::defaultPlaybackRate() const 2298 2298 { 2299 2299 return m_defaultPlaybackRate; 2300 2300 } 2301 2301 2302 void HTMLMediaElement::setDefaultPlaybackRate( floatrate)2302 void HTMLMediaElement::setDefaultPlaybackRate(double rate) 2303 2303 { 2304 2304 if (m_defaultPlaybackRate != rate) { … … 2308 2308 } 2309 2309 2310 floatHTMLMediaElement::playbackRate() const2310 double HTMLMediaElement::playbackRate() const 2311 2311 { 2312 2312 return m_playbackRate; 2313 2313 } 2314 2314 2315 void HTMLMediaElement::setPlaybackRate( floatrate)2315 void HTMLMediaElement::setPlaybackRate(double rate) 2316 2316 { 2317 2317 LOG(Media, "HTMLMediaElement::setPlaybackRate(%f)", rate); … … 2329 2329 void HTMLMediaElement::updatePlaybackRate() 2330 2330 { 2331 floateffectiveRate = m_mediaController ? m_mediaController->playbackRate() : m_playbackRate;2331 double effectiveRate = m_mediaController ? m_mediaController->playbackRate() : m_playbackRate; 2332 2332 if (m_player && potentiallyPlaying() && m_player->rate() != effectiveRate) 2333 2333 m_player->setRate(effectiveRate); … … 2625 2625 } 2626 2626 2627 floatHTMLMediaElement::volume() const2627 double HTMLMediaElement::volume() const 2628 2628 { 2629 2629 return m_volume; 2630 2630 } 2631 2631 2632 void HTMLMediaElement::setVolume( floatvol, ExceptionCode& ec)2632 void HTMLMediaElement::setVolume(double vol, ExceptionCode& ec) 2633 2633 { 2634 2634 LOG(Media, "HTMLMediaElement::setVolume(%f)", vol); … … 2759 2759 // Some media engines make multiple "time changed" callbacks at the same time, but we only want one 2760 2760 // event at a given time so filter here 2761 floatmovieTime = currentTime();2761 double movieTime = currentTime(); 2762 2762 if (movieTime != m_lastTimeUpdateEventMovieTime) { 2763 2763 scheduleEvent(eventNames().timeupdateEvent); … … 2772 2772 } 2773 2773 2774 floatHTMLMediaElement::percentLoaded() const2774 double HTMLMediaElement::percentLoaded() const 2775 2775 { 2776 2776 if (!m_player) 2777 2777 return 0; 2778 floatduration = m_player->duration();2778 double duration = m_player->duration(); 2779 2779 2780 2780 if (!duration || std::isinf(duration)) 2781 2781 return 0; 2782 2782 2783 floatbuffered = 0;2783 double buffered = 0; 2784 2784 RefPtr<TimeRanges> timeRanges = m_player->buffered(); 2785 2785 for (unsigned i = 0; i < timeRanges->length(); ++i) { 2786 floatstart = timeRanges->start(i, IGNORE_EXCEPTION);2787 floatend = timeRanges->end(i, IGNORE_EXCEPTION);2786 double start = timeRanges->start(i, IGNORE_EXCEPTION); 2787 double end = timeRanges->end(i, IGNORE_EXCEPTION); 2788 2788 buffered += end - start; 2789 2789 } … … 3463 3463 scheduleTimeupdateEvent(false); 3464 3464 3465 floatnow = currentTime();3466 floatdur = duration();3465 double now = currentTime(); 3466 double dur = duration(); 3467 3467 3468 3468 // When the current playback position reaches the end of the media resource when the direction of … … 3506 3506 beginProcessingMediaPlayerCallback(); 3507 3507 if (m_player) { 3508 floatvol = m_player->volume();3508 double vol = m_player->volume(); 3509 3509 if (vol != m_volume) { 3510 3510 m_volume = vol; … … 3535 3535 mediaPlayerCharacteristicChanged(player); 3536 3536 3537 floatnow = currentTime();3538 floatdur = duration();3537 double now = currentTime(); 3538 double dur = duration(); 3539 3539 if (now > dur) 3540 3540 seek(dur, IGNORE_EXCEPTION); … … 3691 3691 { 3692 3692 if (m_playing) { 3693 floattime = currentTime();3693 double time = currentTime(); 3694 3694 if (time > m_lastSeekTime) 3695 3695 addPlayedRange(m_lastSeekTime, time); … … 3723 3723 bool HTMLMediaElement::endedPlayback() const 3724 3724 { 3725 floatdur = duration();3725 double dur = duration(); 3726 3726 if (!m_player || std::isnan(dur)) 3727 3727 return false; … … 3737 3737 // of playback is forwards, Either the media element does not have a loop attribute specified, 3738 3738 // or the media element has a current media controller. 3739 floatnow = currentTime();3739 double now = currentTime(); 3740 3740 if (m_playbackRate > 0) 3741 3741 return dur > 0 && now >= dur && (!loop() || m_mediaController); … … 3766 3766 } 3767 3767 3768 floatHTMLMediaElement::minTimeSeekable() const3768 double HTMLMediaElement::minTimeSeekable() const 3769 3769 { 3770 3770 return 0; 3771 3771 } 3772 3772 3773 floatHTMLMediaElement::maxTimeSeekable() const3773 double HTMLMediaElement::maxTimeSeekable() const 3774 3774 { 3775 3775 return m_player ? m_player->maxTimeSeekable() : 0; … … 3784 3784 if (!processingMediaPlayerCallback()) { 3785 3785 Page* page = document()->page(); 3786 floatvolumeMultiplier = page ? page->mediaVolume() : 1;3786 double volumeMultiplier = page ? page->mediaVolume() : 1; 3787 3787 bool shouldMute = m_muted; 3788 3788 … … 3849 3849 m_playbackProgressTimer.stop(); 3850 3850 m_playing = false; 3851 floattime = currentTime();3851 double time = currentTime(); 3852 3852 if (time > m_lastSeekTime) 3853 3853 addPlayedRange(m_lastSeekTime, time); … … 4713 4713 // position relative to the MediaController's timeline or after the end of the media resource 4714 4714 // relative to the MediaController's timeline. 4715 floatmediaControllerPosition = m_mediaController->currentTime();4715 double mediaControllerPosition = m_mediaController->currentTime(); 4716 4716 if (mediaControllerPosition < startTime() || mediaControllerPosition > startTime() + duration()) 4717 4717 return true; … … 4723 4723 { 4724 4724 MediaFragmentURIParser fragmentParser(m_currentSrc); 4725 floatdur = duration();4725 double dur = duration(); 4726 4726 4727 4727 double start = fragmentParser.startTime(); -
trunk/Source/WebCore/html/HTMLMediaElement.h
r147675 r148099 98 98 virtual bool hasAudio() const; 99 99 100 void rewind( floattimeDelta);100 void rewind(double timeDelta); 101 101 void returnToRealtime(); 102 102 … … 147 147 148 148 // playback state 149 floatcurrentTime() const;150 void setCurrentTime( float, ExceptionCode&);149 double currentTime() const; 150 void setCurrentTime(double, ExceptionCode&); 151 151 double initialTime() const; 152 floatstartTime() const;153 floatduration() const;152 double startTime() const; 153 double duration() const; 154 154 bool paused() const; 155 floatdefaultPlaybackRate() const;156 void setDefaultPlaybackRate( float);157 floatplaybackRate() const;158 void setPlaybackRate( float);155 double defaultPlaybackRate() const; 156 void setDefaultPlaybackRate(double); 157 double playbackRate() const; 158 void setPlaybackRate(double); 159 159 void updatePlaybackRate(); 160 160 bool webkitPreservesPitch() const; … … 209 209 bool controls() const; 210 210 void setControls(bool); 211 floatvolume() const;212 void setVolume( float, ExceptionCode&);211 double volume() const; 212 void setVolume(double, ExceptionCode&); 213 213 bool muted() const; 214 214 void setMuted(bool); … … 220 220 bool canPlay() const; 221 221 222 floatpercentLoaded() const;222 double percentLoaded() const; 223 223 224 224 #if ENABLE(VIDEO_TRACK) … … 496 496 void stopPeriodicTimers(); 497 497 498 void seek( floattime, ExceptionCode&);498 void seek(double time, ExceptionCode&); 499 499 void finishSeek(); 500 500 void checkIfSeekNeeded(); 501 void addPlayedRange( float start, floatend);501 void addPlayedRange(double start, double end); 502 502 503 503 void scheduleTimeupdateEvent(bool periodicEvent); … … 523 523 524 524 #if ENABLE(VIDEO_TRACK) 525 void updateActiveTextTrackCues( float);525 void updateActiveTextTrackCues(double); 526 526 HTMLTrackElement* showingTrackWithSameKind(HTMLTrackElement*) const; 527 527 … … 550 550 bool couldPlayIfEnoughData() const; 551 551 552 floatminTimeSeekable() const;553 floatmaxTimeSeekable() const;552 double minTimeSeekable() const; 553 double maxTimeSeekable() const; 554 554 555 555 // Pauses playback without changing any states or generating events 556 556 void setPausedInternal(bool); 557 557 558 void setPlaybackRateInternal( float);558 void setPlaybackRateInternal(double); 559 559 560 560 virtual void mediaCanStart(); … … 600 600 OwnPtr<GenericEventQueue> m_asyncEventQueue; 601 601 602 floatm_playbackRate;603 floatm_defaultPlaybackRate;602 double m_playbackRate; 603 double m_defaultPlaybackRate; 604 604 bool m_webkitPreservesPitch; 605 605 NetworkState m_networkState; … … 610 610 RefPtr<MediaError> m_error; 611 611 612 floatm_volume;613 floatm_lastSeekTime;612 double m_volume; 613 double m_lastSeekTime; 614 614 615 615 unsigned m_previousProgress; … … 620 620 621 621 // The last time a timeupdate event was sent in movie time. 622 floatm_lastTimeUpdateEventMovieTime;622 double m_lastTimeUpdateEventMovieTime; 623 623 624 624 // Loading state. … … 647 647 #endif 648 648 649 mutable floatm_cachedTime;649 mutable double m_cachedTime; 650 650 mutable double m_cachedTimeWallClockUpdateTime; 651 651 mutable double m_minimumWallClockTimeToCacheMediaTime; … … 696 696 bool m_haveVisibleTextTrack : 1; 697 697 bool m_processingPreferenceChange : 1; 698 699 698 float m_lastTextTrackUpdateTime; 699 700 700 CaptionUserPreferences::CaptionDisplayMode m_captionDisplayMode; 701 701 -
trunk/Source/WebCore/html/HTMLMediaElement.idl
r147857 r148099 64 64 65 65 // playback state 66 attribute floatcurrentTime66 attribute double currentTime 67 67 setter raises (DOMException); 68 68 readonly attribute double initialTime; 69 readonly attribute floatstartTime;70 readonly attribute floatduration;69 readonly attribute double startTime; 70 readonly attribute double duration; 71 71 readonly attribute boolean paused; 72 attribute floatdefaultPlaybackRate;73 attribute floatplaybackRate;72 attribute double defaultPlaybackRate; 73 attribute double playbackRate; 74 74 readonly attribute TimeRanges played; 75 75 readonly attribute TimeRanges seekable; … … 82 82 // controls 83 83 attribute boolean controls; 84 attribute floatvolume84 attribute double volume 85 85 setter raises (DOMException); 86 86 attribute boolean muted; -
trunk/Source/WebCore/html/MediaController.cpp
r142810 r148099 130 130 } 131 131 132 floatMediaController::duration() const132 double MediaController::duration() const 133 133 { 134 134 // FIXME: Investigate caching the maximum duration and only updating the cached value 135 135 // when the slaved media elements' durations change. 136 floatmaxDuration = 0;137 for (size_t index = 0; index < m_mediaElements.size(); ++index) { 138 floatduration = m_mediaElements[index]->duration();136 double maxDuration = 0; 137 for (size_t index = 0; index < m_mediaElements.size(); ++index) { 138 double duration = m_mediaElements[index]->duration(); 139 139 if (std::isnan(duration)) 140 140 continue; … … 144 144 } 145 145 146 floatMediaController::currentTime() const146 double MediaController::currentTime() const 147 147 { 148 148 if (m_mediaElements.isEmpty()) … … 151 151 if (m_position == MediaPlayer::invalidTime()) { 152 152 // Some clocks may return times outside the range of [0..duration]. 153 m_position = max(0.0 f, min(duration(), m_clock->currentTime()));153 m_position = max(0.0, min(duration(), m_clock->currentTime())); 154 154 m_clearPositionTimer.startOneShot(0); 155 155 } … … 158 158 } 159 159 160 void MediaController::setCurrentTime( floattime, ExceptionCode& code)160 void MediaController::setCurrentTime(double time, ExceptionCode& code) 161 161 { 162 162 // When the user agent is to seek the media controller to a particular new playback position, 163 163 // it must follow these steps: 164 164 // If the new playback position is less than zero, then set it to zero. 165 time = max(0.0 f, time);165 time = max(0.0, time); 166 166 167 167 // If the new playback position is greater than the media controller duration, then set it … … 218 218 } 219 219 220 void MediaController::setDefaultPlaybackRate( floatrate)220 void MediaController::setDefaultPlaybackRate(double rate) 221 221 { 222 222 if (m_defaultPlaybackRate == rate) … … 231 231 } 232 232 233 floatMediaController::playbackRate() const233 double MediaController::playbackRate() const 234 234 { 235 235 return m_clock->playRate(); 236 236 } 237 237 238 void MediaController::setPlaybackRate( floatrate)238 void MediaController::setPlaybackRate(double rate) 239 239 { 240 240 if (m_clock->playRate() == rate) … … 252 252 } 253 253 254 void MediaController::setVolume( floatlevel, ExceptionCode& code)254 void MediaController::setVolume(double level, ExceptionCode& code) 255 255 { 256 256 if (m_volume == level) -
trunk/Source/WebCore/html/MediaController.h
r136295 r148099 61 61 virtual PassRefPtr<TimeRanges> played(); 62 62 63 virtual floatduration() const;64 virtual floatcurrentTime() const;65 virtual void setCurrentTime( float, ExceptionCode&);63 virtual double duration() const; 64 virtual double currentTime() const; 65 virtual void setCurrentTime(double, ExceptionCode&); 66 66 67 67 virtual bool paused() const { return m_paused; } … … 70 70 void unpause(); 71 71 72 virtual floatdefaultPlaybackRate() const { return m_defaultPlaybackRate; }73 virtual void setDefaultPlaybackRate( float);72 virtual double defaultPlaybackRate() const { return m_defaultPlaybackRate; } 73 virtual void setDefaultPlaybackRate(double); 74 74 75 virtual floatplaybackRate() const;76 virtual void setPlaybackRate( float);75 virtual double playbackRate() const; 76 virtual void setPlaybackRate(double); 77 77 78 virtual floatvolume() const { return m_volume; }79 virtual void setVolume( float, ExceptionCode&);78 virtual double volume() const { return m_volume; } 79 virtual void setVolume(double, ExceptionCode&); 80 80 81 81 virtual bool muted() const { return m_muted; } … … 144 144 Vector<HTMLMediaElement*> m_mediaElements; 145 145 bool m_paused; 146 floatm_defaultPlaybackRate;147 floatm_volume;148 mutable floatm_position;146 double m_defaultPlaybackRate; 147 double m_volume; 148 mutable double m_position; 149 149 bool m_muted; 150 150 ReadyState m_readyState; -
trunk/Source/WebCore/html/MediaControllerInterface.h
r100159 r148099 46 46 virtual PassRefPtr<TimeRanges> played() = 0; 47 47 48 virtual floatduration() const = 0;49 virtual floatcurrentTime() const = 0;50 virtual void setCurrentTime( float, ExceptionCode&) = 0;48 virtual double duration() const = 0; 49 virtual double currentTime() const = 0; 50 virtual void setCurrentTime(double, ExceptionCode&) = 0; 51 51 52 52 virtual bool paused() const = 0; … … 54 54 virtual void pause() = 0; 55 55 56 virtual floatdefaultPlaybackRate() const = 0;57 virtual void setDefaultPlaybackRate( float) = 0;56 virtual double defaultPlaybackRate() const = 0; 57 virtual void setDefaultPlaybackRate(double) = 0; 58 58 59 virtual floatplaybackRate() const = 0;60 virtual void setPlaybackRate( float) = 0;59 virtual double playbackRate() const = 0; 60 virtual void setPlaybackRate(double) = 0; 61 61 62 virtual floatvolume() const = 0;63 virtual void setVolume( float, ExceptionCode&) = 0;62 virtual double volume() const = 0; 63 virtual void setVolume(double, ExceptionCode&) = 0; 64 64 65 65 virtual bool muted() const = 0; -
trunk/Source/WebCore/html/TimeRanges.cpp
r142271 r148099 35 35 using namespace std; 36 36 37 TimeRanges::TimeRanges( float start, floatend)37 TimeRanges::TimeRanges(double start, double end) 38 38 { 39 39 add(start, end); … … 54 54 { 55 55 RefPtr<TimeRanges> inverted = TimeRanges::create(); 56 float posInf = std::numeric_limits<float>::infinity();57 float negInf = -std::numeric_limits<float>::infinity();56 double posInf = std::numeric_limits<double>::infinity(); 57 double negInf = -std::numeric_limits<double>::infinity(); 58 58 59 59 if (!m_ranges.size()) 60 60 inverted->add(negInf, posInf); 61 61 else { 62 if ( floatstart = m_ranges.first().m_start != negInf)62 if (double start = m_ranges.first().m_start != negInf) 63 63 inverted->add(negInf, start); 64 64 … … 66 66 inverted->add(m_ranges[index].m_end, m_ranges[index + 1].m_start); 67 67 68 if ( floatend = m_ranges.last().m_end != posInf)68 if (double end = m_ranges.last().m_end != posInf) 69 69 inverted->add(end, posInf); 70 70 } … … 96 96 } 97 97 98 floatTimeRanges::start(unsigned index, ExceptionCode& ec) const98 double TimeRanges::start(unsigned index, ExceptionCode& ec) const 99 99 { 100 100 if (index >= length()) { … … 105 105 } 106 106 107 floatTimeRanges::end(unsigned index, ExceptionCode& ec) const107 double TimeRanges::end(unsigned index, ExceptionCode& ec) const 108 108 { 109 109 if (index >= length()) { … … 114 114 } 115 115 116 void TimeRanges::add( float start, floatend)116 void TimeRanges::add(double start, double end) 117 117 { 118 118 ASSERT(start <= end); … … 157 157 } 158 158 159 bool TimeRanges::contain( floattime) const159 bool TimeRanges::contain(double time) const 160 160 { 161 161 for (unsigned n = 0; n < length(); n++) { … … 166 166 } 167 167 168 float TimeRanges::nearest(floattime) const168 double TimeRanges::nearest(double time) const 169 169 { 170 floatclosest = 0;170 double closest = 0; 171 171 unsigned count = length(); 172 172 for (unsigned ndx = 0; ndx < count; ndx++) { 173 floatstartTime = start(ndx, IGNORE_EXCEPTION);174 floatendTime = end(ndx, IGNORE_EXCEPTION);173 double startTime = start(ndx, IGNORE_EXCEPTION); 174 double endTime = end(ndx, IGNORE_EXCEPTION); 175 175 if (time >= startTime && time <= endTime) 176 176 return time; -
trunk/Source/WebCore/html/TimeRanges.h
r100159 r148099 42 42 return adoptRef(new TimeRanges); 43 43 } 44 static PassRefPtr<TimeRanges> create( float start, floatend)44 static PassRefPtr<TimeRanges> create(double start, double end) 45 45 { 46 46 return adoptRef(new TimeRanges(start, end)); … … 53 53 54 54 unsigned length() const { return m_ranges.size(); } 55 floatstart(unsigned index, ExceptionCode&) const;56 floatend(unsigned index, ExceptionCode&) const;55 double start(unsigned index, ExceptionCode&) const; 56 double end(unsigned index, ExceptionCode&) const; 57 57 58 void add( float start, floatend);58 void add(double start, double end); 59 59 60 bool contain( floattime) const;60 bool contain(double time) const; 61 61 62 float nearest(floattime) const;62 double nearest(double time) const; 63 63 64 64 private: 65 65 TimeRanges() { } 66 TimeRanges( float start, floatend);66 TimeRanges(double start, double end); 67 67 TimeRanges(const TimeRanges&); 68 68 … … 70 70 struct Range { 71 71 Range() { } 72 Range( float start, floatend)72 Range(double start, double end) 73 73 { 74 74 m_start = start; 75 75 m_end = end; 76 76 } 77 floatm_start;78 floatm_end;77 double m_start; 78 double m_end; 79 79 80 inline bool isPointInRange( floatpoint) const80 inline bool isPointInRange(double point) const 81 81 { 82 82 return m_start <= point && point < m_end; -
trunk/Source/WebCore/html/TimeRanges.idl
r141034 r148099 29 29 ] interface TimeRanges { 30 30 readonly attribute unsigned long length; 31 floatstart(in unsigned long index)31 double start(in unsigned long index) 32 32 raises (DOMException); 33 floatend(in unsigned long index)33 double end(in unsigned long index) 34 34 raises (DOMException); 35 35 }; -
trunk/Source/WebCore/html/shadow/MediaControlElementTypes.cpp
r147675 r148099 35 35 #include "CSSValueKeywords.h" 36 36 #include "ExceptionCodePlaceholder.h" 37 #include "FloatConversion.h"38 37 #include "HTMLNames.h" 39 38 #include "MouseEvent.h" … … 49 48 50 49 // FIXME: These constants may need to be tweaked to better match the seeking in the QuickTime plug-in. 51 static const float cSkipRepeatDelay = 0.1f;52 static const float cSkipTime = 0.2f;53 static const float cScanRepeatDelay = 1.5f;54 static const floatcScanMaximumRate = 8;50 static const double cSkipRepeatDelay = 0.1; 51 static const double cSkipTime = 0.2; 52 static const double cScanRepeatDelay = 1.5; 53 static const double cScanMaximumRate = 8; 55 54 56 55 HTMLMediaElement* toParentMediaElement(Node* node) … … 135 134 } 136 135 137 void MediaControlTimeDisplayElement::setCurrentValue( floattime)136 void MediaControlTimeDisplayElement::setCurrentValue(double time) 138 137 { 139 138 m_currentValue = time; … … 230 229 } 231 230 232 floatMediaControlSeekButtonElement::nextRate() const233 { 234 float rate = std::min(cScanMaximumRate, fabsf(mediaController()->playbackRate() * 2));231 double MediaControlSeekButtonElement::nextRate() const 232 { 233 double rate = std::min(cScanMaximumRate, fabs(mediaController()->playbackRate() * 2)); 235 234 if (!isForwardButton()) 236 235 rate *= -1; … … 241 240 { 242 241 if (m_seekType == Skip) { 243 floatskipTime = isForwardButton() ? cSkipTime : -cSkipTime;242 double skipTime = isForwardButton() ? cSkipTime : -cSkipTime; 244 243 mediaController()->setCurrentTime(mediaController()->currentTime() + skipTime, IGNORE_EXCEPTION); 245 244 } else … … 269 268 return; 270 269 271 float volume = narrowPrecisionToFloat(value().toDouble());270 double volume = value().toDouble(); 272 271 if (volume != mediaController()->volume()) 273 272 mediaController()->setVolume(volume, ASSERT_NO_EXCEPTION); … … 292 291 } 293 292 294 void MediaControlVolumeSliderElement::setVolume( floatvolume)295 { 296 if (value().to Float() != volume)293 void MediaControlVolumeSliderElement::setVolume(double volume) 294 { 295 if (value().toDouble() != volume) 297 296 setValue(String::number(volume)); 298 297 } -
trunk/Source/WebCore/html/shadow/MediaControlElementTypes.h
r147675 r148099 130 130 class MediaControlTimeDisplayElement : public MediaControlDivElement { 131 131 public: 132 void setCurrentValue( float);133 floatcurrentValue() const { return m_currentValue; }132 void setCurrentValue(double); 133 double currentValue() const { return m_currentValue; } 134 134 135 135 protected: … … 137 137 138 138 private: 139 floatm_currentValue;139 double m_currentValue; 140 140 }; 141 141 … … 174 174 void startTimer(); 175 175 void stopTimer(); 176 floatnextRate() const;176 double nextRate() const; 177 177 void seekTimerFired(Timer<MediaControlSeekButtonElement>*); 178 178 … … 190 190 virtual bool willRespondToMouseMoveEvents() OVERRIDE; 191 191 virtual bool willRespondToMouseClickEvents() OVERRIDE; 192 void setVolume( float);192 void setVolume(double); 193 193 void setClearMutedOnUserInteraction(bool); 194 194 -
trunk/Source/WebCore/html/shadow/MediaControlElements.cpp
r148061 r148099 38 38 #include "EventTarget.h" 39 39 #include "ExceptionCodePlaceholder.h" 40 #include "FloatConversion.h"41 40 #include "Frame.h" 42 41 #include "GraphicsContext.h" … … 630 629 { 631 630 if (event->type() == eventNames().clickEvent) { 632 mediaController()->setCurrentTime(max(0.0 f, mediaController()->currentTime() - 30), IGNORE_EXCEPTION);631 mediaController()->setCurrentTime(max(0.0, mediaController()->currentTime() - 30), IGNORE_EXCEPTION); 633 632 event->setDefaultHandled(); 634 633 } … … 946 945 return; 947 946 948 float time = narrowPrecisionToFloat(value().toDouble());947 double time = value().toDouble(); 949 948 if (event->type() == eventNames().inputEvent && time != mediaController()->currentTime()) 950 949 mediaController()->setCurrentTime(time, IGNORE_EXCEPTION); … … 963 962 } 964 963 965 void MediaControlTimelineElement::setPosition( floatcurrentTime)964 void MediaControlTimelineElement::setPosition(double currentTime) 966 965 { 967 966 setValue(String::number(currentTime)); 968 967 } 969 968 970 void MediaControlTimelineElement::setDuration( floatduration)969 void MediaControlTimelineElement::setDuration(double duration) 971 970 { 972 971 setAttribute(maxAttr, String::number(std::isfinite(duration) ? duration : 0)); -
trunk/Source/WebCore/html/shadow/MediaControlElements.h
r148050 r148099 334 334 virtual bool willRespondToMouseClickEvents() OVERRIDE; 335 335 336 void setPosition( float);337 void setDuration( float);336 void setPosition(double); 337 void setDuration(double); 338 338 339 339 private: -
trunk/Source/WebCore/html/shadow/MediaControls.cpp
r148050 r148099 93 93 updateCurrentTimeDisplay(); 94 94 95 floatduration = m_mediaController->duration();95 double duration = m_mediaController->duration(); 96 96 if (std::isfinite(duration) || page->theme()->hasOwnDisabledStateHandlingFor(MediaSliderPart)) { 97 97 m_timeline->setDuration(duration); … … 215 215 void MediaControls::updateCurrentTimeDisplay() 216 216 { 217 floatnow = m_mediaController->currentTime();217 double now = m_mediaController->currentTime(); 218 218 219 219 Page* page = document()->page(); -
trunk/Source/WebCore/html/shadow/MediaControlsApple.cpp
r147675 r148099 324 324 m_fullScreenButton->hide(); 325 325 326 floatduration = m_mediaController->duration();326 double duration = m_mediaController->duration(); 327 327 if (std::isfinite(duration) || page->theme()->hasOwnDisabledStateHandlingFor(MediaSliderPart)) { 328 328 m_timeline->setDuration(duration); … … 382 382 void MediaControlsApple::updateCurrentTimeDisplay() 383 383 { 384 floatnow = m_mediaController->currentTime();385 floatduration = m_mediaController->duration();384 double now = m_mediaController->currentTime(); 385 double duration = m_mediaController->duration(); 386 386 387 387 Page* page = document()->page(); -
trunk/Source/WebCore/html/shadow/MediaControlsBlackBerry.cpp
r144891 r148099 34 34 #include "DOMTokenList.h" 35 35 #include "ExceptionCodePlaceholder.h" 36 #include "FloatConversion.h"37 36 #include "Frame.h" 38 37 #include "HTMLMediaElement.h" … … 482 481 timeline->ensureUserAgentShadowRoot(); 483 482 timeline->setType("range"); 484 timeline->setAttribute(precisionAttr, " float");483 timeline->setAttribute(precisionAttr, "double"); 485 484 return timeline.release(); 486 485 } … … 506 505 return; 507 506 508 float time = narrowPrecisionToFloat(value().toDouble());507 double time = value().toDouble(); 509 508 if (event->type() == eventNames().inputEvent && time != mediaController()->currentTime()) 510 509 mediaController()->setCurrentTime(time, IGNORE_EXCEPTION); … … 523 522 } 524 523 525 void MediaControlFullscreenTimelineElement::setPosition( floatcurrentTime)524 void MediaControlFullscreenTimelineElement::setPosition(double currentTime) 526 525 { 527 526 setValue(String::number(currentTime)); 528 527 } 529 528 530 void MediaControlFullscreenTimelineElement::setDuration( floatduration)529 void MediaControlFullscreenTimelineElement::setDuration(double duration) 531 530 { 532 531 setAttribute(maxAttr, String::number(std::isfinite(duration) ? duration : 0)); … … 912 911 m_fullscreenFullScreenButton->hide(); 913 912 } 914 floatduration = m_mediaController->duration();913 double duration = m_mediaController->duration(); 915 914 if (std::isfinite(duration) || page->theme()->hasOwnDisabledStateHandlingFor(MediaSliderPart)) { 916 floatnow = m_mediaController->currentTime();915 double now = m_mediaController->currentTime(); 917 916 m_timeline->setDuration(duration); 918 917 m_fullscreenTimeline->setDuration(duration); … … 956 955 // playback playbackProgressed() will take care of it. 957 956 if (m_mediaController->paused()) { 958 floatnow = m_mediaController->currentTime();957 double now = m_mediaController->currentTime(); 959 958 m_timeline->setPosition(now); 960 959 m_fullscreenTimeline->setPosition(now); … … 964 963 void MediaControlsBlackBerry::playbackStarted() 965 964 { 966 floatnow = m_mediaController->currentTime();965 double now = m_mediaController->currentTime(); 967 966 m_playButton->updateDisplayType(); 968 967 m_fullscreenPlayButton->updateDisplayType(); … … 977 976 void MediaControlsBlackBerry::playbackProgressed() 978 977 { 979 floatnow = m_mediaController->currentTime();978 double now = m_mediaController->currentTime(); 980 979 m_timeline->setPosition(now); 981 980 m_fullscreenTimeline->setPosition(now); … … 988 987 void MediaControlsBlackBerry::playbackStopped() 989 988 { 990 floatnow = m_mediaController->currentTime();989 double now = m_mediaController->currentTime(); 991 990 m_playButton->updateDisplayType(); 992 991 m_fullscreenPlayButton->updateDisplayType(); … … 1001 1000 void MediaControlsBlackBerry::updateCurrentTimeDisplay() 1002 1001 { 1003 floatnow = m_mediaController->currentTime();1004 floatduration = m_mediaController->duration();1002 double now = m_mediaController->currentTime(); 1003 double duration = m_mediaController->duration(); 1005 1004 1006 1005 Page* page = document()->page(); -
trunk/Source/WebCore/html/shadow/MediaControlsBlackBerry.h
r137514 r148099 194 194 195 195 virtual bool willRespondToMouseClickEvents() OVERRIDE; 196 void setPosition( float);197 void setDuration( float);196 void setPosition(double); 197 void setDuration(double); 198 198 199 199 private: -
trunk/Source/WebCore/html/shadow/MediaControlsGtk.cpp
r145403 r148099 156 156 return; 157 157 158 floatduration = m_mediaController->duration();158 double duration = m_mediaController->duration(); 159 159 m_durationDisplay->setInnerText(page->theme()->formatMediaControlsTime(duration), ASSERT_NO_EXCEPTION); 160 160 m_durationDisplay->setCurrentValue(duration); … … 173 173 void MediaControlsGtk::updateCurrentTimeDisplay() 174 174 { 175 floatnow = m_mediaController->currentTime();176 floatduration = m_mediaController->duration();175 double now = m_mediaController->currentTime(); 176 double duration = m_mediaController->duration(); 177 177 178 178 Page* page = document()->page(); -
trunk/Source/WebCore/html/track/TextTrackCue.cpp
r148050 r148099 765 765 } 766 766 767 void TextTrackCue::updateDisplayTree( floatmovieTime)767 void TextTrackCue::updateDisplayTree(double movieTime) 768 768 { 769 769 // The display tree may contain WebVTT timestamp objects representing -
trunk/Source/WebCore/html/track/TextTrackCue.h
r148050 r148099 148 148 PassRefPtr<HTMLDivElement> element() const { return m_cueBackgroundBox; } 149 149 150 void updateDisplayTree( float);150 void updateDisplayTree(double); 151 151 void removeDisplayTree(); 152 152 void markFutureAndPastNodes(ContainerNode*, double, double); -
trunk/Source/WebCore/platform/Clock.h
r99222 r148099 37 37 virtual ~Clock() { } 38 38 39 virtual void setCurrentTime( float) = 0;40 virtual floatcurrentTime() const = 0;39 virtual void setCurrentTime(double) = 0; 40 virtual double currentTime() const = 0; 41 41 42 virtual void setPlayRate( float) = 0;43 virtual floatplayRate() const = 0;42 virtual void setPlayRate(double) = 0; 43 virtual double playRate() const = 0; 44 44 45 45 virtual void start() = 0; -
trunk/Source/WebCore/platform/ClockGeneric.cpp
r118205 r148099 27 27 #include "ClockGeneric.h" 28 28 29 #include "FloatConversion.h"30 29 #include <wtf/CurrentTime.h> 31 30 … … 40 39 } 41 40 42 void ClockGeneric::setCurrentTime( floattime)41 void ClockGeneric::setCurrentTime(double time) 43 42 { 44 43 m_startTime = m_lastTime = now(); … … 46 45 } 47 46 48 floatClockGeneric::currentTime() const47 double ClockGeneric::currentTime() const 49 48 { 50 49 if (m_running) 51 50 m_lastTime = now(); 52 float time = narrowPrecisionToFloat(((m_lastTime - m_startTime) * m_rate) + m_offset); 53 return time; 51 return ((m_lastTime - m_startTime) * m_rate) + m_offset; 54 52 } 55 53 56 void ClockGeneric::setPlayRate( floatrate)54 void ClockGeneric::setPlayRate(double rate) 57 55 { 58 56 m_offset = now(); … … 84 82 return WTF::currentTime(); 85 83 } 86 -
trunk/Source/WebCore/platform/ClockGeneric.h
r118205 r148099 36 36 37 37 private: 38 virtual void setCurrentTime( float);39 virtual floatcurrentTime() const;38 virtual void setCurrentTime(double); 39 virtual double currentTime() const; 40 40 41 virtual void setPlayRate( float);42 virtual floatplayRate() const { return m_rate; }41 virtual void setPlayRate(double); 42 virtual double playRate() const { return m_rate; } 43 43 44 44 virtual void start(); … … 49 49 50 50 bool m_running; 51 floatm_rate;51 double m_rate; 52 52 double m_offset; 53 53 double m_startTime; -
trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp
r147888 r148099 114 114 virtual void setVisible(bool) { } 115 115 116 virtual float duration() const { return 0; }117 118 virtual float currentTime() const { return 0; }119 virtual void seek (float) { }116 virtual double durationDouble() const { return 0; } 117 118 virtual double currentTimeDouble() const { return 0; } 119 virtual void seekDouble(double) { } 120 120 virtual bool seeking() const { return false; } 121 121 122 virtual void setRate (float) { }122 virtual void setRateDouble(double) { } 123 123 virtual void setPreservesPitch(bool) { } 124 124 virtual bool paused() const { return false; } 125 125 126 virtual void setVolume (float) { }126 virtual void setVolumeDouble(double) { } 127 127 128 128 virtual bool supportsMuting() const { return false; } … … 135 135 virtual MediaPlayer::ReadyState readyState() const { return MediaPlayer::HaveNothing; } 136 136 137 virtual float maxTimeSeekable() const { return 0; }137 virtual double maxTimeSeekableDouble() const { return 0; } 138 138 virtual PassRefPtr<TimeRanges> buffered() const { return TimeRanges::create(); } 139 139 … … 512 512 #endif 513 513 514 floatMediaPlayer::duration() const515 { 516 return m_private->duration ();517 } 518 519 floatMediaPlayer::startTime() const520 { 521 return m_private->startTime ();514 double MediaPlayer::duration() const 515 { 516 return m_private->durationDouble(); 517 } 518 519 double MediaPlayer::startTime() const 520 { 521 return m_private->startTimeDouble(); 522 522 } 523 523 … … 527 527 } 528 528 529 floatMediaPlayer::currentTime() const530 { 531 return m_private->currentTime ();532 } 533 534 void MediaPlayer::seek( floattime)535 { 536 m_private->seek (time);529 double MediaPlayer::currentTime() const 530 { 531 return m_private->currentTimeDouble(); 532 } 533 534 void MediaPlayer::seek(double time) 535 { 536 m_private->seekDouble(time); 537 537 } 538 538 … … 607 607 } 608 608 609 floatMediaPlayer::volume() const609 double MediaPlayer::volume() const 610 610 { 611 611 return m_volume; 612 612 } 613 613 614 void MediaPlayer::setVolume( floatvolume)614 void MediaPlayer::setVolume(double volume) 615 615 { 616 616 m_volume = volume; 617 617 618 618 if (m_private->supportsMuting() || !m_muted) 619 m_private->setVolume (volume);619 m_private->setVolumeDouble(volume); 620 620 } 621 621 … … 645 645 } 646 646 647 floatMediaPlayer::rate() const647 double MediaPlayer::rate() const 648 648 { 649 649 return m_rate; 650 650 } 651 651 652 void MediaPlayer::setRate( floatrate)652 void MediaPlayer::setRate(double rate) 653 653 { 654 654 m_rate = rate; 655 m_private->setRate (rate);655 m_private->setRateDouble(rate); 656 656 } 657 657 … … 677 677 } 678 678 679 floatMediaPlayer::maxTimeSeekable()680 { 681 return m_private->maxTimeSeekable ();679 double MediaPlayer::maxTimeSeekable() 680 { 681 return m_private->maxTimeSeekableDouble(); 682 682 } 683 683 … … 852 852 } 853 853 854 float MediaPlayer::mediaTimeForTimeValue(floattimeValue) const855 { 856 return m_private->mediaTimeForTimeValue (timeValue);854 double MediaPlayer::mediaTimeForTimeValue(double timeValue) const 855 { 856 return m_private->mediaTimeForTimeValueDouble(timeValue); 857 857 } 858 858 … … 950 950 } 951 951 952 void MediaPlayer::volumeChanged( floatnewVolume)952 void MediaPlayer::volumeChanged(double newVolume) 953 953 { 954 954 m_volume = newVolume; -
trunk/Source/WebCore/platform/graphics/MediaPlayer.h
r147675 r148099 299 299 bool seeking() const; 300 300 301 static float invalidTime() { return -1.0f;}302 floatduration() const;303 floatcurrentTime() const;304 void seek( floattime);305 306 floatstartTime() const;301 static double invalidTime() { return -1.0;} 302 double duration() const; 303 double currentTime() const; 304 void seek(double time); 305 306 double startTime() const; 307 307 308 308 double initialTime() const; 309 309 310 floatrate() const;311 void setRate( float);310 double rate() const; 311 void setRate(double); 312 312 313 313 bool preservesPitch() const; … … 316 316 PassRefPtr<TimeRanges> buffered(); 317 317 PassRefPtr<TimeRanges> seekable(); 318 floatmaxTimeSeekable();318 double maxTimeSeekable(); 319 319 320 320 bool didLoadingProgress(); 321 321 322 floatvolume() const;323 void setVolume( float);322 double volume() const; 323 void setVolume(double); 324 324 325 325 bool muted() const; … … 365 365 void networkStateChanged(); 366 366 void readyStateChanged(); 367 void volumeChanged( float);367 void volumeChanged(double); 368 368 void muteChanged(bool); 369 369 void timeChanged(); … … 415 415 bool didPassCORSAccessCheck() const; 416 416 417 float mediaTimeForTimeValue(float) const;417 double mediaTimeForTimeValue(double) const; 418 418 419 419 double maximumDurationToCacheMediaTime() const; … … 488 488 Preload m_preload; 489 489 bool m_visible; 490 floatm_rate;491 floatm_volume;490 double m_rate; 491 double m_volume; 492 492 bool m_muted; 493 493 bool m_preservesPitch; -
trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h
r147675 r148099 71 71 virtual void setVisible(bool) = 0; 72 72 73 virtual float duration() const = 0; 74 75 virtual float currentTime() const = 0; 76 virtual void seek(float time) = 0; 73 virtual float duration() const { return 0; } 74 virtual double durationDouble() const { return duration(); } 75 76 virtual float currentTime() const { return 0; } 77 virtual double currentTimeDouble() const { return currentTime(); } 78 79 virtual void seek(float) { } 80 virtual void seekDouble(double time) { seek(time); } 81 77 82 virtual bool seeking() const = 0; 78 83 79 84 virtual float startTime() const { return 0; } 85 virtual double startTimeDouble() const { return startTime(); } 80 86 81 87 virtual double initialTime() const { return 0; } 82 88 83 virtual void setRate(float) = 0; 89 virtual void setRate(float) { } 90 virtual void setRateDouble(double rate) { setRate(rate); } 91 84 92 virtual void setPreservesPitch(bool) { } 85 93 86 94 virtual bool paused() const = 0; 87 95 88 virtual void setVolume(float) = 0; 96 virtual void setVolume(float) { } 97 virtual void setVolumeDouble(double volume) { return setVolume(volume); } 89 98 90 99 virtual bool supportsMuting() const { return false; } … … 98 107 99 108 virtual PassRefPtr<TimeRanges> seekable() const { return maxTimeSeekable() ? TimeRanges::create(0, maxTimeSeekable()) : TimeRanges::create(); } 100 virtual float maxTimeSeekable() const = 0; 109 virtual float maxTimeSeekable() const { return 0; } 110 virtual double maxTimeSeekableDouble() const { return maxTimeSeekable(); } 101 111 virtual PassRefPtr<TimeRanges> buffered() const = 0; 102 112 … … 150 160 // engine uses rational numbers to represent media time. 151 161 virtual float mediaTimeForTimeValue(float timeValue) const { return timeValue; } 162 virtual double mediaTimeForTimeValueDouble(double timeValue) const { return timeValue; } 152 163 153 164 // Overide this if it is safe for HTMLMediaElement to cache movie time and report -
trunk/Source/WebCore/platform/mac/PlatformClockCA.cpp
r103249 r148099 30 30 #include "PlatformClockCA.h" 31 31 32 #include "FloatConversion.h"33 32 #include <AudioToolbox/CoreAudioClock.h> 34 33 #include <CoreAudio/AudioHardware.h> … … 62 61 } 63 62 64 void PlatformClockCA::setCurrentTime( floattime)63 void PlatformClockCA::setCurrentTime(double time) 65 64 { 66 65 if (m_running) … … 74 73 } 75 74 76 floatPlatformClockCA::currentTime() const75 double PlatformClockCA::currentTime() const 77 76 { 78 77 CAClockTime caTime; … … 82 81 if (m_running) { 83 82 if (CAClockGetCurrentTime(m_clock, kCAClockTimeFormat_Seconds, &caTime) == noErr) 84 return narrowPrecisionToFloat(caTime.time.seconds);83 return caTime.time.seconds; 85 84 } else { 86 85 if (CAClockGetStartTime(m_clock, kCAClockTimeFormat_Seconds, &caTime) == noErr) 87 return narrowPrecisionToFloat(caTime.time.seconds);86 return caTime.time.seconds; 88 87 } 89 88 return 0; 90 89 } 91 90 92 void PlatformClockCA::setPlayRate( floatrate)91 void PlatformClockCA::setPlayRate(double rate) 93 92 { 94 93 CAClockSetPlayRate(m_clock, rate); 95 94 } 96 95 97 floatPlatformClockCA::PlatformClockCA::playRate() const96 double PlatformClockCA::PlatformClockCA::playRate() const 98 97 { 99 98 double rate = 0; 100 99 if (CAClockGetPlayRate(m_clock, &rate) == noErr) 101 return narrowPrecisionToFloat(rate);100 return rate; 102 101 return 0; 103 102 } -
trunk/Source/WebCore/platform/mac/PlatformClockCA.h
r99222 r148099 41 41 42 42 private: 43 virtual void setCurrentTime( float);44 virtual floatcurrentTime() const;43 virtual void setCurrentTime(double); 44 virtual double currentTime() const; 45 45 46 virtual void setPlayRate( float);47 virtual floatplayRate() const;46 virtual void setPlayRate(double); 47 virtual double playRate() const; 48 48 49 49 virtual void start(); -
trunk/Source/WebCore/platform/mac/PlatformClockCM.h
r106978 r148099 45 45 void initializeWithTimingSource(CMClockRef); 46 46 47 virtual void setCurrentTime( float);48 virtual floatcurrentTime() const;47 virtual void setCurrentTime(double); 48 virtual double currentTime() const; 49 49 50 virtual void setPlayRate( float);51 virtual floatplayRate() const { return m_rate; }50 virtual void setPlayRate(double); 51 virtual double playRate() const { return m_rate; } 52 52 53 53 virtual void start(); … … 56 56 57 57 RetainPtr<CMTimebaseRef> m_timebase; 58 floatm_rate;58 double m_rate; 59 59 bool m_running; 60 60 }; -
trunk/Source/WebCore/platform/mac/PlatformClockCM.mm
r118204 r148099 30 30 #import "PlatformClockCM.h" 31 31 32 #import "FloatConversion.h"33 32 #import "SoftLinking.h" 34 33 #import <CoreMedia/CMAudioDeviceClock.h> … … 74 73 } 75 74 76 void PlatformClockCM::setCurrentTime( floattime)75 void PlatformClockCM::setCurrentTime(double time) 77 76 { 78 77 CMTime cmTime = CMTimeMakeWithSeconds(time, DefaultTimeScale); … … 80 79 } 81 80 82 floatPlatformClockCM::currentTime() const81 double PlatformClockCM::currentTime() const 83 82 { 84 83 CMTime cmTime = CMTimebaseGetTime(m_timebase.get()); 85 return narrowPrecisionToFloat(CMTimeGetSeconds(cmTime));84 return CMTimeGetSeconds(cmTime); 86 85 } 87 86 88 void PlatformClockCM::setPlayRate( floatrate)87 void PlatformClockCM::setPlayRate(double rate) 89 88 { 90 89 if (m_rate == rate)
Note:
See TracChangeset
for help on using the changeset viewer.