[webkit-changes] [295286] trunk

2022-06-06 Thread eocanha
Title: [295286] trunk








Revision 295286
Author eoca...@igalia.com
Date 2022-06-06 07:34:46 -0700 (Mon, 06 Jun 2022)


Log Message
Revert of revert of [MSE][GStreamer] Honor MP4 edit lists, bis
https://bugs.webkit.org/show_bug.cgi?id=231019

Reviewed by Xabier Rodriguez-Calvar.

This patch reintroduces https://commits.webkit.org/243426@main with
some corrections that avoid the problems detected in
https://bugs.webkit.org/show_bug.cgi?id=233861, which motivated the
original patch revert.

Original author: Alicia Boya Garcia 

Source/WebCore:

This patch takes into consideration the GstSegment attached to a
sample to offset the PTS and DTS. This ensures accurate timestamps are
obtained for MP4 files containing edit lists (commonly necessary for
files containing video with B frames to have PTS starting at zero).

Before this was implemented, a workaround was in place based on a
heuristic (DTS = 0 && PTS > 0 && PTS < 0.1). The workaround is
preserved for the sake of content without proper edit lists, but
any edit list takes preference.

The time fudge factor has been modified from 0.083 seconds up to
0.100 seconds to accomodate the size of the empty edit in test.mp4
used by Web Platform Tests.

This test fixes improves expectation results and fixes two subtests in
imported/w3c/web-platform-tests/media-source/mediasource-remove.html.

This is a reworked version that avoids using gst_sample_set_buffer()
which is not available on GStreamer 1.14, and fixes an issue where
frames that would get a negative DTS were not being enqueued properly.

LayoutTests:

Update expectations for mediasource-remove.html in the GStreamer
ports, as a couple subtests get fixed.

* LayoutTests/platform/glib/imported/w3c/web-platform-tests/media-source/mediasource-remove-expected.txt:
* Source/WebCore/Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::currentTimeFudgeFactor):
* Source/WebCore/platform/graphics/SourceBufferPrivate.h:
(WebCore::SourceBufferPrivate::timeFudgeFactor const):
* Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h:
(WebCore::toGstClockTime):
* Source/WebCore/platform/graphics/gstreamer/MediaSampleGStreamer.cpp:
(WebCore::MediaSampleGStreamer::MediaSampleGStreamer):
* Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::bufferTimeToStreamTime):
(WebCore::AppendPipeline::appsinkNewSample):
(WebCore::matroskademuxForceSegmentStartToEqualZero): Now we reset segment.time in addition to segment.start. This avoids the regressions.

Canonical link: https://commits.webkit.org/251332@main

Modified Paths

trunk/LayoutTests/platform/glib/imported/w3c/web-platform-tests/media-source/mediasource-remove-expected.txt
trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp
trunk/Source/WebCore/platform/graphics/SourceBufferPrivate.h
trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h
trunk/Source/WebCore/platform/graphics/gstreamer/MediaSampleGStreamer.cpp
trunk/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp




Diff

Modified: trunk/LayoutTests/platform/glib/imported/w3c/web-platform-tests/media-source/mediasource-remove-expected.txt (295285 => 295286)

--- trunk/LayoutTests/platform/glib/imported/w3c/web-platform-tests/media-source/mediasource-remove-expected.txt	2022-06-06 14:18:26 UTC (rev 295285)
+++ trunk/LayoutTests/platform/glib/imported/w3c/web-platform-tests/media-source/mediasource-remove-expected.txt	2022-06-06 14:34:46 UTC (rev 295286)
@@ -11,8 +11,8 @@
 PASS Test aborting a remove operation.
 PASS Test remove with a start at the duration.
 PASS Test remove transitioning readyState from 'ended' to 'open'.
-FAIL Test removing all appended data. assert_equals: Initial buffered range. expected "{ [0.095, 6.548) }" but got "{ [0.000, 6.548) }"
-FAIL Test removing beginning of appended data. assert_equals: Initial buffered range. expected "{ [0.095, 6.548) }" but got "{ [0.000, 6.548) }"
-FAIL Test removing the middle of appended data. assert_equals: Initial buffered range. expected "{ [0.095, 6.548) }" but got "{ [0.000, 6.548) }"
-FAIL Test removing the end of appended data. assert_equals: Initial buffered range. expected "{ [0.095, 6.548) }" but got "{ [0.000, 6.548) }"
+PASS Test removing all appended data.
+PASS Test removing beginning of appended data.
+FAIL Test removing the middle of appended data. assert_equals: Buffered ranges after remove(). expected "{ [0.095, 0.997) [3.298, 6.548) }" but got "{ [0.095, 0.975) [3.298, 6.548) }"
+FAIL Test removing the end of appended data. assert_equals: Buffered ranges after remove(). expected "{ [0.095, 1.022) }" but got "{ [0.095, 0.995) }"
 


Modified: trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp (295285 => 295286)

--- trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp	2022-06-06 14:18:26 UTC (rev 295285)
+++ trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp	2022-06-06 14:34:46 UTC (rev 295286)
@@ -324,8 +324,8 @@
 
 const MediaTime& MediaSource::currentTimeFudge

[webkit-changes] [293216] trunk/Source/WebCore

2022-04-22 Thread eocanha
Title: [293216] trunk/Source/WebCore








Revision 293216
Author eoca...@igalia.com
Date 2022-04-22 04:40:59 -0700 (Fri, 22 Apr 2022)


Log Message
[MSE] Improve SourceBuffer memory cost reporting
https://bugs.webkit.org/show_bug.cgi?id=238948

Reviewed by Xabier Rodriguez-Calvar.

Properly implementing the memoryCost() API in SourceBuffer would improve memory
awareness when garbage collecting.

This patch extends the SourceBuffer interface with the ReportExtraMemoryCost
attribute, implements memoryCost() method for the interface and fixes
calculations for removed buffers. It distinguishes the amount of memory
increases reported (extraMemoryCostDelta, what was reported until now, can
only grow) from the total amount of memory reported (can grow and shrink).

This patch is co-authored by Andrzej Surdej (https://github.com/asurdej-comcast)
See: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/827

* Modules/mediasource/SourceBuffer.cpp: Implement memoryCost() interface and hold the absolute memory consumed as m_extraMemoryCost, keeping the original m_reportedExtraMemoryCost behaviour.
* Modules/mediasource/SourceBuffer.h: Added memoryCost() and m_extraMemoryCost.
* Modules/mediasource/SourceBuffer.idl: Require the ReportExtraMemoryCost feature.
* platform/graphics/SourceBufferPrivate.cpp: Also report the memory change to SourceBuffer when evicting frames (memory reduction).

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp
trunk/Source/WebCore/Modules/mediasource/SourceBuffer.h
trunk/Source/WebCore/Modules/mediasource/SourceBuffer.idl
trunk/Source/WebCore/platform/graphics/SourceBufferPrivate.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (293215 => 293216)

--- trunk/Source/WebCore/ChangeLog	2022-04-22 11:08:58 UTC (rev 293215)
+++ trunk/Source/WebCore/ChangeLog	2022-04-22 11:40:59 UTC (rev 293216)
@@ -1,3 +1,27 @@
+2022-04-22  Enrique Ocaña González  
+
+[MSE] Improve SourceBuffer memory cost reporting
+https://bugs.webkit.org/show_bug.cgi?id=238948
+
+Reviewed by Xabier Rodriguez-Calvar.
+
+Properly implementing the memoryCost() API in SourceBuffer would improve memory
+awareness when garbage collecting.
+
+This patch extends the SourceBuffer interface with the ReportExtraMemoryCost
+attribute, implements memoryCost() method for the interface and fixes
+calculations for removed buffers. It distinguishes the amount of memory
+increases reported (extraMemoryCostDelta, what was reported until now, can
+only grow) from the total amount of memory reported (can grow and shrink).
+
+This patch is co-authored by Andrzej Surdej (https://github.com/asurdej-comcast)
+See: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/827
+
+* Modules/mediasource/SourceBuffer.cpp: Implement memoryCost() interface and hold the absolute memory consumed as m_extraMemoryCost, keeping the original m_reportedExtraMemoryCost behaviour.
+* Modules/mediasource/SourceBuffer.h: Added memoryCost() and m_extraMemoryCost.
+* Modules/mediasource/SourceBuffer.idl: Require the ReportExtraMemoryCost feature.
+* platform/graphics/SourceBufferPrivate.cpp: Also report the memory change to SourceBuffer when evicting frames (memory reduction).
+
 2022-04-22  Tyler Wilcock  
 
 AX: The isolated tree is not updated after role changes in AccessibilityRenderObject::updateRoleAfterChildrenCreation()


Modified: trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp (293215 => 293216)

--- trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp	2022-04-22 11:08:58 UTC (rev 293215)
+++ trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp	2022-04-22 11:40:59 UTC (rev 293216)
@@ -1246,6 +1246,8 @@
 if (m_pendingAppendData)
 extraMemoryCost += m_pendingAppendData->size();
 
+m_extraMemoryCost = extraMemoryCost;
+
 if (extraMemoryCost <= m_reportedExtraMemoryCost)
 return;
 
@@ -1355,6 +1357,11 @@
 m_private->setMediaSourceEnded(isEnded);
 }
 
+size_t SourceBuffer::memoryCost() const
+{
+return sizeof(SourceBuffer) + m_extraMemoryCost;
+}
+
 #if !RELEASE_LOG_DISABLED
 WTFLogChannel& SourceBuffer::logChannel() const
 {


Modified: trunk/Source/WebCore/Modules/mediasource/SourceBuffer.h (293215 => 293216)

--- trunk/Source/WebCore/Modules/mediasource/SourceBuffer.h	2022-04-22 11:08:58 UTC (rev 293215)
+++ trunk/Source/WebCore/Modules/mediasource/SourceBuffer.h	2022-04-22 11:40:59 UTC (rev 293216)
@@ -130,6 +130,8 @@
 MediaTime highestPresentationTimestamp() const;
 void readyStateChanged();
 
+size_t memoryCost() const;
+
 void setMediaSourceEnded(bool isEnded);
 
 #if !RELEASE_LOG_DISABLED
@@ -245,7 +247,10 @@
 double m_averageBufferRate { 0 };
 bool m_bufferedDirty { true };
 
+// Can only grow.
 uint64_t m_reportedExtraMemoryCost { 0 };
+// Can grow and shrink.
+u

[webkit-changes] [291487] trunk/Source/WebCore

2022-03-18 Thread eocanha
Title: [291487] trunk/Source/WebCore








Revision 291487
Author eoca...@igalia.com
Date 2022-03-18 09:45:44 -0700 (Fri, 18 Mar 2022)


Log Message
[GStreamer] Add stop position to the range request
https://bugs.webkit.org/show_bug.cgi?id=238028

Reviewed by Philippe Normand.

Currently, the range requests performed by WebKitWebSourceGStreamer indicate a range
start position but not a range stop one, even though it's set in the internal
members->stopPosition attribute.

This may not be a problem when WebKitWebSrc is used as a source for the whole video,
but certainly is when it's used as an embedded source inside adaptive demux
(replacing SoupHttpSrc). It causes decoding errors in some MPEG-DASH streams.
See: https://github.com/WebPlatformForEmbedded/WPEWebKit/issues/813

This patch is authored by Eugene Mutavchi 
See: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/814

* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: Apply stopPosition to the range request when it's valid.

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (291486 => 291487)

--- trunk/Source/WebCore/ChangeLog	2022-03-18 15:39:27 UTC (rev 291486)
+++ trunk/Source/WebCore/ChangeLog	2022-03-18 16:45:44 UTC (rev 291487)
@@ -1,3 +1,24 @@
+2022-03-18  Enrique Ocaña González  
+
+[GStreamer] Add stop position to the range request
+https://bugs.webkit.org/show_bug.cgi?id=238028
+
+Reviewed by Philippe Normand.
+
+Currently, the range requests performed by WebKitWebSourceGStreamer indicate a range
+start position but not a range stop one, even though it's set in the internal
+members->stopPosition attribute.
+
+This may not be a problem when WebKitWebSrc is used as a source for the whole video,
+but certainly is when it's used as an embedded source inside adaptive demux
+(replacing SoupHttpSrc). It causes decoding errors in some MPEG-DASH streams.
+See: https://github.com/WebPlatformForEmbedded/WPEWebKit/issues/813
+
+This patch is authored by Eugene Mutavchi 
+See: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/814
+
+* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: Apply stopPosition to the range request when it's valid.
+
 2022-03-18  Youenn Fablet  
 
 REGRESSION(r290356-r290351?): [ iOS EWS ] 3 imported/w3c/web-platform-tests/service-workers/service-worker/* tests are constant text failures.


Modified: trunk/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp (291486 => 291487)

--- trunk/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp	2022-03-18 15:39:27 UTC (rev 291486)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp	2022-03-18 16:45:44 UTC (rev 291487)
@@ -674,8 +674,12 @@
 || !g_ascii_strcasecmp("trailers.apple.com", url.host().utf8().data()))
 request.setHTTPUserAgent("Quicktime/7.6.6");
 
-if (members->requestedPosition) {
-GUniquePtr formatedRange(g_strdup_printf("bytes=%" G_GUINT64_FORMAT "-", members->requestedPosition));
+if (members->requestedPosition || members->stopPosition != UINT64_MAX) {
+GUniquePtr formatedRange;
+if (members->stopPosition != UINT64_MAX)
+formatedRange.reset(g_strdup_printf("bytes=%" G_GUINT64_FORMAT "-%" G_GUINT64_FORMAT, members->requestedPosition, members->stopPosition > 0 ? members->stopPosition - 1 : 0));
+else
+formatedRange.reset(g_strdup_printf("bytes=%" G_GUINT64_FORMAT "-", members->requestedPosition));
 GST_DEBUG_OBJECT(src, "Range request: %s", formatedRange.get());
 request.setHTTPHeaderField(HTTPHeaderName::Range, formatedRange.get());
 }






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [291337] trunk/Source/WebCore

2022-03-16 Thread eocanha
Title: [291337] trunk/Source/WebCore








Revision 291337
Author eoca...@igalia.com
Date 2022-03-16 03:16:11 -0700 (Wed, 16 Mar 2022)


Log Message
[GStreamer] Avoid auto-selection of hole punching player
https://bugs.webkit.org/show_bug.cgi?id=237828

Reviewed by Xabier Rodriguez-Calvar.

The hole punch player private shouldn't be automatically selected when
the mime type is empty or unsupported by that specific player
("video/holepunch" in practice). This patch returns a FormatError
networkState in those cases, forcing the selection algorithm to
discard the hole punch player private.

This patch is authored by Eugene Mutavchi 
See: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/797

* platform/graphics/holepunch/MediaPlayerPrivateHolePunch.cpp: Implement networkState setter. Set FormatError networkState on load when the mime type is empty or unknown.
* platform/graphics/holepunch/MediaPlayerPrivateHolePunch.h: Refactor networkState management. Move load() implementation to cpp file.

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/holepunch/MediaPlayerPrivateHolePunch.cpp
trunk/Source/WebCore/platform/graphics/holepunch/MediaPlayerPrivateHolePunch.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (291336 => 291337)

--- trunk/Source/WebCore/ChangeLog	2022-03-16 10:14:17 UTC (rev 291336)
+++ trunk/Source/WebCore/ChangeLog	2022-03-16 10:16:11 UTC (rev 291337)
@@ -1,3 +1,22 @@
+2022-03-16  Enrique Ocaña González  
+
+[GStreamer] Avoid auto-selection of hole punching player
+https://bugs.webkit.org/show_bug.cgi?id=237828
+
+Reviewed by Xabier Rodriguez-Calvar.
+
+The hole punch player private shouldn't be automatically selected when
+the mime type is empty or unsupported by that specific player
+("video/holepunch" in practice). This patch returns a FormatError
+networkState in those cases, forcing the selection algorithm to
+discard the hole punch player private.
+
+This patch is authored by Eugene Mutavchi 
+See: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/797
+
+* platform/graphics/holepunch/MediaPlayerPrivateHolePunch.cpp: Implement networkState setter. Set FormatError networkState on load when the mime type is empty or unknown.
+* platform/graphics/holepunch/MediaPlayerPrivateHolePunch.h: Refactor networkState management. Move load() implementation to cpp file.
+
 2022-03-15  Alan Bujtas  
 
 REGRESSION (r282737): `text-shadow` is clipped


Modified: trunk/Source/WebCore/platform/graphics/holepunch/MediaPlayerPrivateHolePunch.cpp (291336 => 291337)

--- trunk/Source/WebCore/platform/graphics/holepunch/MediaPlayerPrivateHolePunch.cpp	2022-03-16 10:14:17 UTC (rev 291336)
+++ trunk/Source/WebCore/platform/graphics/holepunch/MediaPlayerPrivateHolePunch.cpp	2022-03-16 10:16:11 UTC (rev 291337)
@@ -33,6 +33,7 @@
 MediaPlayerPrivateHolePunch::MediaPlayerPrivateHolePunch(MediaPlayer* player)
 : m_player(player)
 , m_readyTimer(RunLoop::main(), this, &MediaPlayerPrivateHolePunch::notifyReadyState)
+, m_networkState(MediaPlayer::NetworkState::Empty)
 #if USE(NICOSIA)
 , m_nicosiaLayer(Nicosia::ContentLayer::create(Nicosia::ContentLayerTextureMapperImpl::createFactory(*this)))
 #else
@@ -171,5 +172,21 @@
 // Notify the ready state so the GraphicsLayer gets created.
 m_player->readyStateChanged();
 }
+
+void MediaPlayerPrivateHolePunch::setNetworkState(MediaPlayer::NetworkState networkState)
+{
+m_networkState = networkState;
+m_player->networkStateChanged();
 }
+
+void MediaPlayerPrivateHolePunch::load(const String&)
+{
+if (!m_player)
+return;
+
+auto mimeType = m_player->contentMIMEType();
+if (mimeType.isEmpty() || !mimeTypeCache().contains(mimeType))
+setNetworkState(MediaPlayer::NetworkState::FormatError);
+}
+}
 #endif // USE(EXTERNAL_HOLEPUNCH)


Modified: trunk/Source/WebCore/platform/graphics/holepunch/MediaPlayerPrivateHolePunch.h (291336 => 291337)

--- trunk/Source/WebCore/platform/graphics/holepunch/MediaPlayerPrivateHolePunch.h	2022-03-16 10:14:17 UTC (rev 291336)
+++ trunk/Source/WebCore/platform/graphics/holepunch/MediaPlayerPrivateHolePunch.h	2022-03-16 10:16:11 UTC (rev 291337)
@@ -51,7 +51,7 @@
 
 static void registerMediaEngine(MediaEngineRegistrar);
 
-void load(const String&) final { };
+void load(const String&) final;
 #if ENABLE(MEDIA_SOURCE)
 void load(const URL&, const ContentType&, MediaSourcePrivateClient*) final { };
 #endif
@@ -76,7 +76,7 @@
 
 bool paused() const final { return false; };
 
-MediaPlayer::NetworkState networkState() const final { return MediaPlayer::NetworkState::Empty; };
+MediaPlayer::NetworkState networkState() const final { return m_networkState; };
 MediaPlayer::ReadyState readyState() const final { return MediaPlayer::ReadyState::HaveMetadata; };
 
 std::unique_ptr buffered() const final { return makeU

[webkit-changes] [291290] trunk/Source/WebCore

2022-03-15 Thread eocanha
Title: [291290] trunk/Source/WebCore








Revision 291290
Author eoca...@igalia.com
Date 2022-03-15 08:23:14 -0700 (Tue, 15 Mar 2022)


Log Message
[GStreamer] clarify playback errors with MediaError.message
https://bugs.webkit.org/show_bug.cgi?id=237602

Reviewed by Philippe Normand.

This patch is co-authored by Eugene Mutavchi 
See: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/797

* html/HTMLMediaElement.cpp: Use internal last error message from the player, if available.
* platform/graphics/MediaPlayer.cpp: Cache the last error message from the player private and update it when NetworkState changes to an error state. This allows the player private to be regenerated (as it has always been) while providing access to the former player private error after that.
* platform/graphics/MediaPlayer.h: Added lastErrorMessage() method to get the last internal error message from the player private.
* platform/graphics/MediaPlayerPrivate.h: Default lastErrorMessage() empty implementation.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: Detect decryption and no-key errors.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Added errorMessage() to expose the internal error message.
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: Post multiple kind of errors to the GstBus to notify upper layers instead of just logging them.

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/html/HTMLMediaElement.cpp
trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp
trunk/Source/WebCore/platform/graphics/MediaPlayer.h
trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
trunk/Source/WebCore/platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (291289 => 291290)

--- trunk/Source/WebCore/ChangeLog	2022-03-15 15:02:03 UTC (rev 291289)
+++ trunk/Source/WebCore/ChangeLog	2022-03-15 15:23:14 UTC (rev 291290)
@@ -1,3 +1,21 @@
+2022-03-15  Enrique Ocaña González  
+
+[GStreamer] clarify playback errors with MediaError.message
+https://bugs.webkit.org/show_bug.cgi?id=237602
+
+Reviewed by Philippe Normand.
+
+This patch is co-authored by Eugene Mutavchi 
+See: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/797
+
+* html/HTMLMediaElement.cpp: Use internal last error message from the player, if available.
+* platform/graphics/MediaPlayer.cpp: Cache the last error message from the player private and update it when NetworkState changes to an error state. This allows the player private to be regenerated (as it has always been) while providing access to the former player private error after that.
+* platform/graphics/MediaPlayer.h: Added lastErrorMessage() method to get the last internal error message from the player private.
+* platform/graphics/MediaPlayerPrivate.h: Default lastErrorMessage() empty implementation.
+* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: Detect decryption and no-key errors.
+* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Added errorMessage() to expose the internal error message.
+* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: Post multiple kind of errors to the GstBus to notify upper layers instead of just logging them.
+
 2022-03-15  Antti Koivisto  
 
 CSSConditionRule.conditionText should be readonly


Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (291289 => 291290)

--- trunk/Source/WebCore/html/HTMLMediaElement.cpp	2022-03-15 15:02:03 UTC (rev 291289)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp	2022-03-15 15:23:14 UTC (rev 291290)
@@ -2175,7 +2175,9 @@
 
 // 6.1 - Set the error attribute to a new MediaError object whose code attribute is set to
 // MEDIA_ERR_SRC_NOT_SUPPORTED.
-m_error = MediaError::create(MediaError::MEDIA_ERR_SRC_NOT_SUPPORTED, "Unsupported source type"_s);
+m_error = m_player
+? MediaError::create(MediaError::MEDIA_ERR_SRC_NOT_SUPPORTED, m_player->lastErrorMessage())
+: MediaError::create(MediaError::MEDIA_ERR_SRC_NOT_SUPPORTED, "Unsupported source type"_s);
 
 // 6.2 - Forget the media element's media-resource-specific text tracks.
 forgetResourceSpecificTracks();
@@ -2213,12 +2215,24 @@
 stopPeriodicTimers();
 m_loadState = WaitingForSource;
 
+const auto getErrorMessage = [&] (String&& defaultMessage) {
+String message = WTFMove(defaultMessage);
+if (!m_player)
+return message;
+
+auto lastErrorMessage = m_player->lastErrorMessage();
+if (!lastErrorMessage)
+return message;
+
+return makeString(message, ": ", lastErrorMessage);
+};
+
 // 2 - Set the erro

[webkit-changes] [291283] trunk/Source/WebCore

2022-03-15 Thread eocanha
Title: [291283] trunk/Source/WebCore








Revision 291283
Author eoca...@igalia.com
Date 2022-03-15 05:40:14 -0700 (Tue, 15 Mar 2022)


Log Message
[GStreamer][MSE] add ac-3,ec-3 and flac codecs gst caps
https://bugs.webkit.org/show_bug.cgi?id=237843

Reviewed by Philippe Normand.

AC-3, EC-3 and FLAC formats should be supported on MSE and EME on those
platforms having the appropriate decoders for them.

This patch adds the appropriate mime types, factories and caps to the
set of codecs whose local support will be tested on MSE.

This patch is authored by Eugene Mutavchi 
See: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/804

* platform/graphics/gstreamer/GStreamerRegistryScanner.cpp: Add support for the codecs, factories and caps.
* platform/graphics/gstreamer/eme/WebKitThunderDecryptorGStreamer.cpp: Add support for the caps.

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp
trunk/Source/WebCore/platform/graphics/gstreamer/eme/WebKitThunderDecryptorGStreamer.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (291282 => 291283)

--- trunk/Source/WebCore/ChangeLog	2022-03-15 11:40:00 UTC (rev 291282)
+++ trunk/Source/WebCore/ChangeLog	2022-03-15 12:40:14 UTC (rev 291283)
@@ -1,3 +1,22 @@
+2022-03-15  Enrique Ocaña González  
+
+[GStreamer][MSE] add ac-3,ec-3 and flac codecs gst caps
+https://bugs.webkit.org/show_bug.cgi?id=237843
+
+Reviewed by Philippe Normand.
+
+AC-3, EC-3 and FLAC formats should be supported on MSE and EME on those
+platforms having the appropriate decoders for them.
+
+This patch adds the appropriate mime types, factories and caps to the
+set of codecs whose local support will be tested on MSE.
+
+This patch is authored by Eugene Mutavchi 
+See: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/804
+
+* platform/graphics/gstreamer/GStreamerRegistryScanner.cpp: Add support for the codecs, factories and caps.
+* platform/graphics/gstreamer/eme/WebKitThunderDecryptorGStreamer.cpp: Add support for the caps.
+
 2022-03-15  Antoine Quint  
 
 Dialog element only animates once


Modified: trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp (291282 => 291283)

--- trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp	2022-03-15 11:40:00 UTC (rev 291282)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp	2022-03-15 12:40:14 UTC (rev 291283)
@@ -337,6 +337,13 @@
 m_decoderCodecMap.add(AtomString("x-av1"), av1DecoderAvailable.isUsingHardware);
 }
 
+Vector mseCompatibleMapping = {
+{ ElementFactories::Type::AudioDecoder, "audio/x-ac3", { }, {"x-ac3", "ac-3", "ac3"} },
+{ ElementFactories::Type::AudioDecoder, "audio/x-eac3", {"audio/x-ac3"},  {"x-eac3", "ec3", "ec-3", "eac3"} },
+{ ElementFactories::Type::AudioDecoder, "audio/x-flac", {"audio/x-flac", "audio/flac"}, {"x-flac", "flac" } },
+};
+fillMimeTypeSetFromCapsMapping(factories, mseCompatibleMapping);
+
 if (m_isMediaSource)
 return;
 
@@ -344,10 +351,7 @@
 
 Vector mapping = {
 { ElementFactories::Type::AudioDecoder, "audio/midi", { "audio/midi", "audio/riff-midi" }, { } },
-{ ElementFactories::Type::AudioDecoder, "audio/x-ac3", { }, { } },
 { ElementFactories::Type::AudioDecoder, "audio/x-dts", { }, { } },
-{ ElementFactories::Type::AudioDecoder, "audio/x-eac3", { "audio/x-ac3" }, { } },
-{ ElementFactories::Type::AudioDecoder, "audio/x-flac", { "audio/x-flac", "audio/flac" }, { } },
 { ElementFactories::Type::AudioDecoder, "audio/x-sbc", { }, { } },
 { ElementFactories::Type::AudioDecoder, "audio/x-sid", { }, { } },
 { ElementFactories::Type::AudioDecoder, "audio/x-speex", { "audio/speex", "audio/x-speex" }, { } },


Modified: trunk/Source/WebCore/platform/graphics/gstreamer/eme/WebKitThunderDecryptorGStreamer.cpp (291282 => 291283)

--- trunk/Source/WebCore/platform/graphics/gstreamer/eme/WebKitThunderDecryptorGStreamer.cpp	2022-03-15 11:40:00 UTC (rev 291282)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/eme/WebKitThunderDecryptorGStreamer.cpp	2022-03-15 12:40:14 UTC (rev 291283)
@@ -46,7 +46,7 @@
 GST_DEBUG_CATEGORY(webkitMediaThunderDecryptDebugCategory);
 #define GST_CAT_DEFAULT webkitMediaThunderDecryptDebugCategory
 
-static const char* cencEncryptionMediaTypes[] = { "video/mp4", "audio/mp4", "video/x-h264", "video/x-h265", "audio/mpeg", "video/x-vp9", nullptr };
+static const char* cencEncryptionMediaTypes[] = { "video/mp4", "audio/mp4", "video/x-h264", "video/x-h265", "audio/mpeg", "audio/x-eac3", "audio/x-ac3", "audio/x-flac", "video/x-vp9", nullptr };
 static const char** cbcsEncryptionMediaTypes = cencEncryptionMediaTypes;
 static const char* webmEncryptionMediaTypes[] = { "video/webm", "audio/webm", "video/x-vp9", "audi

[webkit-changes] [291225] trunk

2022-03-14 Thread eocanha
Title: [291225] trunk








Revision 291225
Author eoca...@igalia.com
Date 2022-03-14 06:21:44 -0700 (Mon, 14 Mar 2022)


Log Message
[MSE][SourceBuffer] Fix removal of paddings from buffered range
https://bugs.webkit.org/show_bug.cgi?id=237780

Reviewed by Jer Noble.

Source/WebCore:

When removing a range ending up in a sample S2 which overlaps slightly with a
previous one S1 but still extends beyond the removal range, the buffered range
computing algorithm can become confused removing the range paddings and
completely skip the S2 sample (instead of accounting it as part of the still
buffered ranges). The sample S2 is leaked and becomes unnoticed in the buffered
ranges.

This patch changes the way in which buffered ranges boundaries are computed in
such cases.

This patch is authored by Eugene Mutavchi 
See: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/797#discussion_r818973424

Test: media/media-source/media-source-remove-overlapped.html

* platform/graphics/SourceBufferPrivate.cpp: End the additionalErasedRanges iterator in removeSamplesFromTrackBuffer() in a sample starting after erasedStart, instead of starting on or after erasedEnd.

LayoutTests:

This tests that overlapped samples in the boundaries of removal ranges aren't leaked.

This patch is authored by Eugene Mutavchi 
See: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/797

* media/media-source/media-source-remove-overlapped-expected.txt: Added.
* media/media-source/media-source-remove-overlapped.html: Added.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/SourceBufferPrivate.cpp


Added Paths

trunk/LayoutTests/media/media-source/media-source-remove-overlapped-expected.txt
trunk/LayoutTests/media/media-source/media-source-remove-overlapped.html




Diff

Modified: trunk/LayoutTests/ChangeLog (291224 => 291225)

--- trunk/LayoutTests/ChangeLog	2022-03-14 12:45:36 UTC (rev 291224)
+++ trunk/LayoutTests/ChangeLog	2022-03-14 13:21:44 UTC (rev 291225)
@@ -1,3 +1,18 @@
+2022-03-14  Enrique Ocaña González  
+
+[MSE][SourceBuffer] Fix removal of paddings from buffered range
+https://bugs.webkit.org/show_bug.cgi?id=237780
+
+Reviewed by Jer Noble.
+
+This tests that overlapped samples in the boundaries of removal ranges aren't leaked.
+
+This patch is authored by Eugene Mutavchi 
+See: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/797
+
+* media/media-source/media-source-remove-overlapped-expected.txt: Added.
+* media/media-source/media-source-remove-overlapped.html: Added.
+
 2022-03-14  Youenn Fablet  
 
 [ MacOS ] imported/w3c/web-platform-tests/webrtc-extensions/transfer-datachannel.html is a flaky failure


Added: trunk/LayoutTests/media/media-source/media-source-remove-overlapped-expected.txt (0 => 291225)

--- trunk/LayoutTests/media/media-source/media-source-remove-overlapped-expected.txt	(rev 0)
+++ trunk/LayoutTests/media/media-source/media-source-remove-overlapped-expected.txt	2022-03-14 13:21:44 UTC (rev 291225)
@@ -0,0 +1,22 @@
+This tests that overlapped samples in the boundaries of removal ranges aren't leaked.
+
+RUN(video.src = ""
+EVENT(sourceopen)
+RUN(sourceBuffer = source.addSourceBuffer("video/mock; codecs=mock"))
+RUN(sourceBuffer.appendBuffer(initSegment))
+EVENT(updateend)
+RUN(sourceBuffer.appendBuffer(samples))
+EVENT(updateend)
+RUN(sourceBuffer.abort())
+RUN(sourceBuffer.appendBuffer(initSegment))
+EVENT(updateend)
+RUN(sourceBuffer.appendBuffer(samples))
+EVENT(updateend)
+RUN(sourceBuffer.remove(sourceBuffer.buffered.start(0), 3.96))
+EVENT(updateend)
+EXPECTED (sourceBuffer.buffered.start(0) <= '4') OK
+RUN(sourceBuffer.remove(sourceBuffer.buffered.start(0), 5))
+EVENT(updateend)
+EXPECTED (sourceBuffer.buffered.length == '0') OK
+END OF TEST
+


Added: trunk/LayoutTests/media/media-source/media-source-remove-overlapped.html (0 => 291225)

--- trunk/LayoutTests/media/media-source/media-source-remove-overlapped.html	(rev 0)
+++ trunk/LayoutTests/media/media-source/media-source-remove-overlapped.html	2022-03-14 13:21:44 UTC (rev 291225)
@@ -0,0 +1,85 @@
+
+
+
+mock-media-source
+
+var source;
+var sourceBuffer;
+var initSegment;
+
+if (window.internals)
+internals.initializeMockMediaSource();
+
+function runTest() {
+findMediaElement();
+
+source = new MediaSource();
+waitForEventOn(source, 'sourceopen', sourceOpen);
+run('video.src = ""
+}
+
+function sourceOpen() {
+run('sourceBuffer = source.addSourceBuffer("video/mock; codecs=mock")');
+waitForEventOn(sourceBuffer, 'updateend', loadSamples1, false, true);
+initSegment = makeAInit(8, [makeATrack(1, 'mock', TRACK_KIND.VIDEO)]);
+run('sourceBuffer.appendBuffer(initSegment)');
+}
+
+function loadSamples1() {
+// Adding buffered ran

[webkit-changes] [291101] trunk/Source/WebCore

2022-03-10 Thread eocanha
Title: [291101] trunk/Source/WebCore








Revision 291101
Author eoca...@igalia.com
Date 2022-03-10 04:03:07 -0800 (Thu, 10 Mar 2022)


Log Message
[MSE][SourceBuffer] Fix creating float PTS/DTS when dividing sample
https://bugs.webkit.org/show_bug.cgi?id=237528

Reviewed by Xabier Rodriguez-Calvar.

The timestamps used for sample division in SourceBuffer aren't being
aligned with the same rounding margin used in
SourceBuffer::sourceBufferPrivateDidReceiveSample().

This patch is authored by Eugene Mutavchi 
See: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/797

* platform/graphics/SourceBufferPrivate.cpp: Extracted roundTowardsTimeScaleWithRoundingMargin lambda as a function and used it from removeCodedFrames(), on top of the current usage from sourceBufferPrivateDidReceiveSample().

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/SourceBufferPrivate.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (291100 => 291101)

--- trunk/Source/WebCore/ChangeLog	2022-03-10 11:38:43 UTC (rev 291100)
+++ trunk/Source/WebCore/ChangeLog	2022-03-10 12:03:07 UTC (rev 291101)
@@ -1,3 +1,19 @@
+2022-03-10  Enrique Ocaña González  
+
+[MSE][SourceBuffer] Fix creating float PTS/DTS when dividing sample
+https://bugs.webkit.org/show_bug.cgi?id=237528
+
+Reviewed by Xabier Rodriguez-Calvar.
+
+The timestamps used for sample division in SourceBuffer aren't being
+aligned with the same rounding margin used in
+SourceBuffer::sourceBufferPrivateDidReceiveSample().
+
+This patch is authored by Eugene Mutavchi 
+See: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/797
+
+* platform/graphics/SourceBufferPrivate.cpp: Extracted roundTowardsTimeScaleWithRoundingMargin lambda as a function and used it from removeCodedFrames(), on top of the current usage from sourceBufferPrivateDidReceiveSample().
+
 2022-03-09  Antoine Quint  
 
 [web-animations] fill-rule should support discrete animation


Modified: trunk/Source/WebCore/platform/graphics/SourceBufferPrivate.cpp (291100 => 291101)

--- trunk/Source/WebCore/platform/graphics/SourceBufferPrivate.cpp	2022-03-10 11:38:43 UTC (rev 291100)
+++ trunk/Source/WebCore/platform/graphics/SourceBufferPrivate.cpp	2022-03-10 12:03:07 UTC (rev 291101)
@@ -44,6 +44,18 @@
 
 namespace WebCore {
 
+static inline MediaTime roundTowardsTimeScaleWithRoundingMargin(const MediaTime& time, uint32_t timeScale, const MediaTime& roundingMargin)
+{
+while (true) {
+MediaTime roundedTime = time.toTimeScale(timeScale);
+if (abs(roundedTime - time) < roundingMargin || timeScale >= MediaTime::MaximumTimeScale)
+return roundedTime;
+
+if (!WTF::safeMultiply(timeScale, 2, timeScale) || timeScale > MediaTime::MaximumTimeScale)
+timeScale = MediaTime::MaximumTimeScale;
+}
+};
+
 // Do not enqueue samples spanning a significant unbuffered gap.
 // NOTE: one second is somewhat arbitrary. MediaSource::monitorSourceBuffers() is run
 // on the playbackTimer, which is effectively every 350ms. Allowing > 350ms gap between
@@ -559,7 +571,9 @@
 RefPtr sample = sampleIterator->second;
 if (!sample->isDivisable())
 return;
-std::pair, RefPtr> replacementSamples = sample->divide(time);
+MediaTime microsecond(1, 100);
+MediaTime roundedTime = roundTowardsTimeScaleWithRoundingMargin(time, sample->presentationTime().timeScale(), microsecond);
+std::pair, RefPtr> replacementSamples = sample->divide(roundedTime);
 if (!replacementSamples.first || !replacementSamples.second)
 return;
 DEBUG_LOG(LOGIDENTIFIER, "splitting sample ", *sample, " into ", *replacementSamples.first, " and ", *replacementSamples.second);
@@ -926,17 +940,6 @@
 
 MediaTime microsecond(1, 100);
 
-auto roundTowardsTimeScaleWithRoundingMargin = [] (const MediaTime& time, uint32_t timeScale, const MediaTime& roundingMargin) {
-while (true) {
-MediaTime roundedTime = time.toTimeScale(timeScale);
-if (abs(roundedTime - time) < roundingMargin || timeScale >= MediaTime::MaximumTimeScale)
-return roundedTime;
-
-if (!WTF::safeMultiply(timeScale, 2, timeScale) || timeScale > MediaTime::MaximumTimeScale)
-timeScale = MediaTime::MaximumTimeScale;
-}
-};
-
 // 1.4 If timestampOffset is not 0, then run the following steps:
 if (m_timestampOffset) {
 if (!trackBuffer.roundedTimestampOffset.isValid() || presentationTimestamp.timeScale() != trackBuffer.lastFrameTimescale) {






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [290984] trunk/Source/WebCore

2022-03-08 Thread eocanha
Title: [290984] trunk/Source/WebCore








Revision 290984
Author eoca...@igalia.com
Date 2022-03-08 04:21:51 -0800 (Tue, 08 Mar 2022)


Log Message
[GStreamer] Handle gst pad error as format error
https://bugs.webkit.org/show_bug.cgi?id=237526

Reviewed by Xabier Rodriguez-Calvar.

This patch is authored by Eugene Mutavchi 
See: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/797

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (290983 => 290984)

--- trunk/Source/WebCore/ChangeLog	2022-03-08 09:25:40 UTC (rev 290983)
+++ trunk/Source/WebCore/ChangeLog	2022-03-08 12:21:51 UTC (rev 290984)
@@ -1,3 +1,15 @@
+2022-03-08  Enrique Ocaña González  
+
+[GStreamer] Handle gst pad error as format error
+https://bugs.webkit.org/show_bug.cgi?id=237526
+
+Reviewed by Xabier Rodriguez-Calvar.
+
+This patch is authored by Eugene Mutavchi 
+See: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/797
+
+* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+
 2022-03-08  Carlos Garcia Campos  
 
 PDF.js content script is adding custom cocoa style unconditionally


Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp (290983 => 290984)

--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2022-03-08 09:25:40 UTC (rev 290983)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2022-03-08 12:21:51 UTC (rev 290984)
@@ -1718,6 +1718,7 @@
 || g_error_matches(err.get(), GST_STREAM_ERROR, GST_STREAM_ERROR_WRONG_TYPE)
 || g_error_matches(err.get(), GST_STREAM_ERROR, GST_STREAM_ERROR_FAILED)
 || g_error_matches(err.get(), GST_CORE_ERROR, GST_CORE_ERROR_MISSING_PLUGIN)
+|| g_error_matches(err.get(), GST_CORE_ERROR, GST_CORE_ERROR_PAD)
 || g_error_matches(err.get(), GST_RESOURCE_ERROR, GST_RESOURCE_ERROR_NOT_FOUND))
 error = MediaPlayer::NetworkState::FormatError;
 else if (g_error_matches(err.get(), GST_STREAM_ERROR, GST_STREAM_ERROR_TYPE_NOT_FOUND)) {






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [289800] trunk/Source/WebCore

2022-02-15 Thread eocanha
Title: [289800] trunk/Source/WebCore








Revision 289800
Author eoca...@igalia.com
Date 2022-02-15 04:01:59 -0800 (Tue, 15 Feb 2022)


Log Message
[GStreamer][MSE] Let MSE set natural video size when using holepunch
https://bugs.webkit.org/show_bug.cgi?id=236453

Reviewed by Xabier Rodriguez-Calvar.

Currently the holepunch implementation completely overrides the video size to a hardcoded
value. It would be desirable to let the m_videoSize value set by
MediaPlayerPrivateGStreamerMSE::setInitialVideoSize() take precedence over the hardcoded value.

This is a fix for media element events test case from YTS:

https://ytlr-cert.appspot.com/2021/main.html?tests=18

This patch is authored by Eugene Mutavchi 
See: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/775

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::naturalSize const): Return m_videoSize when set.

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (289799 => 289800)

--- trunk/Source/WebCore/ChangeLog	2022-02-15 09:37:07 UTC (rev 289799)
+++ trunk/Source/WebCore/ChangeLog	2022-02-15 12:01:59 UTC (rev 289800)
@@ -1,3 +1,24 @@
+2022-02-15  Enrique Ocaña González  
+
+[GStreamer][MSE] Let MSE set natural video size when using holepunch
+https://bugs.webkit.org/show_bug.cgi?id=236453
+
+Reviewed by Xabier Rodriguez-Calvar.
+
+Currently the holepunch implementation completely overrides the video size to a hardcoded
+value. It would be desirable to let the m_videoSize value set by
+MediaPlayerPrivateGStreamerMSE::setInitialVideoSize() take precedence over the hardcoded value.
+
+This is a fix for media element events test case from YTS:
+
+https://ytlr-cert.appspot.com/2021/main.html?tests=18
+
+This patch is authored by Eugene Mutavchi 
+See: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/775
+
+* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+(WebCore::MediaPlayerPrivateGStreamer::naturalSize const): Return m_videoSize when set.
+
 2022-02-15  Adrian Perez de Castro  
 
 [GTK][WPE] Inclusion of OpenGLShims.h should not depend on USE(GLX)


Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp (289799 => 289800)

--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2022-02-15 09:37:07 UTC (rev 289799)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2022-02-15 12:01:59 UTC (rev 289800)
@@ -1555,13 +1555,6 @@
 // Returns the size of the video.
 FloatSize MediaPlayerPrivateGStreamer::naturalSize() const
 {
-#if USE(GSTREAMER_HOLEPUNCH)
-// When using the holepuch we may not be able to get the video frames size, so we can't use
-// it. But we need to report some non empty naturalSize for the player's GraphicsLayer
-// to be properly created.
-return s_holePunchDefaultFrameSize;
-#endif
-
 #if ENABLE(MEDIA_STREAM)
 if (!m_isLegacyPlaybin && !m_wantedVideoStreamId.isEmpty()) {
 RefPtr videoTrack = m_videoTracks.get(m_wantedVideoStreamId);
@@ -1579,6 +1572,16 @@
 if (!hasVideo())
 return FloatSize();
 
+if (!m_videoSize.isEmpty())
+return m_videoSize;
+
+#if USE(GSTREAMER_HOLEPUNCH)
+// When using the holepuch we may not be able to get the video frames size, so we can't use
+// it. But we need to report some non empty naturalSize for the player's GraphicsLayer
+// to be properly created.
+return s_holePunchDefaultFrameSize;
+#endif
+
 return m_videoSize;
 }
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [289730] trunk/Source/WebCore

2022-02-14 Thread eocanha
Title: [289730] trunk/Source/WebCore








Revision 289730
Author eoca...@igalia.com
Date 2022-02-14 04:20:41 -0800 (Mon, 14 Feb 2022)


Log Message
Don't throw exception when controls are removed
https://bugs.webkit.org/show_bug.cgi?id=236456

Reviewed by Xabier Rodriguez-Calvar.

In mediaControlsBase.js, when media controls are removed, calling controlsAreHidden() can cause
an exception because the panel has no parentElement.

This patch is authored by Eugene Mutavchi 
See: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/775

* Modules/mediacontrols/mediaControlsBase.js: Return false if there's no parent.

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/mediacontrols/mediaControlsBase.js




Diff

Modified: trunk/Source/WebCore/ChangeLog (289729 => 289730)

--- trunk/Source/WebCore/ChangeLog	2022-02-14 11:29:16 UTC (rev 289729)
+++ trunk/Source/WebCore/ChangeLog	2022-02-14 12:20:41 UTC (rev 289730)
@@ -1,3 +1,18 @@
+2022-02-14  Enrique Ocaña González  
+
+Don't throw exception when controls are removed
+https://bugs.webkit.org/show_bug.cgi?id=236456
+
+Reviewed by Xabier Rodriguez-Calvar.
+
+In mediaControlsBase.js, when media controls are removed, calling controlsAreHidden() can cause
+an exception because the panel has no parentElement.
+
+This patch is authored by Eugene Mutavchi 
+See: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/775
+
+* Modules/mediacontrols/mediaControlsBase.js: Return false if there's no parent.
+
 2022-02-14  Alejandro G. Castro  
 
 [GTK] [WPE] Fix problem when the buffer object is released before we try to send it to the compositor


Modified: trunk/Source/WebCore/Modules/mediacontrols/mediaControlsBase.js (289729 => 289730)

--- trunk/Source/WebCore/Modules/mediacontrols/mediaControlsBase.js	2022-02-14 11:29:16 UTC (rev 289729)
+++ trunk/Source/WebCore/Modules/mediacontrols/mediaControlsBase.js	2022-02-14 12:20:41 UTC (rev 289730)
@@ -1035,6 +1035,8 @@
 return false;
 
 var panel = this.controls.panel;
+if (!panel.parentElement)
+return true;
 return (!panel.classList.contains(this.ClassNames.show) || panel.classList.contains(this.ClassNames.hidden))
 && (panel.parentElement.querySelector(':hover') !== panel);
 },






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [286358] trunk/Source/WebCore

2021-12-01 Thread eocanha
Title: [286358] trunk/Source/WebCore








Revision 286358
Author eoca...@igalia.com
Date 2021-12-01 02:56:22 -0800 (Wed, 01 Dec 2021)


Log Message
[MSE][WPE] Parameterize maximum buffer size using the MSE_MAX_BUFFER_SIZE env var
https://bugs.webkit.org/show_bug.cgi?id=233495

Reviewed by Xabier Rodriguez-Calvar.

The current MSE policy of SourceBuffers taking all the available system memory until the MemoryPressureHandler
complains may work fine for a typical desktop system, when caching is preferred over memory footprint. However,
memory is scarce on embedded systems and WebKit may compete with other software for memory resources. In that
scenario, the embedder may prefer to restrict the amount of memory available for each kind of SourceBuffer
(audio, video, text).

For that purpose, the MSE_MAX_BUFFER_SIZE environment variable is honored. It has the following syntax: Case
insensitive, full type (audio, video, text), compact type (a, v, t), wildcard (*), unit multipliers (M=Mb,
K=Kb, =bytes). Examples:

  MSE_MAX_BUFFER_SIZE='V:50M,audio:12k,TeXT:500K'
  MSE_MAX_BUFFER_SIZE='*:100M'
  MSE_MAX_BUFFER_SIZE='video:90M,T:10'

* Modules/mediasource/SourceBuffer.cpp: Honor platform imposed buffer size restrictions with higher priority (if present) than the element ones.
* platform/graphics/SourceBufferPrivate.h: Added platformMaximumBufferSize() default implementation that sets no buffer size restrictions.
* platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp: Read the MSE_MAX_BUFFER_SIZE environment variable and compute the maximum buffer
size if the size is specified in the variable for all the track types present in the SourceBufferPrivate. Otherwise, use the default size.
* platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h: Override default platformMaximumBufferSize() implementation.

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp
trunk/Source/WebCore/platform/graphics/SourceBufferPrivate.h
trunk/Source/WebCore/platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp
trunk/Source/WebCore/platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (286357 => 286358)

--- trunk/Source/WebCore/ChangeLog	2021-12-01 10:53:40 UTC (rev 286357)
+++ trunk/Source/WebCore/ChangeLog	2021-12-01 10:56:22 UTC (rev 286358)
@@ -1,3 +1,30 @@
+2021-12-01  Enrique Ocaña González  
+
+[MSE][WPE] Parameterize maximum buffer size using the MSE_MAX_BUFFER_SIZE env var
+https://bugs.webkit.org/show_bug.cgi?id=233495
+
+Reviewed by Xabier Rodriguez-Calvar.
+
+The current MSE policy of SourceBuffers taking all the available system memory until the MemoryPressureHandler
+complains may work fine for a typical desktop system, when caching is preferred over memory footprint. However,
+memory is scarce on embedded systems and WebKit may compete with other software for memory resources. In that
+scenario, the embedder may prefer to restrict the amount of memory available for each kind of SourceBuffer
+(audio, video, text).
+
+For that purpose, the MSE_MAX_BUFFER_SIZE environment variable is honored. It has the following syntax: Case
+insensitive, full type (audio, video, text), compact type (a, v, t), wildcard (*), unit multipliers (M=Mb,
+K=Kb, =bytes). Examples:
+
+  MSE_MAX_BUFFER_SIZE='V:50M,audio:12k,TeXT:500K'
+  MSE_MAX_BUFFER_SIZE='*:100M'
+  MSE_MAX_BUFFER_SIZE='video:90M,T:10'
+
+* Modules/mediasource/SourceBuffer.cpp: Honor platform imposed buffer size restrictions with higher priority (if present) than the element ones.
+* platform/graphics/SourceBufferPrivate.h: Added platformMaximumBufferSize() default implementation that sets no buffer size restrictions.
+* platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp: Read the MSE_MAX_BUFFER_SIZE environment variable and compute the maximum buffer
+size if the size is specified in the variable for all the track types present in the SourceBufferPrivate. Otherwise, use the default size.
+* platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h: Override default platformMaximumBufferSize() implementation.
+
 2021-11-30  Simon Fraser  
 
 Pass the timestamp for scrolling thread animations through all the serviceScrollAnimation() calls


Modified: trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp (286357 => 286358)

--- trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp	2021-12-01 10:53:40 UTC (rev 286357)
+++ trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp	2021-12-01 10:56:22 UTC (rev 286358)
@@ -630,6 +630,10 @@
 if (!element)
 return 0;
 
+size_t platformMaximumBufferSize = m_private->platformMaximumBufferSize();
+if (platformMaximumBufferSize)
+return platformMaximumBufferSize;
+
 return element-

[webkit-changes] [286210] trunk/Source/WebCore

2021-11-29 Thread eocanha
Title: [286210] trunk/Source/WebCore








Revision 286210
Author eoca...@igalia.com
Date 2021-11-29 06:32:21 -0800 (Mon, 29 Nov 2021)


Log Message
[GStreamer][WPE] Control on-disk multimedia buffering via the WPE_SHELL_DISABLE_MEDIA_DISK_CACHE environment variable
https://bugs.webkit.org/show_bug.cgi?id=233492

Reviewed by Xabier Rodriguez-Calvar.

Embedded platforms often don't have a persistent storage suitable for repetitive writes (eg: caching
media files may wear out a flash drive, and RAM memory is scarce enough to use a tmpfs for caching).
Those platforms need a way to disable on-disk caching.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: Honor environment variable.

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (286209 => 286210)

--- trunk/Source/WebCore/ChangeLog	2021-11-29 13:05:30 UTC (rev 286209)
+++ trunk/Source/WebCore/ChangeLog	2021-11-29 14:32:21 UTC (rev 286210)
@@ -1,3 +1,16 @@
+2021-11-29  Enrique Ocaña González  
+
+[GStreamer][WPE] Control on-disk multimedia buffering via the WPE_SHELL_DISABLE_MEDIA_DISK_CACHE environment variable
+https://bugs.webkit.org/show_bug.cgi?id=233492
+
+Reviewed by Xabier Rodriguez-Calvar.
+
+Embedded platforms often don't have a persistent storage suitable for repetitive writes (eg: caching
+media files may wear out a flash drive, and RAM memory is scarce enough to use a tmpfs for caching).
+Those platforms need a way to disable on-disk caching.
+
+* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: Honor environment variable.
+
 2021-11-29  Kimmo Kinnunen  
 
 GPUP GraphicsContextGL creation failure cannot be detected


Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp (286209 => 286210)

--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2021-11-29 13:05:30 UTC (rev 286209)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2021-11-29 14:32:21 UTC (rev 286210)
@@ -2595,6 +2595,22 @@
 return finalResult;
 }
 
+bool isMediaDiskCacheDisabled()
+{
+static bool result = false;
+#if PLATFORM(WPE)
+static std::once_flag once;
+std::call_once(once, []() {
+String s(std::getenv("WPE_SHELL_DISABLE_MEDIA_DISK_CACHE"));
+if (!s.isEmpty()) {
+String value = s.stripWhiteSpace().convertToLowercaseWithoutLocale();
+result = (value == "1" || value == "t" || value == "true");
+}
+});
+#endif
+return result;
+}
+
 void MediaPlayerPrivateGStreamer::updateDownloadBufferingFlag()
 {
 if (!m_pipeline)
@@ -2618,7 +2634,10 @@
 return;
 }
 
-bool shouldDownload = !m_isLiveStream && m_preload == MediaPlayer::Preload::Auto;
+bool diskCacheDisabled = isMediaDiskCacheDisabled();
+GST_DEBUG_OBJECT(pipeline(), "Media on-disk cache is %s", (diskCacheDisabled) ? "disabled" : "enabled");
+
+bool shouldDownload = !m_isLiveStream && m_preload == MediaPlayer::Preload::Auto && !diskCacheDisabled;
 if (shouldDownload) {
 GST_INFO_OBJECT(pipeline(), "Enabling on-disk buffering");
 g_object_set(m_pipeline.get(), "flags", flags | flagDownload, nullptr);






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [286166] trunk/Source/WebCore

2021-11-25 Thread eocanha
Title: [286166] trunk/Source/WebCore








Revision 286166
Author eoca...@igalia.com
Date 2021-11-25 04:34:05 -0800 (Thu, 25 Nov 2021)


Log Message
[GStreamer][WPE] Use WPE_SHELL_MEDIA_DISK_CACHE_PATH env var to customize media disk cache path
https://bugs.webkit.org/show_bug.cgi?id=233477

Reviewed by Xabier Rodriguez-Calvar.

"/var/tmp" isn't always the best place to store the media download cache generated by GstDownloadBuffer
on embedded platforms. Each of those downloads can hold up to a whole movie (Gigabytes) and "/var/tmp"
is sometimes a memory based tmpfs. Some way to control the cache path is needed.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: Honor environment variable.

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (286165 => 286166)

--- trunk/Source/WebCore/ChangeLog	2021-11-25 12:02:28 UTC (rev 286165)
+++ trunk/Source/WebCore/ChangeLog	2021-11-25 12:34:05 UTC (rev 286166)
@@ -1,3 +1,16 @@
+2021-11-25  Enrique Ocaña González  
+
+[GStreamer][WPE] Use WPE_SHELL_MEDIA_DISK_CACHE_PATH env var to customize media disk cache path
+https://bugs.webkit.org/show_bug.cgi?id=233477
+
+Reviewed by Xabier Rodriguez-Calvar.
+
+"/var/tmp" isn't always the best place to store the media download cache generated by GstDownloadBuffer
+on embedded platforms. Each of those downloads can hold up to a whole movie (Gigabytes) and "/var/tmp"
+is sometimes a memory based tmpfs. Some way to control the cache path is needed.
+
+* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: Honor environment variable.
+
 2021-11-25  Said Abou-Hallawa  
 
 [GPU Process] Make FilterEffect appliers take FilterImages in their apply() methods


Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp (286165 => 286166)

--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2021-11-25 12:02:28 UTC (rev 286165)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2021-11-25 12:34:05 UTC (rev 286166)
@@ -2154,7 +2154,17 @@
 GUniqueOutPtr oldDownloadTemplate;
 g_object_get(element, "temp-template", &oldDownloadTemplate.outPtr(), nullptr);
 
-GUniquePtr newDownloadTemplate(g_build_filename(G_DIR_SEPARATOR_S, "var", "tmp", "WebKit-Media-XX", nullptr));
+#if PLATFORM(WPE)
+GUniquePtr mediaDiskCachePath(g_strdup(std::getenv("WPE_SHELL_MEDIA_DISK_CACHE_PATH")));
+if (!mediaDiskCachePath || !*mediaDiskCachePath) {
+GUniquePtr defaultValue(g_build_filename(G_DIR_SEPARATOR_S, "var", "tmp", nullptr));
+mediaDiskCachePath.swap(defaultValue);
+}
+#else
+GUniquePtr mediaDiskCachePath(g_build_filename(G_DIR_SEPARATOR_S, "var", "tmp", nullptr));
+#endif
+
+GUniquePtr newDownloadTemplate(g_build_filename(G_DIR_SEPARATOR_S, mediaDiskCachePath.get(), "WebKit-Media-XX", nullptr));
 g_object_set(element, "temp-template", newDownloadTemplate.get(), nullptr);
 GST_DEBUG_OBJECT(pipeline(), "Reconfigured file download template from '%s' to '%s'", oldDownloadTemplate.get(), newDownloadTemplate.get());
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [286165] trunk/LayoutTests

2021-11-25 Thread eocanha
Title: [286165] trunk/LayoutTests








Revision 286165
Author eoca...@igalia.com
Date 2021-11-25 04:02:28 -0800 (Thu, 25 Nov 2021)


Log Message
[GTK] Layout Test http/tests/media/video-play-waiting.html is timing out
https://bugs.webkit.org/show_bug.cgi?id=142489

Reviewed by Philippe Normand.

The test was failing with a timeout even after properly calling TestRunner.notifyDone()
internally because there was still an injectedBundle.topLoadingFrame() in InjectedBundlePage,
which means that the web page hadn't completely finished to be downloaded. This was caused
by the stalled video download that the test wants to exercise.

The solution is to set the video src to empty in order to convince TestRunner that the page
has finished downloading.

* http/tests/media/video-play-waiting.html: Set the video src to empty.
* platform/mac/TestExpectations: The test now just fails (for reasons unrelated to this fix) on mac instead of timing out.
* platform/glib/TestExpectations: Unskipped test.
* platform/win/TestExpectations: Unskipped test.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/http/tests/media/video-play-waiting.html
trunk/LayoutTests/platform/glib/TestExpectations
trunk/LayoutTests/platform/mac/TestExpectations
trunk/LayoutTests/platform/win/TestExpectations




Diff

Modified: trunk/LayoutTests/ChangeLog (286164 => 286165)

--- trunk/LayoutTests/ChangeLog	2021-11-25 11:44:44 UTC (rev 286164)
+++ trunk/LayoutTests/ChangeLog	2021-11-25 12:02:28 UTC (rev 286165)
@@ -1,3 +1,23 @@
+2021-11-25  Enrique Ocaña González  
+
+[GTK] Layout Test http/tests/media/video-play-waiting.html is timing out
+https://bugs.webkit.org/show_bug.cgi?id=142489
+
+Reviewed by Philippe Normand.
+
+The test was failing with a timeout even after properly calling TestRunner.notifyDone()
+internally because there was still an injectedBundle.topLoadingFrame() in InjectedBundlePage,
+which means that the web page hadn't completely finished to be downloaded. This was caused
+by the stalled video download that the test wants to exercise.
+
+The solution is to set the video src to empty in order to convince TestRunner that the page
+has finished downloading.
+
+* http/tests/media/video-play-waiting.html: Set the video src to empty.
+* platform/mac/TestExpectations: The test now just fails (for reasons unrelated to this fix) on mac instead of timing out.
+* platform/glib/TestExpectations: Unskipped test.
+* platform/win/TestExpectations: Unskipped test.
+
 2021-11-24  Ziran Sun  
 
 [css-grid] Track sizing algorithm not repeated even if used flex fraction would change


Modified: trunk/LayoutTests/http/tests/media/video-play-waiting.html (286164 => 286165)

--- trunk/LayoutTests/http/tests/media/video-play-waiting.html	2021-11-25 11:44:44 UTC (rev 286164)
+++ trunk/LayoutTests/http/tests/media/video-play-waiting.html	2021-11-25 12:02:28 UTC (rev 286165)
@@ -9,7 +9,11 @@
 waitForEvent('durationchange');
 waitForEvent('loadedmetadata');
 waitForEvent('loadeddata');
-waitForEventAndEnd('waiting');
+waitForEventAndEnd('waiting', function() {
+// TestRunner waits for the complete frame download before finishing, so having the video load stalled
+// prevents TestRunner from finishing. Changing the src will abort the download and let the test finish.
+video.src = ""
+});
 
 waitForEvent('canplay', function () {
 run("video.play()");


Modified: trunk/LayoutTests/platform/glib/TestExpectations (286164 => 286165)

--- trunk/LayoutTests/platform/glib/TestExpectations	2021-11-25 11:44:44 UTC (rev 286164)
+++ trunk/LayoutTests/platform/glib/TestExpectations	2021-11-25 12:02:28 UTC (rev 286165)
@@ -2356,7 +2356,6 @@
 
 webkit.org/b/137698 media/video-controls-drag.html [ Timeout ]
 webkit.org/b/141959 http/tests/media/clearkey/clear-key-hls-aes128.html [ Crash Timeout ]
-webkit.org/b/142489 http/tests/media/video-play-waiting.html [ Timeout ]
 webkit.org/b/130971 media/track/track-remove-track.html [ Timeout ]
 webkit.org/b/113127 media/track/track-prefer-captions.html [ Timeout ]
 


Modified: trunk/LayoutTests/platform/mac/TestExpectations (286164 => 286165)

--- trunk/LayoutTests/platform/mac/TestExpectations	2021-11-25 11:44:44 UTC (rev 286164)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2021-11-25 12:02:28 UTC (rev 286165)
@@ -745,8 +745,7 @@
 webkit.org/b/136708 http/tests/media/video-play-stall-seek.html
 webkit.org/b/136708 media/media-fullscreen-not-in-document.html
 
-webkit.org/b/140639 http/tests/media/video-play-waiting.html [ Pass Timeout ]
-
+webkit.org/b/140639 http/tests/media/video-play-waiting.html [ Failure ]
 # This test requires generation of progress events during loading
 webkit.org/b/100984 media/progress-events-generated-correctly.html [ Failure ]
 


Modified: trunk/LayoutTests/platform/win/TestExpectations (286164 => 286165)

--- t

[webkit-changes] [285802] trunk

2021-11-15 Thread eocanha
Title: [285802] trunk








Revision 285802
Author eoca...@igalia.com
Date 2021-11-15 04:57:16 -0800 (Mon, 15 Nov 2021)


Log Message
[GTK] webaudio/silent-audio-interrupted-in-background.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=229964

Reviewed by Carlos Garcia Campos.

Source/WebCore:

I can't reproduce the timeout locally anymore, but I'm getting a crash sometimes. This fix is for the crash.
Unregister dbus objects on MediaSessionGLib destruction to prevent the dbus connection to keep processing requests.

* platform/audio/glib/MediaSessionGLib.cpp:
(WebCore::MediaSessionGLib::MediaSessionGLib()): Don't register a GBusNameLostCallback, as unregistration is now going to be handled in the destructor.
(WebCore::MediaSessionGLib::~MediaSessionGLib()): Unregister dbus objects.
(WebCore::MediaSessionGLib::nameLost()): Refactored into the destructor.
* platform/audio/glib/MediaSessionGLib.h:
(WebCore::MediaSessionGLib::nameLost()): Deleted.

LayoutTests:

Removed failing test from TestExpectations.

* platform/gtk/TestExpectations:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/platform/gtk/TestExpectations
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/audio/glib/MediaSessionGLib.cpp
trunk/Source/WebCore/platform/audio/glib/MediaSessionGLib.h




Diff

Modified: trunk/LayoutTests/ChangeLog (285801 => 285802)

--- trunk/LayoutTests/ChangeLog	2021-11-15 11:12:32 UTC (rev 285801)
+++ trunk/LayoutTests/ChangeLog	2021-11-15 12:57:16 UTC (rev 285802)
@@ -1,3 +1,14 @@
+2021-11-15  Enrique Ocaña González  
+
+[GTK] webaudio/silent-audio-interrupted-in-background.html is a flaky timeout
+https://bugs.webkit.org/show_bug.cgi?id=229964
+
+Reviewed by Carlos Garcia Campos.
+
+Removed failing test from TestExpectations.
+
+* platform/gtk/TestExpectations:
+
 2021-11-15  Antti Koivisto  
 
 Stack overflow with revert-layer


Modified: trunk/LayoutTests/platform/gtk/TestExpectations (285801 => 285802)

--- trunk/LayoutTests/platform/gtk/TestExpectations	2021-11-15 11:12:32 UTC (rev 285801)
+++ trunk/LayoutTests/platform/gtk/TestExpectations	2021-11-15 12:57:16 UTC (rev 285802)
@@ -1248,8 +1248,6 @@
 webkit.org/b/229268 media/media-fragments/TC0009.html [ Failure Pass ]
 webkit.org/b/229268 media/media-fragments/TC0014.html [ Failure Pass ]
 
-webkit.org/b/229964 webaudio/silent-audio-interrupted-in-background.html [ Pass Timeout ]
-
 # Flaky on skip-failing-test bot (EWS)
 webkit.org/b/229270 fast/events/monotonic-event-time.html [ Failure Pass ]
 


Modified: trunk/Source/WebCore/ChangeLog (285801 => 285802)

--- trunk/Source/WebCore/ChangeLog	2021-11-15 11:12:32 UTC (rev 285801)
+++ trunk/Source/WebCore/ChangeLog	2021-11-15 12:57:16 UTC (rev 285802)
@@ -1,3 +1,20 @@
+2021-11-15  Enrique Ocaña González  
+
+[GTK] webaudio/silent-audio-interrupted-in-background.html is a flaky timeout
+https://bugs.webkit.org/show_bug.cgi?id=229964
+
+Reviewed by Carlos Garcia Campos.
+
+I can't reproduce the timeout locally anymore, but I'm getting a crash sometimes. This fix is for the crash.
+Unregister dbus objects on MediaSessionGLib destruction to prevent the dbus connection to keep processing requests.
+
+* platform/audio/glib/MediaSessionGLib.cpp:
+(WebCore::MediaSessionGLib::MediaSessionGLib()): Don't register a GBusNameLostCallback, as unregistration is now going to be handled in the destructor.
+(WebCore::MediaSessionGLib::~MediaSessionGLib()): Unregister dbus objects.
+(WebCore::MediaSessionGLib::nameLost()): Refactored into the destructor.
+* platform/audio/glib/MediaSessionGLib.h:
+(WebCore::MediaSessionGLib::nameLost()): Deleted.
+
 2021-11-15  Antti Koivisto  
 
 Stack overflow with revert-layer


Modified: trunk/Source/WebCore/platform/audio/glib/MediaSessionGLib.cpp (285801 => 285802)

--- trunk/Source/WebCore/platform/audio/glib/MediaSessionGLib.cpp	2021-11-15 11:12:32 UTC (rev 285801)
+++ trunk/Source/WebCore/platform/audio/glib/MediaSessionGLib.cpp	2021-11-15 12:57:16 UTC (rev 285802)
@@ -218,44 +218,21 @@
 const auto& applicationID = getApplicationID();
 m_instanceId = applicationID.isEmpty() ? makeString("org.mpris.MediaPlayer2.webkit.instance", getpid(), "-", identifier.toUInt64()) : makeString("org.mpris.MediaPlayer2.", applicationID.ascii().data(), "-", identifier.toUInt64());
 
-m_ownerId = g_bus_own_name_on_connection(m_connection.get(), m_instanceId.ascii().data(), G_BUS_NAME_OWNER_FLAGS_NONE, nullptr,
-reinterpret_cast(+[](GDBusConnection* connection, const char*, gpointer userData) {
-auto& session = *reinterpret_cast(userData);
-session.nameLost(connection);
-}), this, nullptr);
+m_ownerId = g_bus_own_name_on_connection(m_connection.get(), m_instanceId.ascii().data(), G_BUS_NAME_OWNER_FLAGS_NONE, nullptr, nullptr, this, nullptr);
 }
 
 MediaSessionGLib::~Medi

[webkit-changes] [285586] trunk

2021-11-10 Thread eocanha
Title: [285586] trunk








Revision 285586
Author eoca...@igalia.com
Date 2021-11-10 09:42:35 -0800 (Wed, 10 Nov 2021)


Log Message
[GTK] Layout Test media/video-seek-with-negative-playback.html timeouts on the release bot.
https://bugs.webkit.org/show_bug.cgi?id=135086

Reviewed by Xabier Rodriguez-Calvar.

Source/WebCore:

In some specific cases, an EOS GstEvent can happen right before a seek. The event is translated
by playbin as an EOS GstMessage and posted to the bus, waiting to be forwarded to the main thread.
The EOS message (now irrelevant after the seek) is received and processed right after the seek,
causing the termination of the media at the player private and upper levels. This can even happen
after the seek has completed (m_isSeeking already false).

This patch detects that condition by ensuring that the playback is coherent with the EOS message,
that is, if we're still playing somewhere inside the playable ranges, there should be no EOS at
all. If that's the case, it's considered to be one of those spureous EOS and is ignored.

Live streams (infinite duration) are special and we still have to detect legitimate EOS there, so
this message bailout isn't done in those cases.

Also refactored the code that queries the position to the sinks.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: Ignore EOS message if the playback position is inside the playback limits when they're finite. Refactored sink position query code as gstreamerPositionFromSinks().
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Added gstreamerPositionFromSinks().

LayoutTests:

* platform/glib/TestExpectations: Unskipped test.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/platform/glib/TestExpectations
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h




Diff

Modified: trunk/LayoutTests/ChangeLog (285585 => 285586)

--- trunk/LayoutTests/ChangeLog	2021-11-10 17:41:49 UTC (rev 285585)
+++ trunk/LayoutTests/ChangeLog	2021-11-10 17:42:35 UTC (rev 285586)
@@ -1,3 +1,12 @@
+2021-11-10  Enrique Ocaña González  
+
+[GTK] Layout Test media/video-seek-with-negative-playback.html timeouts on the release bot.
+https://bugs.webkit.org/show_bug.cgi?id=135086
+
+Reviewed by Xabier Rodriguez-Calvar.
+
+* platform/glib/TestExpectations: Unskipped test.
+
 2021-11-10  Rob Buis  
 
 [css-contain] Support contain:paint


Modified: trunk/LayoutTests/platform/glib/TestExpectations (285585 => 285586)

--- trunk/LayoutTests/platform/glib/TestExpectations	2021-11-10 17:41:49 UTC (rev 285585)
+++ trunk/LayoutTests/platform/glib/TestExpectations	2021-11-10 17:42:35 UTC (rev 285586)
@@ -2341,7 +2341,6 @@
 
 webkit.org/b/108925 http/tests/media/video-play-stall.html [ Failure Timeout ]
 
-webkit.org/b/135086 media/video-seek-with-negative-playback.html [ Timeout Pass ]
 webkit.org/b/137698 media/video-controls-drag.html [ Timeout ]
 webkit.org/b/141959 http/tests/media/clearkey/clear-key-hls-aes128.html [ Crash Timeout ]
 webkit.org/b/142489 http/tests/media/video-play-waiting.html [ Timeout ]


Modified: trunk/Source/WebCore/ChangeLog (285585 => 285586)

--- trunk/Source/WebCore/ChangeLog	2021-11-10 17:41:49 UTC (rev 285585)
+++ trunk/Source/WebCore/ChangeLog	2021-11-10 17:42:35 UTC (rev 285586)
@@ -1,3 +1,28 @@
+2021-11-10  Enrique Ocaña González  
+
+[GTK] Layout Test media/video-seek-with-negative-playback.html timeouts on the release bot.
+https://bugs.webkit.org/show_bug.cgi?id=135086
+
+Reviewed by Xabier Rodriguez-Calvar.
+
+In some specific cases, an EOS GstEvent can happen right before a seek. The event is translated
+by playbin as an EOS GstMessage and posted to the bus, waiting to be forwarded to the main thread.
+The EOS message (now irrelevant after the seek) is received and processed right after the seek,
+causing the termination of the media at the player private and upper levels. This can even happen
+after the seek has completed (m_isSeeking already false).
+
+This patch detects that condition by ensuring that the playback is coherent with the EOS message,
+that is, if we're still playing somewhere inside the playable ranges, there should be no EOS at
+all. If that's the case, it's considered to be one of those spureous EOS and is ignored.
+
+Live streams (infinite duration) are special and we still have to detect legitimate EOS there, so
+this message bailout isn't done in those cases.
+
+Also refactored the code that queries the position to the sinks.
+
+* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: Ignore EOS message if the playback position is inside the playback limits when they're finite. Refactored sink position query code as gstreamerPositionFromSinks().
+* pl

[webkit-changes] [285571] trunk

2021-11-10 Thread eocanha
Title: [285571] trunk








Revision 285571
Author eoca...@igalia.com
Date 2021-11-10 03:36:04 -0800 (Wed, 10 Nov 2021)


Log Message
[Media] Make currentTime compliant with the spec when readyState is HAVE_NOTHING
https://bugs.webkit.org/show_bug.cgi?id=229605
Source/WebCore:

Reviewed by Xabier Rodriguez-Calvar.

Covered by LayoutTests/media/video-seek-have-nothing.html.

Added an internal defaultPlaybackPosition in HTMLMediaElement when currentTime changes
are done when readyState is still HAVE_NOTHING, as mandated by the spec[1] since late
2011: https://html.spec.whatwg.org/#current-playback-position

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setReadyState): Seek to defaultPlaybackPosition (and reset it)  when readyState increases to HAVE_METADATA.
(WebCore::HTMLMediaElement::currentMediaTime const): Return defaultPlaybackPosition when higher than zero.
(WebCore::HTMLMediaElement::setCurrentTimeForBindings): Store the new currentTime in defaultPlaybackPosition when changed during a HAVE_NOTHING readyState.
* html/HTMLMediaElement.h: Added m_defaultPlaybackStartPosition private attribute.

LayoutTests:

Reviewed by Xabier Rodriguez-Calvar.

New test that checks that changes in currentTime done while on readyState=HAVE_NOTHING
are recorded and trigger a seek as soon as readyState increases to HAVE_METADATA or above.

* media/video-seek-have-nothing-expected.txt: Added.
* media/video-seek-have-nothing.html: Added.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/html/HTMLMediaElement.cpp
trunk/Source/WebCore/html/HTMLMediaElement.h


Added Paths

trunk/LayoutTests/media/video-seek-have-nothing-expected.txt
trunk/LayoutTests/media/video-seek-have-nothing.html




Diff

Modified: trunk/LayoutTests/ChangeLog (285570 => 285571)

--- trunk/LayoutTests/ChangeLog	2021-11-10 09:42:52 UTC (rev 285570)
+++ trunk/LayoutTests/ChangeLog	2021-11-10 11:36:04 UTC (rev 285571)
@@ -1,3 +1,16 @@
+2021-11-10  Enrique Ocaña González  
+
+[Media] Make currentTime compliant with the spec when readyState is HAVE_NOTHING
+https://bugs.webkit.org/show_bug.cgi?id=229605
+
+Reviewed by Xabier Rodriguez-Calvar.
+
+New test that checks that changes in currentTime done while on readyState=HAVE_NOTHING
+are recorded and trigger a seek as soon as readyState increases to HAVE_METADATA or above.
+
+* media/video-seek-have-nothing-expected.txt: Added.
+* media/video-seek-have-nothing.html: Added.
+
 2021-11-10  Tim Nguyen  
 
 Fix crash in GraphicsContextCG::endTransparencyLayer


Added: trunk/LayoutTests/media/video-seek-have-nothing-expected.txt (0 => 285571)

--- trunk/LayoutTests/media/video-seek-have-nothing-expected.txt	(rev 0)
+++ trunk/LayoutTests/media/video-seek-have-nothing-expected.txt	2021-11-10 11:36:04 UTC (rev 285571)
@@ -0,0 +1,19 @@
+Test that we can change currentTime when readyState is HAVE_NOTHING, the new value is returned, and a seek is done when readyState increases to HAVE_METADATA.
+
+
+EXPECTED (video.readyState == '0') OK
+EXPECTED (video.currentTime == '0') OK
+RUN(video.currentTime = 2)
+EXPECTED (video.readyState == '0') OK
+EXPECTED (video.currentTime == '2') OK
+EVENT(loadedmetadata)
+EXPECTED (video.readyState >= video.HAVE_METADATA == 'true') OK
+EVENT(seeked)
+RUN(video.play())
+EVENT(playing)
+EXPECTED (video.readyState >= video.HAVE_CURRENT_DATA == 'true') OK
+EVENT(timeupdate)
+EXPECTED (video.currentTime > 2 == 'true') OK
+EXPECTED (video.readyState >= video.HAVE_FUTURE_DATA == 'true') OK
+END OF TEST
+


Added: trunk/LayoutTests/media/video-seek-have-nothing.html (0 => 285571)

--- trunk/LayoutTests/media/video-seek-have-nothing.html	(rev 0)
+++ trunk/LayoutTests/media/video-seek-have-nothing.html	2021-11-10 11:36:04 UTC (rev 285571)
@@ -0,0 +1,47 @@
+
+
+
+
+function start()
+{
+findMediaElement();
+
+waitForEventOnce('loadedmetadata', function() {
+testExpected('video.readyState >= video.HAVE_METADATA', true);
+});
+waitForEventOnce('seeked', function() {
+// FIXME: This check sometimes fails on the mac-wk2-stress EWS.
+// testExpected('video.currentTime', 2);
+waitForEventOnce('playing', function() {
+testExpected('video.readyState >= video.HAVE_CURRENT_DATA', true);
+waitForEventOnce('timeupdate', function() {
+testExpected('video.currentTime > 2', true);
+testExpected('video.readyState >= video.HAVE_FUTURE_DATA', true);
+endTest();
+});
+});
+run('video.play()');
+});
+
+video.src = "" 'content/test');
+te

[webkit-changes] [284601] trunk/LayoutTests

2021-10-21 Thread eocanha
Title: [284601] trunk/LayoutTests








Revision 284601
Author eoca...@igalia.com
Date 2021-10-21 05:28:57 -0700 (Thu, 21 Oct 2021)


Log Message
REGRESSION(r282059) [GStreamer] Test media/media-source/media-source-stalled-holds-sleep-assertion.html timeouts
https://bugs.webkit.org/show_bug.cgi?id=229979

Reviewed by Xabier Rodriguez-Calvar.

Detect stall by monitoring currentTime instead of listening to the 'stall' event. This is needed after
removing emission of 'stall' event in GStreamer ports after https://bugs.webkit.org/show_bug.cgi?id=226882

Also remove initial seek, which is irrelevant to the test purpose and causes troubles in GStreamer ports.

* media/media-source/media-source-stalled-holds-sleep-assertion-expected.txt: Updated expectations.
* media/media-source/media-source-stalled-holds-sleep-assertion.html: Monitor currentTime instead of stall event, remove initial seek.
* platform/glib/TestExpectations: Removed timeout expectation.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/media/media-source/media-source-stalled-holds-sleep-assertion-expected.txt
trunk/LayoutTests/media/media-source/media-source-stalled-holds-sleep-assertion.html
trunk/LayoutTests/platform/glib/TestExpectations




Diff

Modified: trunk/LayoutTests/ChangeLog (284600 => 284601)

--- trunk/LayoutTests/ChangeLog	2021-10-21 11:51:12 UTC (rev 284600)
+++ trunk/LayoutTests/ChangeLog	2021-10-21 12:28:57 UTC (rev 284601)
@@ -1,3 +1,19 @@
+2021-10-21  Enrique Ocaña González  
+
+REGRESSION(r282059) [GStreamer] Test media/media-source/media-source-stalled-holds-sleep-assertion.html timeouts
+https://bugs.webkit.org/show_bug.cgi?id=229979
+
+Reviewed by Xabier Rodriguez-Calvar.
+
+Detect stall by monitoring currentTime instead of listening to the 'stall' event. This is needed after
+removing emission of 'stall' event in GStreamer ports after https://bugs.webkit.org/show_bug.cgi?id=226882
+
+Also remove initial seek, which is irrelevant to the test purpose and causes troubles in GStreamer ports.
+
+* media/media-source/media-source-stalled-holds-sleep-assertion-expected.txt: Updated expectations.
+* media/media-source/media-source-stalled-holds-sleep-assertion.html: Monitor currentTime instead of stall event, remove initial seek.
+* platform/glib/TestExpectations: Removed timeout expectation.
+
 2021-10-20  Antti Koivisto  
 
 [ iOS ] fast/inline/inline-background-clip-text-multiline.html is image failing


Modified: trunk/LayoutTests/media/media-source/media-source-stalled-holds-sleep-assertion-expected.txt (284600 => 284601)

--- trunk/LayoutTests/media/media-source/media-source-stalled-holds-sleep-assertion-expected.txt	2021-10-21 11:51:12 UTC (rev 284600)
+++ trunk/LayoutTests/media/media-source/media-source-stalled-holds-sleep-assertion-expected.txt	2021-10-21 12:28:57 UTC (rev 284601)
@@ -7,9 +7,8 @@
 EVENT(update)
 RUN(sourceBuffer.appendBuffer(loader.mediaSegment(0)))
 EVENT(update)
-RUN(video.currentTime = video.buffered.end(0) - 0.1)
 RUN(video.play())
-EVENT(stalled)
+EXPECTED ((currentTime != initialCurrentTime && oldCurrentTime == currentTime) == 'true') OK
 EXPECTED (internals.elementIsBlockingDisplaySleep(video) == 'false') OK
 END OF TEST
 


Modified: trunk/LayoutTests/media/media-source/media-source-stalled-holds-sleep-assertion.html (284600 => 284601)

--- trunk/LayoutTests/media/media-source/media-source-stalled-holds-sleep-assertion.html	2021-10-21 11:51:12 UTC (rev 284600)
+++ trunk/LayoutTests/media/media-source/media-source-stalled-holds-sleep-assertion.html	2021-10-21 12:28:57 UTC (rev 284601)
@@ -8,6 +8,9 @@
 var loader;
 var source;
 var sourceBuffer;
+var currentTime;
+var oldCurrentTime;
+var initialCurrentTime = null;
 
 function runTest() {
 findMediaElement();
@@ -39,13 +42,24 @@
 run('sourceBuffer.appendBuffer(loader.mediaSegment(0))');
 }
 
+function checkStalled() {
+oldCurrentTime = currentTime;
+currentTime = video.currentTime;
+if (initialCurrentTime == null)
+initialCurrentTime = currentTime;
+if (currentTime != initialCurrentTime && oldCurrentTime == currentTime)
+stalled();
+else
+setTimeout(checkStalled, 300);
+}
+
 function sourceUpdated() {
-run('video.currentTime = video.buffered.end(0) - 0.1');
 run('video.play()');
-waitForEvent('stalled', stalled);
+checkStalled();
 }
 
 function stalled() {
+testExpected('(currentTime != initialCurrentTime && oldCurrentTime == currentTime)', true);
 testExpected('internals.elementIsBlockingDisplaySleep(video)', false);
 endTest();
 }
@@ -54,4 +68,4 @@
 
 
 
-
\ No newline at end of file
+


Modified: trunk/LayoutTests/platform/glib/TestExpectations (284600 => 284601)

--- trunk/LayoutTests/platform/glib/TestExpectations	2021-10-21 11:51:12 UTC (rev 2

[webkit-changes] [284365] trunk

2021-10-18 Thread eocanha
Title: [284365] trunk








Revision 284365
Author eoca...@igalia.com
Date 2021-10-18 04:33:38 -0700 (Mon, 18 Oct 2021)


Log Message
[GLIB][GStreamer] test http/tests/security/webaudio-render-remote-audio-allowed-crossorigin-redirect.html is a flaky timeout since r278004
https://bugs.webkit.org/show_bug.cgi?id=229219


Reviewed by Philippe Normand.

Source/WebCore:

Forward EOS from webaudio appsink to the main pipeline. For some reason, some intermediate
GstBin isn't forwarding the GST_MESSAGE_EOS emitted by the appsink added by webaudio, so
the code at MediaPlayerPrivateGStreamer::handleMessage() can't detect EOS properly and signal
it to the player and the HTMLMediaElement.

* platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
(WebCore::AudioSourceProviderGStreamer::handleNewDeinterleavePad): Listen to the EOS signal of each created appsink and forward it to the main pipeline bus as GST_MESSAGE_EOS.
(WebCore::AudioSourceProviderGStreamer::handleRemovedDeinterleavePad): Remove the signal handler on pad destruction.

LayoutTests:

Give some more time to the frequency analyzer to detect activity.

* http/tests/security/webaudio-render-remote-audio-allowed-crossorigin-redirect.html:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/http/tests/security/webaudio-render-remote-audio-allowed-crossorigin-redirect.html
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp




Diff

Modified: trunk/LayoutTests/ChangeLog (284364 => 284365)

--- trunk/LayoutTests/ChangeLog	2021-10-18 10:47:58 UTC (rev 284364)
+++ trunk/LayoutTests/ChangeLog	2021-10-18 11:33:38 UTC (rev 284365)
@@ -1,3 +1,15 @@
+2021-10-18  Enrique Ocaña González  
+
+[GLIB][GStreamer] test http/tests/security/webaudio-render-remote-audio-allowed-crossorigin-redirect.html is a flaky timeout since r278004
+https://bugs.webkit.org/show_bug.cgi?id=229219
+
+
+Reviewed by Philippe Normand.
+
+Give some more time to the frequency analyzer to detect activity.
+
+* http/tests/security/webaudio-render-remote-audio-allowed-crossorigin-redirect.html:
+
 2021-10-18  Kiet Ho  
 
 Implement parsing and animation support for offset-distance, offset-position, offset-anchor


Modified: trunk/LayoutTests/http/tests/security/webaudio-render-remote-audio-allowed-crossorigin-redirect.html (284364 => 284365)

--- trunk/LayoutTests/http/tests/security/webaudio-render-remote-audio-allowed-crossorigin-redirect.html	2021-10-18 10:47:58 UTC (rev 284364)
+++ trunk/LayoutTests/http/tests/security/webaudio-render-remote-audio-allowed-crossorigin-redirect.html	2021-10-18 11:33:38 UTC (rev 284365)
@@ -37,11 +37,13 @@
 }, 30);
 
 audio.addEventListener("ended", event => {
-clearInterval(intervalToken);
-context.suspend().then(() => {
-shouldNotBe("outputArray", "silentArray");
-finishJSTest();
-});
+setTimeout(function() {
+clearInterval(intervalToken);
+context.suspend().then(() => {
+shouldNotBe("outputArray", "silentArray");
+finishJSTest();
+});
+}, 100);
 });
 }
 window.addEventListener('load', go);


Modified: trunk/Source/WebCore/ChangeLog (284364 => 284365)

--- trunk/Source/WebCore/ChangeLog	2021-10-18 10:47:58 UTC (rev 284364)
+++ trunk/Source/WebCore/ChangeLog	2021-10-18 11:33:38 UTC (rev 284365)
@@ -1,3 +1,20 @@
+2021-10-18  Enrique Ocaña González  
+
+[GLIB][GStreamer] test http/tests/security/webaudio-render-remote-audio-allowed-crossorigin-redirect.html is a flaky timeout since r278004
+https://bugs.webkit.org/show_bug.cgi?id=229219
+
+
+Reviewed by Philippe Normand.
+
+Forward EOS from webaudio appsink to the main pipeline. For some reason, some intermediate
+GstBin isn't forwarding the GST_MESSAGE_EOS emitted by the appsink added by webaudio, so
+the code at MediaPlayerPrivateGStreamer::handleMessage() can't detect EOS properly and signal
+it to the player and the HTMLMediaElement.
+
+* platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
+(WebCore::AudioSourceProviderGStreamer::handleNewDeinterleavePad): Listen to the EOS signal of each created appsink and forward it to the main pipeline bus as GST_MESSAGE_EOS.
+(WebCore::AudioSourceProviderGStreamer::handleRemovedDeinterleavePad): Remove the signal handler on pad destruction.
+
 2021-10-18  Kiet Ho  
 
 Implement parsing and animation support for offset-distance, offset-position, offset-anchor


Modified: trunk/Source/WebCore/platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp (284364 => 284365)

--- trunk/Source/WebCore/platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp	2021-10-18 10:47:58 UTC (rev 284364)
+++ trunk/Source/WebCore/platform/audio/gstreamer/Au

[webkit-changes] [284150] trunk

2021-10-14 Thread eocanha
Title: [284150] trunk








Revision 284150
Author eoca...@igalia.com
Date 2021-10-14 03:15:41 -0700 (Thu, 14 Oct 2021)


Log Message
[contributors.json] Add eocanha github account and canonicalize
https://bugs.webkit.org/show_bug.cgi?id=231729

Unreviewed.

Added eocanha github user to contributors.json and canonicalize the file to make the style checker happy.


* metadata/contributors.json:

Modified Paths

trunk/ChangeLog
trunk/metadata/contributors.json




Diff

Modified: trunk/ChangeLog (284149 => 284150)

--- trunk/ChangeLog	2021-10-14 07:04:05 UTC (rev 284149)
+++ trunk/ChangeLog	2021-10-14 10:15:41 UTC (rev 284150)
@@ -1,3 +1,14 @@
+2021-10-14  Enrique Ocaña González  
+
+[contributors.json] Add eocanha github account and canonicalize
+https://bugs.webkit.org/show_bug.cgi?id=231729
+
+Unreviewed.
+
+Added eocanha github user to contributors.json and canonicalize the file to make the style checker happy.
+
+* metadata/contributors.json:
+
 2021-10-13  Tim Horton  
 
 Add my GitHub username to contributors.json


Modified: trunk/metadata/contributors.json (284149 => 284150)

--- trunk/metadata/contributors.json	2021-10-14 07:04:05 UTC (rev 284149)
+++ trunk/metadata/contributors.json	2021-10-14 10:15:41 UTC (rev 284150)
@@ -2236,6 +2236,7 @@
  "eoca...@gmail.com"
   ],
   "expertise" : "GStreamer, Media Source Extensions",
+  "github" : "eocanha",
   "name" : "Enrique Oca\u00f1a Gonz\u00e1lez",
   "nicks" : [
  "eocanha"
@@ -5024,8 +5025,8 @@
  "n...@webkit.org",
  "noam.rosent...@nokia.com"
   ],
+  "expertise" : "TextureMapper, coordinated graphics, images, paint timing API",
   "github" : "noamr",
-  "expertise" : "TextureMapper, coordinated graphics, images, paint timing API",
   "name" : "Noam Rosenthal",
   "nicks" : [
  "noamr"
@@ -5291,8 +5292,8 @@
  "ph...@webkit.org",
  "ph...@igalia.com"
   ],
+  "expertise" : "WebKitGTK, WPE, Media support (focused on the GStreamer implementation)",
   "github" : "philn",
-  "expertise" : "WebKitGTK, WPE, Media support (focused on the GStreamer implementation)",
   "name" : "Philippe Normand",
   "nicks" : [
  "philn"
@@ -6960,4 +6961,4 @@
   ],
   "status" : "reviewer"
}
-]
+]
\ No newline at end of file






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [283309] trunk

2021-09-30 Thread eocanha
Title: [283309] trunk








Revision 283309
Author eoca...@igalia.com
Date 2021-09-30 05:47:30 -0700 (Thu, 30 Sep 2021)


Log Message
[MSE][GStreamer] Allow infinite duration on MSE
https://bugs.webkit.org/show_bug.cgi?id=231017

Reviewed by Alicia Boya Garcia.

Source/WebCore:

Positive infinite duration isn't properly working on MSE in the glib (GStreamer) ports. When
such a duration is set, nothing happens and the default zero duration remains. This can break
some live streams, because the wrong duration has influence in the real seek target time
used[1], so the seek may end up being done to the wrong time (before the buffered ranges in
my case) and the playback never starts.

[1] https://github.com/WebKit/WebKit/blob/a12c487/Source/WebCore/html/HTMLMediaElement.cpp#L3153

Covered by existing tests.

* platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.cpp:
(WebCore::MediaSourcePrivateGStreamer::durationChanged): Don't discard the change on infinite duration.

LayoutTests:

* platform/glib/TestExpectations: mediasource-seekable.html now passes.
* platform/glib/imported/w3c/web-platform-tests/media-source/mediasource-changetype-play-implicit-expected.txt: Changed expectations because this test now passes for audio/mpeg <-> audio/mpeg.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/platform/glib/TestExpectations
trunk/LayoutTests/platform/glib/imported/w3c/web-platform-tests/media-source/mediasource-changetype-play-implicit-expected.txt
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.cpp




Diff

Modified: trunk/LayoutTests/ChangeLog (283308 => 283309)

--- trunk/LayoutTests/ChangeLog	2021-09-30 12:47:13 UTC (rev 283308)
+++ trunk/LayoutTests/ChangeLog	2021-09-30 12:47:30 UTC (rev 283309)
@@ -1,3 +1,13 @@
+2021-09-30  Enrique Ocaña González  
+
+[MSE][GStreamer] Allow infinite duration on MSE
+https://bugs.webkit.org/show_bug.cgi?id=231017
+
+Reviewed by Alicia Boya Garcia.
+
+* platform/glib/TestExpectations: mediasource-seekable.html now passes.
+* platform/glib/imported/w3c/web-platform-tests/media-source/mediasource-changetype-play-implicit-expected.txt: Changed expectations because this test now passes for audio/mpeg <-> audio/mpeg.
+
 2021-09-30  Youenn Fablet  
 
 Layout Test imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-iceConnectionState.https.html is a flaky failure


Modified: trunk/LayoutTests/platform/glib/TestExpectations (283308 => 283309)

--- trunk/LayoutTests/platform/glib/TestExpectations	2021-09-30 12:47:13 UTC (rev 283308)
+++ trunk/LayoutTests/platform/glib/TestExpectations	2021-09-30 12:47:30 UTC (rev 283309)
@@ -2258,7 +2258,6 @@
 webkit.org/b/211940 fast/text/multiple-codeunit-vertical-upright.html [ ImageOnlyFailure ]
 
 webkit.org/b/167108 imported/w3c/web-platform-tests/media-source/mediasource-sequencemode-append-buffer.html [ Failure ]
-webkit.org/b/167108 imported/w3c/web-platform-tests/media-source/mediasource-seekable.html [ Failure ]
 webkit.org/b/197711 imported/w3c/web-platform-tests/media-source/mediasource-correct-frames.html [ Pass Timeout Failure ]
 webkit.org/b/214349 imported/w3c/web-platform-tests/media-source/mediasource-changetype-play-negative.html [ Crash Failure Pass ]
 webkit.org/b/203078 imported/w3c/web-platform-tests/media-source/mediasource-seek-beyond-duration.html [ Failure ]


Modified: trunk/LayoutTests/platform/glib/imported/w3c/web-platform-tests/media-source/mediasource-changetype-play-implicit-expected.txt (283308 => 283309)

--- trunk/LayoutTests/platform/glib/imported/w3c/web-platform-tests/media-source/mediasource-changetype-play-implicit-expected.txt	2021-09-30 12:47:13 UTC (rev 283308)
+++ trunk/LayoutTests/platform/glib/imported/w3c/web-platform-tests/media-source/mediasource-changetype-play-implicit-expected.txt	2021-09-30 12:47:30 UTC (rev 283309)
@@ -4,7 +4,7 @@
 PASS Test audio-only implicit changeType for audio/webm; codecs="vorbis" <-> audio/webm; codecs="vorbis" (using types without codecs parameters for addSourceBuffer)
 PASS Test audio-only implicit changeType for audio/mp4; codecs="mp4a.40.2" <-> audio/mp4; codecs="mp4a.40.2"
 PASS Test audio-only implicit changeType for audio/mp4; codecs="mp4a.40.2" <-> audio/mp4; codecs="mp4a.40.2" (using types without codecs parameters for addSourceBuffer)
-FAIL Test audio-only implicit changeType for audio/mpeg <-> audio/mpeg assert_less_than: expected a number less than 0 but got 2.1
+PASS Test audio-only implicit changeType for audio/mpeg <-> audio/mpeg
 PASS Test video-only implicit changeType for video/webm; codecs="vp8" <-> video/webm; codecs="vp8"
 PASS Test video-only implicit changeType for video/webm; codecs="vp8" <-> video/webm; codecs="vp8" (using types without codecs parameters for addSourceBuffer)
 FAIL Test video-only implicit changeType for video/webm; codecs="vp8" <-> video/webm; codecs="vp9" assert_unreached: Unexpected event '

[webkit-changes] [282205] trunk/LayoutTests

2021-09-09 Thread eocanha
Title: [282205] trunk/LayoutTests








Revision 282205
Author eoca...@igalia.com
Date 2021-09-09 03:02:34 -0700 (Thu, 09 Sep 2021)


Log Message
[Gstreamer] timeouts in media/media-source/media-source-has-audio-video.html and media/media-source/media-source-seek-unbuffered.html
https://bugs.webkit.org/show_bug.cgi?id=227258


Reviewed by Alicia Boya Garcia.

The media-source-seek-unbuffered.html test was feeding only one segment
(1 second) to the SourceBuffer, but the libav h264 decoder used by the
glib ports needs more data to start producing decoded output.
The test was modified to append two segments (2 seconds) instead and now
the test passes.

The concatArrayBuffers() function from the media-source-error-crash.html
test was refactored as MediaSourceLoader.concatenateMediaSegments() and
reused in media-source-seek-unbuffered.html.

* media/media-source/media-source-error-crash-expected.txt: Expect different concatenation _expression_.
* media/media-source/media-source-error-crash.html: Removed concatArrayBuffers() and use MediaSourceLoader.concatenateMediaSegments() instead.
* media/media-source/media-source-loader.js:
(MediaSourceLoader.prototype.concatenateMediaSegments): New method that concatenates two media segments (ArrayBuffers).
* media/media-source/media-source-seek-unbuffered-expected.txt: Modified expectations to expect a different removed range and a more legible currentTime check.
* media/media-source/media-source-seek-unbuffered.html: Append 2 segments, remove [0.5, 2] instead of [0.5, 1] and improve legibility of currentTime check.
* platform/glib/TestExpectations: Unskipped test.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/media/media-source/media-source-error-crash-expected.txt
trunk/LayoutTests/media/media-source/media-source-error-crash.html
trunk/LayoutTests/media/media-source/media-source-loader.js
trunk/LayoutTests/media/media-source/media-source-seek-unbuffered-expected.txt
trunk/LayoutTests/media/media-source/media-source-seek-unbuffered.html
trunk/LayoutTests/platform/glib/TestExpectations




Diff

Modified: trunk/LayoutTests/ChangeLog (282204 => 282205)

--- trunk/LayoutTests/ChangeLog	2021-09-09 09:38:41 UTC (rev 282204)
+++ trunk/LayoutTests/ChangeLog	2021-09-09 10:02:34 UTC (rev 282205)
@@ -1,3 +1,29 @@
+2021-09-09  Enrique Ocaña González  
+
+[Gstreamer] timeouts in media/media-source/media-source-has-audio-video.html and media/media-source/media-source-seek-unbuffered.html
+https://bugs.webkit.org/show_bug.cgi?id=227258
+
+
+Reviewed by Alicia Boya Garcia.
+
+The media-source-seek-unbuffered.html test was feeding only one segment
+(1 second) to the SourceBuffer, but the libav h264 decoder used by the
+glib ports needs more data to start producing decoded output.
+The test was modified to append two segments (2 seconds) instead and now
+the test passes.
+
+The concatArrayBuffers() function from the media-source-error-crash.html
+test was refactored as MediaSourceLoader.concatenateMediaSegments() and
+reused in media-source-seek-unbuffered.html.
+
+* media/media-source/media-source-error-crash-expected.txt: Expect different concatenation _expression_.
+* media/media-source/media-source-error-crash.html: Removed concatArrayBuffers() and use MediaSourceLoader.concatenateMediaSegments() instead.
+* media/media-source/media-source-loader.js:
+(MediaSourceLoader.prototype.concatenateMediaSegments): New method that concatenates two media segments (ArrayBuffers).
+* media/media-source/media-source-seek-unbuffered-expected.txt: Modified expectations to expect a different removed range and a more legible currentTime check.
+* media/media-source/media-source-seek-unbuffered.html: Append 2 segments, remove [0.5, 2] instead of [0.5, 1] and improve legibility of currentTime check.
+* platform/glib/TestExpectations: Unskipped test.
+
 2021-09-09  Cameron McCormack  
 
 Update WPT tests under /html/canvas/element


Modified: trunk/LayoutTests/media/media-source/media-source-error-crash-expected.txt (282204 => 282205)

--- trunk/LayoutTests/media/media-source/media-source-error-crash-expected.txt	2021-09-09 09:38:41 UTC (rev 282204)
+++ trunk/LayoutTests/media/media-source/media-source-error-crash-expected.txt	2021-09-09 10:02:34 UTC (rev 282205)
@@ -5,7 +5,7 @@
 RUN(sourceBuffer = source.addSourceBuffer(loader.type()))
 RUN(sourceBuffer2 = source.addSourceBuffer(loader.type()))
 Append an invalid media segment; should not crash.
-RUN(sourceBuffer.appendBuffer(concatArrayBuffers(loader.initSegment(), new ArrayBuffer(512
+RUN(sourceBuffer.appendBuffer(loader.concatenateMediaSegments([loader.initSegment(), new ArrayBuffer(512)])))
 EVENT(error)
 END OF TEST
 


Modified: trunk/LayoutTests/media/media-source/media-source-error-crash.html (282204 => 282205)

--- trunk/LayoutTests/media/media-source/media-sourc

[webkit-changes] [282059] trunk

2021-09-06 Thread eocanha
Title: [282059] trunk








Revision 282059
Author eoca...@igalia.com
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


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 .
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

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/platform/glib/imported/w3c/web-platform-tests/media-source/mediasource-append-buffer-expected.txt
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/html/HTMLMediaElement.cpp
trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp
trunk/Source/WebCore/platform/graphics/MediaPlayer.h
trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h
trunk/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h




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  
+
+[MSE] Prevent false-positive "stalled" event iff MSE used
+https://bugs.webkit.org/show_bug.cgi?id=226882
+
+
+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  
 
 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  
+
+[MSE] Prevent false-positive "stalled" event iff MSE used
+https://bugs.webkit.org/show_bug.cgi?id=226882
+
+
+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 .
+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

[webkit-changes] [282056] trunk/LayoutTests

2021-09-06 Thread eocanha
Title: [282056] trunk/LayoutTests








Revision 282056
Author eoca...@igalia.com
Date 2021-09-06 08:57:45 -0700 (Mon, 06 Sep 2021)


Log Message
[GTK] webaudio/silent-audio-interrupted-in-background.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=229964

Unreviewed test gardening.

Flagged flaky timeout for webaudio/silent-audio-interrupted-in-background.html.


* platform/gtk/TestExpectations:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/platform/gtk/TestExpectations




Diff

Modified: trunk/LayoutTests/ChangeLog (282055 => 282056)

--- trunk/LayoutTests/ChangeLog	2021-09-06 11:47:32 UTC (rev 282055)
+++ trunk/LayoutTests/ChangeLog	2021-09-06 15:57:45 UTC (rev 282056)
@@ -1,3 +1,14 @@
+2021-09-06  Enrique Ocaña González  
+
+[GTK] webaudio/silent-audio-interrupted-in-background.html is a flaky timeout
+https://bugs.webkit.org/show_bug.cgi?id=229964
+
+Unreviewed test gardening.
+
+Flagged flaky timeout for webaudio/silent-audio-interrupted-in-background.html.
+
+* platform/gtk/TestExpectations:
+
 2021-09-06  Youenn Fablet  
 
 Implement libwebrtc network manager GetMdnsResponder


Modified: trunk/LayoutTests/platform/gtk/TestExpectations (282055 => 282056)

--- trunk/LayoutTests/platform/gtk/TestExpectations	2021-09-06 11:47:32 UTC (rev 282055)
+++ trunk/LayoutTests/platform/gtk/TestExpectations	2021-09-06 15:57:45 UTC (rev 282056)
@@ -1229,6 +1229,8 @@
 webkit.org/b/229268 media/media-fragments/TC0009.html [ Failure Pass ]
 webkit.org/b/229268 media/media-fragments/TC0014.html [ Failure Pass ]
 
+webkit.org/b/229964 webaudio/silent-audio-interrupted-in-background.html [ Pass Timeout ]
+
 # Flaky on skip-failing-test bot (EWS)
 webkit.org/b/229270 fast/events/monotonic-event-time.html [ Failure Pass ]
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [282055] trunk/Source/WebCore

2021-09-06 Thread eocanha
Title: [282055] trunk/Source/WebCore








Revision 282055
Author eoca...@igalia.com
Date 2021-09-06 04:47:32 -0700 (Mon, 06 Sep 2021)


Log Message
[GStreamer][MSE] Check ContentType parameters when checking supported types
https://bugs.webkit.org/show_bug.cgi?id=229859

Reviewed by Xabier Rodriguez-Calvar.

Some services like YouTube TV or Apple TV use ContentType parameters (channels, features, width, height,
framerate) to check for extra features or device maximum capabilities and just don't work if they're not
honored.

This patch checks that those parameters don't go over reasonable limits and reject support for the type
if they do.

This patch is an adaptation of the following downstream patches:

- https://github.com/WebPlatformForEmbedded/WPEWebKit/commit/12c726290ac3395a0b7dd09861355e97be42e434 (authored by me)
- https://github.com/WebPlatformForEmbedded/WPEWebKit/commit/b33dfe9fea5f991cf98884ef3bb3e3d9c660bc6b (authored by Pawel Lampe)

* platform/graphics/gstreamer/GStreamerRegistryScanner.cpp:
(WebCore::GStreamerRegistryScanner::supportsFeatures const): Check the features parameter. Factored out as a method with the idea to add more checks it in the future.
(WebCore::GStreamerRegistryScanner::isContentTypeSupported const): Check the channels, features, width, height and framerate parameters against sane maximum values.
* platform/graphics/gstreamer/GStreamerRegistryScanner.h: Added supportsFeatures() method.

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp
trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (282054 => 282055)

--- trunk/Source/WebCore/ChangeLog	2021-09-06 08:49:02 UTC (rev 282054)
+++ trunk/Source/WebCore/ChangeLog	2021-09-06 11:47:32 UTC (rev 282055)
@@ -1,3 +1,27 @@
+2021-09-06  Enrique Ocaña González  
+
+[GStreamer][MSE] Check ContentType parameters when checking supported types
+https://bugs.webkit.org/show_bug.cgi?id=229859
+
+Reviewed by Xabier Rodriguez-Calvar.
+
+Some services like YouTube TV or Apple TV use ContentType parameters (channels, features, width, height,
+framerate) to check for extra features or device maximum capabilities and just don't work if they're not
+honored.
+
+This patch checks that those parameters don't go over reasonable limits and reject support for the type
+if they do.
+
+This patch is an adaptation of the following downstream patches:
+
+- https://github.com/WebPlatformForEmbedded/WPEWebKit/commit/12c726290ac3395a0b7dd09861355e97be42e434 (authored by me)
+- https://github.com/WebPlatformForEmbedded/WPEWebKit/commit/b33dfe9fea5f991cf98884ef3bb3e3d9c660bc6b (authored by Pawel Lampe)
+
+* platform/graphics/gstreamer/GStreamerRegistryScanner.cpp:
+(WebCore::GStreamerRegistryScanner::supportsFeatures const): Check the features parameter. Factored out as a method with the idea to add more checks it in the future.
+(WebCore::GStreamerRegistryScanner::isContentTypeSupported const): Check the channels, features, width, height and framerate parameters against sane maximum values.
+* platform/graphics/gstreamer/GStreamerRegistryScanner.h: Added supportsFeatures() method.
+
 2021-09-06  Youenn Fablet  
 
 Implement libwebrtc network manager GetMdnsResponder


Modified: trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp (282054 => 282055)

--- trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp	2021-09-06 08:49:02 UTC (rev 282054)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp	2021-09-06 11:47:32 UTC (rev 282055)
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace WebCore {
 
@@ -34,6 +35,15 @@
 GST_DEBUG_CATEGORY_STATIC(webkit_media_gst_registry_scanner_debug);
 #define GST_CAT_DEFAULT webkit_media_gst_registry_scanner_debug
 
+// We shouldn't accept media that the player can't actually play.
+// AAC supports up to 96 channels.
+#define MEDIA_MAX_AAC_CHANNELS 96
+
+// Assume hardware video decoding acceleration up to 8K@60fps for the generic case. Some embedded platforms might want to tune this.
+#define MEDIA_MAX_WIDTH 7680.0f
+#define MEDIA_MAX_HEIGHT 4320.0f
+#define MEDIA_MAX_FRAMERATE 60.0f
+
 GStreamerRegistryScanner& GStreamerRegistryScanner::singleton()
 {
 static NeverDestroyed sharedInstance;
@@ -501,6 +511,16 @@
 return supported;
 }
 
+bool GStreamerRegistryScanner::supportsFeatures(const String& features) const
+{
+// Apple TV requires this one for DD+.
+constexpr auto dolbyDigitalPlusJOC = "joc";
+if (features == dolbyDigitalPlusJOC)
+return true;
+
+return false;
+}
+
 MediaPlayerEnums::SupportsType GStreamerRegistryScanner::isContentTypeSupported(Configuration configuration, const ContentType& contentType, const Vecto

[webkit-changes] [281622] trunk/LayoutTests

2021-08-26 Thread eocanha
Title: [281622] trunk/LayoutTests








Revision 281622
Author eoca...@igalia.com
Date 2021-08-26 06:05:58 -0700 (Thu, 26 Aug 2021)


Log Message
[GLIB][Media] imported/w3c/web-platform-tests/media-source/mediasource-changetype-play-without-codecs-parameter.html fails after r281617
https://bugs.webkit.org/show_bug.cgi?id=229548

Unreviewed test gardening.

The patch from https://bugs.webkit.org/show_bug.cgi?id=210341 caused a regression in
mediasource-changetype-play-without-codecs-parameter.html. The test tries to change the
media type and codecs of a SourceBuffer on the fly. That operation is unsupported in glib
ports, so there is a custom expectation file that expects failures on the transitions
between supported types. Bug 210341 adds audio/mpeg (without container) as a new supported
format, so new "failures" appear in the test. This patch adds expectations for those new
failures.


* platform/glib/imported/w3c/web-platform-tests/media-source/mediasource-changetype-play-without-codecs-parameter-expected.txt:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/platform/glib/imported/w3c/web-platform-tests/media-source/mediasource-changetype-play-without-codecs-parameter-expected.txt




Diff

Modified: trunk/LayoutTests/ChangeLog (281621 => 281622)

--- trunk/LayoutTests/ChangeLog	2021-08-26 12:45:55 UTC (rev 281621)
+++ trunk/LayoutTests/ChangeLog	2021-08-26 13:05:58 UTC (rev 281622)
@@ -1,3 +1,20 @@
+2021-08-26  Enrique Ocaña González  
+
+[GLIB][Media] imported/w3c/web-platform-tests/media-source/mediasource-changetype-play-without-codecs-parameter.html fails after r281617
+https://bugs.webkit.org/show_bug.cgi?id=229548
+
+Unreviewed test gardening.
+
+The patch from https://bugs.webkit.org/show_bug.cgi?id=210341 caused a regression in
+mediasource-changetype-play-without-codecs-parameter.html. The test tries to change the
+media type and codecs of a SourceBuffer on the fly. That operation is unsupported in glib
+ports, so there is a custom expectation file that expects failures on the transitions
+between supported types. Bug 210341 adds audio/mpeg (without container) as a new supported
+format, so new "failures" appear in the test. This patch adds expectations for those new
+failures.
+
+* platform/glib/imported/w3c/web-platform-tests/media-source/mediasource-changetype-play-without-codecs-parameter-expected.txt:
+
 2021-08-26  Arcady Goldmints-Orlov  
 
 [GLIB] Update baselines after r281512


Modified: trunk/LayoutTests/platform/glib/imported/w3c/web-platform-tests/media-source/mediasource-changetype-play-without-codecs-parameter-expected.txt (281621 => 281622)

--- trunk/LayoutTests/platform/glib/imported/w3c/web-platform-tests/media-source/mediasource-changetype-play-without-codecs-parameter-expected.txt	2021-08-26 12:45:55 UTC (rev 281621)
+++ trunk/LayoutTests/platform/glib/imported/w3c/web-platform-tests/media-source/mediasource-changetype-play-without-codecs-parameter-expected.txt	2021-08-26 13:05:58 UTC (rev 281622)
@@ -2,8 +2,13 @@
 PASS Check if browser supports enough test media types
 FAIL Test audio-only changeType for audio/webm; codecs="vorbis" <-> audio/webm; codecs="vorbis" (using types without codecs parameters) The operation is not supported.
 FAIL Test audio-only changeType for audio/webm; codecs="vorbis" <-> audio/mp4; codecs="mp4a.40.2" (using types without codecs parameters) The operation is not supported.
+FAIL Test audio-only changeType for audio/webm; codecs="vorbis" <-> audio/mpeg (using types without codecs parameters) The operation is not supported.
 FAIL Test audio-only changeType for audio/mp4; codecs="mp4a.40.2" <-> audio/webm; codecs="vorbis" (using types without codecs parameters) The operation is not supported.
 FAIL Test audio-only changeType for audio/mp4; codecs="mp4a.40.2" <-> audio/mp4; codecs="mp4a.40.2" (using types without codecs parameters) The operation is not supported.
+FAIL Test audio-only changeType for audio/mp4; codecs="mp4a.40.2" <-> audio/mpeg (using types without codecs parameters) The operation is not supported.
+FAIL Test audio-only changeType for audio/mpeg <-> audio/webm; codecs="vorbis" (using types without codecs parameters) The operation is not supported.
+FAIL Test audio-only changeType for audio/mpeg <-> audio/mp4; codecs="mp4a.40.2" (using types without codecs parameters) The operation is not supported.
+FAIL Test audio-only changeType for audio/mpeg <-> audio/mpeg (using types without codecs parameters) The operation is not supported.
 FAIL Test video-only changeType for video/webm; codecs="vp8" <-> video/webm; codecs="vp8" (using types without codecs parameters) The operation is not supported.
 FAIL Test video-only changeType for video/webm; codecs="vp8" <-> video/webm; codecs="vp9" (using types without codecs parameters) The operation is not supported.
 FAIL Test video-only changeType for video/webm; codecs="vp8" <-> video/m

[webkit-changes] [281617] trunk

2021-08-26 Thread eocanha
Title: [281617] trunk








Revision 281617
Author eoca...@igalia.com
Date 2021-08-26 02:29:59 -0700 (Thu, 26 Aug 2021)


Log Message
[GStreamer][MSE] Implement the "sequence" mode in SourceBuffer for the GStreamer ports
https://bugs.webkit.org/show_bug.cgi?id=210341

Reviewed by Alicia Boya Garcia.

LayoutTests/imported/w3c:

* web-platform-tests/media-source/mediasource-sourcebuffer-mode-timestamps-expected.txt: Added extra blank line in expectations, like in many other expectations files.

Source/WebCore:

Declare audio/mpeg support and handle it properly in AppendPipeline. This media type
doesn't have any container format, so an identity element is used in place of the
demuxer (dummy demuxer). As this element isn't an actual demuxer, the standard
no-more-pads signal isn't present, so its behaviour is simulated when the first buffer
is emitted by the element (detected by a probe).

A parser element is needed to process the data (mpegaudioparse for mpeg audio v1,
aacparse for mpeg audio v2 & v4). The existing createOptionalParserForFormat()
infrastructure is used for that after analyzing the caps, and an identity element is
now also used instead in the cases when a parser isn't needed. This simplifies the code
that links the pipeline elements, as now there aren't any optional (non existing)
elements in place, just GstIdentity instances there.

Still, the selection of the proper mpeg/aac parser requires precise caps. A new typefind
element is now used after the appsrc (when needed, and another identity element when
not).

Return TypeError in SourceBuffer::setMode(), instead of InvalidAccessError. The MSE spec
changed this behaviour at some point before June 2016 and the WebKit code never reflected
the change, still returning the deprecated InvalidAccessError when generate timestamps
flag equals true and new mode equals "segments".

Finally, the MediaSample::setTimestamps() method has been implemented for the GStreamer
port. It had an empty implementation and no problem had been detected before because
the "sequence" SourceBuffer mode had never been used until now.

Covered by existing tests.

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::setMode): Return TypeError.
* platform/graphics/gstreamer/GStreamerRegistryScanner.cpp:
(WebCore::GStreamerRegistryScanner::initializeDecoders): Declare audio/mpeg support.
* platform/graphics/gstreamer/MediaSampleGStreamer.cpp:
(WebCore::MediaSampleGStreamer::setTimestamps): Implement method.
* platform/graphics/gstreamer/MediaSampleGStreamer.h: Removed setTimestamps() empty implementation.
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::AppendPipeline): Support audio/mpeg by instancing a typefind element when needed (or identity when not), using an identity element instead of a demuxer and simulating what would be done in the no-more-pads signal handlers, but using a probe to detect the first buffer traversing the parser.
(WebCore::createOptionalParserForFormat): Use the mpegversion caps field to instance the right kind of parser when detecting the audio/mpeg media type in the caps. An identity element is now returned in case no parser is needed.
(WebCore::AppendPipeline::Track::initializeElements): Simplify element linking now that the parser (or identity) is always guaranteed to exist.
(WebCore::AppendPipeline::streamTypeToString): Added default branch to switch to fix build warning.
* platform/graphics/gstreamer/mse/AppendPipeline.h: Added m_typefind. Reordered some attributes and added comments to improve readability.

LayoutTests:

* platform/glib/TestExpectations: Unskipped test

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/imported/w3c/ChangeLog
trunk/LayoutTests/imported/w3c/web-platform-tests/media-source/mediasource-sourcebuffer-mode-timestamps-expected.txt
trunk/LayoutTests/platform/glib/TestExpectations
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp
trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp
trunk/Source/WebCore/platform/graphics/gstreamer/MediaSampleGStreamer.cpp
trunk/Source/WebCore/platform/graphics/gstreamer/MediaSampleGStreamer.h
trunk/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp
trunk/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.h




Diff

Modified: trunk/LayoutTests/ChangeLog (281616 => 281617)

--- trunk/LayoutTests/ChangeLog	2021-08-26 07:57:35 UTC (rev 281616)
+++ trunk/LayoutTests/ChangeLog	2021-08-26 09:29:59 UTC (rev 281617)
@@ -1,3 +1,12 @@
+2021-08-26  Enrique Ocaña González  
+
+[GStreamer][MSE] Implement the "sequence" mode in SourceBuffer for the GStreamer ports
+https://bugs.webkit.org/show_bug.cgi?id=210341
+
+Reviewed by Alicia Boya Garcia.
+
+* platform/glib/TestExpectations: Unskipped test
+
 2021-08-26  Youenn Fablet  
 
 Signaling state check when applying a local or remote description is no longer aligned with t

[webkit-changes] [279217] trunk

2021-06-24 Thread eocanha
Title: [279217] trunk








Revision 279217
Author eoca...@igalia.com
Date 2021-06-24 02:31:16 -0700 (Thu, 24 Jun 2021)


Log Message
[GTK] media/muted-video-is-playing-audio.html is timing out
https://bugs.webkit.org/show_bug.cgi?id=208321

Reviewed by Xabier Rodriguez-Calvar.

Source/WebCore:

Added setPageMediaVolume() API to set the Page mediaVolume. This was 0
by default and a way to set it to a non-zero value was needed in order
to prevent a zero effectiveVolume in HTMLMediaElement.

* testing/Internals.cpp:
(WebCore::Internals::setPageMediaVolume): Set the Page mediaVolume.
* testing/Internals.h: Added setPageMediaVolume().
* testing/Internals.idl: Ditto.

Tools:

Set the WebKitTestRunnerWPE application name on user-agent to ease the
detection of the WPE port from the layout tests using the isWPE()
function in platform-helper.js.

* WebKitTestRunner/wpe/TestControllerWPE.cpp:
(WTR::TestController::platformConfigureViewForTest): Set WebKitTestRunnerWPE application name on user-agent.

LayoutTests:

Changed the test to set a non-zero mediaVolume, because a zero one
(default value set by TestController::resetStateToConsistentValues())
would multiply any other volume in HTMLMediaElement::effectiveVolume(),
cause a zero effectiveVolume (being considered in practice as "no audio" by
HTMLMediaElement::mediaState()) and prevent the IsPlayingAudio MediaState
being set.

Also, adapted the test to still expect IsPlayingAudio after mute on the
glib ports (GTK & WPE), since on those ports a muted video is expected to
report IsPlayingAudio, as per the HTMLMediaElement::mediaState() source
code comments.

* media/muted-video-is-playing-audio.html: Test changed as described above.
* platform/glib/media/muted-video-is-playing-audio-expected.txt: Added expectation for glib port.
* resources/platform-helper.js:
(isGtk): Clarified where the GTK user-agent string comes from.
(isWPE): New function to check if a WPE port is being used.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/media/muted-video-is-playing-audio.html
trunk/LayoutTests/resources/platform-helper.js
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/testing/Internals.cpp
trunk/Source/WebCore/testing/Internals.h
trunk/Source/WebCore/testing/Internals.idl
trunk/Tools/ChangeLog
trunk/Tools/WebKitTestRunner/wpe/TestControllerWPE.cpp


Added Paths

trunk/LayoutTests/platform/glib/media/muted-video-is-playing-audio-expected.txt




Diff

Modified: trunk/LayoutTests/ChangeLog (279216 => 279217)

--- trunk/LayoutTests/ChangeLog	2021-06-24 08:31:48 UTC (rev 279216)
+++ trunk/LayoutTests/ChangeLog	2021-06-24 09:31:16 UTC (rev 279217)
@@ -1,3 +1,28 @@
+2021-06-24  Enrique Ocaña González  
+
+[GTK] media/muted-video-is-playing-audio.html is timing out
+https://bugs.webkit.org/show_bug.cgi?id=208321
+
+Reviewed by Xabier Rodriguez-Calvar.
+
+Changed the test to set a non-zero mediaVolume, because a zero one
+(default value set by TestController::resetStateToConsistentValues())
+would multiply any other volume in HTMLMediaElement::effectiveVolume(),
+cause a zero effectiveVolume (being considered in practice as "no audio" by
+HTMLMediaElement::mediaState()) and prevent the IsPlayingAudio MediaState
+being set.
+
+Also, adapted the test to still expect IsPlayingAudio after mute on the
+glib ports (GTK & WPE), since on those ports a muted video is expected to
+report IsPlayingAudio, as per the HTMLMediaElement::mediaState() source
+code comments.
+
+* media/muted-video-is-playing-audio.html: Test changed as described above.
+* platform/glib/media/muted-video-is-playing-audio-expected.txt: Added expectation for glib port.
+* resources/platform-helper.js:
+(isGtk): Clarified where the GTK user-agent string comes from.
+(isWPE): New function to check if a WPE port is being used.
+
 2021-06-23  Chris Dumez  
 
 Unreviewed, mark imported/w3c/web-platform-tests/mediacapture-streams/MediaStreamTrack-MediaElement-disabled-audio-is-silence.https.html as flaky on iOS.


Modified: trunk/LayoutTests/media/muted-video-is-playing-audio.html (279216 => 279217)

--- trunk/LayoutTests/media/muted-video-is-playing-audio.html	2021-06-24 08:31:48 UTC (rev 279216)
+++ trunk/LayoutTests/media/muted-video-is-playing-audio.html	2021-06-24 09:31:16 UTC (rev 279217)
@@ -2,6 +2,7 @@
 
 
 +