Changeset 252938 in webkit


Ignore:
Timestamp:
Nov 29, 2019 3:11:00 AM (4 years ago)
Author:
Philippe Normand
Message:

Unreviewed, rolling out r252937.

broke GTK/WPE builds and most likely media track notification
support

Reverted changeset:

"[GStreamer] MediaPlayerPrivateGStreamer style cleanups"
https://bugs.webkit.org/show_bug.cgi?id=204617
https://trac.webkit.org/changeset/252937

Location:
trunk/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r252937 r252938  
     12019-11-29  Philippe Normand  <pnormand@igalia.com>
     2
     3        Unreviewed, rolling out r252937.
     4
     5        broke GTK/WPE builds and most likely media track notification
     6        support
     7
     8        Reverted changeset:
     9
     10        "[GStreamer] MediaPlayerPrivateGStreamer style cleanups"
     11        https://bugs.webkit.org/show_bug.cgi?id=204617
     12        https://trac.webkit.org/changeset/252937
     13
    1142019-11-29  Charlie Turner  <cturner@igalia.com>
    215
  • trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp

    r252937 r252938  
    337337#endif
    338338
    339 static void initializeDebugCategory()
    340 {
    341     static std::once_flag onceFlag;
    342     std::call_once(onceFlag, [] {
    343         GST_DEBUG_CATEGORY_INIT(webkit_media_player_debug, "webkitmediaplayer", 0, "WebKit media player");
    344     });
     339void MediaPlayerPrivateGStreamer::initializeDebugCategory()
     340{
     341    GST_DEBUG_CATEGORY_INIT(webkit_media_player_debug, "webkitmediaplayer", 0, "WebKit media player");
    345342}
    346343
     
    501498    if (m_preload == MediaPlayer::None) {
    502499        GST_INFO_OBJECT(pipeline(), "Delaying load.");
    503         m_isDelayingLoad = true;
     500        m_delayingLoad = true;
    504501    }
    505502
     
    510507    m_readyState = MediaPlayer::HaveNothing;
    511508    m_player->readyStateChanged();
    512     m_areVolumeAndMuteInitialized = false;
     509    m_volumeAndMuteInitialized = false;
    513510    m_hasTaintedOrigin = WTF::nullopt;
    514511
    515     if (!m_isDelayingLoad)
     512    if (!m_delayingLoad)
    516513        commitLoad();
    517514}
     
    545542#endif
    546543
     544void MediaPlayerPrivateGStreamer::commitLoad()
     545{
     546    ASSERT(!m_delayingLoad);
     547    GST_DEBUG_OBJECT(pipeline(), "Committing load.");
     548
     549    // GStreamer needs to have the pipeline set to a paused state to
     550    // start providing anything useful.
     551    changePipelineState(GST_STATE_PAUSED);
     552
     553    updateDownloadBufferingFlag();
     554    updateStates();
     555}
     556
    547557void MediaPlayerPrivateGStreamer::cancelLoad()
    548558{
     
    558568    GST_DEBUG_OBJECT(pipeline(), "Prepare to play");
    559569    m_preload = MediaPlayer::Auto;
    560     if (m_isDelayingLoad) {
    561         m_isDelayingLoad = false;
     570    if (m_delayingLoad) {
     571        m_delayingLoad = false;
    562572        commitLoad();
    563573    }
     
    567577{
    568578    if (!m_playbackRate) {
    569         m_isPlaybackRatePaused = true;
     579        m_playbackRatePause = true;
    570580        return;
    571581    }
     
    573583    if (changePipelineState(GST_STATE_PLAYING)) {
    574584        m_isEndReached = false;
    575         m_isDelayingLoad = false;
     585        m_delayingLoad = false;
    576586        m_preload = MediaPlayer::Auto;
    577587        updateDownloadBufferingFlag();
     
    583593void MediaPlayerPrivateGStreamer::pause()
    584594{
    585     m_isPlaybackRatePaused = false;
     595    m_playbackRatePause = false;
    586596    GstState currentState, pendingState;
    587597    gst_element_get_state(m_pipeline.get(), &currentState, &pendingState, 0);
     
    605615    }
    606616
    607     if (m_isPlaybackRatePaused) {
     617    if (m_playbackRatePause) {
    608618        GST_DEBUG_OBJECT(pipeline(), "Playback rate is 0, simulating PAUSED state");
    609619        return false;
     
    624634    if (rate < 0) {
    625635        startTime = MediaTime::zeroTime();
    626         // If we are at beginning of media, start from the end to avoid immediate EOS.
    627         endTime = position < MediaTime::zeroTime() ? durationMediaTime() : position;
     636        // If we are at beginning of media, start from the end to
     637        // avoid immediate EOS.
     638        if (position < MediaTime::zeroTime())
     639            endTime = durationMediaTime();
     640        else
     641            endTime = position;
    628642    }
    629643
     
    637651void MediaPlayerPrivateGStreamer::seek(const MediaTime& mediaTime)
    638652{
    639     if (!m_pipeline || m_didErrorOccur)
     653    if (!m_pipeline)
     654        return;
     655
     656    if (m_errorOccured)
    640657        return;
    641658
     
    650667    MediaTime time = std::min(mediaTime, durationMediaTime());
    651668
    652     if (m_isLiveStream) {
     669    if (isLiveStream()) {
    653670        GST_DEBUG_OBJECT(pipeline(), "[Seek] Live stream seek unhandled");
    654671        return;
     
    657674    GST_INFO_OBJECT(pipeline(), "[Seek] seeking to %s", toString(time).utf8().data());
    658675
    659     if (m_isSeeking) {
     676    if (m_seeking) {
    660677        m_timeOfOverlappingSeek = time;
    661         if (m_isSeekPending) {
     678        if (m_seekIsPending) {
    662679            m_seekTime = time;
    663680            return;
     
    672689    }
    673690    if (getStateResult == GST_STATE_CHANGE_ASYNC || state < GST_STATE_PAUSED || m_isEndReached) {
    674         m_isSeekPending = true;
     691        m_seekIsPending = true;
    675692        if (m_isEndReached) {
    676693            GST_DEBUG_OBJECT(pipeline(), "[Seek] reset pipeline");
    677             m_shouldResetPipeline = true;
     694            m_resetPipeline = true;
    678695            if (!changePipelineState(GST_STATE_PAUSED))
    679696                loadingFailed(MediaPlayer::Empty);
     
    687704    }
    688705
    689     m_isSeeking = true;
     706    m_seeking = true;
    690707    m_seekTime = time;
    691708    m_isEndReached = false;
     
    694711void MediaPlayerPrivateGStreamer::updatePlaybackRate()
    695712{
    696     if (!m_isChangingRate)
     713    if (!m_changingRate)
    697714        return;
    698715
     
    700717
    701718    // Mute the sound if the playback rate is negative or too extreme and audio pitch is not adjusted.
    702     bool mute = m_playbackRate <= 0 || (!m_shouldPreservePitch && (m_playbackRate < 0.8 || m_playbackRate > 2));
     719    bool mute = m_playbackRate <= 0 || (!m_preservesPitch && (m_playbackRate < 0.8 || m_playbackRate > 2));
    703720
    704721    GST_INFO_OBJECT(pipeline(), mute ? "Need to mute audio" : "Do not need to mute audio");
     
    712729    }
    713730
    714     if (m_isPlaybackRatePaused) {
    715         GstState state, pending;
     731    if (m_playbackRatePause) {
     732        GstState state;
     733        GstState pending;
    716734
    717735        gst_element_get_state(m_pipeline.get(), &state, &pending, 0);
    718736        if (state != GST_STATE_PLAYING && pending != GST_STATE_PLAYING)
    719737            changePipelineState(GST_STATE_PLAYING);
    720         m_isPlaybackRatePaused = false;
    721     }
    722 
    723     m_isChangingRate = false;
     738        m_playbackRatePause = false;
     739    }
     740
     741    m_changingRate = false;
    724742    m_player->rateChanged();
     743}
     744
     745MediaTime MediaPlayerPrivateGStreamer::platformDuration() const
     746{
     747    if (!m_pipeline)
     748        return MediaTime::invalidTime();
     749
     750    GST_TRACE_OBJECT(pipeline(), "errorOccured: %s, pipeline state: %s", boolForPrinting(m_errorOccured), gst_element_state_get_name(GST_STATE(m_pipeline.get())));
     751    if (m_errorOccured)
     752        return MediaTime::invalidTime();
     753
     754    // The duration query would fail on a not-prerolled pipeline.
     755    if (GST_STATE(m_pipeline.get()) < GST_STATE_PAUSED)
     756        return MediaTime::invalidTime();
     757
     758    int64_t duration = 0;
     759    if (!gst_element_query_duration(m_pipeline.get(), GST_FORMAT_TIME, &duration) || !GST_CLOCK_TIME_IS_VALID(duration)) {
     760        GST_DEBUG_OBJECT(pipeline(), "Time duration query failed for %s", m_url.string().utf8().data());
     761        return MediaTime::positiveInfiniteTime();
     762    }
     763
     764    GST_LOG_OBJECT(pipeline(), "Duration: %" GST_TIME_FORMAT, GST_TIME_ARGS(duration));
     765    return MediaTime(duration, GST_SECOND);
    725766}
    726767
     
    742783MediaTime MediaPlayerPrivateGStreamer::currentMediaTime() const
    743784{
    744     if (!m_pipeline || m_didErrorOccur)
     785    if (!m_pipeline || m_errorOccured)
    745786        return MediaTime::invalidTime();
    746787
    747     GST_TRACE_OBJECT(pipeline(), "seeking: %s, seekTime: %s", boolForPrinting(m_isSeeking), m_seekTime.toString().utf8().data());
    748     if (m_isSeeking)
     788    GST_TRACE_OBJECT(pipeline(), "seeking: %s, seekTime: %s", boolForPrinting(m_seeking), m_seekTime.toString().utf8().data());
     789    if (m_seeking)
    749790        return m_seekTime;
    750791
     
    754795void MediaPlayerPrivateGStreamer::setRate(float rate)
    755796{
    756     float rateClamped = clampTo(rate, -20.0, 20.0);
    757     if (rateClamped != rate)
    758         GST_WARNING("Clamping original rate (%f) to [-20, 20] (%f), higher rates cause crashes", rate, rateClamped);
     797    // Higher rate causes crash.
     798    rate = clampTo(rate, -20.0, 20.0);
    759799
    760800    // Avoid useless playback rate update.
    761     if (m_playbackRate == rateClamped) {
    762         // And make sure that upper layers were notified if rate was set.
    763 
    764         if (!m_isChangingRate && m_player->rate() != m_playbackRate)
     801    if (m_playbackRate == rate) {
     802        // and make sure that upper layers were notified if rate was set
     803
     804        if (!m_changingRate && m_player->rate() != m_playbackRate)
    765805            m_player->rateChanged();
    766806        return;
    767807    }
    768808
    769     if (m_isLiveStream) {
    770         // Notify upper layers that we cannot handle passed rate.
    771         m_isChangingRate = false;
     809    if (isLiveStream()) {
     810        // notify upper layers that we cannot handle passed rate.
     811        m_changingRate = false;
    772812        m_player->rateChanged();
    773813        return;
    774814    }
    775815
    776     GstState state, pending;
    777 
    778     m_playbackRate = rateClamped;
    779     m_isChangingRate = true;
     816    GstState state;
     817    GstState pending;
     818
     819    m_playbackRate = rate;
     820    m_changingRate = true;
    780821
    781822    gst_element_get_state(m_pipeline.get(), &state, &pending, 0);
    782823
    783     if (!rateClamped) {
    784         m_isChangingRate = false;
    785         m_isPlaybackRatePaused = true;
     824    if (!rate) {
     825        m_changingRate = false;
     826        m_playbackRatePause = true;
    786827        if (state != GST_STATE_PAUSED && pending != GST_STATE_PAUSED)
    787828            changePipelineState(GST_STATE_PAUSED);
     
    803844void MediaPlayerPrivateGStreamer::setPreservesPitch(bool preservesPitch)
    804845{
    805     m_shouldPreservePitch = preservesPitch;
     846    m_preservesPitch = preservesPitch;
    806847}
    807848
     
    809850{
    810851    GST_DEBUG_OBJECT(pipeline(), "Setting preload to %s", convertEnumerationToString(preload).utf8().data());
    811     if (preload == MediaPlayer::Auto && m_isLiveStream)
     852    if (preload == MediaPlayer::Auto && isLiveStream())
    812853        return;
    813854
     
    815856    updateDownloadBufferingFlag();
    816857
    817     if (m_isDelayingLoad && m_preload != MediaPlayer::None) {
    818         m_isDelayingLoad = false;
     858    if (m_delayingLoad && m_preload != MediaPlayer::None) {
     859        m_delayingLoad = false;
    819860        commitLoad();
    820861    }
     
    824865{
    825866    auto timeRanges = makeUnique<PlatformTimeRanges>();
    826     if (m_didErrorOccur || m_isLiveStream)
     867    if (m_errorOccured || isLiveStream())
    827868        return timeRanges;
    828869
     
    836877        return timeRanges;
    837878
    838     unsigned numBufferingRanges = gst_query_get_n_buffering_ranges(query.get());
    839     for (unsigned index = 0; index < numBufferingRanges; index++) {
     879    guint numBufferingRanges = gst_query_get_n_buffering_ranges(query.get());
     880    for (guint index = 0; index < numBufferingRanges; index++) {
    840881        gint64 rangeStart = 0, rangeStop = 0;
    841882        if (gst_query_parse_nth_buffering_range(query.get(), index, &rangeStart, &rangeStop)) {
     
    846887    }
    847888
    848     // Fallback to the more general maxTimeLoaded() if no range has been found.
     889    // Fallback to the more general maxTimeLoaded() if no range has
     890    // been found.
    849891    if (!timeRanges->length()) {
    850892        MediaTime loaded = maxTimeLoaded();
     
    858900MediaTime MediaPlayerPrivateGStreamer::maxMediaTimeSeekable() const
    859901{
    860     GST_TRACE_OBJECT(pipeline(), "errorOccured: %s, isLiveStream: %s", boolForPrinting(m_didErrorOccur), boolForPrinting(m_isLiveStream));
    861     if (m_didErrorOccur)
     902    GST_TRACE_OBJECT(pipeline(), "errorOccured: %s, isLiveStream: %s", boolForPrinting(m_errorOccured), boolForPrinting(isLiveStream()));
     903    if (m_errorOccured)
    862904        return MediaTime::zeroTime();
    863905
    864     if (m_isLiveStream)
     906    if (isLiveStream())
    865907        return MediaTime::zeroTime();
    866908
    867909    MediaTime duration = durationMediaTime();
    868910    GST_DEBUG_OBJECT(pipeline(), "maxMediaTimeSeekable, duration: %s", toString(duration).utf8().data());
    869     // Infinite duration means live stream.
     911    // infinite duration means live stream
    870912    if (duration.isPositiveInfinite())
    871913        return MediaTime::zeroTime();
     
    876918MediaTime MediaPlayerPrivateGStreamer::maxTimeLoaded() const
    877919{
    878     if (m_didErrorOccur)
     920    if (m_errorOccured)
    879921        return MediaTime::zeroTime();
    880922
     
    888930bool MediaPlayerPrivateGStreamer::didLoadingProgress() const
    889931{
    890     if (m_didErrorOccur || m_loadingStalled)
     932    if (m_errorOccured || m_loadingStalled)
    891933        return false;
    892934
     
    911953unsigned long long MediaPlayerPrivateGStreamer::totalBytes() const
    912954{
    913     if (m_didErrorOccur || !m_source || m_isLiveStream)
     955    if (m_errorOccured)
    914956        return 0;
    915957
    916958    if (m_totalBytes)
    917959        return m_totalBytes;
     960
     961    if (!m_source)
     962        return 0;
     963
     964    if (isLiveStream())
     965        return 0;
    918966
    919967    GstFormat fmt = GST_FORMAT_BYTES;
     
    922970        GST_INFO_OBJECT(pipeline(), "totalBytes %" G_GINT64_FORMAT, length);
    923971        m_totalBytes = static_cast<unsigned long long>(length);
    924         m_isLiveStream = !length;
     972        m_isStreaming = !length;
    925973        return m_totalBytes;
    926974    }
    927975
    928     // Fall back to querying the source pads manually. See also https://bugzilla.gnome.org/show_bug.cgi?id=638749
     976    // Fall back to querying the source pads manually.
     977    // See also https://bugzilla.gnome.org/show_bug.cgi?id=638749
    929978    GstIterator* iter = gst_element_iterate_src_pads(m_source.get());
    930979    bool done = false;
     
    9561005    GST_INFO_OBJECT(pipeline(), "totalBytes %" G_GINT64_FORMAT, length);
    9571006    m_totalBytes = static_cast<unsigned long long>(length);
    958     m_isLiveStream = !length;
     1007    m_isStreaming = !length;
    9591008    return m_totalBytes;
    9601009}
     
    10811130    ASSERT(m_pipeline);
    10821131
    1083     GstState currentState, pending;
     1132    GstState currentState;
     1133    GstState pending;
    10841134
    10851135    gst_element_get_state(m_pipeline.get(), &currentState, &pending, 0);
     
    10981148        return false;
    10991149
    1100     // Create a timer when entering the READY state so that we can free resources if we stay for too long on READY.
    1101     // Also lets remove the timer if we request a state change for any state other than READY. See also https://bugs.webkit.org/show_bug.cgi?id=117354
     1150    // Create a timer when entering the READY state so that we can free resources
     1151    // if we stay for too long on READY.
     1152    // Also lets remove the timer if we request a state change for any state other than READY.
     1153    // See also https://bugs.webkit.org/show_bug.cgi?id=117354
    11021154    if (newState == GST_STATE_READY && !m_readyTimerHandler.isActive()) {
    1103         // Max interval in seconds to stay in the READY state on manual state change requests.
     1155        // Max interval in seconds to stay in the READY state on manual
     1156        // state change requests.
    11041157        static const Seconds readyStateTimerDelay { 1_min };
    11051158        m_readyTimerHandler.startOneShot(readyStateTimerDelay);
     
    11451198}
    11461199
    1147 enum MediaType {
    1148     Video, Audio, Text
    1149 };
    1150 void MediaPlayerPrivateGStreamer::notifyPlayerOf(MediaType mediaType)
     1200void MediaPlayerPrivateGStreamer::notifyPlayerOfVideo()
    11511201{
    11521202    if (UNLIKELY(!m_pipeline || !m_source))
     
    11551205    ASSERT(m_isLegacyPlaybin || isMediaSource());
    11561206
    1157     const char *mediaType;
    1158     const char *sourceType;
    1159     switch (mediaType) {
    1160     case MediaType::Video:
    1161         mediaType = "video";
    1162         sourceType = "n-video";       
    1163         break;
    1164     case MediaType::Audio:
    1165         mediaType = "audio";
    1166         sourceType = "n-audio";       
    1167         break;
    1168     case MediaType::Text:
    1169         mediaType = "text";
    1170         sourceType = "n-text";
    1171         break;
    1172     }
    1173 
    1174     unsigned numTracks = 0;
     1207    gint numTracks = 0;
    11751208    bool useMediaSource = isMediaSource();
    11761209    GstElement* element = useMediaSource ? m_source.get() : m_pipeline.get();
    1177     g_object_get(element, sourceType, &numTracks, nullptr);
     1210    g_object_get(element, "n-video", &numTracks, nullptr);
    11781211
    11791212    GST_INFO_OBJECT(pipeline(), "Media has %d video tracks", numTracks);
     
    11951228#if ENABLE(VIDEO_TRACK)
    11961229    Vector<String> validVideoStreams;
    1197     for (unsigned i = 0; i < numTracks; ++i) {
     1230    for (gint i = 0; i < numTracks; ++i) {
    11981231        GRefPtr<GstPad> pad;
    11991232        g_signal_emit_by_name(m_pipeline.get(), "get-video-pad", i, &pad.outPtr(), nullptr);
     
    12021235        String streamId = "V" + String::number(i);
    12031236        validVideoStreams.append(streamId);
    1204         if (i < m_videoTracks.size()) {
     1237        if (i < static_cast<gint>(m_videoTracks.size())) {
    12051238            RefPtr<VideoTrackPrivateGStreamer> existingTrack = m_videoTracks.get(streamId);
    12061239            if (existingTrack) {
     
    12231256}
    12241257
    1225 void MediaPlayerPrivateGStreamer::notifyPlayerOfVideo()
    1226 {
    1227 }
    1228 
    12291258void MediaPlayerPrivateGStreamer::videoSinkCapsChangedCallback(MediaPlayerPrivateGStreamer* player)
    12301259{
     
    12541283    ASSERT(m_isLegacyPlaybin || isMediaSource());
    12551284
    1256     unsigned numTracks = 0;
     1285    gint numTracks = 0;
    12571286    bool useMediaSource = isMediaSource();
    12581287    GstElement* element = useMediaSource ? m_source.get() : m_pipeline.get();
     
    12731302#if ENABLE(VIDEO_TRACK)
    12741303    Vector<String> validAudioStreams;
    1275     for (unsigned i = 0; i < numTracks; ++i) {
     1304    for (gint i = 0; i < numTracks; ++i) {
    12761305        GRefPtr<GstPad> pad;
    12771306        g_signal_emit_by_name(m_pipeline.get(), "get-audio-pad", i, &pad.outPtr(), nullptr);
     
    12801309        String streamId = "A" + String::number(i);
    12811310        validAudioStreams.append(streamId);
    1282         if (i < m_audioTracks.size()) {
     1311        if (i < static_cast<gint>(m_audioTracks.size())) {
    12831312            RefPtr<AudioTrackPrivateGStreamer> existingTrack = m_audioTracks.get(streamId);
    12841313            if (existingTrack) {
     
    13161345    ASSERT(m_isLegacyPlaybin || isMediaSource());
    13171346
    1318     unsigned numTracks = 0;
     1347    gint numTracks = 0;
    13191348    bool useMediaSource = isMediaSource();
    13201349    GstElement* element = useMediaSource ? m_source.get() : m_pipeline.get();
     
    13291358
    13301359    Vector<String> validTextStreams;
    1331     for (unsigned i = 0; i < numTracks; ++i) {
     1360    for (gint i = 0; i < numTracks; ++i) {
    13321361        GRefPtr<GstPad> pad;
    13331362        g_signal_emit_by_name(m_pipeline.get(), "get-text-pad", i, &pad.outPtr(), nullptr);
     
    13411370
    13421371        validTextStreams.append(streamId);
    1343         if (i < m_textTracks.size()) {
     1372        if (i < static_cast<gint>(m_textTracks.size())) {
    13441373            RefPtr<InbandTextTrackPrivateGStreamer> existingTrack = m_textTracks.get(streamId);
    13451374            if (existingTrack) {
     
    13941423#endif
    13951424
    1396 MediaTime MediaPlayerPrivateGStreamer::platformDuration() const
    1397 {
    1398     if (!m_pipeline)
    1399         return MediaTime::invalidTime();
    1400 
    1401     GST_TRACE_OBJECT(pipeline(), "errorOccured: %s, pipeline state: %s", boolForPrinting(m_didErrorOccur), gst_element_state_get_name(GST_STATE(m_pipeline.get())));
    1402     if (m_didErrorOccur)
    1403         return MediaTime::invalidTime();
    1404 
    1405     // The duration query would fail on a not-prerolled pipeline.
    1406     if (GST_STATE(m_pipeline.get()) < GST_STATE_PAUSED)
    1407         return MediaTime::invalidTime();
    1408 
    1409     int64_t duration = 0;
    1410     if (!gst_element_query_duration(m_pipeline.get(), GST_FORMAT_TIME, &duration) || !GST_CLOCK_TIME_IS_VALID(duration)) {
    1411         GST_DEBUG_OBJECT(pipeline(), "Time duration query failed for %s", m_url.string().utf8().data());
    1412         return MediaTime::positiveInfiniteTime();
    1413     }
    1414 
    1415     GST_LOG_OBJECT(pipeline(), "Duration: %" GST_TIME_FORMAT, GST_TIME_ARGS(duration));
    1416     return MediaTime(duration, GST_SECOND);
    1417 }
    1418 
    1419 bool MediaPlayerPrivateGStreamer::isMuted() const
    1420 {
    1421     if (!m_volumeElement)
    1422         return false;
    1423 
    1424     gboolean isMuted;
    1425     g_object_get(m_volumeElement.get(), "mute", &isMuted, nullptr);
    1426     GST_INFO_OBJECT(pipeline(), "Player is muted: %s", boolForPrinting(!!isMuted));
    1427     return isMuted;
    1428 }
    1429 
    1430 void MediaPlayerPrivateGStreamer::commitLoad()
    1431 {
    1432     ASSERT(!m_isDelayingLoad);
    1433     GST_DEBUG_OBJECT(pipeline(), "Committing load.");
    1434 
    1435     // GStreamer needs to have the pipeline set to a paused state to
    1436     // start providing anything useful.
    1437     changePipelineState(GST_STATE_PAUSED);
    1438 
    1439     updateDownloadBufferingFlag();
    1440     updateStates();
    1441 }
    1442 
    14431425void MediaPlayerPrivateGStreamer::fillTimerFired()
    14441426{
    1445     if (m_didErrorOccur) {
     1427    if (m_errorOccured) {
    14461428        GST_DEBUG_OBJECT(pipeline(), "[Buffering] An error occurred, disabling the fill timer");
    14471429        m_fillTimer.stop();
     
    14851467    GST_WARNING("Loading failed, error: %s", convertEnumerationToString(networkError).utf8().data());
    14861468
    1487     m_didErrorOccur = true;
     1469    m_errorOccured = true;
    14881470    if (forceNotifications || m_networkState != networkError) {
    14891471        m_networkState = networkError;
     
    15281510MediaTime MediaPlayerPrivateGStreamer::playbackPosition() const
    15291511{
    1530     GST_TRACE_OBJECT(pipeline(), "isEndReached: %s, seeking: %s, seekTime: %s", boolForPrinting(m_isEndReached), boolForPrinting(m_isSeeking), m_seekTime.toString().utf8().data());
    1531     if (m_isEndReached && m_isSeeking)
     1512    GST_TRACE_OBJECT(pipeline(), "isEndReached: %s, seeking: %s, seekTime: %s", boolForPrinting(m_isEndReached), boolForPrinting(m_seeking), m_seekTime.toString().utf8().data());
     1513    if (m_isEndReached && m_seeking)
    15321514        return m_seekTime;
    15331515
     
    15491531    gst_query_unref(query);
    15501532
     1533    GST_TRACE_OBJECT(pipeline(), "Position %" GST_TIME_FORMAT ", canFallBackToLastFinishedSeekPosition: %s", GST_TIME_ARGS(position), boolForPrinting(m_canFallBackToLastFinishedSeekPosition));
     1534
     1535    MediaTime playbackPosition = MediaTime::zeroTime();
    15511536    GstClockTime gstreamerPosition = static_cast<GstClockTime>(position);
    1552     GST_TRACE_OBJECT(pipeline(), "Position %" GST_TIME_FORMAT ", canFallBackToLastFinishedSeekPosition: %s", GST_TIME_ARGS(gstreamerPosition), boolForPrinting(m_canFallBackToLastFinishedSeekPosition));
    1553 
    1554     MediaTime playbackPosition = MediaTime::zeroTime();
    1555 
    15561537    if (GST_CLOCK_TIME_IS_VALID(gstreamerPosition))
    15571538        playbackPosition = MediaTime(gstreamerPosition, GST_SECOND);
     
    16291610        break;
    16301611    case TrackPrivateBaseGStreamer::TrackType::Unknown:
    1631         FALLTHROUGH;
    16321612    default:
    16331613        ASSERT_NOT_REACHED();
     
    16811661    }
    16821662
    1683     if (oldHasVideo != m_hasVideo || oldHasAudio != m_hasAudio)
     1663    if ((oldHasVideo != m_hasVideo) || (oldHasAudio != m_hasAudio))
    16841664        m_player->characteristicChanged();
    16851665
     
    17411721
    17421722    const gchar* contextType;
    1743     if (!gst_message_parse_context_type(message, &contextType))
    1744         return false;
    1745 
     1723    gst_message_parse_context_type(message, &contextType);
    17461724    GST_DEBUG_OBJECT(pipeline(), "Handling %s need-context message for %s", contextType, GST_MESSAGE_SRC_NAME(message));
    17471725
     
    17941772            gst_element_set_context(GST_ELEMENT(GST_MESSAGE_SRC(message)), context.get());
    17951773        } else
    1796             GST_WARNING("CDM instance not initialized");
     1774            GST_WARNING("CDM instance not initializaed");
    17971775
    17981776        return true;
     
    18041782}
    18051783
    1806 // Returns the size of the video.
     1784// Returns the size of the video
    18071785FloatSize MediaPlayerPrivateGStreamer::naturalSize() const
    18081786{
     
    18421820        return FloatSize();
    18431821
    1844     // TODO: handle possible clean aperture data. See https://bugzilla.gnome.org/show_bug.cgi?id=596571
    1845     // TODO: handle possible transformation matrix. See https://bugzilla.gnome.org/show_bug.cgi?id=596326
     1822    // TODO: handle possible clean aperture data. See
     1823    // https://bugzilla.gnome.org/show_bug.cgi?id=596571
     1824    // TODO: handle possible transformation matrix. See
     1825    // https://bugzilla.gnome.org/show_bug.cgi?id=596326
    18461826
    18471827    // Get the video PAR and original size, if this fails the
     
    18551835#if USE(TEXTURE_MAPPER_GL)
    18561836    // When using accelerated compositing, if the video is tagged as rotated 90 or 270 degrees, swap width and height.
    1857     if (m_canRenderingBeAccelerated) {
     1837    if (m_renderingCanBeAccelerated) {
    18581838        if (m_videoSourceOrientation.usesWidthAsHeight())
    18591839            originalSize = originalSize.transposedSize();
     
    18741854
    18751855    // Apply DAR to original video size. This is the same behavior as in xvimagesink's setcaps function.
    1876     uint64_t width = 0, height = 0;
     1856    guint64 width = 0, height = 0;
    18771857    if (!(originalSize.height() % displayHeight)) {
    18781858        GST_DEBUG_OBJECT(pipeline(), "Keeping video original height");
    18791859        width = gst_util_uint64_scale_int(originalSize.height(), displayWidth, displayHeight);
    1880         height = originalSize.height();
     1860        height = static_cast<guint64>(originalSize.height());
    18811861    } else if (!(originalSize.width() % displayWidth)) {
    18821862        GST_DEBUG_OBJECT(pipeline(), "Keeping video original width");
    18831863        height = gst_util_uint64_scale_int(originalSize.width(), displayHeight, displayWidth);
    1884         width = originalSize.width();
     1864        width = static_cast<guint64>(originalSize.width());
    18851865    } else {
    18861866        GST_DEBUG_OBJECT(pipeline(), "Approximating while keeping original video height");
    18871867        width = gst_util_uint64_scale_int(originalSize.height(), displayWidth, displayHeight);
    1888         height = originalSize.height();
     1868        height = static_cast<guint64>(originalSize.height());
    18891869    }
    18901870
     
    19441924}
    19451925
    1946 void MediaPlayerPrivateGStreamer::setMuted(bool shouldMute)
    1947 {
    1948     if (!m_volumeElement || shouldMute == isMuted())
    1949         return;
    1950 
    1951     GST_INFO_OBJECT(pipeline(), "Muted? %s", boolForPrinting(shouldMute));
    1952     g_object_set(m_volumeElement.get(), "mute", shouldMute, nullptr);
     1926void MediaPlayerPrivateGStreamer::sizeChanged()
     1927{
     1928    notImplemented();
     1929}
     1930
     1931void MediaPlayerPrivateGStreamer::setMuted(bool mute)
     1932{
     1933    if (!m_volumeElement)
     1934        return;
     1935
     1936    bool currentValue = muted();
     1937    if (currentValue == mute)
     1938        return;
     1939
     1940    GST_INFO_OBJECT(pipeline(), "Set muted to %s", toString(mute).utf8().data());
     1941    g_object_set(m_volumeElement.get(), "mute", mute, nullptr);
     1942}
     1943
     1944bool MediaPlayerPrivateGStreamer::muted() const
     1945{
     1946    if (!m_volumeElement)
     1947        return false;
     1948
     1949    gboolean muted;
     1950    g_object_get(m_volumeElement.get(), "mute", &muted, nullptr);
     1951    GST_INFO_OBJECT(pipeline(), "Player is muted: %s", toString(static_cast<bool>(muted)).utf8().data());
     1952    return muted;
    19531953}
    19541954
     
    20002000    switch (GST_MESSAGE_TYPE(message)) {
    20012001    case GST_MESSAGE_ERROR:
    2002         if (m_shouldResetPipeline || !m_missingPluginCallbacks.isEmpty() || m_didErrorOccur)
     2002        if (m_resetPipeline || !m_missingPluginCallbacks.isEmpty() || m_errorOccured)
    20032003            break;
    20042004        gst_message_parse_error(message, &err.outPtr(), &debug.outPtr());
     
    20152015            error = MediaPlayer::FormatError;
    20162016        else if (g_error_matches(err.get(), GST_STREAM_ERROR, GST_STREAM_ERROR_TYPE_NOT_FOUND)) {
    2017             // Let the mediaPlayerClient handle the stream error, in this case the HTMLMediaElement will emit a stalled event.
     2017            // Let the mediaPlayerClient handle the stream error, in
     2018            // this case the HTMLMediaElement will emit a stalled
     2019            // event.
    20182020            GST_ERROR("Decode error, let the Media element emit a stalled event.");
    20192021            m_loadingStalled = true;
     
    20282030            issueError = !loadNextLocation();
    20292031        if (issueError) {
    2030             m_didErrorOccur = true;
     2032            m_errorOccured = true;
    20312033            if (m_networkState != error) {
    20322034                m_networkState = error;
     
    20392041        break;
    20402042    case GST_MESSAGE_ASYNC_DONE:
    2041         if (!messageSourceIsPlaybin || m_isDelayingLoad)
     2043        if (!messageSourceIsPlaybin || m_delayingLoad)
    20422044            break;
    20432045        asyncStateChangeDone();
    20442046        break;
    20452047    case GST_MESSAGE_STATE_CHANGED: {
    2046         if (!messageSourceIsPlaybin || m_isDelayingLoad)
     2048        if (!messageSourceIsPlaybin || m_delayingLoad)
    20472049            break;
    20482050        updateStates();
     
    21752177                }
    21762178                if (!isRangeRequest) {
    2177                     m_isLiveStream = !contentLength;
    2178                     GST_INFO_OBJECT(pipeline(), "%s stream detected", m_isLiveStream ? "Live" : "Non-live");
     2179                    m_isStreaming = !contentLength;
     2180                    GST_INFO_OBJECT(pipeline(), "%s stream detected", m_isStreaming ? "Live" : "Non-live");
    21792181                    updateDownloadBufferingFlag();
    21802182                }
     
    22842286    GST_DEBUG_OBJECT(pipeline(), "[Buffering] mode: %s, status: %f%%", enumToString(GST_TYPE_BUFFERING_MODE, mode).data(), percentage);
    22852287
    2286     m_didDownloadFinish = percentage == 100;
    2287     m_isBuffering = !m_didDownloadFinish;
     2288    m_downloadFinished = percentage == 100;
     2289    m_buffering = !m_downloadFinished;
    22882290
    22892291    switch (mode) {
     
    22922294
    22932295        m_bufferingPercentage = percentage;
    2294         if (m_didDownloadFinish)
     2296        if (m_downloadFinished)
    22952297            updateStates();
    22962298
     
    23022304        // Media is now fully loaded. It will play even if network connection is
    23032305        // cut. Buffering is done, remove the fill source from the main loop.
    2304         if (m_didDownloadFinish)
     2306        if (m_downloadFinished)
    23052307            m_fillTimer.stop();
    23062308
     
    23222324        const GstMpegtsPMT* pmt = gst_mpegts_section_get_pmt(section);
    23232325        m_metadataTracks.clear();
    2324         for (unsigned i = 0; i < pmt->streams->len; ++i) {
     2326        for (guint i = 0; i < pmt->streams->len; ++i) {
    23252327            const GstMpegtsPMTStream* stream = static_cast<const GstMpegtsPMTStream*>(g_ptr_array_index(pmt->streams, i));
    23262328            if (stream->stream_type == 0x05 || stream->stream_type >= 0x80) {
     
    23412343                String inbandMetadataTrackDispatchType;
    23422344                appendUnsignedAsHexFixedSize(stream->stream_type, inbandMetadataTrackDispatchType, 2);
    2343                 for (unsigned j = 0; j < stream->descriptors->len; ++j) {
     2345                for (guint j = 0; j < stream->descriptors->len; ++j) {
    23442346                    const GstMpegtsDescriptor* descriptor = static_cast<const GstMpegtsDescriptor*>(g_ptr_array_index(stream->descriptors, j));
    2345                     for (unsigned k = 0; k < descriptor->length; ++k)
     2347                    for (guint k = 0; k < descriptor->length; ++k)
    23462348                        appendByteAsHex(descriptor->data[k], inbandMetadataTrackDispatchType);
    23472349                }
     
    23932395    gint64 start = -1, stop = -1;
    23942396    gst_toc_entry_get_start_stop_times(entry, &start, &stop);
    2395 
    2396     uint32_t truncatedGstSecond = static_cast<uint32_t>(GST_SECOND);
    23972397    if (start != -1)
    2398         cue->setStartTime(MediaTime(static_cast<int64_t>(start), truncatedGstSecond));
     2398        cue->setStartTime(MediaTime(start, GST_SECOND));
    23992399    if (stop != -1)
    2400         cue->setEndTime(MediaTime(static_cast<int64_t>(stop), truncatedGstSecond));
     2400        cue->setEndTime(MediaTime(stop, GST_SECOND));
    24012401
    24022402    GstTagList* tags = gst_toc_entry_get_tags(entry);
     
    24962496void MediaPlayerPrivateGStreamer::asyncStateChangeDone()
    24972497{
    2498     if (!m_pipeline || m_didErrorOccur)
    2499         return;
    2500 
    2501     if (m_isSeeking) {
    2502         if (m_isSeekPending)
     2498    if (!m_pipeline || m_errorOccured)
     2499        return;
     2500
     2501    if (m_seeking) {
     2502        if (m_seekIsPending)
    25032503            updateStates();
    25042504        else {
    25052505            GST_DEBUG_OBJECT(pipeline(), "[Seek] seeked to %s", toString(m_seekTime).utf8().data());
    2506             m_isSeeking = false;
     2506            m_seeking = false;
    25072507            m_cachedPosition = MediaTime::invalidTime();
    25082508            if (m_timeOfOverlappingSeek != m_seekTime && m_timeOfOverlappingSeek.isValid()) {
     
    25242524void MediaPlayerPrivateGStreamer::updateStates()
    25252525{
    2526     if (!m_pipeline || m_didErrorOccur)
     2526    if (!m_pipeline)
     2527        return;
     2528
     2529    if (m_errorOccured)
    25272530        return;
    25282531
    25292532    MediaPlayer::NetworkState oldNetworkState = m_networkState;
    25302533    MediaPlayer::ReadyState oldReadyState = m_readyState;
    2531     GstState pending, state;
     2534    GstState pending;
     2535    GstState state;
    25322536    bool stateReallyChanged = false;
    25332537
     
    25492553            break;
    25502554
    2551         m_shouldResetPipeline = m_currentState <= GST_STATE_READY;
    2552 
    2553         bool didBuffering = m_isBuffering;
     2555        m_resetPipeline = m_currentState <= GST_STATE_READY;
     2556
     2557        bool didBuffering = m_buffering;
    25542558
    25552559        // Update ready and network states.
     
    25652569        case GST_STATE_PAUSED:
    25662570        case GST_STATE_PLAYING:
    2567             if (m_isBuffering) {
     2571            if (m_buffering) {
    25682572                if (m_bufferingPercentage == 100) {
    25692573                    GST_DEBUG_OBJECT(pipeline(), "[Buffering] Complete.");
    2570                     m_isBuffering = false;
     2574                    m_buffering = false;
    25712575                    m_readyState = MediaPlayer::HaveEnoughData;
    2572                     m_networkState = m_didDownloadFinish ? MediaPlayer::Idle : MediaPlayer::Loading;
     2576                    m_networkState = m_downloadFinished ? MediaPlayer::Idle : MediaPlayer::Loading;
    25732577                } else {
    25742578                    m_readyState = MediaPlayer::HaveCurrentData;
    25752579                    m_networkState = MediaPlayer::Loading;
    25762580                }
    2577             } else if (m_didDownloadFinish) {
     2581            } else if (m_downloadFinished) {
    25782582                m_readyState = MediaPlayer::HaveEnoughData;
    25792583                m_networkState = MediaPlayer::Loaded;
     
    25912595        // Sync states where needed.
    25922596        if (m_currentState == GST_STATE_PAUSED) {
    2593             if (!m_areVolumeAndMuteInitialized) {
     2597            if (!m_volumeAndMuteInitialized) {
    25942598                notifyPlayerOfVolumeChange();
    25952599                notifyPlayerOfMute();
    2596                 m_areVolumeAndMuteInitialized = true;
     2600                m_volumeAndMuteInitialized = true;
    25972601            }
    25982602
    2599             if (didBuffering && !m_isBuffering && !m_isPaused && m_playbackRate) {
     2603            if (didBuffering && !m_buffering && !m_paused && m_playbackRate) {
    26002604                GST_DEBUG_OBJECT(pipeline(), "[Buffering] Restarting playback.");
    26012605                changePipelineState(GST_STATE_PLAYING);
    26022606            }
    26032607        } else if (m_currentState == GST_STATE_PLAYING) {
    2604             m_isPaused = false;
    2605 
    2606             if ((m_isBuffering && m_isLiveStream) || !m_playbackRate) {
     2608            m_paused = false;
     2609
     2610            if ((m_buffering && !isLiveStream()) || !m_playbackRate) {
    26072611                GST_DEBUG_OBJECT(pipeline(), "[Buffering] Pausing stream for buffering.");
    26082612                changePipelineState(GST_STATE_PAUSED);
    26092613            }
    26102614        } else
    2611             m_isPaused = true;
     2615            m_paused = true;
    26122616
    26132617        GST_DEBUG_OBJECT(pipeline(), "Old state: %s, new state: %s (requested: %s)", gst_element_state_get_name(m_oldState), gst_element_state_get_name(m_currentState), gst_element_state_get_name(m_requestedState));
     
    26342638    case GST_STATE_CHANGE_FAILURE:
    26352639        GST_DEBUG_OBJECT(pipeline(), "Failure: State: %s, pending: %s", gst_element_state_get_name(m_currentState), gst_element_state_get_name(pending));
    2636         // Change failed.
     2640        // Change failed
    26372641        return;
    26382642    case GST_STATE_CHANGE_NO_PREROLL:
     
    26402644
    26412645        // Live pipelines go in PAUSED without prerolling.
    2642         m_isLiveStream = true;
     2646        m_isStreaming = true;
    26432647        updateDownloadBufferingFlag();
    26442648
     
    26472651        else if (m_currentState == GST_STATE_PAUSED) {
    26482652            m_readyState = MediaPlayer::HaveEnoughData;
    2649             m_isPaused = true;
     2653            m_paused = true;
    26502654        } else if (m_currentState == GST_STATE_PLAYING)
    2651             m_isPaused = false;
    2652 
    2653         if (!m_isPaused && m_playbackRate)
     2655            m_paused = false;
     2656
     2657        if (!m_paused && m_playbackRate)
    26542658            changePipelineState(GST_STATE_PLAYING);
    26552659
     
    26772681    if (getStateResult == GST_STATE_CHANGE_SUCCESS && m_currentState >= GST_STATE_PAUSED) {
    26782682        updatePlaybackRate();
    2679         if (m_isSeekPending) {
     2683        if (m_seekIsPending) {
    26802684            GST_DEBUG_OBJECT(pipeline(), "[Seek] committing pending seek to %s", toString(m_seekTime).utf8().data());
    2681             m_isSeekPending = false;
    2682             m_isSeeking = doSeek(m_seekTime, m_player->rate(), static_cast<GstSeekFlags>(GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE));
    2683             if (!m_isSeeking) {
     2685            m_seekIsPending = false;
     2686            m_seeking = doSeek(m_seekTime, m_player->rate(), static_cast<GstSeekFlags>(GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE));
     2687            if (!m_seeking) {
    26842688                m_cachedPosition = MediaTime::invalidTime();
    26852689                GST_DEBUG_OBJECT(pipeline(), "[Seek] seeking to %s failed", toString(m_seekTime).utf8().data());
     
    27152719
    27162720    const GValue* locations = gst_structure_get_value(m_mediaLocations, "locations");
    2717     const char* newLocation = nullptr;
     2721    const gchar* newLocation = nullptr;
    27182722
    27192723    if (!locations) {
     
    27722776
    27732777            // Reset pipeline state.
    2774             m_shouldResetPipeline = true;
     2778            m_resetPipeline = true;
    27752779
    27762780            GstState state;
     
    27982802    m_cachedPosition = MediaTime::invalidTime();
    27992803    MediaTime now = currentMediaTime();
    2800     if (now > MediaTime::zeroTime() && !m_isSeeking) {
     2804    if (now > MediaTime::zeroTime() && !m_seeking) {
    28012805        m_cachedDuration = now;
    28022806        m_player->durationChanged();
     
    28062810
    28072811    if (!m_player->client().mediaPlayerIsLooping()) {
    2808         m_isPaused = true;
     2812        m_paused = true;
    28092813        changePipelineState(GST_STATE_READY);
    2810         m_didDownloadFinish = false;
     2814        m_downloadFinished = false;
    28112815    }
    28122816    timeChanged();
     
    28612865
    28622866    // We don't want to stop downloading if we already started it.
    2863     if (flags & flagDownload && m_readyState > MediaPlayer::HaveNothing && !m_shouldResetPipeline) {
     2867    if (flags & flagDownload && m_readyState > MediaPlayer::HaveNothing && !m_resetPipeline) {
    28642868        GST_DEBUG_OBJECT(pipeline(), "Download already started, not starting again");
    28652869        return;
    28662870    }
    28672871
    2868     bool shouldDownload = !m_isLiveStream && m_preload == MediaPlayer::Auto;
     2872    bool shouldDownload = !isLiveStream() && m_preload == MediaPlayer::Auto;
    28692873    if (shouldDownload) {
    28702874        GST_INFO_OBJECT(pipeline(), "Enabling on-disk buffering");
     
    28802884void MediaPlayerPrivateGStreamer::createGSTPlayBin(const URL& url, const String& pipelineName)
    28812885{
    2882     const char* playbinName = "playbin";
     2886    const gchar* playbinName = "playbin";
    28832887
    28842888    // MSE doesn't support playbin3. Mediastream requires playbin3. Regular
     
    29032907    m_isLegacyPlaybin = !g_strcmp0(playbinName, "playbin");
    29042908
     2909    // gst_element_factory_make() returns a floating reference so
     2910    // we should not adopt.
    29052911    static Atomic<uint32_t> pipelineId;
    29062912    setPipeline(gst_element_factory_make(playbinName,
     
    29682974    configurePlaySink();
    29692975
    2970     if (m_shouldPreservePitch) {
     2976    if (m_preservesPitch) {
    29712977        GstElement* scale = gst_element_factory_make("scaletempo", nullptr);
    29722978
     
    29772983    }
    29782984
    2979     if (!m_canRenderingBeAccelerated) {
     2985    if (!m_renderingCanBeAccelerated) {
    29802986        // If not using accelerated compositing, let GStreamer handle
    29812987        // the image-orientation tag.
     
    30023008bool MediaPlayerPrivateGStreamer::canSaveMediaData() const
    30033009{
    3004     if (m_isLiveStream)
     3010    if (isLiveStream())
    30053011        return false;
    30063012
     
    30223028void MediaPlayerPrivateGStreamer::acceleratedRenderingStateChanged()
    30233029{
    3024     m_canRenderingBeAccelerated = m_player && m_player->client().mediaPlayerAcceleratedCompositingEnabled();
     3030    m_renderingCanBeAccelerated = m_player && m_player->client().mediaPlayerAcceleratedCompositingEnabled();
    30253031}
    30263032
     
    30703076                return;
    30713077
    3072             std::unique_ptr<GstVideoFrameHolder> frameHolder = makeUnique<GstVideoFrameHolder>(m_sample.get(), m_videoDecoderPlatform, m_textureMapperFlags, !m_isUsingFallbackVideoSink);
     3078            std::unique_ptr<GstVideoFrameHolder> frameHolder = makeUnique<GstVideoFrameHolder>(m_sample.get(), m_videoDecoderPlatform, m_textureMapperFlags, !m_usingFallbackVideoSink);
    30733079
    30743080            std::unique_ptr<TextureMapperPlatformLayerBuffer> layerBuffer;
     
    31123118void MediaPlayerPrivateGStreamer::triggerRepaint(GstSample* sample)
    31133119{
    3114     bool shouldTriggerResize;
     3120    bool triggerResize;
    31153121    {
    31163122        auto sampleLocker = holdLock(m_sampleMutex);
    3117         shouldTriggerResize = !m_sample;
     3123        triggerResize = !m_sample;
    31183124        m_sample = sample;
    31193125    }
    31203126
    3121     if (shouldTriggerResize) {
     3127    if (triggerResize) {
    31223128        GST_DEBUG_OBJECT(pipeline(), "First sample reached the sink, triggering video dimensions update");
    31233129        m_notifier->notify(MainThreadNotification::SizeChanged, [this] {
     
    31263132    }
    31273133
    3128     if (!m_canRenderingBeAccelerated) {
     3134    if (!m_renderingCanBeAccelerated) {
    31293135        LockHolder locker(m_drawMutex);
    3130         if (m_isBeingDestroyed)
     3136        if (m_destroying)
    31313137            return;
    31323138        m_drawTimer.startOneShot(0_s);
     
    31363142
    31373143#if USE(TEXTURE_MAPPER_GL)
    3138     if (m_isUsingFallbackVideoSink) {
     3144    if (m_usingFallbackVideoSink) {
    31393145        LockHolder lock(m_drawMutex);
    31403146        auto proxyOperation =
     
    31723178    // This function is also used when destroying the player (destroying parameter is true), to release the gstreamer thread from
    31733179    // m_drawCondition and to ensure that new triggerRepaint calls won't wait on m_drawCondition.
    3174     if (!m_canRenderingBeAccelerated) {
     3180    if (!m_renderingCanBeAccelerated) {
    31753181        LockHolder locker(m_drawMutex);
    31763182        m_drawTimer.stop();
    3177         m_isBeingDestroyed = destroying;
     3183        m_destroying = destroying;
    31783184        m_drawCondition.notifyOne();
    31793185    }
     
    32573263            m_colorConvertOutputCaps = adoptGRef(gst_caps_copy(caps));
    32583264#if G_BYTE_ORDER == G_LITTLE_ENDIAN
    3259             const char* formatString = GST_VIDEO_INFO_HAS_ALPHA(&videoInfo) ? "RGBA" : "BGRx";
     3265            const gchar* formatString = GST_VIDEO_INFO_HAS_ALPHA(&videoInfo) ? "RGBA" : "BGRx";
    32603266#else
    3261             const char* formatString = GST_VIDEO_INFO_HAS_ALPHA(&videoInfo) ? "RGBA" : "RGBx";
     3267            const gchar* formatString = GST_VIDEO_INFO_HAS_ALPHA(&videoInfo) ? "RGBA" : "RGBx";
    32623268#endif
    32633269            gst_caps_set_simple(m_colorConvertOutputCaps.get(), "format", G_TYPE_STRING, formatString, nullptr);
     
    32803286        return;
    32813287
    3282     context.drawImage(gstImage->image(), rect, gstImage->rect(), { CompositeCopy, m_canRenderingBeAccelerated ? m_videoSourceOrientation : ImageOrientation() });
     3288    context.drawImage(gstImage->image(), rect, gstImage->rect(), { CompositeCopy, m_renderingCanBeAccelerated ? m_videoSourceOrientation : ImageOrientation() });
    32833289}
    32843290
     
    32883294    UNUSED_PARAM(context);
    32893295
    3290     if (m_isUsingFallbackVideoSink)
     3296    if (m_usingFallbackVideoSink)
    32913297        return false;
    32923298
     
    33203326{
    33213327#if USE(CAIRO) && ENABLE(ACCELERATED_2D_CANVAS)
    3322     if (m_isUsingFallbackVideoSink)
     3328    if (m_usingFallbackVideoSink)
    33233329        return nullptr;
    33243330
     
    34013407        return MediaPlayer::Unknown;
    34023408
    3403     if (m_isLiveStream)
     3409    if (isLiveStream())
    34043410        return MediaPlayer::LiveStream;
    34053411
     
    34793485
    34803486#if USE(GSTREAMER_GL)
    3481     if (m_canRenderingBeAccelerated)
     3487    if (m_renderingCanBeAccelerated)
    34823488        m_videoSink = createVideoSinkGL();
    34833489#endif
    34843490
    34853491    if (!m_videoSink) {
    3486         m_isUsingFallbackVideoSink = true;
     3492        m_usingFallbackVideoSink = true;
    34873493        m_videoSink = webkitVideoSinkNew();
    34883494        g_signal_connect_swapped(m_videoSink.get(), "repaint-requested", G_CALLBACK(repaintCallback), this);
     
    35383544unsigned MediaPlayerPrivateGStreamer::decodedFrameCount() const
    35393545{
    3540     uint64_t decodedFrames = 0;
     3546    guint64 decodedFrames = 0;
    35413547    if (m_fpsSink)
    35423548        g_object_get(m_fpsSink.get(), "frames-rendered", &decodedFrames, nullptr);
     
    35463552unsigned MediaPlayerPrivateGStreamer::droppedFrameCount() const
    35473553{
    3548     uint64_t framesDropped = 0;
     3554    guint64 framesDropped = 0;
    35493555    if (m_fpsSink)
    35503556        g_object_get(m_fpsSink.get(), "frames-dropped", &framesDropped, nullptr);
     
    36443650void MediaPlayerPrivateGStreamer::attemptToDecryptWithLocalInstance()
    36453651{
    3646     bool wasEventHandled = gst_element_send_event(pipeline(), gst_event_new_custom(GST_EVENT_CUSTOM_DOWNSTREAM_OOB, gst_structure_new_empty("attempt-to-decrypt")));
    3647     GST_DEBUG("attempting to decrypt, event handled %s", boolForPrinting(wasEventHandled));
     3652    bool eventHandled = gst_element_send_event(pipeline(), gst_event_new_custom(GST_EVENT_CUSTOM_DOWNSTREAM_OOB, gst_structure_new_empty("attempt-to-decrypt")));
     3653    GST_DEBUG("attempting to decrypt, event handled %s", boolForPrinting(eventHandled));
    36483654}
    36493655
     
    36643670}
    36653671
    3666 void MediaPlayerPrivateGStreamer::setWaitingForKey(bool isWaitingForKey)
     3672void MediaPlayerPrivateGStreamer::setWaitingForKey(bool waitingForKey)
    36673673{
    36683674    // We bail out if values did not change or if we are requested to not wait anymore but there are still waiting decryptors.
    3669     GST_TRACE("isWaitingForKey %s, m_isWaitingForKey %s", boolForPrinting(isWaitingForKey), boolForPrinting(m_isWaitingForKey));
    3670     if (isWaitingForKey == m_isWaitingForKey || (!isWaitingForKey && this->waitingForKey()))
    3671         return;
    3672 
    3673     m_isWaitingForKey = isWaitingForKey;
    3674     GST_DEBUG("waiting for key changed %s", boolForPrinting(m_isWaitingForKey));
     3675    GST_TRACE("waitingForKey %s, m_waitingForKey %s", boolForPrinting(waitingForKey), boolForPrinting(m_waitingForKey));
     3676    if (waitingForKey == m_waitingForKey || (!waitingForKey && this->waitingForKey()))
     3677        return;
     3678
     3679    m_waitingForKey = waitingForKey;
     3680    GST_DEBUG("waiting for key changed %s", boolForPrinting(m_waitingForKey));
    36753681    m_player->waitingForKeyChanged();
    36763682}
  • trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h

    r252937 r252938  
    121121    WTF_MAKE_FAST_ALLOCATED;
    122122public:
     123    static void initializeDebugCategory();
     124
    123125    MediaPlayerPrivateGStreamer(MediaPlayer*);
    124126    virtual ~MediaPlayerPrivateGStreamer();
    125127
     128    static bool isAvailable();
    126129    static void registerMediaEngine(MediaEngineRegistrar);
    127     static MediaPlayer::SupportsType extendedSupportsType(const MediaEngineSupportParameters&, MediaPlayer::SupportsType);
    128 
    129     bool hasVideo() const final { return m_hasVideo; }
    130     bool hasAudio() const final { return m_hasAudio; }
     130
     131    bool hasVideo() const override { return m_hasVideo; }
     132    bool hasAudio() const override { return m_hasAudio; }
     133
    131134    void load(const String &url) override;
    132135#if ENABLE(MEDIA_SOURCE)
     
    136139    void load(MediaStreamPrivate&) override;
    137140#endif
    138     void cancelLoad() final;
    139     void prepareToPlay() final;
    140     void play() final;
     141    void commitLoad();
     142    void cancelLoad() override;
     143
     144    void prepareToPlay() override;
     145    void play() override;
    141146    void pause() override;
    142     bool paused() const final;
    143     bool seeking() const override { return m_isSeeking; }
     147    bool paused() const override;
     148    bool seeking() const override { return m_seeking; }
    144149    void seek(const MediaTime&) override;
     150
     151    MediaTime platformDuration() const;
     152
    145153    void setRate(float) override;
    146     double rate() const final;
    147     void setPreservesPitch(bool) final;
    148     void setPreload(MediaPlayer::Preload) final;
     154    double rate() const override;
     155    void setPreservesPitch(bool) override;
     156    void setPreload(MediaPlayer::Preload) override;
     157
    149158    FloatSize naturalSize() const final;
    150     void setVolume(float) final;
    151     float volume() const final;
    152     void setMuted(bool) final;
    153     MediaPlayer::NetworkState networkState() const final;
    154     MediaPlayer::ReadyState readyState() const final;
    155     void setVisible(bool) final { }
    156     void setSize(const IntSize&) final;
     159
     160    void setVolume(float) override;
     161    float volume() const override;
     162
     163    void setMuted(bool) override;
     164    bool muted() const;
     165
     166    MediaPlayer::NetworkState networkState() const override;
     167    MediaPlayer::ReadyState readyState() const override;
     168
     169    void setVisible(bool) override { }
     170    void setSize(const IntSize&) override;
     171    void sizeChanged();
     172
    157173    // Prefer MediaTime based methods over float based.
    158     float duration() const final { return durationMediaTime().toFloat(); }
    159     double durationDouble() const final { return durationMediaTime().toDouble(); }
    160     MediaTime durationMediaTime() const;
    161     float currentTime() const final { return currentMediaTime().toFloat(); }
    162     double currentTimeDouble() const final { return currentMediaTime().toDouble(); }
     174
     175    float duration() const override { return durationMediaTime().toFloat(); }
     176    double durationDouble() const override { return durationMediaTime().toDouble(); }
     177    MediaTime durationMediaTime() const override;
     178    float currentTime() const override { return currentMediaTime().toFloat(); }
     179    double currentTimeDouble() const override { return currentMediaTime().toDouble(); }
    163180    MediaTime currentMediaTime() const override;
    164181    std::unique_ptr<PlatformTimeRanges> buffered() const override;
    165     void seek(float time) final { seek(MediaTime::createWithFloat(time)); }
    166     void seekDouble(double time) final { seek(MediaTime::createWithDouble(time)); }
    167     float maxTimeSeekable() const final { return maxMediaTimeSeekable().toFloat(); }
     182    void seek(float time) override { seek(MediaTime::createWithFloat(time)); }
     183    void seekDouble(double time) override { seek(MediaTime::createWithDouble(time)); }
     184
     185    float maxTimeSeekable() const override { return maxMediaTimeSeekable().toFloat(); }
    168186    MediaTime maxMediaTimeSeekable() const override;
    169     double minTimeSeekable() const final { return minMediaTimeSeekable().toFloat(); }
    170     MediaTime minMediaTimeSeekable() const final { return MediaTime::zeroTime(); }
    171     bool didLoadingProgress() const final;
    172     unsigned long long totalBytes() const final;
    173     bool hasSingleSecurityOrigin() const final;
    174     Optional<bool> wouldTaintOrigin(const SecurityOrigin&) const final;
    175     void simulateAudioInterruption() final;
     187    double minTimeSeekable() const override { return minMediaTimeSeekable().toFloat(); }
     188    MediaTime minMediaTimeSeekable() const override { return MediaTime::zeroTime(); }
     189
     190    bool didLoadingProgress() const override;
     191    unsigned long long totalBytes() const override;
     192
     193    bool hasSingleSecurityOrigin() const override;
     194    Optional<bool> wouldTaintOrigin(const SecurityOrigin&) const override;
     195
     196    void simulateAudioInterruption() override;
     197
    176198#if ENABLE(WEB_AUDIO)
    177     AudioSourceProvider* audioSourceProvider() final;
    178 #endif
    179     void paint(GraphicsContext&, const FloatRect&) final;
    180     bool supportsFullscreen() const final;
    181     MediaPlayer::MovieLoadType movieLoadType() const final;
    182 
    183     unsigned decodedFrameCount() const final;
    184     unsigned droppedFrameCount() const final;
    185     unsigned audioDecodedByteCount() const final;
    186     unsigned videoDecodedByteCount() const final;
    187 
    188     void acceleratedRenderingStateChanged() final;
     199    AudioSourceProvider* audioSourceProvider() override;
     200#endif
     201
     202    void paint(GraphicsContext&, const FloatRect&) override;
     203
     204    bool supportsFullscreen() const override;
     205
     206    MediaPlayer::MovieLoadType movieLoadType() const override;
     207
     208    MediaPlayer* mediaPlayer() const { return m_player; }
     209
     210    unsigned decodedFrameCount() const override;
     211    unsigned droppedFrameCount() const override;
     212    unsigned audioDecodedByteCount() const override;
     213    unsigned videoDecodedByteCount() const override;
     214
     215    void acceleratedRenderingStateChanged() override;
    189216
    190217#if USE(TEXTURE_MAPPER_GL)
     
    199226
    200227#if ENABLE(ENCRYPTED_MEDIA)
    201     void cdmInstanceAttached(CDMInstance&) final;
    202     void cdmInstanceDetached(CDMInstance&) final;
     228    void cdmInstanceAttached(CDMInstance&) override;
     229    void cdmInstanceDetached(CDMInstance&) override;
     230    void handleProtectionEvent(GstEvent*);
     231    virtual void attemptToDecryptWithLocalInstance();
    203232    void attemptToDecryptWithInstance(CDMInstance&) final;
    204     bool waitingForKey() const final;
    205 
    206     void handleProtectionEvent(GstEvent*);
    207 #endif
     233    void initializationDataEncountered(InitData&&);
     234    void setWaitingForKey(bool);
     235    bool waitingForKey() const override;
     236#endif
     237
     238    static bool supportsKeySystem(const String& keySystem, const String& mimeType);
     239    static MediaPlayer::SupportsType extendedSupportsType(const MediaEngineSupportParameters&, MediaPlayer::SupportsType);
    208240
    209241#if USE(GSTREAMER_GL)
     
    212244#endif
    213245
     246    void setVideoSourceOrientation(ImageOrientation);
     247    GstElement* pipeline() const { return m_pipeline.get(); }
    214248    void enableTrack(TrackPrivateBaseGStreamer::TrackType, unsigned index);
    215249
    216250    // Append pipeline interface
    217     // FIXME: Use the client interface pattern, AppendPipeline does not need the full interface to this class just for these two functions.
    218251    bool handleSyncMessage(GstMessage*);
    219252    void handleMessage(GstMessage*);
     
    238271    };
    239272
    240     static bool isAvailable();
    241 #if ENABLE(ENCRYPTED_MEDIA)
    242     static bool supportsKeySystem(const String& keySystem, const String& mimeType);
    243 #endif
     273    virtual bool isLiveStream() const { return m_isStreaming; }
     274    MediaTime maxTimeLoaded() const;
    244275
    245276    virtual void durationChanged();
     
    248279    virtual bool changePipelineState(GstState);
    249280
     281
    250282#if USE(GSTREAMER_HOLEPUNCH)
    251283    GstElement* createHolePunchVideoSink();
     
    261293    void pushTextureToCompositor();
    262294#if USE(NICOSIA)
    263     void swapBuffersIfNeeded() final;
     295    void swapBuffersIfNeeded() override;
    264296#else
    265     RefPtr<TextureMapperPlatformLayerProxy> proxy() const final;
    266     void swapBuffersIfNeeded() final;
     297    RefPtr<TextureMapperPlatformLayerProxy> proxy() const override;
     298    void swapBuffersIfNeeded() override;
    267299#endif
    268300#endif
     
    285317    static void volumeChangedCallback(MediaPlayerPrivateGStreamer*);
    286318    static void muteChangedCallback(MediaPlayerPrivateGStreamer*);
     319
     320    // FIXME: Where is this used?
     321    void handlePluginInstallerResult(GstInstallPluginsReturn);
    287322
    288323    void readyTimerFired();
     
    324359    mutable MediaTime m_cachedDuration;
    325360    bool m_canFallBackToLastFinishedSeekPosition { false };
    326     bool m_isChangingRate { false };
    327     bool m_didDownloadFinish { false };
    328     bool m_didErrorOccur { false };
     361    bool m_changingRate { false };
     362    bool m_downloadFinished { false };
     363    bool m_errorOccured { false };
    329364    mutable bool m_isEndReached { false };
    330     mutable bool m_isLiveStream { false };
    331     bool m_isPaused { true };
     365    mutable bool m_isStreaming { false };
     366    bool m_paused { true };
    332367    float m_playbackRate { 1 };
    333368    GstState m_currentState;
    334369    GstState m_oldState;
    335370    GstState m_requestedState { GST_STATE_VOID_PENDING };
    336     bool m_shouldResetPipeline { false };
    337     bool m_isSeeking { false };
    338     bool m_isSeekPending { false };
     371    bool m_resetPipeline { false };
     372    bool m_seeking { false };
     373    bool m_seekIsPending { false };
    339374    MediaTime m_seekTime;
    340375    GRefPtr<GstElement> m_source { nullptr };
    341     bool m_areVolumeAndMuteInitialized { false };
     376    bool m_volumeAndMuteInitialized { false };
    342377
    343378#if USE(TEXTURE_MAPPER_GL)
     
    357392
    358393    mutable FloatSize m_videoSize;
    359     bool m_isUsingFallbackVideoSink { false };
    360     bool m_canRenderingBeAccelerated { false };
    361 
    362     bool m_isBeingDestroyed { false };
     394    bool m_usingFallbackVideoSink { false };
     395    bool m_renderingCanBeAccelerated { false };
     396
     397    bool m_destroying { false };
    363398
    364399#if USE(GSTREAMER_GL)
     
    378413    HashSet<uint32_t> m_handledProtectionEvents;
    379414
    380     bool m_isWaitingForKey { false };
     415    bool m_waitingForKey { false };
    381416#endif
    382417
     
    384419
    385420private:
    386     MediaTime maxTimeLoaded() const;
    387     GstElement* pipeline() const { return m_pipeline.get(); }
    388     void setVideoSourceOrientation(ImageOrientation);
    389     MediaTime platformDuration() const;
    390     bool isMuted() const;
    391     void commitLoad();
    392421    void fillTimerFired();
     422
    393423    void didEnd();
     424
    394425
    395426    GstElement* createVideoSink();
     
    445476    void clearTracks();
    446477
    447 #if ENABLE(ENCRYPTED_MEDIA)
    448     void attemptToDecryptWithLocalInstance();
    449     void initializationDataEncountered(InitData&&);
    450     void setWaitingForKey(bool);
    451 #endif
    452 
    453478#if ENABLE(VIDEO_TRACK)
    454479    GRefPtr<GstElement> m_textAppSink;
     
    457482    GstStructure* m_mediaLocations { nullptr };
    458483    int m_mediaLocationCurrentIndex { 0 };
    459     bool m_isPlaybackRatePaused { false };
     484    bool m_playbackRatePause { false };
    460485    MediaTime m_timeOfOverlappingSeek;
    461486    float m_lastPlaybackRate { 1 };
     
    464489    bool m_loadingStalled { false };
    465490    MediaPlayer::Preload m_preload;
    466     bool m_isDelayingLoad { false };
     491    bool m_delayingLoad { false };
    467492    mutable MediaTime m_maxTimeLoadedAtLastDidLoadingProgress;
    468493    bool m_hasVideo { false };
     
    479504#endif
    480505#endif
    481     bool m_isBuffering { false };
     506    bool m_buffering { false };
    482507    int m_bufferingPercentage { 0 };
    483508    mutable unsigned long long m_totalBytes { 0 };
    484509    URL m_url;
    485     bool m_shouldPreservePitch { false };
     510    bool m_preservesPitch { false };
    486511    mutable Optional<Seconds> m_lastQueryTime;
    487512    bool m_isLegacyPlaybin;
  • trunk/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp

    r252937 r252938  
    133133void MediaPlayerPrivateGStreamerMSE::pause()
    134134{
    135     // FIXME: Should not need direct access to this member. This override is probably not needed.
    136     m_isPaused = true;
     135    m_paused = true;
    137136    MediaPlayerPrivateGStreamer::pause();
    138137}
     
    140139MediaTime MediaPlayerPrivateGStreamerMSE::durationMediaTime() const
    141140{
    142     if (UNLIKELY(!m_pipeline || m_didErrorOccur))
     141    if (UNLIKELY(!m_pipeline || m_errorOccured))
    143142        return MediaTime();
    144143
     
    148147void MediaPlayerPrivateGStreamerMSE::seek(const MediaTime& time)
    149148{
    150     if (UNLIKELY(!m_pipeline || m_didErrorOccur))
     149    if (UNLIKELY(!m_pipeline || m_errorOccured))
    151150        return;
    152151
     
    156155    MediaTime current = currentMediaTime();
    157156    if (time == current) {
    158         if (!m_isSeeking)
     157        if (!m_seeking)
    159158            timeChanged();
    160159        return;
    161160    }
    162161
    163     if (m_isLiveStream)
    164         return;
    165 
    166     if (m_isSeeking && m_isSeekPending) {
     162    if (isLiveStream())
     163        return;
     164
     165    if (m_seeking && m_seekIsPending) {
    167166        m_seekTime = time;
    168167        return;
     
    181180
    182181    m_isEndReached = false;
    183     GST_DEBUG("m_isSeeking=%s, m_seekTime=%s", boolForPrinting(m_isSeeking), toString(m_seekTime).utf8().data());
     182    GST_DEBUG("m_seeking=%s, m_seekTime=%s", boolForPrinting(m_seeking), toString(m_seekTime).utf8().data());
    184183}
    185184
     
    234233
    235234    // Always move to seeking state to report correct 'currentTime' while pending for actual seek to complete.
    236     m_isSeeking = true;
     235    m_seeking = true;
    237236
    238237    // Check if playback pipeline is ready for seek.
     
    242241        GST_DEBUG("[Seek] cannot seek, current state change is %s", gst_element_state_change_return_get_name(getStateResult));
    243242        webKitMediaSrcSetReadyForSamples(WEBKIT_MEDIA_SRC(m_source.get()), true);
    244         m_isSeeking = false;
     243        m_seeking = false;
    245244        return false;
    246245    }
     
    264263        GST_DEBUG("[Seek] Delaying the seek: %s", reason.data());
    265264
    266         m_isSeekPending = true;
     265        m_seekIsPending = true;
    267266
    268267        if (m_isEndReached) {
    269268            GST_DEBUG("[Seek] reset pipeline");
    270             m_shouldResetPipeline = true;
    271             m_isSeeking = false;
     269            m_resetPipeline = true;
     270            m_seeking = false;
    272271            if (!changePipelineState(GST_STATE_PAUSED))
    273272                loadingFailed(MediaPlayer::Empty);
    274273            else
    275                 m_isSeeking = true;
     274                m_seeking = true;
    276275        }
    277276
    278         return m_isSeeking;
     277        return m_seeking;
    279278    }
    280279
     
    302301            GST_DEBUG("[Seek] Cannot seek, failed to pause playback pipeline.");
    303302            webKitMediaSrcSetReadyForSamples(WEBKIT_MEDIA_SRC(m_source.get()), true);
    304             m_isSeeking = false;
     303            m_seeking = false;
    305304            return false;
    306305        }
     
    316315        ASSERT(m_mseSeekCompleted);
    317316        // Note: seekCompleted will recursively call us.
    318         return m_isSeeking;
     317        return m_seeking;
    319318    }
    320319
     
    339338    if (!gst_element_seek(m_pipeline.get(), rate, GST_FORMAT_TIME, seekType, GST_SEEK_TYPE_SET, toGstClockTime(startTime), GST_SEEK_TYPE_SET, toGstClockTime(endTime))) {
    340339        webKitMediaSrcSetReadyForSamples(WEBKIT_MEDIA_SRC(m_source.get()), true);
    341         m_isSeeking = false;
     340        m_seeking = false;
    342341        m_gstSeekCompleted = true;
    343342        GST_DEBUG("doSeek(): gst_element_seek() failed, returning false");
     
    352351void MediaPlayerPrivateGStreamerMSE::maybeFinishSeek()
    353352{
    354     if (!m_isSeeking || !m_mseSeekCompleted || !m_gstSeekCompleted)
     353    if (!m_seeking || !m_mseSeekCompleted || !m_gstSeekCompleted)
    355354        return;
    356355
     
    364363    }
    365364
    366     if (m_isSeekPending) {
     365    if (m_seekIsPending) {
    367366        GST_DEBUG("[Seek] Committing pending seek to %s", toString(m_seekTime).utf8().data());
    368         m_isSeekPending = false;
     367        m_seekIsPending = false;
    369368        if (!doSeek()) {
    370369            GST_WARNING("[Seek] Seeking to %s failed", toString(m_seekTime).utf8().data());
     
    377376
    378377    webKitMediaSrcSetReadyForSamples(WEBKIT_MEDIA_SRC(m_source.get()), true);
    379     m_isSeeking = false;
     378    m_seeking = false;
    380379    m_cachedPosition = MediaTime::invalidTime();
    381380    // The pipeline can still have a pending state. In this case a position query will fail.
     
    392391bool MediaPlayerPrivateGStreamerMSE::seeking() const
    393392{
    394     return m_isSeeking;
     393    return m_seeking;
    395394}
    396395
     
    430429void MediaPlayerPrivateGStreamerMSE::waitForSeekCompleted()
    431430{
    432     if (!m_isSeeking)
     431    if (!m_seeking)
    433432        return;
    434433
     
    481480void MediaPlayerPrivateGStreamerMSE::updateStates()
    482481{
    483     if (UNLIKELY(!m_pipeline || m_didErrorOccur))
     482    if (UNLIKELY(!m_pipeline || m_errorOccured))
    484483        return;
    485484
     
    500499            break;
    501500
    502         m_shouldResetPipeline = (state <= GST_STATE_READY);
    503         if (m_shouldResetPipeline)
     501        m_resetPipeline = (state <= GST_STATE_READY);
     502        if (m_resetPipeline)
    504503            m_mediaTimeDuration = MediaTime::zeroTime();
    505504
     
    540539        // Sync states where needed.
    541540        if (state == GST_STATE_PAUSED) {
    542             if (!m_areVolumeAndMuteInitialized) {
     541            if (!m_volumeAndMuteInitialized) {
    543542                notifyPlayerOfVolumeChange();
    544543                notifyPlayerOfMute();
    545                 m_areVolumeAndMuteInitialized = true;
     544                m_volumeAndMuteInitialized = true;
    546545            }
    547546
    548             if (!seeking() && !m_isPaused && m_playbackRate) {
     547            if (!seeking() && !m_paused && m_playbackRate) {
    549548                GST_DEBUG("[Buffering] Restarting playback.");
    550549                changePipelineState(GST_STATE_PLAYING);
    551550            }
    552551        } else if (state == GST_STATE_PLAYING) {
    553             m_isPaused = false;
     552            m_paused = false;
    554553
    555554            if (!m_playbackRate) {
     
    558557            }
    559558        } else
    560             m_isPaused = true;
     559            m_paused = true;
    561560
    562561        if (m_requestedState == GST_STATE_PAUSED && state == GST_STATE_PAUSED) {
     
    579578
    580579        // Live pipelines go in PAUSED without prerolling.
    581         m_isLiveStream = true;
     580        m_isStreaming = true;
    582581
    583582        if (state == GST_STATE_READY) {
     
    587586            m_readyState = MediaPlayer::HaveEnoughData;
    588587            GST_DEBUG("m_readyState=%s", dumpReadyState(m_readyState));
    589             m_isPaused = true;
     588            m_paused = true;
    590589        } else if (state == GST_STATE_PLAYING)
    591             m_isPaused = false;
    592 
    593         if (!m_isPaused && m_playbackRate)
     590            m_paused = false;
     591
     592        if (!m_paused && m_playbackRate)
    594593            changePipelineState(GST_STATE_PLAYING);
    595594
     
    622621void MediaPlayerPrivateGStreamerMSE::asyncStateChangeDone()
    623622{
    624     if (UNLIKELY(!m_pipeline || m_didErrorOccur))
    625         return;
    626 
    627     if (m_isSeeking)
     623    if (UNLIKELY(!m_pipeline || m_errorOccured))
     624        return;
     625
     626    if (m_seeking)
    628627        maybeFinishSeek();
    629628    else
     
    776775MediaTime MediaPlayerPrivateGStreamerMSE::maxMediaTimeSeekable() const
    777776{
    778     if (UNLIKELY(m_didErrorOccur))
     777    if (UNLIKELY(m_errorOccured))
    779778        return MediaTime::zeroTime();
    780779
  • trunk/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h

    r252937 r252938  
    5555    void updateDownloadBufferingFlag() override { };
    5656
     57    bool isLiveStream() const override { return false; }
    5758    MediaTime currentMediaTime() const override;
    5859
  • trunk/Source/WebCore/platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp

    r252937 r252938  
    164164
    165165    // This is only for on-the-fly reenqueues after appends. When seeking, the seek will do its own flush.
    166     // FIXME: Should not be touching private parts.
    167     if (!m_playerPrivate.m_isSeeking)
     166    if (!m_playerPrivate.m_seeking)
    168167        m_playerPrivate.m_playbackPipeline->flush(trackId);
    169168}
Note: See TracChangeset for help on using the changeset viewer.