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>
This commit is contained in:
committed by
The Qt Project
parent
d964388b38
commit
b28ee24628
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user