summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorThomas McGuire <thomas.mcguire@kdab.com>2012-04-12 11:14:04 +0200
committerQt by Nokia <qt-info@nokia.com>2012-04-25 04:02:15 +0200
commit7c84225cc877ef76143e1f476d0179bfb0594f02 (patch)
tree9ba3d564049c0526cb25504c7e0867cc10a19008 /tests
parenta775af111bde7810ebd18ad9f02ff096a3f74cb6 (diff)
Move QVideoWindowControl out of widgets.
There is no widget dependency in it, and this enables the QML Video element to support video overlays later. Change-Id: I7ebcde350f9595a9f7c319663ff745930535a8a7 Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/unit/qmultimedia_common/mockcameraservice.h11
-rw-r--r--tests/auto/unit/qmultimedia_common/mockmediaplayerservice.h12
-rw-r--r--tests/auto/unit/qmultimedia_common/mockvideo.pri8
-rw-r--r--tests/auto/unit/qmultimedia_common/mockvideowindowcontrol.h3
4 files changed, 2 insertions, 32 deletions
diff --git a/tests/auto/unit/qmultimedia_common/mockcameraservice.h b/tests/auto/unit/qmultimedia_common/mockcameraservice.h
index 93b7fcc4a..2ee01a3ec 100644
--- a/tests/auto/unit/qmultimedia_common/mockcameraservice.h
+++ b/tests/auto/unit/qmultimedia_common/mockcameraservice.h
@@ -56,10 +56,7 @@
#include "../qmultimedia_common/mockcameracontrol.h"
#include "../qmultimedia_common/mockvideosurface.h"
#include "../qmultimedia_common/mockvideorenderercontrol.h"
-
-#if defined(QT_MULTIMEDIA_MOCK_WIDGETS)
#include "../qmultimedia_common/mockvideowindowcontrol.h"
-#endif
class MockSimpleCameraService : public QMediaService
{
@@ -107,9 +104,7 @@ public:
mockImageProcessingControl = new MockImageProcessingControl(this);
mockImageEncoderControl = new MockImageEncoderControl(this);
rendererControl = new MockVideoRendererControl(this);
-#if defined(QT_MULTIMEDIA_MOCK_WIDGETS)
windowControl = new MockVideoWindowControl(this);
-#endif
rendererRef = 0;
windowRef = 0;
}
@@ -159,14 +154,12 @@ public:
return rendererControl;
}
}
-#if defined(QT_MULTIMEDIA_MOCK_WIDGETS)
if (qstrcmp(iid, QVideoWindowControl_iid) == 0) {
if (windowRef == 0) {
windowRef += 1;
return windowControl;
}
}
-#endif
return 0;
}
@@ -174,10 +167,8 @@ public:
{
if (control == rendererControl)
rendererRef -= 1;
-#if defined(QT_MULTIMEDIA_MOCK_WIDGETS)
if (control == windowControl)
windowRef -= 1;
-#endif
}
MockCameraControl *mockControl;
@@ -192,9 +183,7 @@ public:
MockImageProcessingControl *mockImageProcessingControl;
MockImageEncoderControl *mockImageEncoderControl;
MockVideoRendererControl *rendererControl;
-#if defined(QT_MULTIMEDIA_MOCK_WIDGETS)
MockVideoWindowControl *windowControl;
-#endif
int rendererRef;
int windowRef;
};
diff --git a/tests/auto/unit/qmultimedia_common/mockmediaplayerservice.h b/tests/auto/unit/qmultimedia_common/mockmediaplayerservice.h
index dd7d0e6ea..abe7d27c3 100644
--- a/tests/auto/unit/qmultimedia_common/mockmediaplayerservice.h
+++ b/tests/auto/unit/qmultimedia_common/mockmediaplayerservice.h
@@ -49,9 +49,7 @@
#include "mockmedianetworkaccesscontrol.h"
#include "mockvideorenderercontrol.h"
#include "mockvideoprobecontrol.h"
-#if defined(QT_MULTIMEDIA_MOCK_WIDGETS)
#include "mockvideowindowcontrol.h"
-#endif
class MockMediaPlayerService : public QMediaService
{
@@ -66,10 +64,8 @@ public:
rendererControl = new MockVideoRendererControl;
rendererRef = 0;
mockVideoProbeControl = new MockVideoProbeControl;
-#if defined(QT_MULTIMEDIA_MOCK_WIDGETS)
windowControl = new MockVideoWindowControl;
windowRef = 0;
-#endif
}
~MockMediaPlayerService()
@@ -79,9 +75,7 @@ public:
delete mockNetworkControl;
delete rendererControl;
delete mockVideoProbeControl;
-#if defined(QT_MULTIMEDIA_MOCK_WIDGETS)
delete windowControl;
-#endif
}
QMediaControl* requestControl(const char *iid)
@@ -96,14 +90,12 @@ public:
} else if (qstrcmp(iid, QMediaVideoProbeControl_iid) == 0) {
return mockVideoProbeControl;
}
-#if defined(QT_MULTIMEDIA_MOCK_WIDGETS)
if (qstrcmp(iid, QVideoWindowControl_iid) == 0) {
if (windowRef == 0) {
windowRef += 1;
return windowControl;
}
}
-#endif
if (qstrcmp(iid, QMediaNetworkAccessControl_iid) == 0)
return mockNetworkControl;
@@ -114,10 +106,8 @@ public:
{
if (control == rendererControl)
rendererRef -= 1;
-#if defined(QT_MULTIMEDIA_MOCK_WIDGETS)
if (control == windowControl)
windowRef -= 1;
-#endif
}
void setState(QMediaPlayer::State state) { emit mockControl->stateChanged(mockControl->_state = state); }
@@ -170,10 +160,8 @@ public:
MockNetworkAccessControl *mockNetworkControl;
MockVideoRendererControl *rendererControl;
MockVideoProbeControl *mockVideoProbeControl;
-#if defined(QT_MULTIMEDIA_MOCK_WIDGETS)
MockVideoWindowControl *windowControl;
int windowRef;
-#endif
int rendererRef;
};
diff --git a/tests/auto/unit/qmultimedia_common/mockvideo.pri b/tests/auto/unit/qmultimedia_common/mockvideo.pri
index ea991661f..a2492298c 100644
--- a/tests/auto/unit/qmultimedia_common/mockvideo.pri
+++ b/tests/auto/unit/qmultimedia_common/mockvideo.pri
@@ -3,12 +3,8 @@ INCLUDEPATH += $$PWD \
../../../src/multimedia \
../../../src/multimedia/video
-contains(QT,multimediawidgets)|contains(QT,multimediawidgets-private) {
- HEADERS *= ../qmultimedia_common/mockvideowindowcontrol.h
- DEFINES *= QT_MULTIMEDIA_MOCK_WIDGETS
-}
-
HEADERS *= \
../qmultimedia_common/mockvideosurface.h \
- ../qmultimedia_common/mockvideorenderercontrol.h
+ ../qmultimedia_common/mockvideorenderercontrol.h \
+ ../qmultimedia_common/mockvideowindowcontrol.h
diff --git a/tests/auto/unit/qmultimedia_common/mockvideowindowcontrol.h b/tests/auto/unit/qmultimedia_common/mockvideowindowcontrol.h
index 67cbe06f6..fb5dddb07 100644
--- a/tests/auto/unit/qmultimedia_common/mockvideowindowcontrol.h
+++ b/tests/auto/unit/qmultimedia_common/mockvideowindowcontrol.h
@@ -42,8 +42,6 @@
#ifndef MOCKVIDEOWINDOWCONTROL_H
#define MOCKVIDEOWINDOWCONTROL_H
-#if defined(QT_MULTIMEDIA_MOCK_WIDGETS)
-
#include "qvideowindowcontrol.h"
class MockVideoWindowControl : public QVideoWindowControl
@@ -70,5 +68,4 @@ public:
void setSaturation(int) {}
};
-#endif // QT_MULTIMEDIA_MOCK_WIDGETS
#endif // MOCKVIDEOWINDOWCONTROL_H