[MSE] Expose additional MediaSource methods to MediaSourcePrivate
authoreocanha@igalia.com <eocanha@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 Oct 2016 08:47:08 +0000 (08:47 +0000)
committereocanha@igalia.com <eocanha@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 Oct 2016 08:47:08 +0000 (08:47 +0000)
https://bugs.webkit.org/show_bug.cgi?id=162920

Reviewed by Xabier Rodriguez-Calvar.

The GStreamer MSE platform implementation needs to report duration changes and trigger
monitorSourceBuffers() calls.

* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::durationChanged):
* Modules/mediasource/MediaSource.h:
* platform/graphics/MediaSourcePrivateClient.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207889 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/Modules/mediasource/MediaSource.cpp
Source/WebCore/Modules/mediasource/MediaSource.h
Source/WebCore/platform/graphics/MediaSourcePrivateClient.h

index 2e007a6..ac40c67 100644 (file)
@@ -1,5 +1,20 @@
 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
 
+        [MSE] Expose additional MediaSource methods to MediaSourcePrivate
+        https://bugs.webkit.org/show_bug.cgi?id=162920
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        The GStreamer MSE platform implementation needs to report duration changes and trigger
+        monitorSourceBuffers() calls.
+
+        * Modules/mediasource/MediaSource.cpp:
+        (WebCore::MediaSource::durationChanged):
+        * Modules/mediasource/MediaSource.h:
+        * platform/graphics/MediaSourcePrivateClient.h:
+
+2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
+
         [GStreamer][EME] ClearKey decryption support
         https://bugs.webkit.org/show_bug.cgi?id=162918
 
index 2272c57..80e7284 100644 (file)
@@ -147,6 +147,11 @@ MediaTime MediaSource::duration() const
     return m_duration;
 }
 
+void MediaSource::durationChanged(const MediaTime& duration)
+{
+    m_duration = duration;
+}
+
 MediaTime MediaSource::currentTime() const
 {
     return m_mediaElement ? m_mediaElement->currentMediaTime() : MediaTime::zeroTime();
index fa3797a..37f113c 100644 (file)
@@ -68,11 +68,12 @@ public:
     void streamEndedWithError(Optional<EndOfStreamError>);
 
     MediaTime duration() const final;
+    void durationChanged(const MediaTime&) final;
     std::unique_ptr<PlatformTimeRanges> buffered() const final;
 
     bool attachToElement(HTMLMediaElement&);
     void detachFromElement(HTMLMediaElement&);
-    void monitorSourceBuffers();
+    void monitorSourceBuffers() override;
     bool isSeeking() const { return m_pendingSeekTime.isValid(); }
     Ref<TimeRanges> seekable();
     ExceptionOr<void> setLiveSeekableRange(double start, double end);
index bb5cc57..3f68635 100644 (file)
@@ -41,8 +41,10 @@ public:
 
     virtual void setPrivateAndOpen(Ref<MediaSourcePrivate>&&) = 0;
     virtual MediaTime duration() const = 0;
+    virtual void durationChanged(const MediaTime&) = 0;
     virtual std::unique_ptr<PlatformTimeRanges> buffered() const = 0;
     virtual void seekToTime(const MediaTime&) = 0;
+    virtual void monitorSourceBuffers() = 0;
 };
 
 }