Title: [142251] trunk/Source/WebCore
Revision
142251
Author
[email protected]
Date
2013-02-08 03:15:27 -0800 (Fri, 08 Feb 2013)

Log Message

Unreviewed, rolling out r141695 and r141697.
http://trac.webkit.org/changeset/141695
http://trac.webkit.org/changeset/141697
https://bugs.webkit.org/show_bug.cgi?id=109279

broke on-disk buffering for http(s) media (Requested by philn
on #webkit).

Patch by Sheriff Bot <[email protected]> on 2013-02-08

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::load):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
(MediaPlayerPrivateGStreamer):
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webKitWebSrcGetProtocols):
(webKitWebSrcSetUri):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (142250 => 142251)


--- trunk/Source/WebCore/ChangeLog	2013-02-08 10:17:15 UTC (rev 142250)
+++ trunk/Source/WebCore/ChangeLog	2013-02-08 11:15:27 UTC (rev 142251)
@@ -1,3 +1,21 @@
+2013-02-08  Sheriff Bot  <[email protected]>
+
+        Unreviewed, rolling out r141695 and r141697.
+        http://trac.webkit.org/changeset/141695
+        http://trac.webkit.org/changeset/141697
+        https://bugs.webkit.org/show_bug.cgi?id=109279
+
+        broke on-disk buffering for http(s) media (Requested by philn
+        on #webkit).
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivateGStreamer::load):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
+        (MediaPlayerPrivateGStreamer):
+        * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
+        (webKitWebSrcGetProtocols):
+        (webKitWebSrcSetUri):
+
 2013-02-08  Dan Carney  <[email protected]>
 
         [v8] isolate parameter added to all v8::peristent calls

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


--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2013-02-08 10:17:15 UTC (rev 142250)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2013-02-08 11:15:27 UTC (rev 142251)
@@ -218,37 +218,18 @@
         g_source_remove(m_audioTimerHandler);
 }
 
-KURL MediaPlayerPrivateGStreamer::convertPlaybinURL(const gchar* uri)
-{
-    KURL url(KURL(), uri);
-
-    ASSERT(url.protocol().substring(0, 7) == "webkit+");
-    url.setProtocol(url.protocol().substring(7));
-    return url;
-}
-
-void MediaPlayerPrivateGStreamer::setPlaybinURL(KURL& url)
-{
-    // Clean out everything after file:// url path.
-    if (url.isLocalFile()) {
-        url.setQuery(String());
-        url.removeFragmentIdentifier();
-    }
-
-    m_url = url;
-
-    if (url.protocolIsInHTTPFamily())
-        url.setProtocol("webkit+" + url.protocol());
-
-    LOG_MEDIA_MESSAGE("Load %s", url.string().utf8().data());
-    g_object_set(m_playBin.get(), "uri", url.string().utf8().data(), NULL);
-}
-
 void MediaPlayerPrivateGStreamer::load(const String& url)
 {
     if (!initializeGStreamerAndRegisterWebKitElements())
         return;
 
+    KURL kurl(KURL(), url);
+    String cleanUrl(url);
+
+    // Clean out everything after file:// url path.
+    if (kurl.isLocalFile())
+        cleanUrl = cleanUrl.substring(0, kurl.pathEnd());
+
     if (!m_playBin) {
         createGSTPlayBin();
         setDownloadBuffering();
@@ -256,9 +237,11 @@
 
     ASSERT(m_playBin);
 
-    KURL kurl(KURL(), url);
-    setPlaybinURL(kurl);
+    m_url = KURL(KURL(), cleanUrl);
+    g_object_set(m_playBin.get(), "uri", cleanUrl.utf8().data(), NULL);
 
+    LOG_MEDIA_MESSAGE("Load %s", cleanUrl.utf8().data());
+
     if (m_preload == MediaPlayer::None) {
         LOG_MEDIA_MESSAGE("Delaying load.");
         m_delayingLoad = true;
@@ -1201,13 +1184,20 @@
         // though. We need to take the base of the current url and
         // append the value of new-location to it.
 
+        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(), m_url.baseAsString() + newLocation);
+            newUrl = KURL(KURL(), currentUrl.baseAsString() + newLocation);
 
-        RefPtr<SecurityOrigin> securityOrigin = SecurityOrigin::create(m_url);
+        RefPtr<SecurityOrigin> securityOrigin = SecurityOrigin::create(currentUrl);
         if (securityOrigin->canRequest(newUrl)) {
             LOG_MEDIA_MESSAGE("New media url: %s", newUrl.string().utf8().data());
 
@@ -1225,7 +1215,7 @@
             gst_element_get_state(m_playBin.get(), &state, 0, 0);
             if (state <= GST_STATE_READY) {
                 // Set the new uri and start playing.
-                setPlaybinURL(newUrl);
+                g_object_set(m_playBin.get(), "uri", newUrl.string().utf8().data(), NULL);
                 gst_element_set_state(m_playBin.get(), GST_STATE_PLAYING);
                 return true;
             }

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h (142250 => 142251)


--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h	2013-02-08 10:17:15 UTC (rev 142250)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h	2013-02-08 11:15:27 UTC (rev 142251)
@@ -89,8 +89,6 @@
             void sourceChanged();
             GstElement* audioSink() const;
 
-            static KURL convertPlaybinURL(const gchar* uri);
-
         private:
             MediaPlayerPrivateGStreamer(MediaPlayer*);
 
@@ -99,8 +97,6 @@
             static void getSupportedTypes(HashSet<String>&);
             static MediaPlayer::SupportsType supportsType(const String& type, const String& codecs, const KURL&);
 
-            void setPlaybinURL(KURL&);
-
             static bool isAvailable();
 
             void updateAudioSink();

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


--- trunk/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp	2013-02-08 10:17:15 UTC (rev 142250)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp	2013-02-08 11:15:27 UTC (rev 142251)
@@ -27,7 +27,6 @@
 #include "GRefPtrGStreamer.h"
 #include "GStreamerVersioning.h"
 #include "MediaPlayer.h"
-#include "MediaPlayerPrivateGStreamer.h"
 #include "NetworkingContext.h"
 #include "NotImplemented.h"
 #include "ResourceHandleClient.h"
@@ -578,7 +577,7 @@
 
 const gchar* const* webKitWebSrcGetProtocols(GType)
 {
-    static const char* const protocols[] = {"webkit+http", "webkit+https", 0 };
+    static const char* protocols[] = {"http", "https", 0 };
     return protocols;
 }
 
@@ -603,7 +602,7 @@
     if (!uri)
         return TRUE;
 
-    KURL url = ""
+    KURL url(KURL(), uri);
 
     if (!url.isValid() || !url.protocolIsInHTTPFamily()) {
         g_set_error(error, GST_URI_ERROR, GST_URI_ERROR_BAD_URI, "Invalid URI '%s'", uri);
@@ -622,7 +621,7 @@
 
 static gchar** webKitWebSrcGetProtocols(void)
 {
-    static gchar* protocols[] = {(gchar*) "webkit+http", (gchar*) "webkit+https", 0 };
+    static gchar* protocols[] = {(gchar*) "http", (gchar*) "https", 0 };
     return protocols;
 }
 
@@ -647,7 +646,7 @@
     if (!uri)
         return TRUE;
 
-    KURL url = ""
+    KURL url(KURL(), uri);
 
     if (!url.isValid() || !url.protocolIsInHTTPFamily()) {
         GST_ERROR_OBJECT(src, "Invalid URI '%s'", uri);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to