Changeset 138017 in webkit
- Timestamp:
- Dec 18, 2012 7:23:29 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r138014 r138017 1 2012-12-18 Eric Carlson <eric.carlson@apple.com> 2 3 Add in-band text track cues only once 4 https://bugs.webkit.org/show_bug.cgi?id=104593 5 6 Reviewed by Dean Jackson. 7 8 Test to ensure that in-band text track cues are not added to the the cue list more than once. 9 10 * media/track/track-in-band-cues-added-once-expected.txt: Added. 11 * media/track/track-in-band-cues-added-once.html: Added. 12 * platform/chromium/TestExpectations: 13 * platform/efl/TestExpectations: 14 * platform/gtk/TestExpectations: 15 * platform/mac/TestExpectations: 16 * platform/qt/TestExpectations: 17 * platform/win/TestExpectations: 18 1 19 2012-12-18 Thiago Marcos P. Santos <thiago.santos@intel.com> 2 20 -
trunk/LayoutTests/platform/chromium/TestExpectations
r137966 r138017 4232 4232 # No support for exposing in-band text tracks 4233 4233 webkit.org/b/103767 [ Win Mac Linux ] media/track/track-in-band.html [ Skip ] 4234 webkit.org/b/103767 [ Win Mac Linux ] media/track/track-in-band-cues-added-once.html [ Skip ] 4234 4235 4235 4236 # Flaky on Win (perhaps due to lighttpd?) -
trunk/LayoutTests/platform/efl/TestExpectations
r137966 r138017 1654 1654 # No support for exposing in-band text tracks 1655 1655 Bug(EFL) media/track/track-in-band.html [ Skip ] 1656 Bug(EFL) media/track/track-in-band-cues-added-once.html [ Skip ] 1656 1657 1657 1658 # Newly added test in r136225 fails on GTK bot too. -
trunk/LayoutTests/platform/gtk/TestExpectations
r137995 r138017 458 458 # No support for exposing in-band text tracks 459 459 webkit.org/b/103771 media/track/track-in-band.html [ Failure ] 460 webkit.org/b/103771 media/track/track-in-band-cues-added-once.html [ Failure ] 460 461 461 462 #//////////////////////////////////////////////////////////////////////////////////////// -
trunk/LayoutTests/platform/mac/TestExpectations
r137762 r138017 1242 1242 # Mountain Lion and prior do not allow access to in-band text tracks 1243 1243 webkit.org/b/103663 [ MountainLion Lion SnowLeopard ] media/track/track-in-band.html 1244 webkit.org/b/103663 [ MountainLion Lion SnowLeopard ] media/track/track-in-band-cues-added-once.html 1244 1245 1245 1246 webkit.org/b/104104 fast/overflow/scrollbar-click-retains-focus.html [ Failure ] -
trunk/LayoutTests/platform/qt/TestExpectations
r137966 r138017 2443 2443 # No support for exposing in-band text tracks 2444 2444 webkit.org/b/103769 media/track/track-in-band.html [ Skip ] 2445 webkit.org/b/103769 media/track/track-in-band-cues-added-once.html [ Skip ] 2445 2446 2446 2447 webkit.org/b/104150 fast/media/implicit-media-all.html [ ImageOnlyFailure ] -
trunk/LayoutTests/platform/win/TestExpectations
r137662 r138017 2477 2477 # No support for exposing in-band text tracks 2478 2478 webkit.org/b/103770 media/track/track-in-band.html [ Skip ] 2479 webkit.org/b/103770 media/track/track-in-band-cues-added-once.html [ Skip ] 2479 2480 2480 2481 # https://bugs.webkit.org/show_bug.cgi?id=97026 -
trunk/Source/WebCore/ChangeLog
r138016 r138017 1 2012-12-18 Eric Carlson <eric.carlson@apple.com> 2 3 Add in-band text track cues only once 4 https://bugs.webkit.org/show_bug.cgi?id=104593 5 6 Reviewed by Dean Jackson. 7 8 Test: media/track/track-in-band-cues-added-once.html 9 10 * html/track/InbandTextTrack.cpp: 11 (WebCore::InbandTextTrack::hasCue): New. 12 * html/track/InbandTextTrack.h: 13 14 * html/track/TextTrackCue.cpp: 15 (WebCore::TextTrackCue::setCueSettings): Remember the raw cue settings so they can be accessed later. 16 * html/track/TextTrackCue.h: 17 18 * platform/graphics/InbandTextTrackPrivateClient.h: Declare hasCue. 19 20 * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: 21 (WebCore::InbandTextTrackPrivateAVF::processCue): Early return if m_player has been cleared. 22 (WebCore::InbandTextTrackPrivateAVF::setMode): Ditto. 23 24 * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: 25 (WebCore::MediaPlayerPrivateAVFoundation::seek): Clear the partially accumulated cue when the seek 26 starts, not when it completes. 27 (WebCore::MediaPlayerPrivateAVFoundation::seekCompleted): Ditto. 28 (WebCore::MediaPlayerPrivateAVFoundation::flushCurrentCue): Don't add a cue if it is already in the 29 text track cue list. 30 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: 31 (WebCore::MediaPlayerPrivateAVFoundationObjC::clearTextTracks): Drive-by cleanup, clear the track list completely. 32 1 33 2012-12-18 Eugene Klyuchnikov <eustas@chromium.org> 2 34 -
trunk/Source/WebCore/html/track/InbandTextTrack.cpp
r137161 r138017 116 116 client()->textTrackAddCues(this, m_cues.get()); 117 117 } 118 119 bool InbandTextTrack::hasCue(InbandTextTrackPrivate*, double startTime, double endTime, const String& id, const String& content, const String& settings) 120 { 121 122 if (startTime < 0 || endTime < 0) 123 return false; 124 125 if (!cues()->length()) 126 return false; 127 128 size_t searchStart = 0; 129 size_t searchEnd = cues()->length(); 130 131 while (1) { 132 ASSERT(searchStart <= cues()->length()); 133 ASSERT(searchEnd <= cues()->length()); 134 135 TextTrackCue* cue; 136 137 // Cues in the TextTrackCueList are maintained in start time order. 138 if (searchStart == searchEnd) { 139 if (!searchStart) 140 return false; 141 142 cue = cues()->item(searchStart - 1); 143 if (!cue) 144 return false; 145 if (cue->startTime() != startTime) 146 return false; 147 if (cue->endTime() != endTime) 148 return false; 149 if (cue->text() != content) 150 return false; 151 if (cue->cueSettings() != settings) 152 return false; 153 if (cue->id() != id) 154 return false; 155 156 return true; 157 } 158 159 size_t index = (searchStart + searchEnd) / 2; 160 cue = cues()->item(index); 161 if (startTime < cue->startTime() || (startTime == cue->startTime() && endTime > cue->endTime())) 162 searchEnd = index; 163 else 164 searchStart = index + 1; 165 } 118 166 167 ASSERT_NOT_REACHED(); 168 return false; 169 } 170 119 171 } // namespace WebCore 120 172 -
trunk/Source/WebCore/html/track/InbandTextTrack.h
r137161 r138017 53 53 54 54 virtual void addCue(InbandTextTrackPrivate*, double, double, const String&, const String&, const String&) OVERRIDE; 55 virtual bool hasCue(InbandTextTrackPrivate*, double, double, const String&, const String&, const String&) OVERRIDE; 55 56 56 57 RefPtr<InbandTextTrackPrivate> m_private; -
trunk/Source/WebCore/html/track/TextTrackCue.cpp
r137955 r138017 836 836 void TextTrackCue::setCueSettings(const String& input) 837 837 { 838 m_settings = input; 838 839 unsigned position = 0; 839 840 -
trunk/Source/WebCore/html/track/TextTrackCue.h
r137955 r138017 120 120 void setText(const String&); 121 121 122 const String& cueSettings() const { return m_settings; } 122 123 void setCueSettings(const String&); 123 124 … … 186 187 double m_endTime; 187 188 String m_content; 189 String m_settings; 188 190 int m_linePosition; 189 191 int m_computedLinePosition; -
trunk/Source/WebCore/platform/graphics/InbandTextTrackPrivateClient.h
r137161 r138017 40 40 41 41 virtual void addCue(InbandTextTrackPrivate*, double /*start*/, double /*end*/, const String& /*id*/, const String& /*content*/, const String& /*settings*/) = 0; 42 virtual bool hasCue(InbandTextTrackPrivate*, double /*start*/, double /*end*/, const String& /*id*/, const String& /*content*/, const String& /*settings*/) = 0; 42 43 }; 43 44 -
trunk/Source/WebCore/platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp
r137161 r138017 223 223 void InbandTextTrackPrivateAVF::processCue(CFArrayRef attributedStrings, double time) 224 224 { 225 if (!m_player) 226 return; 227 225 228 if (m_havePartialCue) { 226 229 // Cues do not have an explicit duration, they are displayed until the next "cue" (which might be empty) is emitted. … … 269 272 void InbandTextTrackPrivateAVF::setMode(InbandTextTrackPrivate::Mode newMode) 270 273 { 274 if (!m_player) 275 return; 276 271 277 InbandTextTrackPrivate::Mode oldMode = mode(); 272 278 InbandTextTrackPrivate::setMode(newMode); -
trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp
r137707 r138017 267 267 return; 268 268 269 #if HAVE(AVFOUNDATION_TEXT_TRACK_SUPPORT) 270 // Forget any partially accumulated cue data as the seek could be to a time outside of the cue's 271 // range, which will mean that the next cue delivered will result in the current cue getting the 272 // incorrect duration. 273 if (currentTrack()) 274 currentTrack()->resetCueValues(); 275 #endif 276 269 277 LOG(Media, "MediaPlayerPrivateAVFoundation::seek(%p) - seeking to %f", this, time); 270 278 m_seekTo = time; … … 575 583 UNUSED_PARAM(finished); 576 584 577 #if HAVE(AVFOUNDATION_TEXT_TRACK_SUPPORT)578 // Forget any partially accumulated cue data as the seek could be to a time outside of the cue's579 // range, which will mean that the next cue delivered will result in the current cue getting the580 // incorrect duration.581 if (currentTrack())582 currentTrack()->resetCueValues();583 #endif584 585 585 m_seekTo = MediaPlayer::invalidTime(); 586 586 updateStates(); … … 817 817 return; 818 818 819 // AVFoundation returns a cue every time the data is buffered, only add it once. 820 if (track->client()->hasCue(track, track->start(), track->end(), track->id(), track->content(), track->settings())) { 821 LOG(Media, "MediaPlayerPrivateAVFoundation::flushCurrentCue(%p) - already have cue for time %.2f", this, track->start()); 822 return; 823 } 824 825 LOG(Media, "MediaPlayerPrivateAVFoundation::flushCurrentCue(%p) - adding cue for time %.2f", this, track->start()); 819 826 track->client()->addCue(track, track->start(), track->end(), track->id(), track->content(), track->settings()); 820 827 } -
trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
r137844 r138017 1198 1198 void MediaPlayerPrivateAVFoundationObjC::clearTextTracks() 1199 1199 { 1200 for (unsigned i = 0; i < m_textTracks.size(); ++i) 1201 player()->removeTextTrack(m_textTracks[i].get()); 1200 for (unsigned i = 0; i < m_textTracks.size(); ++i) { 1201 RefPtr<InbandTextTrackPrivateAVF> track = m_textTracks[i]; 1202 player()->removeTextTrack(track); 1203 track->disconnect(); 1204 } 1205 m_textTracks.clear(); 1202 1206 } 1203 1207
Note: See TracChangeset
for help on using the changeset viewer.