diff options
author | Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com> | 2010-03-04 07:23:22 (GMT) |
---|---|---|
committer | Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com> | 2010-03-04 07:23:22 (GMT) |
commit | 53af250a5366b4259bfb97a6b3c29c31e0aa10e0 (patch) | |
tree | 71977c8ca5f74614918a4c71d127bfe00cb2a5ec /src/multimedia/playback | |
parent | 787da2f188c34fd932662ee0229908bec8c4c91a (diff) | |
download | Qt-53af250a5366b4259bfb97a6b3c29c31e0aa10e0.zip Qt-53af250a5366b4259bfb97a6b3c29c31e0aa10e0.tar.gz Qt-53af250a5366b4259bfb97a6b3c29c31e0aa10e0.tar.bz2 |
Debug media player status and media state changes.
Disabled by default.
Reviewed-by: Justin McPherson
Diffstat (limited to 'src/multimedia/playback')
-rw-r--r-- | src/multimedia/playback/qmediaplayer.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/multimedia/playback/qmediaplayer.cpp b/src/multimedia/playback/qmediaplayer.cpp index 8056878..9466cad 100644 --- a/src/multimedia/playback/qmediaplayer.cpp +++ b/src/multimedia/playback/qmediaplayer.cpp @@ -43,6 +43,7 @@ #include <QtCore/qmetaobject.h> #include <QtCore/qtimer.h> #include <QtCore/qpointer.h> +#include <QtCore/qdebug.h> #include <QtMultimedia/qmediaplayer.h> @@ -55,6 +56,7 @@ #include <QtMultimedia/qvideowidget.h> #include <QtMultimedia/qgraphicsvideoitem.h> +//#define DEBUG_PLAYER_STATE QT_BEGIN_HEADER @@ -152,10 +154,16 @@ public: void _q_playlistDestroyed(); }; +#define ENUM_NAME(c,e,v) (c::staticMetaObject.enumerator(c::staticMetaObject.indexOfEnumerator(e)).valueToKey((v))) + void QMediaPlayerPrivate::_q_stateChanged(QMediaPlayer::State ps) { Q_Q(QMediaPlayer); +#ifdef DEBUG_PLAYER_STATE + qDebug() << "State changed:" << ENUM_NAME(QMediaPlayer, "State", ps) << (filterStates ? "(filtered)" : ""); +#endif + if (filterStates) return; @@ -183,6 +191,10 @@ void QMediaPlayerPrivate::_q_mediaStatusChanged(QMediaPlayer::MediaStatus status { Q_Q(QMediaPlayer); +#ifdef DEBUG_PLAYER_STATE + qDebug() << "MediaStatus changed:" << ENUM_NAME(QMediaPlayer, "MediaStatus", status); +#endif + switch (status) { case QMediaPlayer::StalledMedia: case QMediaPlayer::BufferingMedia: @@ -230,8 +242,12 @@ void QMediaPlayerPrivate::_q_updateMedia(const QMediaContent &media) state = control->state(); - if (state != currentState) + if (state != currentState) { +#ifdef DEBUG_PLAYER_STATE + qDebug() << "State changed:" << ENUM_NAME(QMediaPlayer, "State", state); +#endif emit q_func()->stateChanged(state); + } } void QMediaPlayerPrivate::_q_playlistDestroyed() |