diff options
Diffstat (limited to 'src/multimedia')
-rw-r--r-- | src/multimedia/base/qgraphicsvideoitem.cpp | 5 | ||||
-rw-r--r-- | src/multimedia/base/qgraphicsvideoitem.h | 3 | ||||
-rw-r--r-- | src/multimedia/playback/qmediaplayer.cpp | 16 |
3 files changed, 23 insertions, 1 deletions
diff --git a/src/multimedia/base/qgraphicsvideoitem.cpp b/src/multimedia/base/qgraphicsvideoitem.cpp index f903eb7..c50d3ff 100644 --- a/src/multimedia/base/qgraphicsvideoitem.cpp +++ b/src/multimedia/base/qgraphicsvideoitem.cpp @@ -52,6 +52,8 @@ #include <QtOpenGL/qgl.h> #endif +#ifndef QT_NO_GRAPHICSVIEW + QT_BEGIN_NAMESPACE @@ -434,4 +436,7 @@ bool QGraphicsVideoItem::sceneEvent(QEvent *event) } QT_END_NAMESPACE + +#endif // QT_NO_GRAPHICSVIEW + #include "moc_qgraphicsvideoitem.cpp" diff --git a/src/multimedia/base/qgraphicsvideoitem.h b/src/multimedia/base/qgraphicsvideoitem.h index e6f0d81..a20caf3 100644 --- a/src/multimedia/base/qgraphicsvideoitem.h +++ b/src/multimedia/base/qgraphicsvideoitem.h @@ -46,6 +46,7 @@ #include <QtMultimedia/qvideowidget.h> +#if !defined(QT_NO_GRAPHICSVIEW) || (QT_EDITION & QT_MODULE_GRAPHICSVIEW) != QT_MODULE_GRAPHICSVIEW QT_BEGIN_HEADER @@ -109,4 +110,6 @@ QT_END_NAMESPACE QT_END_HEADER +#endif // QT_NO_GRAPHICSVIEW + #endif diff --git a/src/multimedia/playback/qmediaplayer.cpp b/src/multimedia/playback/qmediaplayer.cpp index 9466cad..6b2e0f9 100644 --- a/src/multimedia/playback/qmediaplayer.cpp +++ b/src/multimedia/playback/qmediaplayer.cpp @@ -145,7 +145,9 @@ public: QMediaPlaylist *playlist; QPointer<QVideoWidget> videoWidget; +#ifndef QT_NO_GRAPHICSVIEW QPointer<QGraphicsVideoItem> videoItem; +#endif void _q_stateChanged(QMediaPlayer::State state); void _q_mediaStatusChanged(QMediaPlayer::MediaStatus status); @@ -618,26 +620,36 @@ void QMediaPlayer::bind(QObject *obj) } QVideoWidget *videoWidget = qobject_cast<QVideoWidget*>(obj); +#ifndef QT_NO_GRAPHICSVIEW QGraphicsVideoItem *videoItem = qobject_cast<QGraphicsVideoItem*>(obj); +#endif - if (videoWidget || videoItem) { + if (videoWidget +#ifndef QT_NO_GRAPHICSVIEW + || videoItem +#endif + ) { //detach the current video output if (d->videoWidget) { d->videoWidget->setMediaObject(0); d->videoWidget = 0; } +#ifndef QT_NO_GRAPHICSVIEW if (d->videoItem) { d->videoItem->setMediaObject(0); d->videoItem = 0; } +#endif } if (videoWidget) d->videoWidget = videoWidget; +#ifndef QT_NO_GRAPHICSVIEW if (videoItem) d->videoItem = videoItem; +#endif } } @@ -651,8 +663,10 @@ void QMediaPlayer::unbind(QObject *obj) if (obj == d->videoWidget) { d->videoWidget = 0; +#ifndef QT_NO_GRAPHICSVIEW } else if (obj == d->videoItem) { d->videoItem = 0; +#endif } else if (obj == d->playlist) { disconnect(d->playlist, SIGNAL(currentMediaChanged(QMediaContent)), this, SLOT(_q_updateMedia(QMediaContent))); |