[GStreamer] cannot play live streams
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Sep 2013 08:21:17 +0000 (08:21 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Sep 2013 08:21:17 +0000 (08:21 +0000)
https://bugs.webkit.org/show_bug.cgi?id=116831

Patch by Andre Moreira Magalhaes <andre.magalhaes@collabora.co.uk> on 2013-09-04
Reviewed by Philippe Normand.

Source/WebCore:

Fix issues with rtsp streams embedded on <video> not loading.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
Do not reset pipeline to READY state on STATE_CHANGE_ASYNC when entering PAUSED state for
live streams, otherwise we enter an endless loop of READY->PAUSED->READY->PAUSED when
starting playback.

Tools:

Fix timeout issues with rtspsrc/udpsrc gstreamer elements.

* gtk/jhbuild.modules:
* gtk/patches/rtspsrc-timeout-on-udpsrc-is-in-nanoseconds.patch: Added.
* gtk/patches/udpsrc-improve-timeouts.patch: Added.
Changed gstreamer jhbuild modules to use tarball repos (required to add patches)
and added 2 patches to gst-plugins-good to fix timeout issues with rtsp streams.
Both patches are applied upstream and can be removed once a new gstreamer release
is out (up to 1.0.10 the patches are not included) and we bump the requirements.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@155024 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
Tools/ChangeLog
Tools/gtk/jhbuild.modules
Tools/gtk/patches/rtspsrc-timeout-on-udpsrc-is-in-nanoseconds.patch [new file with mode: 0644]
Tools/gtk/patches/udpsrc-improve-timeouts.patch [new file with mode: 0644]

index c672eec..7a72d39 100644 (file)
@@ -1,3 +1,17 @@
+2013-09-04  Andre Moreira Magalhaes   <andre.magalhaes@collabora.co.uk>
+
+        [GStreamer] cannot play live streams
+        https://bugs.webkit.org/show_bug.cgi?id=116831
+
+        Reviewed by Philippe Normand.
+
+        Fix issues with rtsp streams embedded on <video> not loading.
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        Do not reset pipeline to READY state on STATE_CHANGE_ASYNC when entering PAUSED state for
+        live streams, otherwise we enter an endless loop of READY->PAUSED->READY->PAUSED when
+        starting playback.
+
 2013-09-03  Chris Fleizach  <cfleizach@apple.com>
 
         AX: REGRESSION: @title is exposed as AXDescription when label label from contents already exists.
index 42b1c6a..5d94f69 100644 (file)
@@ -1311,13 +1311,6 @@ void MediaPlayerPrivateGStreamer::updateStates()
     case GST_STATE_CHANGE_ASYNC:
         LOG_MEDIA_MESSAGE("Async: State: %s, pending: %s", gst_element_state_get_name(state), gst_element_state_get_name(pending));
         // Change in progress.
-
-        // A live stream was paused, reset the pipeline.
-        if (state == GST_STATE_PAUSED && pending == GST_STATE_PLAYING && isLiveStream()) {
-            changePipelineState(GST_STATE_READY);
-            changePipelineState(GST_STATE_PLAYING);
-        }
-
         break;
     case GST_STATE_CHANGE_FAILURE:
         LOG_MEDIA_MESSAGE("Failure: State: %s, pending: %s", gst_element_state_get_name(state), gst_element_state_get_name(pending));
index 8de3f63..612b97b 100644 (file)
@@ -1,3 +1,20 @@
+2013-09-04  Andre Moreira Magalhaes   <andre.magalhaes@collabora.co.uk>
+
+        [GStreamer] cannot play live streams
+        https://bugs.webkit.org/show_bug.cgi?id=116831
+
+        Reviewed by Philippe Normand.
+
+        Fix timeout issues with rtspsrc/udpsrc gstreamer elements.
+
+        * gtk/jhbuild.modules:
+        * gtk/patches/rtspsrc-timeout-on-udpsrc-is-in-nanoseconds.patch: Added.
+        * gtk/patches/udpsrc-improve-timeouts.patch: Added.
+        Changed gstreamer jhbuild modules to use tarball repos (required to add patches)
+        and added 2 patches to gst-plugins-good to fix timeout issues with rtsp streams.
+        Both patches are applied upstream and can be removed once a new gstreamer release
+        is out (up to 1.0.10 the patches are not included) and we bump the requirements.
+
 2013-09-03  Alexey Proskuryakov  <ap@apple.com>
 
         [Mac] WebKitTestRunner still beeps sometimes
index 0f12681..88d0146 100644 (file)
@@ -52,8 +52,8 @@
       href="http://xorg.freedesktop.org"/>
   <repository type="tarball" name="xmlsoft.org"
       href="ftp://xmlsoft.org"/>
-  <repository type="git" name="gstreamer"
-      href="git://anongit.freedesktop.org/git/gstreamer/"/>
+  <repository type="tarball" name="gstreamer"
+      href="http://gstreamer.freedesktop.org/src/"/>
   <repository type="tarball" name="savannah.gnu.org"
       href="http://download.savannah.gnu.org/releases/"/>
 
   </autotools>
 
   <autotools id="gstreamer">
-    <branch repo="gstreamer" module="gstreamer" checkoutdir="gstreamer" tag="1.0.8"/>
+    <branch module="gstreamer/gstreamer-1.0.8.tar.xz" version="1.0.8"
+            repo="gstreamer"
+            hash="sha256:ff70f45509566b88e35986971ace5e89cb6cb232e9ca249f84502abceef1762d"
+            md5sum="fb0c73470e8dd5dab01e5e9e62db9db9"/>
   </autotools>
 
   <autotools id="gst-plugins-base" autogenargs="--disable-examples">
     <dependencies>
       <dep package="gstreamer"/>
     </dependencies>
-    <branch repo="gstreamer" module="gst-plugins-base" checkoutdir="gst-plugins-base" tag="1.0.8"/>
+    <branch module="gst-plugins-base/gst-plugins-base-1.0.8.tar.xz" version="1.0.8"
+            repo="gstreamer"
+            hash="sha256:b55c9deea00acf789f82845c088b7c7c17b3ecef24a94831a819071b3dd8ef0d"
+            md5sum="c8b36678186e7d4fb1e6395ffcd1abb1"/>
   </autotools>
 
   <autotools id="gst-plugins-good" autogenargs="--disable-examples --disable-soup --disable-gst_v4l2 --without-libv4l2">
     <dependencies>
       <dep package="gst-plugins-base"/>
     </dependencies>
-    <branch repo="gstreamer" module="gst-plugins-good" checkoutdir="gst-plugins-good" tag="1.0.8"/>
+
+    <branch module="gst-plugins-good/gst-plugins-good-1.0.8.tar.xz" version="1.0.8"
+            repo="gstreamer"
+            hash="sha256:97831570ccdd8e15557f18858b965e54433d572d27fdabebb8b710cee276cfad"
+            md5sum="4969826043bbd3f76e4a0d49ea475736">
+      <patch file="udpsrc-improve-timeouts.patch" strip="1"/>
+      <patch file="rtspsrc-timeout-on-udpsrc-is-in-nanoseconds.patch" strip="1"/>
+    </branch>
   </autotools>
 
   <autotools id="gst-plugins-bad" autogenargs="--disable-examples">
     <dependencies>
       <dep package="gst-plugins-base"/>
     </dependencies>
-    <branch repo="gstreamer" module="gst-plugins-bad" checkoutdir="gst-plugins-bad" tag="1.0.8"/>
+    <branch module="gst-plugins-bad/gst-plugins-bad-1.0.8.tar.xz" version="1.0.8"
+            repo="gstreamer"
+            hash="sha256:6949b5532034fc37d5a874e4e3330107767238bc4def9f769b8193124e2420cc"
+            md5sum="a2fdf125ee2ae46047dcbcfc305949ee"/>
   </autotools>
 
   <autotools id="gst-libav" autogenargs="--with-libav-extra-configure='--disable-yasm'">
     <dependencies>
       <dep package="gst-plugins-base"/>
     </dependencies>
-    <branch repo="gstreamer" module="gst-libav" checkoutdir="gst-libav" tag="1.0.8"/>
+    <branch module="gst-libav/gst-libav-1.0.8.tar.xz" version="1.0.8"
+            repo="gstreamer"
+            hash="sha256:e6e538290e585c993609337761d894dd1b6b53ef625798b2a511d5314579995f"
+            md5sum="7c2e8db039efa1880a61a6982a6909d7"/>
   </autotools>
 
   <autotools id="xserver" autogenargs="--disable-xinerama --enable-glx --enable-composite --disable-xorg --disable-dmx --disable-xnest --disable-xquartz --disable-xwin --disable-xephyr --disable-xfake --disable-xfbdev --disable-install-setuid --disable-unit-tests --enable-unix-transport --enable-tcp-transport --enable-local-transport --with-xkb-path=/usr/share/X11/xkb --with-xkb-output=/var/lib/xkb --with-xkb-bin-directory=/usr/bin">
diff --git a/Tools/gtk/patches/rtspsrc-timeout-on-udpsrc-is-in-nanoseconds.patch b/Tools/gtk/patches/rtspsrc-timeout-on-udpsrc-is-in-nanoseconds.patch
new file mode 100644 (file)
index 0000000..87ed490
--- /dev/null
@@ -0,0 +1,27 @@
+From e0bb1fe30985aa0784825388500cc4fa92c1ff9c Mon Sep 17 00:00:00 2001
+From: Wim Taymans <wim.taymans@collabora.co.uk>
+Date: Wed, 12 Dec 2012 11:09:42 +0100
+Subject: [PATCH 2/2] rtspsrc: timeout on udpsrc is in nanoseconds
+
+---
+ gst/rtsp/gstrtspsrc.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c
+index 98577b8..902d8ff 100644
+--- a/gst/rtsp/gstrtspsrc.c
++++ b/gst/rtsp/gstrtspsrc.c
+@@ -2812,8 +2812,8 @@ gst_rtspsrc_stream_configure_udp (GstRTSPSrc * src, GstRTSPStream * stream,
+     /* configure a timeout on the UDP port. When the timeout message is
+      * posted, we assume UDP transport is not possible. We reconnect using TCP
+      * if we can. */
+-    g_object_set (G_OBJECT (stream->udpsrc[0]), "timeout", src->udp_timeout,
+-        NULL);
++    g_object_set (G_OBJECT (stream->udpsrc[0]), "timeout",
++        src->udp_timeout * 1000, NULL);
+     /* get output pad of the UDP source. */
+     *outpad = gst_element_get_static_pad (stream->udpsrc[0], "src");
+-- 
+1.8.1.2
+
diff --git a/Tools/gtk/patches/udpsrc-improve-timeouts.patch b/Tools/gtk/patches/udpsrc-improve-timeouts.patch
new file mode 100644 (file)
index 0000000..d26e346
--- /dev/null
@@ -0,0 +1,53 @@
+From dbbdf54778771535dfea5ddbdeeaba89d9bc7be6 Mon Sep 17 00:00:00 2001
+From: Wim Taymans <wim.taymans@collabora.co.uk>
+Date: Wed, 12 Dec 2012 11:08:13 +0100
+Subject: [PATCH 1/2] udpsrc: improve timeouts
+
+Make it possible to set the timeout after we went to the READY state by using
+the timeout when checking the condition. This also makes it possible to set the
+timeout with a higher granularity than seconds.
+---
+ gst/udp/gstudpsrc.c | 16 ++++++++++------
+ 1 file changed, 10 insertions(+), 6 deletions(-)
+
+diff --git a/gst/udp/gstudpsrc.c b/gst/udp/gstudpsrc.c
+index bdad5b3..5b54021 100644
+--- a/gst/udp/gstudpsrc.c
++++ b/gst/udp/gstudpsrc.c
+@@ -397,13 +397,20 @@ retry:
+     goto no_select;
+   do {
++    gint64 timeout;
++
+     try_again = FALSE;
++    if (udpsrc->timeout)
++      timeout = udpsrc->timeout / 1000;
++    else
++      timeout = -1;
++
+     GST_LOG_OBJECT (udpsrc, "doing select, timeout %" G_GUINT64_FORMAT,
+-        udpsrc->timeout);
++        timeout);
+-    if (!g_socket_condition_wait (udpsrc->used_socket, G_IO_IN | G_IO_PRI,
+-            udpsrc->cancellable, &err)) {
++    if (!g_socket_condition_timed_wait (udpsrc->used_socket, G_IO_IN | G_IO_PRI,
++            timeout, udpsrc->cancellable, &err)) {
+       if (g_error_matches (err, G_IO_ERROR, G_IO_ERROR_BUSY)
+           || g_error_matches (err, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
+         goto stopped;
+@@ -823,9 +830,6 @@ gst_udpsrc_start (GstBaseSrc * bsrc)
+       goto getsockname_error;
+   }
+-  if (src->timeout)
+-    g_socket_set_timeout (src->used_socket, src->timeout / GST_SECOND);
+-
+ #if GLIB_CHECK_VERSION (2, 35, 7)
+   {
+     gint val = 0;
+-- 
+1.8.1.2
+