Remove nonfunctional mediaDownloadEnabled property
authorAndras Becsi <andras.becsi@digia.com>
Mon, 19 Nov 2012 15:21:50 +0000 (16:21 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Tue, 20 Nov 2012 15:26:21 +0000 (16:26 +0100)
I suppose this was introduced after an API freeze to try
to support on-disk buffering but since the code does not
set the GST_PLAY_FLAG_DOWNLOAD flag on the player element
the feature is not only undocumented but also nonfunctional.

If on-disk buffering is needed we should add proper
API to enable/disable it for all backends which might
be possible with Qt 5.1 the earliest.

Change-Id: I6b42a06166509db0023a3e0263ecc3a36f0d2bdb
Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
src/plugins/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp
src/plugins/gstreamer/mediaplayer/qgstreamerplayercontrol.h
src/plugins/gstreamer/mediaplayer/qgstreamerplayersession.cpp

index 399425a..4b73081 100644 (file)
@@ -614,16 +614,6 @@ void QGstreamerPlayerControl::handleResourcesDenied()
     popAndNotifyState();
 }
 
-bool QGstreamerPlayerControl::isMediaDownloadEnabled() const
-{
-    return m_session->property("mediaDownloadEnabled").toBool();
-}
-
-void QGstreamerPlayerControl::setMediaDownloadEnabled(bool enabled)
-{
-    m_session->setProperty("mediaDownloadEnabled", enabled);
-}
-
 void QGstreamerPlayerControl::pushState()
 {
     m_stateStack.push(m_currentState);
index 9fae769..095ea23 100644 (file)
@@ -64,7 +64,6 @@ class QGstreamerPlayerService;
 class QGstreamerPlayerControl : public QMediaPlayerControl
 {
     Q_OBJECT
-    Q_PROPERTY(bool mediaDownloadEnabled READ isMediaDownloadEnabled WRITE setMediaDownloadEnabled)
 
 public:
     QGstreamerPlayerControl(QGstreamerPlayerSession *session, QObject *parent = 0);
@@ -95,9 +94,6 @@ public:
     const QIODevice *mediaStream() const;
     void setMedia(const QMediaContent&, QIODevice *);
 
-    bool isMediaDownloadEnabled() const;
-    void setMediaDownloadEnabled(bool enabled);
-
     QMediaPlayerResourceSetInterface* resources() const;
 
 public Q_SLOTS:
index a45b2cd..e51531c 100644 (file)
@@ -1614,16 +1614,9 @@ void QGstreamerPlayerSession::handleElementAdded(GstBin *bin, GstElement *elemen
     if (g_str_has_prefix(elementName, "queue2")) {
         session->m_haveQueueElement = true;
 
-        if (session->property("mediaDownloadEnabled").toBool()) {
-            QDir cacheDir(QStandardPaths::writableLocation(QStandardPaths::CacheLocation));
-            QString cacheLocation = cacheDir.absoluteFilePath("gstmedia__XXXXXX");
-#ifdef DEBUG_PLAYBIN
-            qDebug() << "set queue2 temp-location" << cacheLocation;
-#endif
-            g_object_set(G_OBJECT(element), "temp-template", cacheLocation.toUtf8().constData(), NULL);
-        } else {
-            g_object_set(G_OBJECT(element), "temp-template", NULL, NULL);
-        }
+        // Disable on-disk buffering.
+        g_object_set(G_OBJECT(element), "temp-template", NULL, NULL);
+
     } else if (g_str_has_prefix(elementName, "uridecodebin") ||
                g_str_has_prefix(elementName, "decodebin2")) {