summaryrefslogtreecommitdiffstats
path: root/src/multimedia/qmediaserviceproviderplugin.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 /src/multimedia/qmediaserviceproviderplugin.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 'src/multimedia/qmediaserviceproviderplugin.h')
-rw-r--r--src/multimedia/qmediaserviceproviderplugin.h30
1 files changed, 29 insertions, 1 deletions
diff --git a/src/multimedia/qmediaserviceproviderplugin.h b/src/multimedia/qmediaserviceproviderplugin.h
index fa3b88235..2c276beed 100644
--- a/src/multimedia/qmediaserviceproviderplugin.h
+++ b/src/multimedia/qmediaserviceproviderplugin.h
@@ -46,6 +46,7 @@
#include <QtCore/qplugin.h>
#include <QtMultimedia/qmultimedia.h>
#include <QtMultimedia/qtmultimediadefs.h>
+#include <QtMultimedia/qcamera.h>
#ifdef Q_MOC_RUN
# pragma Q_MOC_EXPAND_MACROS
@@ -62,7 +63,7 @@ class QMediaServiceProviderHintPrivate;
class Q_MULTIMEDIA_EXPORT QMediaServiceProviderHint
{
public:
- enum Type { Null, ContentType, Device, SupportedFeatures };
+ enum Type { Null, ContentType, Device, SupportedFeatures, CameraPosition };
enum Feature {
LowLatencyPlayback = 0x01,
@@ -75,6 +76,7 @@ public:
QMediaServiceProviderHint();
QMediaServiceProviderHint(const QString &mimeType, const QStringList& codecs);
QMediaServiceProviderHint(const QByteArray &device);
+ QMediaServiceProviderHint(QCamera::Position position);
QMediaServiceProviderHint(Features features);
QMediaServiceProviderHint(const QMediaServiceProviderHint &other);
~QMediaServiceProviderHint();
@@ -92,6 +94,7 @@ public:
QStringList codecs() const;
QByteArray device() const;
+ QCamera::Position cameraPosition() const;
Features features() const;
@@ -145,6 +148,31 @@ struct Q_MULTIMEDIA_EXPORT QMediaServiceSupportedDevicesInterface
"org.qt-project.qt.mediaservicesupporteddevices/5.0"
Q_DECLARE_INTERFACE(QMediaServiceSupportedDevicesInterface, QMediaServiceSupportedDevicesInterface_iid)
+// This should be part of QMediaServiceSupportedDevicesInterface but it can't in order
+// to preserve binary compatibility with 5.2 and earlier.
+// The whole media service plugin API shouldn't even be public in the first place. It should
+// be made private in Qt 6.0 and QMediaServiceDefaultDeviceInterface should be merged with
+// QMediaServiceSupportedDevicesInterface
+struct Q_MULTIMEDIA_EXPORT QMediaServiceDefaultDeviceInterface
+{
+ virtual ~QMediaServiceDefaultDeviceInterface() {}
+ virtual QByteArray defaultDevice(const QByteArray &service) const = 0;
+};
+
+#define QMediaServiceDefaultDeviceInterface_iid \
+ "org.qt-project.qt.mediaservicedefaultdevice/5.3"
+Q_DECLARE_INTERFACE(QMediaServiceDefaultDeviceInterface, QMediaServiceDefaultDeviceInterface_iid)
+
+struct Q_MULTIMEDIA_EXPORT QMediaServiceCameraInfoInterface
+{
+ virtual QCamera::Position cameraPosition(const QByteArray &device) const = 0;
+ virtual int cameraOrientation(const QByteArray &device) const = 0;
+};
+
+#define QMediaServiceCameraInfoInterface_iid \
+ "org.qt-project.qt.mediaservicecamerainfo/5.3"
+Q_DECLARE_INTERFACE(QMediaServiceCameraInfoInterface, QMediaServiceCameraInfoInterface_iid)
+
// Required for QDoc workaround
class QString;