Unreviewed, rolling out r141695 and r141697.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Feb 2013 11:15:27 +0000 (11:15 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Feb 2013 11:15:27 +0000 (11:15 +0000)
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 <webkit.review.bot@gmail.com> 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):

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

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp

index 98c7260..2e15e39 100644 (file)
@@ -1,3 +1,21 @@
+2013-02-08  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        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  <dcarney@google.com>
 
         [v8] isolate parameter added to all v8::peristent calls
index 241c32c..df14c32 100644 (file)
@@ -218,37 +218,18 @@ MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer()
         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,8 +237,10 @@ void MediaPlayerPrivateGStreamer::load(const String& url)
 
     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.");
@@ -1201,13 +1184,20 @@ bool MediaPlayerPrivateGStreamer::loadNextLocation()
         // 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 @@ bool MediaPlayerPrivateGStreamer::loadNextLocation()
             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;
             }
index 313e733..4c49afd 100644 (file)
@@ -89,8 +89,6 @@ class MediaPlayerPrivateGStreamer : public MediaPlayerPrivateGStreamerBase {
             void sourceChanged();
             GstElement* audioSink() const;
 
-            static KURL convertPlaybinURL(const gchar* uri);
-
         private:
             MediaPlayerPrivateGStreamer(MediaPlayer*);
 
@@ -99,8 +97,6 @@ class MediaPlayerPrivateGStreamer : public MediaPlayerPrivateGStreamerBase {
             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();
index beca38b..af9d6e2 100644 (file)
@@ -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 @@ static GstURIType webKitWebSrcUriGetType(GType)
 
 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 @@ static gboolean webKitWebSrcSetUri(GstURIHandler* handler, const gchar* uri, GEr
     if (!uri)
         return TRUE;
 
-    KURL url = WebCore::MediaPlayerPrivateGStreamer::convertPlaybinURL(uri);
+    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 GstURIType webKitWebSrcUriGetType(void)
 
 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 @@ static gboolean webKitWebSrcSetUri(GstURIHandler* handler, const gchar* uri)
     if (!uri)
         return TRUE;
 
-    KURL url = WebCore::MediaPlayerPrivateGStreamer::convertPlaybinURL(uri);
+    KURL url(KURL(), uri);
 
     if (!url.isValid() || !url.protocolIsInHTTPFamily()) {
         GST_ERROR_OBJECT(src, "Invalid URI '%s'", uri);