Title: [137838] trunk/Source/WebCore
Revision
137838
Author
[email protected]
Date
2012-12-16 07:41:47 -0800 (Sun, 16 Dec 2012)

Log Message

[GStreamer] create playbin in ::load(), not in player constructor
https://bugs.webkit.org/show_bug.cgi?id=103898

Patch by Víctor Manuel Jáquez Leal <[email protected]> on 2012-12-16
Reviewed by Philippe Normand.

This patch moves the instantiation of the playbin pipeline into the
WebCore::MediaPlayerPrivateGStreamer::load() method, so the pipeline
layout can reflect other predefined settings such as audio pitch
preservation in variable playback rate scenarios

No new tests. Covered by existing tests.

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

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (137837 => 137838)


--- trunk/Source/WebCore/ChangeLog	2012-12-16 14:53:04 UTC (rev 137837)
+++ trunk/Source/WebCore/ChangeLog	2012-12-16 15:41:47 UTC (rev 137838)
@@ -1,3 +1,23 @@
+2012-12-16  Víctor Manuel Jáquez Leal  <[email protected]>
+
+        [GStreamer] create playbin in ::load(), not in player constructor
+        https://bugs.webkit.org/show_bug.cgi?id=103898
+
+        Reviewed by Philippe Normand.
+
+        This patch moves the instantiation of the playbin pipeline into the
+        WebCore::MediaPlayerPrivateGStreamer::load() method, so the pipeline
+        layout can reflect other predefined settings such as audio pitch
+        preservation in variable playback rate scenarios
+
+        No new tests. Covered by existing tests.
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
+        (WebCore::MediaPlayerPrivateGStreamer::load):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
+        (MediaPlayerPrivateGStreamer):
+
 2012-12-16  Mihnea Ovidenie  <[email protected]>
 
         [CSSRegions] Pseudo-elements should not be directly collected into a named flow

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


--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2012-12-16 14:53:04 UTC (rev 137837)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2012-12-16 15:41:47 UTC (rev 137838)
@@ -245,8 +245,6 @@
     , m_totalBytes(-1)
     , m_originalPreloadWasAutoAndWasOverridden(false)
 {
-    if (initializeGStreamerAndRegisterWebKitElements())
-        createGSTPlayBin();
 }
 
 MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer()
@@ -293,6 +291,8 @@
 
 void MediaPlayerPrivateGStreamer::load(const String& url)
 {
+    if (!initializeGStreamerAndRegisterWebKitElements())
+        return;
 
     KURL kurl(KURL(), url);
     String cleanUrl(url);
@@ -301,6 +301,13 @@
     if (kurl.isLocalFile())
         cleanUrl = cleanUrl.substring(0, kurl.pathEnd());
 
+    if (!m_playBin) {
+        createGSTPlayBin();
+        setDownloadBuffering();
+    }
+
+    ASSERT(m_playBin);
+
     m_url = KURL(KURL(), cleanUrl);
     g_object_set(m_playBin, "uri", cleanUrl.utf8().data(), NULL);
 
@@ -1744,14 +1751,11 @@
     return MediaPlayer::Download;
 }
 
-void MediaPlayerPrivateGStreamer::setPreload(MediaPlayer::Preload preload)
+void MediaPlayerPrivateGStreamer::setDownloadBuffering()
 {
-    m_originalPreloadWasAutoAndWasOverridden = m_preload != preload && m_preload == MediaPlayer::Auto;
+    if (!m_playBin)
+        return;
 
-    m_preload = preload;
-
-    ASSERT(m_playBin);
-
     GstPlayFlags flags;
     g_object_get(m_playBin, "flags", &flags, NULL);
     if (m_preload == MediaPlayer::Auto) {
@@ -1761,7 +1765,16 @@
         LOG_MEDIA_MESSAGE("Disabling on-disk buffering");
         g_object_set(m_playBin, "flags", flags & ~GST_PLAY_FLAG_DOWNLOAD, NULL);
     }
+}
 
+void MediaPlayerPrivateGStreamer::setPreload(MediaPlayer::Preload preload)
+{
+    m_originalPreloadWasAutoAndWasOverridden = m_preload != preload && m_preload == MediaPlayer::Auto;
+
+    m_preload = preload;
+
+    setDownloadBuffering();
+
     if (m_delayingLoad && m_preload != MediaPlayer::None) {
         m_delayingLoad = false;
         commitLoad();

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


--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h	2012-12-16 14:53:04 UTC (rev 137837)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h	2012-12-16 15:41:47 UTC (rev 137838)
@@ -150,6 +150,7 @@
             bool loadNextLocation();
             void mediaLocationChanged(GstMessage*);
 
+            void setDownloadBuffering();
             void processBufferingStats(GstMessage*);
 
             virtual String engineDescription() const { return "GStreamer"; }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to