Title: [264166] trunk/Source/WebCore
Revision
264166
Author
[email protected]
Date
2020-07-09 05:30:22 -0700 (Thu, 09 Jul 2020)

Log 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:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (264165 => 264166)


--- trunk/Source/WebCore/ChangeLog	2020-07-09 11:43:35 UTC (rev 264165)
+++ trunk/Source/WebCore/ChangeLog	2020-07-09 12:30:22 UTC (rev 264166)
@@ -1,5 +1,25 @@
 2020-07-09  Alicia Boya García  <[email protected]>
 
+        [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:
+
+2020-07-09  Alicia Boya García  <[email protected]>
+
         [MSE][GStreamer] Make duration changes one way
         https://bugs.webkit.org/show_bug.cgi?id=214083
 

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp (264165 => 264166)


--- trunk/Source/WebCore/platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp	2020-07-09 11:43:35 UTC (rev 264165)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp	2020-07-09 12:30:22 UTC (rev 264166)
@@ -46,7 +46,6 @@
 
 MediaSourceClientGStreamerMSE::MediaSourceClientGStreamerMSE(MediaPlayerPrivateGStreamerMSE& playerPrivate)
     : m_playerPrivate(playerPrivate)
-    , m_duration(MediaTime::invalidTime())
 {
     ASSERT(WTF::isMainThread());
 }
@@ -70,11 +69,11 @@
     return m_playerPrivate.m_playbackPipeline->addSourceBuffer(sourceBufferPrivate);
 }
 
-const MediaTime& MediaSourceClientGStreamerMSE::duration()
+MediaTime MediaSourceClientGStreamerMSE::duration()
 {
     ASSERT(WTF::isMainThread());
 
-    return m_duration;
+    return m_playerPrivate.mediaSourcePrivateClient()->duration();
 }
 
 void MediaSourceClientGStreamerMSE::durationChanged(const MediaTime& duration)
@@ -85,7 +84,6 @@
     if (!duration.isValid() || duration.isPositiveInfinite() || duration.isNegativeInfinite())
         return;
 
-    m_duration = duration;
     m_playerPrivate.durationChanged();
 }
 

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h (264165 => 264166)


--- trunk/Source/WebCore/platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h	2020-07-09 11:43:35 UTC (rev 264165)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h	2020-07-09 12:30:22 UTC (rev 264166)
@@ -54,7 +54,7 @@
     void enqueueSample(Ref<MediaSample>&&);
     void allSamplesInTrackEnqueued(const AtomString&);
 
-    const MediaTime& duration();
+    MediaTime duration();
     GRefPtr<WebKitMediaSrc> webKitMediaSrc();
 
 private:
@@ -61,7 +61,6 @@
     MediaSourceClientGStreamerMSE(MediaPlayerPrivateGStreamerMSE&);
 
     MediaPlayerPrivateGStreamerMSE& m_playerPrivate;
-    MediaTime m_duration;
 };
 
 } // namespace WebCore.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to