Changeset 55927 in webkit
- Timestamp:
- Mar 12, 2010 12:11:06 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r55926 r55927 1 2010-03-12 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk> 2 3 Reviewed by Eric Carlson. 4 5 media/video-preload.html fails 6 https://bugs.webkit.org/show_bug.cgi?id=35793 7 8 Only effectively load, and start buffering when playing, or when 9 the preload attribute is set. 10 11 Test: media/video-preload.html 12 13 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: 14 (WebCore::MediaPlayerPrivate::MediaPlayerPrivate): 15 (WebCore::MediaPlayerPrivate::load): 16 (WebCore::MediaPlayerPrivate::commitLoad): 17 (WebCore::MediaPlayerPrivate::prepareToPlay): 18 (WebCore::MediaPlayerPrivate::setPreload): 19 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: 20 1 21 2010-03-12 Dmitry Titov <dimich@chromium.org> 2 22 -
trunk/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
r55789 r55927 315 315 , m_maxTimeLoaded(0) 316 316 , m_bufferingPercentage(0) 317 , m_preload(MediaPlayer::Auto) 318 , m_delayingLoad(false) 317 319 { 318 320 if (doGstInit()) … … 369 371 void MediaPlayerPrivate::load(const String& url) 370 372 { 373 g_object_set(m_playBin, "uri", url.utf8().data(), NULL); 374 375 if (m_preload == MediaPlayer::None) { 376 m_delayingLoad = true; 377 return; 378 } 379 380 commitLoad(); 381 } 382 383 void MediaPlayerPrivate::commitLoad() 384 { 385 // GStreamer needs to have the pipeline set to a paused state to 386 // start providing anything useful. 387 gst_element_set_state(m_playBin, GST_STATE_PAUSED); 388 371 389 LOG_VERBOSE(Media, "Load %s", url.utf8().data()); 372 390 if (m_networkState != MediaPlayer::Loading) { … … 378 396 m_player->readyStateChanged(); 379 397 } 380 381 g_object_set(m_playBin, "uri", url.utf8().data(), NULL);382 383 // GStreamer needs to have the pipeline set to a paused state to384 // start providing anything useful.385 gst_element_set_state(m_playBin, GST_STATE_PAUSED);386 398 } 387 399 … … 403 415 } 404 416 return true; 417 } 418 419 void MediaPlayerPrivate::prepareToPlay() 420 { 421 if (m_delayingLoad) { 422 m_delayingLoad = false; 423 commitLoad(); 424 } 405 425 } 406 426 … … 1366 1386 ASSERT(m_playBin); 1367 1387 1388 m_preload = preload; 1389 1368 1390 GstPlayFlags flags; 1369 1391 g_object_get(m_playBin, "flags", &flags, NULL); … … 1372 1394 else 1373 1395 g_object_set(m_playBin, "flags", flags | GST_PLAY_FLAG_DOWNLOAD, NULL); 1396 1397 if (m_delayingLoad && m_preload != MediaPlayer::None) { 1398 m_delayingLoad = false; 1399 commitLoad(); 1400 } 1374 1401 } 1375 1402 -
trunk/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
r55789 r55927 64 64 65 65 void load(const String &url); 66 void commitLoad(); 66 67 void cancelLoad(); 67 68 bool loadNextLocation(); 68 69 70 void prepareToPlay(); 69 71 void play(); 70 72 void pause(); … … 168 170 float m_maxTimeLoaded; 169 171 int m_bufferingPercentage; 172 MediaPlayer::Preload m_preload; 173 bool m_delayingLoad; 170 174 }; 171 175 }
Note: See TracChangeset
for help on using the changeset viewer.