Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[GStreamer] vid.me videos do not play
https://bugs.webkit.org/show_bug.cgi?id=172240 Patch by Charlie Turner <cturner@igalia.com> on 2017-07-06 Reviewed by Xabier Rodriguez-Calvar. Source/WebCore: In r142251, code to hide the WK HTTP source elements from elsewhere in the pipeline was removed. This has the nasty side-effect of auto-plugging the WK HTTP source into things it really should not be used in, especially the adaptive streaming demuxers. The reasons this is bad are documented in several places on Bugzilla, see the parent bug report for more details. The high-level issue is that the WK HTTP source and its use of WebCore is not thread-safe. Although work has been recently done to improve this situation, it's still not perfect. Another issue is the interface hlsdemux expects its HTTP source to implement, specifically seeking in READY. This does rely on HTTP context sharing being available in GStreamer, upstream bug is here: https://bugzilla.gnome.org/show_bug.cgi?id=761099. The failing case can be demonstrated with https://github.com/thiagoss/adaptive-test-server but manual testing on popular video hosting sites, including vid.me, shows that this doesn't bite us at the moment, just something else to fix in the future. There are some QoS issues with the adaptive streaming code in GStreamer, but it seems much better to offer a below par QoS in lieu of crashing/livelocking when playing certain streams, and issues can be raised upstream when they arise. This patch does take us further away from the future goal of having all networking operations go through the network process, but in return it solves some nasty crashes and livelocks that have been irritating users for some time. With the pressure off on this issue, work can be planned to consider how to make the WK HTTP source a better citizen inside the GStreamer pipeline when we migrate the netcode to go through the network process. A new test is added to check that the single file HLS playlists (new in version 4) can be played, which was the primary cause of this bug report. Test: http/tests/media/hls/range-request.html * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL): Perform some trickery to make sure that we only ever fetch URLs handed to us by WebCore. Any further URLs discovered inside the pipeline will not get WKWS auto-plugged, since they'll be plain https? schemas. (WebCore::MediaPlayerPrivateGStreamer::load): Refactor to use the setPlaybinURL helper method. (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation): Ditto. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Add the setPlaybinURL helper method. * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (webKitWebSrcGetProtocols): Only advertise webkit+https?, this ensures we won't get auto-plugged by pipeline elements asking for an element to fetch https? resources (like adaptive demuxers). (convertPlaybinURI): Undo the trick when another element asks us for our URI. Tools: Build httpsoupsrc again for use in adaptive streaming pipelines, and have the existing libsoup build against GNOME to avoid header drift against GStreamer's linked Soup library. * gtk/jhbuild.modules: LayoutTests: Add a test for single output file HLS playlists that require HTTP range requests to playback. This failed using the WK http source for reasons documented in the linked bug. Generated with mp4hls --segment-duration 3 --output-single-file * Http/tests/media/hls/range-request-expected.txt: Added. * http/tests/media/hls/range-request.html: Added. * http/tests/media/resources/hls/range-request-playlist.m3u8: Added. * http/tests/media/resources/hls/range-request-playlists/iframes.m3u8: Added. * http/tests/media/resources/hls/range-request-playlists/media.ts: Added. * http/tests/media/resources/hls/range-request-playlists/stream.m3u8: Added. Canonical link: https://commits.webkit.org/191037@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219194 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
8074d40
commit 03b4596
Showing
13 changed files
with
227 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
EVENT(playing) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<script src=../../media-resources/video-test.js></script> | ||
<script src=../../media-resources/media-controls.js></script> | ||
<script> | ||
if (window.testRunner) { | ||
testRunner.dumpAsText(); | ||
testRunner.setAlwaysAcceptCookies(true); | ||
testRunner.waitUntilDone(); | ||
} | ||
|
||
function playing() { | ||
testRunner.notifyDone(); | ||
} | ||
|
||
function start() { | ||
video = document.getElementById('video'); | ||
video.autoplay = true | ||
waitForEvent("playing", playing); | ||
video.src = "../resources/hls/range-request-playlist.m3u8"; | ||
} | ||
</script> | ||
</head> | ||
<body onload="start()"> | ||
<video id="video"></video> | ||
</body> | ||
</html> |
11 changes: 11 additions & 0 deletions
11
LayoutTests/http/tests/media/resources/hls/range-request-playlist.m3u8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#EXTM3U | ||
# Created with Bento4 mp4-hls.py version 1.1.0r615 | ||
|
||
#EXT-X-VERSION:4 | ||
|
||
# Media Playlists | ||
#EXT-X-STREAM-INF:AVERAGE-BANDWIDTH=361262,BANDWIDTH=368806,CODECS="avc1.42C00D",RESOLUTION=640x480 | ||
range-request-playlists/stream.m3u8 | ||
|
||
# I-Frame Playlists | ||
#EXT-X-I-FRAME-STREAM-INF:AVERAGE-BANDWIDTH=179875,BANDWIDTH=195520,CODECS="avc1.42C00D",RESOLUTION=640x480,URI="range-request-playlists/iframes.m3u8" |
38 changes: 38 additions & 0 deletions
38
LayoutTests/http/tests/media/resources/hls/range-request-playlists/iframes.m3u8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#EXTM3U | ||
#EXT-X-VERSION:4 | ||
#EXT-X-PLAYLIST-TYPE:VOD | ||
#EXT-X-I-FRAMES-ONLY | ||
#EXT-X-INDEPENDENT-SEGMENTS | ||
#EXT-X-TARGETDURATION:1 | ||
#EXT-X-MEDIA-SEQUENCE:0 | ||
#EXTINF:1.000000, | ||
#EXT-X-BYTERANGE:21808@376 | ||
media.ts | ||
#EXTINF:1.000000, | ||
#EXT-X-BYTERANGE:20680@44180 | ||
media.ts | ||
#EXTINF:1.000000, | ||
#EXT-X-BYTERANGE:24440@87044 | ||
media.ts | ||
#EXTINF:1.000000, | ||
#EXT-X-BYTERANGE:21056@134044 | ||
media.ts | ||
#EXTINF:1.000000, | ||
#EXT-X-BYTERANGE:24252@177848 | ||
media.ts | ||
#EXTINF:1.000000, | ||
#EXT-X-BYTERANGE:21056@224284 | ||
media.ts | ||
#EXTINF:1.000000, | ||
#EXT-X-BYTERANGE:24252@268464 | ||
media.ts | ||
#EXTINF:1.000000, | ||
#EXT-X-BYTERANGE:21056@315088 | ||
media.ts | ||
#EXTINF:1.000000, | ||
#EXT-X-BYTERANGE:24252@358892 | ||
media.ts | ||
#EXTINF:0.958333, | ||
#EXT-X-BYTERANGE:21056@405892 | ||
media.ts | ||
#EXT-X-ENDLIST |
Binary file added
BIN
+439 KB
LayoutTests/http/tests/media/resources/hls/range-request-playlists/media.ts
Binary file not shown.
19 changes: 19 additions & 0 deletions
19
LayoutTests/http/tests/media/resources/hls/range-request-playlists/stream.m3u8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#EXTM3U | ||
#EXT-X-VERSION:4 | ||
#EXT-X-PLAYLIST-TYPE:VOD | ||
#EXT-X-INDEPENDENT-SEGMENTS | ||
#EXT-X-TARGETDURATION:3 | ||
#EXT-X-MEDIA-SEQUENCE:0 | ||
#EXTINF:3.000000, | ||
#EXT-X-BYTERANGE:133668@0 | ||
media.ts | ||
#EXTINF:3.000000, | ||
#EXT-X-BYTERANGE:134420@133668 | ||
media.ts | ||
#EXTINF:3.000000, | ||
#EXT-X-BYTERANGE:137428@268088 | ||
media.ts | ||
#EXTINF:0.958333, | ||
#EXT-X-BYTERANGE:44180@405516 | ||
media.ts | ||
#EXT-X-ENDLIST |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters