Title: [282059] trunk
- Revision
- 282059
- Author
- [email protected]
- Date
- 2021-09-06 09:38:28 -0700 (Mon, 06 Sep 2021)
Log Message
[MSE] Prevent false-positive "stalled" event iff MSE used
https://bugs.webkit.org/show_bug.cgi?id=226882
<rdar://problem/79454993>
Reviewed by Alicia Boya Garcia.
Source/WebCore:
"progress" and "stalled" events make no sense in context of MSE:
https://github.com/w3c/media-source/issues/88
and hence they will likely be removed soon:
https://w3c.github.io/media-source/#h-note-19
This patch is authored by Pawel Lampe <[email protected]>.
See: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/711
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::progressEventTimerFired): Only fire the progess event if the player supports progress monitoring.
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::supportsProgressMonitoring const): Forward call to the player private.
* platform/graphics/MediaPlayer.h: Added new supportsProgressMonitoring() method.
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::supportsProgressMonitoring const): Added method, defaulting to true to trigger the old behaviour.
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h: Return false on new supportsProgressMonitoring() method to prevent progress event triggering.
LayoutTests:
* platform/glib/imported/w3c/web-platform-tests/media-source/mediasource-append-buffer-expected.txt: Updated expectations.
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (282058 => 282059)
--- trunk/LayoutTests/ChangeLog 2021-09-06 16:33:24 UTC (rev 282058)
+++ trunk/LayoutTests/ChangeLog 2021-09-06 16:38:28 UTC (rev 282059)
@@ -1,3 +1,13 @@
+2021-09-06 Enrique Ocaña González <[email protected]>
+
+ [MSE] Prevent false-positive "stalled" event iff MSE used
+ https://bugs.webkit.org/show_bug.cgi?id=226882
+ <rdar://problem/79454993>
+
+ Reviewed by Alicia Boya Garcia.
+
+ * platform/glib/imported/w3c/web-platform-tests/media-source/mediasource-append-buffer-expected.txt: Updated expectations.
+
2021-09-06 Simon Fraser <[email protected]>
Add a temporarily prefixed property for mask-mode, aliased to -webkit-mask-source-type
Modified: trunk/LayoutTests/platform/glib/imported/w3c/web-platform-tests/media-source/mediasource-append-buffer-expected.txt (282058 => 282059)
--- trunk/LayoutTests/platform/glib/imported/w3c/web-platform-tests/media-source/mediasource-append-buffer-expected.txt 2021-09-06 16:33:24 UTC (rev 282058)
+++ trunk/LayoutTests/platform/glib/imported/w3c/web-platform-tests/media-source/mediasource-append-buffer-expected.txt 2021-09-06 16:38:28 UTC (rev 282059)
@@ -21,5 +21,5 @@
PASS Test abort after appendBuffer update ends.
PASS Test appending null.
PASS Test appending after removeSourceBuffer().
-FAIL Test slow appending does not trigger stalled events. assert_unreached: Unexpected 'stalled' event. Reached unreachable code
+PASS Test slow appending does not trigger stalled events.
Modified: trunk/Source/WebCore/ChangeLog (282058 => 282059)
--- trunk/Source/WebCore/ChangeLog 2021-09-06 16:33:24 UTC (rev 282058)
+++ trunk/Source/WebCore/ChangeLog 2021-09-06 16:38:28 UTC (rev 282059)
@@ -1,3 +1,28 @@
+2021-09-06 Enrique Ocaña González <[email protected]>
+
+ [MSE] Prevent false-positive "stalled" event iff MSE used
+ https://bugs.webkit.org/show_bug.cgi?id=226882
+ <rdar://problem/79454993>
+
+ Reviewed by Alicia Boya Garcia.
+
+ "progress" and "stalled" events make no sense in context of MSE:
+ https://github.com/w3c/media-source/issues/88
+ and hence they will likely be removed soon:
+ https://w3c.github.io/media-source/#h-note-19
+
+ This patch is authored by Pawel Lampe <[email protected]>.
+ See: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/711
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::progressEventTimerFired): Only fire the progess event if the player supports progress monitoring.
+ * platform/graphics/MediaPlayer.cpp:
+ (WebCore::MediaPlayer::supportsProgressMonitoring const): Forward call to the player private.
+ * platform/graphics/MediaPlayer.h: Added new supportsProgressMonitoring() method.
+ * platform/graphics/MediaPlayerPrivate.h:
+ (WebCore::MediaPlayerPrivateInterface::supportsProgressMonitoring const): Added method, defaulting to true to trigger the old behaviour.
+ * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h: Return false on new supportsProgressMonitoring() method to prevent progress event triggering.
+
2021-09-06 Simon Fraser <[email protected]>
Add a temporarily prefixed property for mask-mode, aliased to -webkit-mask-source-type
Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (282058 => 282059)
--- trunk/Source/WebCore/html/HTMLMediaElement.cpp 2021-09-06 16:33:24 UTC (rev 282058)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp 2021-09-06 16:38:28 UTC (rev 282059)
@@ -2868,6 +2868,8 @@
ASSERT(m_player);
if (m_networkState != NETWORK_LOADING)
return;
+ if (!m_player->supportsProgressMonitoring())
+ return;
m_player->didLoadingProgress([this, weakThis = makeWeakPtr(this)](bool progress) {
if (!weakThis)
Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp (282058 => 282059)
--- trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp 2021-09-06 16:33:24 UTC (rev 282058)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp 2021-09-06 16:38:28 UTC (rev 282059)
@@ -775,6 +775,11 @@
return m_private->supportsScanning();
}
+bool MediaPlayer::supportsProgressMonitoring() const
+{
+ return m_private->supportsProgressMonitoring();
+}
+
bool MediaPlayer::requiresImmediateCompositing() const
{
return m_private->requiresImmediateCompositing();
Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.h (282058 => 282059)
--- trunk/Source/WebCore/platform/graphics/MediaPlayer.h 2021-09-06 16:33:24 UTC (rev 282058)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.h 2021-09-06 16:38:28 UTC (rev 282059)
@@ -316,6 +316,7 @@
bool supportsFullscreen() const;
bool supportsScanning() const;
bool canSaveMediaData() const;
+ bool supportsProgressMonitoring() const;
bool requiresImmediateCompositing() const;
bool doesHaveAttribute(const AtomString&, AtomString* value = nullptr) const;
PlatformLayer* platformLayer() const;
Modified: trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h (282058 => 282059)
--- trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h 2021-09-06 16:33:24 UTC (rev 282058)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h 2021-09-06 16:38:28 UTC (rev 282059)
@@ -87,6 +87,7 @@
virtual bool supportsPictureInPicture() const { return false; }
virtual bool supportsFullscreen() const { return false; }
virtual bool supportsScanning() const { return false; }
+ virtual bool supportsProgressMonitoring() const { return true; }
virtual bool requiresImmediateCompositing() const { return false; }
virtual bool canSaveMediaData() const { return false; }
Modified: trunk/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h (282058 => 282059)
--- trunk/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h 2021-09-06 16:33:24 UTC (rev 282058)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h 2021-09-06 16:38:28 UTC (rev 282059)
@@ -68,6 +68,11 @@
void sourceSetup(GstElement*) override;
+ // return false to avoid false-positive "stalled" event - it should be soon addressed in the spec
+ // see: https://github.com/w3c/media-source/issues/88
+ // see: https://w3c.github.io/media-source/#h-note-19
+ bool supportsProgressMonitoring() const override { return false; }
+
void setReadyState(MediaPlayer::ReadyState);
MediaSourcePrivateClient* mediaSourcePrivateClient() { return m_mediaSource.get(); }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes