Changeset 70084 in webkit


Ignore:
Timestamp:
Oct 19, 2010 2:11:24 PM (14 years ago)
Author:
jer.noble@apple.com
Message:

Windows: Implement 'preload=none'
https://bugs.webkit.org/show_bug.cgi?id=47317
<rdar://problem/7718442>

Reviewed by Eric Carlson.

WebCore:

Implement the 'preload=none' identically to the mac implementation. Add three new
ivars: m_preload, m_delayLoad and m_movieURL; and override the MediaPlayerPrivate
functions: prepareToPlay() and setPreload().

  • platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:

(WebCore::MediaPlayerPrivateQuickTimeVisualContext::MediaPlayerPrivateQuickTimeVisualContext):

Initialize new ivars m_delayLoad and m_preload.

(WebCore::MediaPlayerPrivateQuickTimeVisualContext::resumeLoad): Added; new.
(WebCore::MediaPlayerPrivateQuickTimeVisualContext::load): Split contents between

load and loadInternal.

(WebCore::MediaPlayerPrivateQuickTimeVisualContext::loadInternal): Added; new.
(WebCore::MediaPlayerPrivateQuickTimeVisualContext::prepareToPlay): Added; overrides MediaPlayerPrivate.
(WebCore::MediaPlayerPrivateQuickTimeVisualContext::setPreload): Added; overrides MediaPlayerPrivate.

  • platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h:

LayoutTests:

Do not skip the media/video-preload.html test on windows any longer.

  • platform/win/Skipped:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r70082 r70084  
     12010-10-06  Jer Noble  <jer.noble@apple.com>
     2
     3        Reviewed by Eric Carlson.
     4
     5        Windows: Implement 'preload=none'
     6        https://bugs.webkit.org/show_bug.cgi?id=47317
     7        <rdar://problem/7718442>
     8       
     9        Do not skip the media/video-preload.html test on windows any longer.
     10
     11        * platform/win/Skipped:
     12
    1132010-10-19  Zhenyao Mo  <zmo@google.com>
    214
  • trunk/LayoutTests/platform/win/Skipped

    r70080 r70084  
    831831fast/events/spatial-navigation
    832832
    833 # <rdar://problem/7718442> Implement 'preload=none'
    834 media/video-preload.html
    835 
    836833# For some reason crashes when run with all tests. Passes individually.
    837834fast/forms/multiple-form-submission-protection-mouse.html
  • trunk/WebCore/ChangeLog

    r70083 r70084  
     12010-10-06  Jer Noble  <jer.noble@apple.com>
     2
     3        Reviewed by Eric Carlson.
     4
     5        Windows: Implement 'preload=none'
     6        https://bugs.webkit.org/show_bug.cgi?id=47317
     7        <rdar://problem/7718442>
     8       
     9        Implement the 'preload=none' identically to the mac implementation. Add three new
     10        ivars: m_preload, m_delayLoad and m_movieURL; and override the MediaPlayerPrivate
     11        functions: prepareToPlay() and setPreload().
     12
     13        * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
     14        (WebCore::MediaPlayerPrivateQuickTimeVisualContext::MediaPlayerPrivateQuickTimeVisualContext):
     15            Initialize new ivars m_delayLoad and m_preload.
     16        (WebCore::MediaPlayerPrivateQuickTimeVisualContext::resumeLoad): Added; new.
     17        (WebCore::MediaPlayerPrivateQuickTimeVisualContext::load): Split contents between
     18            load and loadInternal.
     19        (WebCore::MediaPlayerPrivateQuickTimeVisualContext::loadInternal): Added; new.
     20        (WebCore::MediaPlayerPrivateQuickTimeVisualContext::prepareToPlay): Added; overrides MediaPlayerPrivate.
     21        (WebCore::MediaPlayerPrivateQuickTimeVisualContext::setPreload): Added; overrides MediaPlayerPrivate.
     22        * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h:
     23       
    1242010-10-19  Enrica Casucci  <enrica@apple.com>
    225
  • trunk/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp

    r69594 r70084  
    175175#endif
    176176    , m_visualContextClient(new MediaPlayerPrivateQuickTimeVisualContext::VisualContextClient(this))
     177    , m_delayingLoad(false)
     178    , m_preload(MediaPlayer::Auto)
    177179{
    178180}
     
    317319}
    318320
     321void MediaPlayerPrivateQuickTimeVisualContext::resumeLoad()
     322{
     323    m_delayingLoad = false;
     324
     325    if (!m_movieURL.isEmpty())
     326        loadInternal(m_movieURL);
     327}
     328
    319329void MediaPlayerPrivateQuickTimeVisualContext::load(const String& url)
     330{
     331    m_movieURL = url;
     332
     333    if (m_preload == MediaPlayer::None) {
     334        m_delayingLoad = true;
     335        return;
     336    }
     337
     338    loadInternal(url);
     339}
     340
     341void MediaPlayerPrivateQuickTimeVisualContext::loadInternal(const String& url)
    320342{
    321343    if (!QTMovie::initializeQuickTime()) {
     
    346368    m_movie->load(url.characters(), url.length(), m_player->preservesPitch());
    347369    m_movie->setVolume(m_player->volume());
     370}
     371
     372void MediaPlayerPrivateQuickTimeVisualContext::prepareToPlay()
     373{
     374    if (!m_movie || m_delayingLoad)
     375        resumeLoad();
    348376}
    349377
     
    10061034}
    10071035
     1036void MediaPlayerPrivateQuickTimeVisualContext::setPreload(MediaPlayer::Preload preload)
     1037{
     1038    m_preload = preload;
     1039    if (m_delayingLoad && m_preload != MediaPlayer::None)
     1040        resumeLoad();
     1041}
     1042
    10081043MediaPlayerPrivateQuickTimeVisualContext::MediaRenderingMode MediaPlayerPrivateQuickTimeVisualContext::currentRenderingMode() const
    10091044{
  • trunk/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h

    r67288 r70084  
    7575    void load(const String& url);
    7676    void cancelLoad();
     77    void loadInternal(const String& url);
     78    void resumeLoad();
    7779   
    7880    void play();
    7981    void pause();   
     82    void prepareToPlay();
    8083   
    8184    bool paused() const;
     
    111114    bool hasClosedCaptions() const;
    112115    void setClosedCaptionsVisible(bool);
     116
     117    void setPreload(MediaPlayer::Preload);
    113118
    114119    void updateStates();
     
    190195    bool m_visible;
    191196    bool m_newFrameAvailable;
     197    bool m_delayingLoad;
     198    String m_movieURL;
     199    MediaPlayer::Preload m_preload;
    192200#if DRAW_FRAME_RATE
    193201    double m_frameCountWhilePlaying;
Note: See TracChangeset for help on using the changeset viewer.