WebKit Bugzilla
Attachment 369955 Details for
Bug 197834
: [MSE][GStreamer] update the readyState correctly in MediaPlayerPrivateGStreamerMSE
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-197834-20190515175039.patch (text/plain), 6.50 KB, created by
Yacine Bandou
on 2019-05-15 08:50:40 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Yacine Bandou
Created:
2019-05-15 08:50:40 PDT
Size:
6.50 KB
patch
obsolete
>Subversion Revision: 245126 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 31d3917a0b6ecff2955871d24d4162e119dbb344..cbe371f27b1153e4ca82cc633b7a743d6acd6606 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,19 @@ >+2019-05-15 Yacine Bandou <yacine.bandou@softathome.com> >+ >+ [MSE][GStreamer] update the readyState correctly in MediaPlayerPrivateGStreamerMSE >+ https://bugs.webkit.org/show_bug.cgi?id=197834 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ The buffering state and the m_downloadFinished boolean aren't supported in MSE case. >+ When the readyState is already "HaveEnoughData", we don't want to revert it to "HaveFutureData", >+ else the MediaPlayer would send a "canplay" event instead of "canplaythrough". >+ >+ Test: media/media-source/media-source-canplaythrough-event.html >+ >+ * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: >+ (WebCore::MediaPlayerPrivateGStreamerMSE::updateStates): >+ > 2019-05-09 Antti Koivisto <antti@apple.com> > > Elements with "display: inline-block" don't have a touch-action region >diff --git a/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp b/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp >index aac38c17b7464b128eba3cf85c323f1cb84b98cb..7181b382b72ac1f146c283a78244bf71cc8c2895 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp >@@ -520,24 +520,9 @@ void MediaPlayerPrivateGStreamerMSE::updateStates() > m_readyState = MediaPlayer::HaveMetadata; > // FIXME: Should we manage NetworkState too? > GST_DEBUG("m_readyState=%s", dumpReadyState(m_readyState)); >- } else if (m_buffering) { >- if (m_bufferingPercentage == 100) { >- GST_DEBUG("[Buffering] Complete."); >- m_buffering = false; >- m_readyState = MediaPlayer::HaveEnoughData; >- GST_DEBUG("m_readyState=%s", dumpReadyState(m_readyState)); >- m_networkState = m_downloadFinished ? MediaPlayer::Idle : MediaPlayer::Loading; >- } else { >- m_readyState = MediaPlayer::HaveCurrentData; >- GST_DEBUG("m_readyState=%s", dumpReadyState(m_readyState)); >- m_networkState = MediaPlayer::Loading; >- } >- } else if (m_downloadFinished) { >- m_readyState = MediaPlayer::HaveEnoughData; >- GST_DEBUG("m_readyState=%s", dumpReadyState(m_readyState)); >- m_networkState = MediaPlayer::Loaded; > } else { >- m_readyState = MediaPlayer::HaveFutureData; >+ if (m_readyState < MediaPlayer::HaveFutureData) >+ m_readyState = MediaPlayer::HaveFutureData; > GST_DEBUG("m_readyState=%s", dumpReadyState(m_readyState)); > m_networkState = MediaPlayer::Loading; > } >@@ -559,14 +544,14 @@ void MediaPlayerPrivateGStreamerMSE::updateStates() > m_volumeAndMuteInitialized = true; > } > >- if (!seeking() && !m_buffering && !m_paused && m_playbackRate) { >+ if (!seeking() && !m_paused && m_playbackRate) { > GST_DEBUG("[Buffering] Restarting playback."); > changePipelineState(GST_STATE_PLAYING); > } > } else if (state == GST_STATE_PLAYING) { > m_paused = false; > >- if ((m_buffering && !isLiveStream()) || !m_playbackRate) { >+ if (!m_playbackRate) { > GST_DEBUG("[Buffering] Pausing stream for buffering."); > changePipelineState(GST_STATE_PAUSED); > } >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index f6ed76be796e9022a101e7412947d2896e7b39d2..f8ddb3e7b267b9c6fd2251652aefbc3727c3b20b 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,16 @@ >+2019-05-15 Yacine Bandou <yacine.bandou@softathome.com> >+ >+ [MSE][GStreamer] update the readyState correctly in MediaPlayerPrivateGStreamerMSE >+ https://bugs.webkit.org/show_bug.cgi?id=197834 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add a new test that check if the MediaElement receive the "canplaythrough" >+ event when the media content is entirely injected to MSE sourceBuffer. >+ >+ * media/media-source/media-source-canplaythrough-event-expected.txt: Added. >+ * media/media-source/media-source-canplaythrough-event.html: Added. >+ > 2019-05-09 Antti Koivisto <antti@apple.com> > > Elements with "display: inline-block" don't have a touch-action region >diff --git a/LayoutTests/media/media-source/media-source-canplaythrough-event-expected.txt b/LayoutTests/media/media-source/media-source-canplaythrough-event-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..1a0cf162a3c6aa2d293f65fdd230d088a0dcd4d8 >--- /dev/null >+++ b/LayoutTests/media/media-source/media-source-canplaythrough-event-expected.txt >@@ -0,0 +1,6 @@ >+ >+EVENT(sourceopen) >+EVENT(canplaythrough) >+Receive canplaythrough event OK >+END OF TEST >+ >diff --git a/LayoutTests/media/media-source/media-source-canplaythrough-event.html b/LayoutTests/media/media-source/media-source-canplaythrough-event.html >new file mode 100644 >index 0000000000000000000000000000000000000000..eb204b8ebf615fc0f9a2eb4b5b449e4bda0919db >--- /dev/null >+++ b/LayoutTests/media/media-source/media-source-canplaythrough-event.html >@@ -0,0 +1,31 @@ >+<html> >+<head> >+ <title>media-source-wait-canplaythrough-event</title> >+ <script src="../video-test.js"></script> >+ <script> >+ var source; >+ var sourceBufferVideo; >+ >+ function runTest() { >+ findMediaElement(); >+ source = new MediaSource(); >+ waitForEvent('sourceopen', sourceOpen, false, false, source); >+ video.src = URL.createObjectURL(source); >+ } >+ >+ async function sourceOpen() { >+ sourceBufferVideo = source.addSourceBuffer('video/mp4; codecs="avc1.4d401f"'); >+ waitForEventOn(video, 'canplaythrough', oncanplaythrough, false, true); >+ sourceBufferVideo.appendBuffer(await (await fetch("content/test-red-3s-480x360.mp4")).arrayBuffer()); >+ failTestIn(2000); >+ } >+ >+ function oncanplaythrough() { >+ passTest("Receive canplaythrough event"); >+ } >+ </script> >+</head> >+<body onload="runTest()"> >+<video></video> >+</body> >+</html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 197834
:
369718
|
369955
|
370750