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

Changeset 239374 in webkit


Ignore:
Timestamp:
Dec 19, 2018, 3:20:16 AM (8 years ago)
Author:
aboya@igalia.com
Message:

[MSE] Remove dead code: sourceBufferPrivateSeekToTime()
​https://bugs.webkit.org/show_bug.cgi?id=192827

Reviewed by Xabier Rodriguez-Calvar.

This patch makes two dead code removal changes in
SourceBufferPrivateClient:

First, sourceBufferPrivateFastSeekTimeForMediaTime() is made pure
virtual in SourceBufferPrivateClient. Since SourceBufferPrivateClient
is only inherited by SourceBuffer, it makes no sense to have default
implementations there (they will never be used), moreso it being a
client interface.

Second, sourceBufferPrivateSeekToTime() is removed entirely. It used
to had an empty implementation, which SourceBuffer did not overwrite,
therefore making any calls to it useless.

All calls to sourceBufferPrivateSeekToTime() have been removed:

SourceBufferPrivateAVFObjC::seekToTime(), which was also dead code
itself, used to call this method. This patch deletes it completely.

MockSourceBufferPrivate::seekToTime(), which only called this empty
method, has also been removed along with its only usage in
MockMediaSourcePrivate::seekToTime().

  • platform/graphics/SourceBufferPrivateClient.h:

(WebCore::SourceBufferPrivateClient::sourceBufferPrivateFastSeekTimeForMediaTime): Deleted.
(WebCore::SourceBufferPrivateClient::sourceBufferPrivateSeekToTime): Deleted.

  • platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
  • platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:

(WebCore::SourceBufferPrivateAVFObjC::seekToTime): Deleted.

  • platform/mock/mediasource/MockMediaSourcePrivate.cpp:

(WebCore::MockMediaSourcePrivate::seekToTime):

  • platform/mock/mediasource/MockSourceBufferPrivate.cpp:

(WebCore::MockSourceBufferPrivate::seekToTime): Deleted.

  • platform/mock/mediasource/MockSourceBufferPrivate.h:
Location:
trunk/Source/WebCore
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r239373 r239374  
     12018-12-19  Alicia Boya García  <aboya@igalia.com>
     2
     3        [MSE] Remove dead code: sourceBufferPrivateSeekToTime()
     4        https://bugs.webkit.org/show_bug.cgi?id=192827
     5
     6        Reviewed by Xabier Rodriguez-Calvar.
     7
     8        This patch makes two dead code removal changes in
     9        SourceBufferPrivateClient:
     10
     11        First, sourceBufferPrivateFastSeekTimeForMediaTime() is made pure
     12        virtual in SourceBufferPrivateClient. Since SourceBufferPrivateClient
     13        is only inherited by SourceBuffer, it makes no sense to have default
     14        implementations there (they will never be used), moreso it being a
     15        client interface.
     16
     17        Second, sourceBufferPrivateSeekToTime() is removed entirely. It used
     18        to had an empty implementation, which SourceBuffer did not overwrite,
     19        therefore making any calls to it useless.
     20
     21        All calls to sourceBufferPrivateSeekToTime() have been removed:
     22
     23        SourceBufferPrivateAVFObjC::seekToTime(), which was also dead code
     24        itself, used to call this method. This patch deletes it completely.
     25
     26        MockSourceBufferPrivate::seekToTime(), which only called this empty
     27        method, has also been removed along with its only usage in
     28        MockMediaSourcePrivate::seekToTime().
     29
     30        * platform/graphics/SourceBufferPrivateClient.h:
     31        (WebCore::SourceBufferPrivateClient::sourceBufferPrivateFastSeekTimeForMediaTime): Deleted.
     32        (WebCore::SourceBufferPrivateClient::sourceBufferPrivateSeekToTime): Deleted.
     33        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
     34        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
     35        (WebCore::SourceBufferPrivateAVFObjC::seekToTime): Deleted.
     36        * platform/mock/mediasource/MockMediaSourcePrivate.cpp:
     37        (WebCore::MockMediaSourcePrivate::seekToTime):
     38        * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
     39        (WebCore::MockSourceBufferPrivate::seekToTime): Deleted.
     40        * platform/mock/mediasource/MockSourceBufferPrivate.h:
     41
    1422018-12-19  Xabier Rodriguez Calvar  <calvaris@igalia.com>
    243
  • trunk/Source/WebCore/platform/graphics/SourceBufferPrivateClient.h

    r223728 r239374  
    7272    virtual void sourceBufferPrivateDidBecomeReadyForMoreSamples(const AtomicString& trackID) = 0;
    7373
    74     virtual MediaTime sourceBufferPrivateFastSeekTimeForMediaTime(const MediaTime& time, const MediaTime&, const MediaTime&) { return time; }
    75     virtual void sourceBufferPrivateSeekToTime(const MediaTime&) { };
     74    virtual MediaTime sourceBufferPrivateFastSeekTimeForMediaTime(const MediaTime&, const MediaTime&, const MediaTime&) = 0;
    7675
    7776    enum AppendResult { AppendSucceeded, ReadStreamFailed, ParsingFailed };
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h

    r239230 r239374  
    103103
    104104    void willSeek();
    105     void seekToTime(const MediaTime&);
    106105    MediaTime fastSeekTimeForMediaTime(const MediaTime&, const MediaTime& negativeThreshold, const MediaTime& positiveThreshold);
    107106    FloatSize naturalSize();
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm

    r239230 r239374  
    11721172}
    11731173
    1174 void SourceBufferPrivateAVFObjC::seekToTime(const MediaTime& time)
    1175 {
    1176     if (m_client)
    1177         m_client->sourceBufferPrivateSeekToTime(time);
    1178 }
    1179 
    11801174FloatSize SourceBufferPrivateAVFObjC::naturalSize()
    11811175{
  • trunk/Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.cpp

    r236875 r239374  
    166166    }
    167167
    168     for (auto& buffer : m_activeSourceBuffers)
    169         buffer->seekToTime(seekTime);
    170 
    171168    return seekTime;
    172169}
  • trunk/Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp

    r239273 r239374  
    290290}
    291291
    292 void MockSourceBufferPrivate::seekToTime(const MediaTime& time)
    293 {
    294     if (m_client)
    295         m_client->sourceBufferPrivateSeekToTime(time);
    296 }
    297 
    298292}
    299293
  • trunk/Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.h

    r238054 r239374  
    5050    bool hasAudio() const;
    5151
    52     void seekToTime(const MediaTime&);
    5352    MediaTime fastSeekTimeForMediaTime(const MediaTime&, const MediaTime& negativeThreshold, const MediaTime& positiveThreshold);
    5453
Note: See TracChangeset for help on using the changeset viewer.