diff options
Diffstat (limited to 'src/multimedia/controls')
-rw-r--r-- | src/multimedia/controls/controls.pri | 4 | ||||
-rw-r--r-- | src/multimedia/controls/qcameraimagecapturecontrol.cpp | 5 | ||||
-rw-r--r-- | src/multimedia/controls/qcameraimagecapturecontrol.h | 3 | ||||
-rw-r--r-- | src/multimedia/controls/qmediaplayercontrol.h | 4 | ||||
-rw-r--r-- | src/multimedia/controls/qmediarecordercontrol.h | 6 | ||||
-rw-r--r-- | src/multimedia/controls/qmediastreamscontrol.h | 3 | ||||
-rw-r--r-- | src/multimedia/controls/qmetadatareadercontrol.cpp | 140 | ||||
-rw-r--r-- | src/multimedia/controls/qmetadatareadercontrol.h | 79 | ||||
-rw-r--r-- | src/multimedia/controls/qmetadatawritercontrol.cpp | 160 | ||||
-rw-r--r-- | src/multimedia/controls/qmetadatawritercontrol.h | 82 |
10 files changed, 14 insertions, 472 deletions
diff --git a/src/multimedia/controls/controls.pri b/src/multimedia/controls/controls.pri index 403ee895c..663e55282 100644 --- a/src/multimedia/controls/controls.pri +++ b/src/multimedia/controls/controls.pri @@ -11,8 +11,6 @@ PUBLIC_HEADERS += \ controls/qmediaplayercontrol.h \ controls/qmediarecordercontrol.h \ controls/qmediastreamscontrol.h \ - controls/qmetadatareadercontrol.h \ - controls/qmetadatawritercontrol.h \ controls/qvideorenderercontrol.h \ controls/qvideowindowcontrol.h \ @@ -25,8 +23,6 @@ SOURCES += \ controls/qmediaplayercontrol.cpp \ controls/qmediarecordercontrol.cpp \ controls/qmediastreamscontrol.cpp \ - controls/qmetadatareadercontrol.cpp \ - controls/qmetadatawritercontrol.cpp \ controls/qvideorenderercontrol.cpp \ controls/qvideowindowcontrol.cpp \ controls/qaudiodecodercontrol.cpp \ diff --git a/src/multimedia/controls/qcameraimagecapturecontrol.cpp b/src/multimedia/controls/qcameraimagecapturecontrol.cpp index f0b40002e..9ecd30fc3 100644 --- a/src/multimedia/controls/qcameraimagecapturecontrol.cpp +++ b/src/multimedia/controls/qcameraimagecapturecontrol.cpp @@ -140,10 +140,9 @@ QCameraImageCaptureControl::QCameraImageCaptureControl(QObject *parent) */ /*! - \fn QCameraImageCaptureControl::imageMetadataAvailable(int id, const QString &key, const QVariant &value) + \fn QCameraImageCaptureControl::imageMetadataAvailable(int id, const QMediaMetaData &metaData) - Signals that a metadata for an image with request \a id is available. Signal - also contains the \a key and \a value of the metadata. + Signals that a metadata for an image with request \a id is available. This signal should be emitted between imageExposed and imageSaved signals. */ diff --git a/src/multimedia/controls/qcameraimagecapturecontrol.h b/src/multimedia/controls/qcameraimagecapturecontrol.h index ccebe8cc0..cef317c38 100644 --- a/src/multimedia/controls/qcameraimagecapturecontrol.h +++ b/src/multimedia/controls/qcameraimagecapturecontrol.h @@ -69,12 +69,13 @@ public: virtual QImageEncoderSettings imageSettings() const = 0; virtual void setImageSettings(const QImageEncoderSettings &settings) = 0; + virtual void setMetaData(const QMediaMetaData &) {} Q_SIGNALS: void readyForCaptureChanged(bool ready); void imageExposed(int requestId); void imageCaptured(int requestId, const QImage &preview); - void imageMetadataAvailable(int id, const QString &key, const QVariant &value); + void imageMetadataAvailable(int id, const QMediaMetaData &); void imageAvailable(int requestId, const QVideoFrame &buffer); void imageSaved(int requestId, const QString &fileName); diff --git a/src/multimedia/controls/qmediaplayercontrol.h b/src/multimedia/controls/qmediaplayercontrol.h index 4cc5c4e98..234e43bd4 100644 --- a/src/multimedia/controls/qmediaplayercontrol.h +++ b/src/multimedia/controls/qmediaplayercontrol.h @@ -44,6 +44,7 @@ #include <QtMultimedia/qmediaplayer.h> #include <QtMultimedia/qmediatimerange.h> #include <QtMultimedia/qaudiodeviceinfo.h> +#include <QtMultimedia/qmediametadata.h> #include <QtCore/qpair.h> @@ -100,6 +101,8 @@ public: virtual bool setAudioOutput(const QAudioDeviceInfo &) { return false; } virtual QAudioDeviceInfo audioOutput() const { return QAudioDeviceInfo(); } + virtual QMediaMetaData metaData() const { return {}; } + Q_SIGNALS: void audioRoleChanged(QAudio::Role role); void customAudioRoleChanged(const QString &role); @@ -116,6 +119,7 @@ Q_SIGNALS: void availablePlaybackRangesChanged(const QMediaTimeRange &ranges); void playbackRateChanged(qreal rate); void error(int error, const QString &errorString); + void metaDataChanged(); protected: explicit QMediaPlayerControl(QObject *parent = nullptr); diff --git a/src/multimedia/controls/qmediarecordercontrol.h b/src/multimedia/controls/qmediarecordercontrol.h index 8f764ba90..fd972ea84 100644 --- a/src/multimedia/controls/qmediarecordercontrol.h +++ b/src/multimedia/controls/qmediarecordercontrol.h @@ -42,6 +42,7 @@ #include <QtMultimedia/qmediaservice.h> #include <QtMultimedia/qmediarecorder.h> +#include <QtMultimedia/qmediametadata.h> QT_BEGIN_NAMESPACE @@ -52,7 +53,6 @@ QT_BEGIN_NAMESPACE // Required for QDoc workaround class QString; -class QMetaDataWriterControl; class Q_MULTIMEDIA_EXPORT QMediaRecorderControl : public QObject { @@ -77,7 +77,8 @@ public: virtual void setEncoderSettings(const QMediaEncoderSettings &settings) = 0; - virtual QMetaDataWriterControl *metaDataControl() { return nullptr; } + virtual void setMetaData(const QMediaMetaData &) {} + virtual QMediaMetaData metaData() const { return {}; } Q_SIGNALS: void stateChanged(QMediaRecorder::State state); @@ -87,6 +88,7 @@ Q_SIGNALS: void volumeChanged(qreal volume); void actualLocationChanged(const QUrl &location); void error(int error, const QString &errorString); + void metaDataChanged(); public Q_SLOTS: virtual void setState(QMediaRecorder::State state) = 0; diff --git a/src/multimedia/controls/qmediastreamscontrol.h b/src/multimedia/controls/qmediastreamscontrol.h index ac9674699..8fedd4995 100644 --- a/src/multimedia/controls/qmediastreamscontrol.h +++ b/src/multimedia/controls/qmediastreamscontrol.h @@ -50,6 +50,7 @@ QT_BEGIN_NAMESPACE // Required for QDoc workaround class QString; +class QMediaMetaData; class Q_MULTIMEDIA_EXPORT QMediaStreamsControl : public QObject { @@ -61,7 +62,7 @@ public: virtual int streamCount() = 0; virtual StreamType streamType(int streamNumber) = 0; - virtual QVariant metaData(int streamNumber, const QString &key) = 0; + virtual QMediaMetaData metaData(int streamNumber) = 0; virtual bool isActive(int streamNumber) = 0; virtual void setActive(int streamNumber, bool state) = 0; diff --git a/src/multimedia/controls/qmetadatareadercontrol.cpp b/src/multimedia/controls/qmetadatareadercontrol.cpp deleted file mode 100644 index 18b94a795..000000000 --- a/src/multimedia/controls/qmetadatareadercontrol.cpp +++ /dev/null @@ -1,140 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <qmetadatareadercontrol.h> - -QT_BEGIN_NAMESPACE - - -/*! - \class QMetaDataReaderControl - \obsolete - \inmodule QtMultimedia - - - \ingroup multimedia_control - - - \brief The QMetaDataReaderControl class provides read access to the - meta-data of a QMediaService's media. - - If a QMediaService can provide read or write access to the meta-data of - its current media it will implement QMetaDataReaderControl. This control - provides functions for both retrieving and setting meta-data values. - Meta-data may be addressed by the keys defined in the - QMediaMetaData namespace. - - The functionality provided by this control is exposed to application - code by the meta-data members of QMediaSource, and so meta-data access - is potentially available in any of the media object classes. Any media - service may implement QMetaDataReaderControl. - - The interface name of QMetaDataReaderControl is - \c org.qt-project.qt.metadatareadercontrol/5.0 as defined in - QMetaDataReaderControl_iid. - - \sa QMediaService::requestControl(), QMediaSource -*/ - -/*! - \macro QMetaDataReaderControl_iid - - \c org.qt-project.qt.metadatareadercontrol/5.0 - - Defines the interface name of the QMetaDataReaderControl class. - - \relates QMetaDataReaderControl -*/ - -/*! - Construct a QMetaDataReaderControl with \a parent. This class is meant as a base class - for service specific meta data providers so this constructor is protected. -*/ - -QMetaDataReaderControl::QMetaDataReaderControl(QObject *parent) - : QObject(parent) -{ -} - -/*! - \fn bool QMetaDataReaderControl::isMetaDataAvailable() const - - Identifies if meta-data is available from a media service. - - Returns true if the meta-data is available and false otherwise. -*/ - -/*! - \fn QVariant QMetaDataReaderControl::metaData(const QString &key) const - - Returns the meta-data for the given \a key. -*/ - -/*! - \fn QMetaDataReaderControl::availableMetaData() const - - Returns a list of keys there is meta-data available for. -*/ - -/*! - \fn void QMetaDataReaderControl::metaDataChanged() - - Signal the changes of meta-data. - - If multiple meta-data elements are changed, - metaDataChanged(const QString &key, const QVariant &value) signal is emitted - for each of them with metaDataChanged() changed emitted once. -*/ - -/*! - \fn void QMetaDataReaderControl::metaDataChanged(const QString &key, const QVariant &value) - - Signal the changes of one meta-data element \a value with the given \a key. -*/ - -/*! - \fn void QMetaDataReaderControl::metaDataAvailableChanged(bool available) - - Signal the availability of meta-data has changed, \a available will - be true if the multimedia object has meta-data. -*/ - -QT_END_NAMESPACE - -#include "moc_qmetadatareadercontrol.cpp" diff --git a/src/multimedia/controls/qmetadatareadercontrol.h b/src/multimedia/controls/qmetadatareadercontrol.h deleted file mode 100644 index e45777a15..000000000 --- a/src/multimedia/controls/qmetadatareadercontrol.h +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMETADATAREADERCONTROL_H -#define QMETADATAREADERCONTROL_H - -#include <QtMultimedia/qmediaservice.h> -#include <QtMultimedia/qmediasource.h> - -#include <QtMultimedia/qtmultimediaglobal.h> -#include <QtMultimedia/qmultimedia.h> - -QT_BEGIN_NAMESPACE - -// Required for QDoc workaround -class QString; - -class Q_MULTIMEDIA_EXPORT QMetaDataReaderControl : public QObject -{ - Q_OBJECT -public: - virtual bool isMetaDataAvailable() const = 0; - - virtual QVariant metaData(const QString &key) const = 0; - virtual QStringList availableMetaData() const = 0; - -Q_SIGNALS: - void metaDataChanged(); - void metaDataChanged(const QString &key, const QVariant &value); - - void metaDataAvailableChanged(bool available); - -protected: - explicit QMetaDataReaderControl(QObject *parent = nullptr); -}; - -#define QMetaDataReaderControl_iid "org.qt-project.qt.metadatareadercontrol/5.0" -Q_MEDIA_DECLARE_CONTROL(QMetaDataReaderControl, QMetaDataReaderControl_iid) - -QT_END_NAMESPACE - - -#endif // QMETADATAPROVIDER_H diff --git a/src/multimedia/controls/qmetadatawritercontrol.cpp b/src/multimedia/controls/qmetadatawritercontrol.cpp deleted file mode 100644 index e57a0c873..000000000 --- a/src/multimedia/controls/qmetadatawritercontrol.cpp +++ /dev/null @@ -1,160 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <qmetadatawritercontrol.h> - -QT_BEGIN_NAMESPACE - - -/*! - \class QMetaDataWriterControl - \obsolete - \inmodule QtMultimedia - - - \ingroup multimedia_control - - - \brief The QMetaDataWriterControl class provides write access to the - meta-data of a QMediaService's media. - - If a QMediaService can provide write access to the meta-data of its - current media it will implement QMetaDataWriterControl. This control - provides functions for both retrieving and setting meta-data values. - Meta-data may be addressed by the keys defined in the - QMediaMetaData namespace. - - The functionality provided by this control is exposed to application code - by the meta-data members of QMediaSource, and so meta-data access is - potentially available in any of the media object classes. Any media - service may implement QMetaDataControl. - - The interface name of QMetaDataWriterControl is \c org.qt-project.qt.metadatawritercontrol/5.0 as - defined in QMetaDataWriterControl_iid. - - \sa QMediaService::requestControl(), QMediaSource -*/ - -/*! - \macro QMetaDataWriterControl_iid - - \c org.qt-project.qt.metadatawritercontrol/5.0 - - Defines the interface name of the QMetaDataWriterControl class. - - \relates QMetaDataWriterControl -*/ - -/*! - Construct a QMetaDataWriterControl with \a parent. This class is meant as a base class - for service specific meta data providers so this constructor is protected. -*/ - -QMetaDataWriterControl::QMetaDataWriterControl(QObject *parent) - : QObject(parent) -{ -} - -/*! - \fn bool QMetaDataWriterControl::isMetaDataAvailable() const - - Identifies if meta-data is available from a media service. - - Returns true if the meta-data is available and false otherwise. -*/ - -/*! - \fn bool QMetaDataWriterControl::isWritable() const - - Identifies if a media service's meta-data can be edited. - - Returns true if the meta-data is writable and false otherwise. -*/ - -/*! - \fn QVariant QMetaDataWriterControl::metaData(const QString &key) const - - Returns the meta-data for the given \a key. -*/ - -/*! - \fn void QMetaDataWriterControl::setMetaData(const QString &key, const QVariant &value) - - Sets the \a value of the meta-data element with the given \a key. -*/ - -/*! - \fn QMetaDataWriterControl::availableMetaData() const - - Returns a list of keys there is meta-data available for. -*/ - -/*! - \fn void QMetaDataWriterControl::metaDataChanged() - - Signal the changes of meta-data. - - If multiple meta-data elements are changed, - metaDataChanged(const QString &key, const QVariant &value) signal is emitted - for each of them with metaDataChanged() changed emitted once. -*/ - -/*! - \fn void QMetaDataWriterControl::metaDataChanged(const QString &key, const QVariant &value) - - Signal the changes of one meta-data element \a value with the given \a key. -*/ - -/*! - \fn void QMetaDataWriterControl::metaDataAvailableChanged(bool available) - - Signal the availability of meta-data has changed, \a available will - be true if the multimedia object has meta-data. -*/ - -/*! - \fn void QMetaDataWriterControl::writableChanged(bool writable) - - Signal a change in the writable status of meta-data, \a writable will be - true if meta-data elements can be added or adjusted. -*/ - -QT_END_NAMESPACE - -#include "moc_qmetadatawritercontrol.cpp" diff --git a/src/multimedia/controls/qmetadatawritercontrol.h b/src/multimedia/controls/qmetadatawritercontrol.h deleted file mode 100644 index c10ff1fcd..000000000 --- a/src/multimedia/controls/qmetadatawritercontrol.h +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMETADATAWRITERCONTROL_H -#define QMETADATAWRITERCONTROL_H - -#include <QtMultimedia/qmediaservice.h> -#include <QtMultimedia/qmediasource.h> - -#include <QtMultimedia/qtmultimediaglobal.h> -#include <QtMultimedia/qmultimedia.h> - -QT_BEGIN_NAMESPACE - -// Required for QDoc workaround -class QString; - -class Q_MULTIMEDIA_EXPORT QMetaDataWriterControl : public QObject -{ - Q_OBJECT -public: - virtual bool isWritable() const = 0; - virtual bool isMetaDataAvailable() const = 0; - - virtual QVariant metaData(const QString &key) const = 0; - virtual void setMetaData(const QString &key, const QVariant &value) = 0; - virtual QStringList availableMetaData() const = 0; - -Q_SIGNALS: - void metaDataChanged(); - void metaDataChanged(const QString &key, const QVariant &value); - - void writableChanged(bool writable); - void metaDataAvailableChanged(bool available); - -protected: - explicit QMetaDataWriterControl(QObject *parent = nullptr); -}; - -#define QMetaDataWriterControl_iid "org.qt-project.qt.metadatawritercontrol/5.0" -Q_MEDIA_DECLARE_CONTROL(QMetaDataWriterControl, QMetaDataWriterControl_iid) - -QT_END_NAMESPACE - - -#endif |