summaryrefslogtreecommitdiffstats
path: root/tests/auto/unit/qmultimedia_common/mockmediaserviceprovider.h
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@digia.com>2014-01-22 16:18:42 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-28 14:10:00 +0100
commitb28ee24628f77fced393cacc45500be6761e4497 (patch)
tree811173f8a2caf84e0fa386010283ccfd32c6ad0d /tests/auto/unit/qmultimedia_common/mockmediaserviceprovider.h
parentd964388b38ec4762e315d86aacb779604bcdca1b (diff)
New QCameraInfo class.
The class allows to get the list of available cameras on the system as well as getting some static information about them such as their unique ID, display name, physical position and sensor orientation. This makes QCamera::availableDevices() and QCamera::deviceDescription() obsolete. This patch contains the API, documentation and auto-tests but not the actual implementation by each backend (except for retrieving the default camera device). [ChangeLog][QtMultimedia] Added new QCameraInfo class [ChangeLog][QtMultimedia] QCamera: availableDevices() and deviceDescription() are deprecated, use QCameraInfo instead Change-Id: I64fd65729ab26a789468979ed5444ee90bb82cd0 Reviewed-by: Christian Stromme <christian.stromme@digia.com>
Diffstat (limited to 'tests/auto/unit/qmultimedia_common/mockmediaserviceprovider.h')
-rw-r--r--tests/auto/unit/qmultimedia_common/mockmediaserviceprovider.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/auto/unit/qmultimedia_common/mockmediaserviceprovider.h b/tests/auto/unit/qmultimedia_common/mockmediaserviceprovider.h
index d582ea319..6bf221c50 100644
--- a/tests/auto/unit/qmultimedia_common/mockmediaserviceprovider.h
+++ b/tests/auto/unit/qmultimedia_common/mockmediaserviceprovider.h
@@ -44,6 +44,8 @@
#include "private/qmediaserviceprovider_p.h"
#include "qmediaservice.h"
+#include "mockvideodeviceselectorcontrol.h"
+#include "mockcamerainfocontrol.h"
// Simple provider that lets you set the service
class MockMediaServiceProvider : public QMediaServiceProvider
@@ -67,6 +69,40 @@ public:
}
}
+ QByteArray defaultDevice(const QByteArray &serviceType) const
+ {
+ if (serviceType == Q_MEDIASERVICE_CAMERA)
+ return MockVideoDeviceSelectorControl::defaultCamera();
+
+ return QByteArray();
+ }
+
+ QList<QByteArray> devices(const QByteArray &serviceType) const
+ {
+ if (serviceType == Q_MEDIASERVICE_CAMERA)
+ return MockVideoDeviceSelectorControl::availableCameras();
+
+ return QList<QByteArray>();
+ }
+
+ QString deviceDescription(const QByteArray &serviceType, const QByteArray &device)
+ {
+ if (serviceType == Q_MEDIASERVICE_CAMERA)
+ return MockVideoDeviceSelectorControl::cameraDescription(device);
+
+ return QString();
+ }
+
+ QCamera::Position cameraPosition(const QByteArray &device) const
+ {
+ return MockCameraInfoControl::position(device);
+ }
+
+ int cameraOrientation(const QByteArray &device) const
+ {
+ return MockCameraInfoControl::orientation(device);
+ }
+
QMediaService *service;
bool deleteServiceOnRelease;
};