Title: [264164] trunk/Source/WebCore
- Revision
- 264164
- Author
- [email protected]
- Date
- 2020-07-09 04:20:08 -0700 (Thu, 09 Jul 2020)
Log Message
[MSE][GStreamer] Make duration changes one way
https://bugs.webkit.org/show_bug.cgi?id=214083
Reviewed by Xabier Rodriguez-Calvar.
Until now, AppendPipeline emitted duration changes for the
MediaSource. This was done with
MediaSourcePrivateClient::durationChanged(const MediaTime&), a
method which was added to MediaSource in r207889 just to implement
this in the GStreamer port.
This is not necessary though. AppendPipeline only needs to inform
MediaSource of the duration of the initialization segment, and
MediaSource will in turn set duration from the multi-platform code.
This patch removes MediaSourcePrivateClient::durationChanged(const
MediaTime&) from the multi-platform API, along with its usages in the
GStreamer port, giving the multi-platform code sole responsibility on
duration changes.
This is a code cleanup and it's covered by existing tests.
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::durationChanged): Deleted.
* Modules/mediasource/MediaSource.h:
* platform/graphics/MediaSourcePrivateClient.h:
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::didReceiveInitializationSegment):
(WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink):
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::durationChanged):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (264163 => 264164)
--- trunk/Source/WebCore/ChangeLog 2020-07-09 09:36:52 UTC (rev 264163)
+++ trunk/Source/WebCore/ChangeLog 2020-07-09 11:20:08 UTC (rev 264164)
@@ -1,3 +1,37 @@
+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
+
+ Reviewed by Xabier Rodriguez-Calvar.
+
+ Until now, AppendPipeline emitted duration changes for the
+ MediaSource. This was done with
+ MediaSourcePrivateClient::durationChanged(const MediaTime&), a
+ method which was added to MediaSource in r207889 just to implement
+ this in the GStreamer port.
+
+ This is not necessary though. AppendPipeline only needs to inform
+ MediaSource of the duration of the initialization segment, and
+ MediaSource will in turn set duration from the multi-platform code.
+
+ This patch removes MediaSourcePrivateClient::durationChanged(const
+ MediaTime&) from the multi-platform API, along with its usages in the
+ GStreamer port, giving the multi-platform code sole responsibility on
+ duration changes.
+
+ This is a code cleanup and it's covered by existing tests.
+
+ * Modules/mediasource/MediaSource.cpp:
+ (WebCore::MediaSource::durationChanged): Deleted.
+ * Modules/mediasource/MediaSource.h:
+ * platform/graphics/MediaSourcePrivateClient.h:
+ * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
+ (WebCore::AppendPipeline::didReceiveInitializationSegment):
+ (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink):
+ * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
+ (WebCore::MediaPlayerPrivateGStreamerMSE::durationChanged):
+
2020-07-09 Philippe Normand <[email protected]>
[GStreamer][MSE] AV1 support
Modified: trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp (264163 => 264164)
--- trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp 2020-07-09 09:36:52 UTC (rev 264163)
+++ trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp 2020-07-09 11:20:08 UTC (rev 264164)
@@ -165,12 +165,6 @@
return m_duration;
}
-void MediaSource::durationChanged(const MediaTime& duration)
-{
- ALWAYS_LOG(LOGIDENTIFIER, duration);
- m_duration = duration;
-}
-
MediaTime MediaSource::currentTime() const
{
return m_mediaElement ? m_mediaElement->currentMediaTime() : MediaTime::zeroTime();
Modified: trunk/Source/WebCore/Modules/mediasource/MediaSource.h (264163 => 264164)
--- trunk/Source/WebCore/Modules/mediasource/MediaSource.h 2020-07-09 09:36:52 UTC (rev 264163)
+++ trunk/Source/WebCore/Modules/mediasource/MediaSource.h 2020-07-09 11:20:08 UTC (rev 264164)
@@ -79,7 +79,6 @@
void streamEndedWithError(Optional<EndOfStreamError>);
MediaTime duration() const final;
- void durationChanged(const MediaTime&) final;
std::unique_ptr<PlatformTimeRanges> buffered() const final;
bool attachToElement(HTMLMediaElement&);
Modified: trunk/Source/WebCore/platform/graphics/MediaSourcePrivateClient.h (264163 => 264164)
--- trunk/Source/WebCore/platform/graphics/MediaSourcePrivateClient.h 2020-07-09 09:36:52 UTC (rev 264163)
+++ trunk/Source/WebCore/platform/graphics/MediaSourcePrivateClient.h 2020-07-09 11:20:08 UTC (rev 264164)
@@ -42,7 +42,6 @@
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;
Modified: trunk/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp (264163 => 264164)
--- trunk/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp 2020-07-09 09:36:52 UTC (rev 264163)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp 2020-07-09 11:20:08 UTC (rev 264164)
@@ -499,7 +499,7 @@
WebCore::SourceBufferPrivateClient::InitializationSegment initializationSegment;
GST_DEBUG("Notifying SourceBuffer for track %s", (m_track) ? m_track->id().string().utf8().data() : nullptr);
- initializationSegment.duration = m_mediaSourceClient->duration();
+ initializationSegment.duration = m_initialDuration;
switch (m_streamType) {
case Audio: {
@@ -764,9 +764,6 @@
}
#endif
- if (m_mediaSourceClient->duration().isInvalid() && m_initialDuration > MediaTime::zeroTime())
- m_mediaSourceClient->durationChanged(m_initialDuration);
-
parseDemuxerSrcPadCaps(gst_caps_ref(caps.get()));
switch (m_streamType) {
Modified: trunk/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp (264163 => 264164)
--- trunk/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp 2020-07-09 09:36:52 UTC (rev 264163)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp 2020-07-09 11:20:08 UTC (rev 264164)
@@ -707,7 +707,6 @@
m_playbackPipeline->notifyDurationChanged();
} else
m_shouldReportDurationWhenUnblocking = true;
- m_mediaSource->durationChanged(m_mediaTimeDuration);
}
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes