summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmytro Poplavskiy <dmytro.poplavskiy@nokia.com>2010-02-09 05:56:36 (GMT)
committerDmytro Poplavskiy <dmytro.poplavskiy@nokia.com>2010-02-09 05:56:36 (GMT)
commitbced83df38693948bb815cbfad1a8dc1a9c66baa (patch)
treecd4d09b972dcd78b047ffaa6f15cc9990fe0b01b
parent4603dc768d8c98770311a9136f956f3cefa90362 (diff)
downloadQt-bced83df38693948bb815cbfad1a8dc1a9c66baa.zip
Qt-bced83df38693948bb815cbfad1a8dc1a9c66baa.tar.gz
Qt-bced83df38693948bb815cbfad1a8dc1a9c66baa.tar.bz2
Added errors reporting to gst playback backend.
-rw-r--r--src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp2
-rw-r--r--src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.cpp13
-rw-r--r--src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.h1
3 files changed, 16 insertions, 0 deletions
diff --git a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp
index f008e81..d417266 100644
--- a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp
+++ b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp
@@ -86,6 +86,8 @@ QGstreamerPlayerControl::QGstreamerPlayerControl(QGstreamerPlayerSession *sessio
this, SIGNAL(videoAvailableChanged(bool)));
connect(m_session, SIGNAL(seekableChanged(bool)),
this, SIGNAL(seekableChanged(bool)));
+ connect(m_session, SIGNAL(error(int,QString)),
+ this, SIGNAL(error(int,QString)));
}
QGstreamerPlayerControl::~QGstreamerPlayerControl()
diff --git a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.cpp b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.cpp
index 016909a..355df2f 100644
--- a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.cpp
+++ b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.cpp
@@ -266,6 +266,8 @@ void QGstreamerPlayerSession::play()
emit stateChanged(m_state);
emit mediaStatusChanged(m_mediaStatus);
+
+ emit error(int(QMediaPlayer::ResourceError), tr("Unable to play %1").arg(m_url.path()));
}
}
}
@@ -525,7 +527,18 @@ void QGstreamerPlayerSession::busMessage(const QGstreamerMessage &message)
case GST_MESSAGE_TAG:
case GST_MESSAGE_STREAM_STATUS:
case GST_MESSAGE_UNKNOWN:
+ break;
case GST_MESSAGE_ERROR:
+ {
+ GError *err;
+ gchar *debug;
+ gst_message_parse_error (gm, &err, &debug);
+ emit error(int(QMediaPlayer::ResourceError), QString::fromUtf8(err->message));
+ qWarning() << "Error:" << QString::fromUtf8(err->message);
+ g_error_free (err);
+ g_free (debug);
+ }
+ break;
case GST_MESSAGE_WARNING:
case GST_MESSAGE_INFO:
break;
diff --git a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.h b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.h
index d33ffd2..e277ba9 100644
--- a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.h
+++ b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.h
@@ -129,6 +129,7 @@ signals:
void tagsChanged();
void streamsChanged();
void seekableChanged(bool);
+ void error(int error, const QString &errorString);
private slots:
void busMessage(const QGstreamerMessage &message);