Changeset 155104 in webkit


Ignore:
Timestamp:
Sep 5, 2013 12:33:38 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

[Qt][WK1] REGRESSION(r154988): compositing/video/video-with-invalid-source.html
https://bugs.webkit.org/show_bug.cgi?id=120683

Patch by Andre Moreira Magalhaes <Andre Moreira Magalhaes> on 2013-09-05
Reviewed by Philippe Normand.

Do not set pipeline state to NULL on MediaPlayerPrivateGStreamer::loadingFailed()
otherwise the bus is flushed and we never get a GST_MESSAGE_ERROR when failing to
load uris.
Also restore previous behaviour (before r154988) of not invoking loadingFailed() for
all failed manual state change attempts.

  • platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:

(WebCore::MediaPlayerPrivateGStreamer::changePipelineState):
Do not call loadingFailed() if state change fails as all manual state changes are
now done with changePipelineState().
(WebCore::MediaPlayerPrivateGStreamer::play):
(WebCore::MediaPlayerPrivateGStreamer::pause):
(WebCore::MediaPlayerPrivateGStreamer::seek):
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
Restore previous behaviour (before changeset r154988) when calling changePipelineState().
(WebCore::MediaPlayerPrivateGStreamer::updateStates):
Do nothing if changing to READY on EOS (same behaviour as setting to NULL as it was before
changeset r154988).
(WebCore::MediaPlayerPrivateGStreamer::loadingFailed):
Do not set pipeline state to NULL so we properly get GST_MESSAGE_ERROR on loading failures.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r155102 r155104  
     12013-09-05  Andre Moreira Magalhaes   <andre.magalhaes@collabora.co.uk>
     2
     3        [Qt][WK1] REGRESSION(r154988): compositing/video/video-with-invalid-source.html
     4        https://bugs.webkit.org/show_bug.cgi?id=120683
     5
     6        Reviewed by Philippe Normand.
     7
     8        Do not set pipeline state to NULL on MediaPlayerPrivateGStreamer::loadingFailed()
     9        otherwise the bus is flushed and we never get a GST_MESSAGE_ERROR when failing to
     10        load uris.
     11        Also restore previous behaviour (before r154988) of not invoking loadingFailed() for
     12        all failed manual state change attempts.
     13
     14        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
     15        (WebCore::MediaPlayerPrivateGStreamer::changePipelineState):
     16        Do not call loadingFailed() if state change fails as all manual state changes are
     17        now done with changePipelineState().
     18        (WebCore::MediaPlayerPrivateGStreamer::play):
     19        (WebCore::MediaPlayerPrivateGStreamer::pause):
     20        (WebCore::MediaPlayerPrivateGStreamer::seek):
     21        (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
     22        Restore previous behaviour (before changeset r154988) when calling changePipelineState().
     23        (WebCore::MediaPlayerPrivateGStreamer::updateStates):
     24        Do nothing if changing to READY on EOS (same behaviour as setting to NULL as it was before
     25        changeset r154988).
     26        (WebCore::MediaPlayerPrivateGStreamer::loadingFailed):
     27        Do not set pipeline state to NULL so we properly get GST_MESSAGE_ERROR on loading failures.
     28
    1292013-09-05  Alberto Garcia  <berto@igalia.com>
    230
  • trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp

    r155024 r155104  
    442442    GstState pausedOrPlaying = newState == GST_STATE_PLAYING ? GST_STATE_PAUSED : GST_STATE_PLAYING;
    443443    if (currentState != pausedOrPlaying && setStateResult == GST_STATE_CHANGE_FAILURE) {
    444         loadingFailed(MediaPlayer::Empty);
    445444        return false;
    446445    }
     
    477476        setDownloadBuffering();
    478477        LOG_MEDIA_MESSAGE("Play");
     478    } else {
     479        loadingFailed(MediaPlayer::Empty);
    479480    }
    480481}
     
    489490    if (changePipelineState(GST_STATE_PAUSED))
    490491        INFO_MEDIA_MESSAGE("Pause");
     492    else
     493        loadingFailed(MediaPlayer::Empty);
    491494}
    492495
     
    587590            LOG_MEDIA_MESSAGE("[Seek] reset pipeline");
    588591            m_resetPipeline = true;
    589             changePipelineState(GST_STATE_PAUSED);
     592            if (!changePipelineState(GST_STATE_PAUSED))
     593                loadingFailed(MediaPlayer::Empty);
    590594        }
    591595    } else {
     
    942946                gst_element_state_get_name(requestedState));
    943947            m_requestedState = requestedState;
    944             changePipelineState(requestedState);
     948            if (!changePipelineState(requestedState))
     949                loadingFailed(MediaPlayer::Empty);
    945950        }
    946951        break;
     
    12221227        LOG_MEDIA_MESSAGE("State: %s, pending: %s", gst_element_state_get_name(state), gst_element_state_get_name(pending));
    12231228
     1229        // Do nothing if on EOS and state changed to READY to avoid recreating the player
     1230        // on HTMLMediaElement and properly generate the video 'ended' event.
     1231        if (m_isEndReached && state == GST_STATE_READY)
     1232            break;
     1233
    12241234        if (state <= GST_STATE_READY) {
    12251235            m_resetPipeline = true;
     
    12391249            break;
    12401250        case GST_STATE_READY:
    1241             // Do not change network/ready states if on EOS and state changed to READY to avoid
    1242             // recreating the player on HTMLMediaElement.
    1243             if (!m_isEndReached) {
    1244                 m_readyState = MediaPlayer::HaveMetadata;
    1245                 m_networkState = MediaPlayer::Empty;
    1246             }
     1251            m_readyState = MediaPlayer::HaveMetadata;
     1252            m_networkState = MediaPlayer::Empty;
    12471253            break;
    12481254        case GST_STATE_PAUSED:
     
    15301536    }
    15311537
    1532     // Loading failed, force reset pipeline and remove ready timer.
    1533     gst_element_set_state(m_playBin.get(), GST_STATE_NULL);
     1538    // Loading failed, remove ready timer.
    15341539    if (m_readyTimerHandler) {
    15351540        g_source_remove(m_readyTimerHandler);
Note: See TracChangeset for help on using the changeset viewer.