Title: [148079] trunk
Revision
148079
Author
[email protected]
Date
2013-04-09 23:59:28 -0700 (Tue, 09 Apr 2013)

Log Message

[GStreamer] playbin uri getter is invalid
https://bugs.webkit.org/show_bug.cgi?id=113884

Reviewed by Martin Robinson.

Source/WebCore:

When loading a new media location use the url stored as a member
variable instead of the one stored as a playbin property. The uri
property semantic changed in playbin since 0.10.36+. One should
now use current-uri but to avoid ifdefs depending on GStreamer
version we simply use the url already known as member variable.

Test: http/tests/media/video-redirect.html

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:

LayoutTests:

New test for Quicktime reference movie redirect
support.

* http/tests/media/resources/redirect-to-counting-captioned.mov: Added.
* http/tests/media/video-redirect-expected.txt: Added.
* http/tests/media/video-redirect.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (148078 => 148079)


--- trunk/LayoutTests/ChangeLog	2013-04-10 06:45:02 UTC (rev 148078)
+++ trunk/LayoutTests/ChangeLog	2013-04-10 06:59:28 UTC (rev 148079)
@@ -1,3 +1,17 @@
+2013-04-09  Philippe Normand  <[email protected]>
+
+        [GStreamer] playbin uri getter is invalid
+        https://bugs.webkit.org/show_bug.cgi?id=113884
+
+        Reviewed by Martin Robinson.
+
+        New test for Quicktime reference movie redirect
+        support.
+
+        * http/tests/media/resources/redirect-to-counting-captioned.mov: Added.
+        * http/tests/media/video-redirect-expected.txt: Added.
+        * http/tests/media/video-redirect.html: Added.
+
 2013-04-09  Geoffrey Garen  <[email protected]>
 
         [JSC] Script run from an isolated world should bypass a page's CSP

Added: trunk/LayoutTests/http/tests/media/resources/redirect-to-counting-captioned.mov (0 => 148079)


--- trunk/LayoutTests/http/tests/media/resources/redirect-to-counting-captioned.mov	                        (rev 0)
+++ trunk/LayoutTests/http/tests/media/resources/redirect-to-counting-captioned.mov	2013-04-10 06:59:28 UTC (rev 148079)
@@ -0,0 +1,2 @@
+ymoovqrmrairmdaQrdrfurl =http://127.0.0.1:8000/media/resources/counting-captioned.movrmdr
+\xF0
\ No newline at end of file

Added: trunk/LayoutTests/http/tests/media/video-redirect-expected.txt (0 => 148079)


--- trunk/LayoutTests/http/tests/media/video-redirect-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/http/tests/media/video-redirect-expected.txt	2013-04-10 06:59:28 UTC (rev 148079)
@@ -0,0 +1,3 @@
+EVENT(canplay)
+END OF TEST
+

Added: trunk/LayoutTests/http/tests/media/video-redirect.html (0 => 148079)


--- trunk/LayoutTests/http/tests/media/video-redirect.html	                        (rev 0)
+++ trunk/LayoutTests/http/tests/media/video-redirect.html	2013-04-10 06:59:28 UTC (rev 148079)
@@ -0,0 +1,17 @@
+<html>
+<head>
+</head>
+<body _onload_="startTest()">
+<video id="video" src=""
+/>
+<script src=""
+<script>
+    function startTest() {
+        waitForEventAndFail('error');
+        waitForEventAndEnd('canplay');
+        video.load();
+    }
+</script>
+Tests that the media player will load the url redirected from reftest.mov.<br/>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (148078 => 148079)


--- trunk/Source/WebCore/ChangeLog	2013-04-10 06:45:02 UTC (rev 148078)
+++ trunk/Source/WebCore/ChangeLog	2013-04-10 06:59:28 UTC (rev 148079)
@@ -1,3 +1,20 @@
+2013-04-09  Philippe Normand  <[email protected]>
+
+        [GStreamer] playbin uri getter is invalid
+        https://bugs.webkit.org/show_bug.cgi?id=113884
+
+        Reviewed by Martin Robinson.
+
+        When loading a new media location use the url stored as a member
+        variable instead of the one stored as a playbin property. The uri
+        property semantic changed in playbin since 0.10.36+. One should
+        now use current-uri but to avoid ifdefs depending on GStreamer
+        version we simply use the url already known as member variable.
+
+        Test: http/tests/media/video-redirect.html
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+
 2013-04-09  Geoffrey Garen  <[email protected]>
 
         [JSC] Script run from an isolated world should bypass a page's CSP

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


--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2013-04-10 06:45:02 UTC (rev 148078)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2013-04-10 06:59:28 UTC (rev 148079)
@@ -1287,21 +1287,10 @@
         // Found a candidate. new-location is not always an absolute url
         // though. We need to take the base of the current url and
         // append the value of new-location to it.
+        KURL baseUrl = gst_uri_is_valid(newLocation) ? KURL() : m_url;
+        KURL newUrl = KURL(baseUrl, newLocation);
 
-        gchar* currentLocation = 0;
-        g_object_get(m_playBin.get(), "uri", &currentLocation, NULL);
-
-        KURL currentUrl(KURL(), currentLocation);
-        g_free(currentLocation);
-
-        KURL newUrl;
-
-        if (gst_uri_is_valid(newLocation))
-            newUrl = KURL(KURL(), newLocation);
-        else
-            newUrl = KURL(KURL(), currentUrl.baseAsString() + newLocation);
-
-        RefPtr<SecurityOrigin> securityOrigin = SecurityOrigin::create(currentUrl);
+        RefPtr<SecurityOrigin> securityOrigin = SecurityOrigin::create(m_url);
         if (securityOrigin->canRequest(newUrl)) {
             LOG_MEDIA_MESSAGE("New media url: %s", newUrl.string().utf8().data());
 
@@ -1320,10 +1309,12 @@
             if (state <= GST_STATE_READY) {
                 // Set the new uri and start playing.
                 g_object_set(m_playBin.get(), "uri", newUrl.string().utf8().data(), NULL);
+                m_url = newUrl;
                 gst_element_set_state(m_playBin.get(), GST_STATE_PLAYING);
                 return true;
             }
-        }
+        } else
+            LOG_MEDIA_MESSAGE("Not allowed to load new media location: %s", newUrl.string().utf8().data());
     }
     m_mediaLocationCurrentIndex--;
     return false;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to