⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 264166 in webkit


Ignore:
Timestamp:
Jul 9, 2020, 5:30:22 AM (6 years ago)
Author:
aboya@igalia.com
Message:

[MSE][GStreamer] Don't cache duration in MediaSourceClientGStreamerMSE
​https://bugs.webkit.org/show_bug.cgi?id=214128

Reviewed by Xabier Rodriguez-Calvar.

MediaSource should be the single source of truth for the duration of
the MediaSource, and querying it to MediaSource is efficient enough
(trivial getter). There is no reason for MediaSourceClientGStreamerMSE
to store a separate m_duration field.

This patch introduces no behavior changes.

  • platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:

(WebCore::MediaSourceClientGStreamerMSE::MediaSourceClientGStreamerMSE):
(WebCore::MediaSourceClientGStreamerMSE::duration):
(WebCore::MediaSourceClientGStreamerMSE::durationChanged):

  • platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r264164 r264166  
     12020-07-09  Alicia Boya García  <aboya@igalia.com>
     2
     3        [MSE][GStreamer] Don't cache duration in MediaSourceClientGStreamerMSE
     4        https://bugs.webkit.org/show_bug.cgi?id=214128
     5
     6        Reviewed by Xabier Rodriguez-Calvar.
     7
     8        MediaSource should be the single source of truth for the duration of
     9        the MediaSource, and querying it to MediaSource is efficient enough
     10        (trivial getter). There is no reason for MediaSourceClientGStreamerMSE
     11        to store a separate m_duration field.
     12
     13        This patch introduces no behavior changes.
     14
     15        * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
     16        (WebCore::MediaSourceClientGStreamerMSE::MediaSourceClientGStreamerMSE):
     17        (WebCore::MediaSourceClientGStreamerMSE::duration):
     18        (WebCore::MediaSourceClientGStreamerMSE::durationChanged):
     19        * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
     20
    1212020-07-09  Alicia Boya García  <aboya@igalia.com>
    222
  • trunk/Source/WebCore/platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp

    r252950 r264166  
    4747MediaSourceClientGStreamerMSE::MediaSourceClientGStreamerMSE(MediaPlayerPrivateGStreamerMSE& playerPrivate)
    4848    : m_playerPrivate(playerPrivate)
    49     , m_duration(MediaTime::invalidTime())
    5049{
    5150    ASSERT(WTF::isMainThread());
    … …  
    7170}
    7271
    73 const MediaTime& MediaSourceClientGStreamerMSE::duration()
     72MediaTime MediaSourceClientGStreamerMSE::duration()
    7473{
    7574    ASSERT(WTF::isMainThread());
    7675
    77     return m_duration;
     76    return m_playerPrivate.mediaSourcePrivateClient()->duration();
    7877}
    7978
    … …  
    8685        return;
    8786
    88     m_duration = duration;
    8987    m_playerPrivate.durationChanged();
    9088}
  • trunk/Source/WebCore/platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h

    r263656 r264166  
    5555    void allSamplesInTrackEnqueued(const AtomString&);
    5656
    57     const MediaTime& duration();
     57    MediaTime duration();
    5858    GRefPtr<WebKitMediaSrc> webKitMediaSrc();
    5959
    … …  
    6262
    6363    MediaPlayerPrivateGStreamerMSE& m_playerPrivate;
    64     MediaTime m_duration;
    6564};
    6665
Note: See TracChangeset for help on using the changeset viewer.