summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPiotr Srebrny <piotr.srebrny@qt.io>2021-06-18 14:09:52 +0200
committerPiotr Srebrny <piotr.srebrny@qt.io>2021-06-18 22:15:21 +0200
commit00cedc5107aecbe66619eef8baf18241ef3fc390 (patch)
tree16b279dc453178a31de79465cb60abaf04a4f401
parentb9bb2a3cf78102dfcfd6f80a7e96a1aa855c5f7a (diff)
Put media format enums in class scope and make it available in namespace
The media format enums have conflicting names thus must stay in thier respecitve namespaces when exporting to QML. The dependencies are updated as declaring the namespace and gadget on the same object is not supported with the selected qtdeclarative component. Change-Id: I6c113512128af4c60b431523c5322f77b879bc30 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
-rw-r--r--dependencies.yaml8
-rw-r--r--src/multimedia/qmediaformat.h13
-rw-r--r--src/multimedia/recording/qmediarecorder.h2
-rw-r--r--src/multimediaquick/qtmultimediaquicktypes_p.h7
4 files changed, 19 insertions, 11 deletions
diff --git a/dependencies.yaml b/dependencies.yaml
index 1a85788c4..c1f23821f 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
dependencies:
../qtbase:
- ref: 33aa461ec96201a2d32ce4ec80319f75878fed60
+ ref: e473d96e65e7cf3190c6c16acace6359964d0bee
required: true
../qtshadertools:
- ref: 37f9bda06d422a4a0945ce645459d7068455e2bb
+ ref: a17f5b3e3a02500f758aabf80afe4d9904cbbf14
required: false
../qtdeclarative:
- ref: 9a9ff0df09eecaaed577860025bf77e38824245f
+ ref: 22169421d462e01dbda9aff54e71dd1ed62ee90f
required: false
../qtquickcontrols2:
- ref: df50add85c1f2dd72cf4e8f4d5911a44e8833173
+ ref: 1a65241804842e9456834d29b74f96e1d7b24cc1
required: false
diff --git a/src/multimedia/qmediaformat.h b/src/multimedia/qmediaformat.h
index b74ac39ec..d3d3d68a2 100644
--- a/src/multimedia/qmediaformat.h
+++ b/src/multimedia/qmediaformat.h
@@ -57,6 +57,7 @@ class Q_MULTIMEDIA_EXPORT QMediaFormat
Q_PROPERTY(FileFormat fileFormat READ fileFormat WRITE setFileFormat)
Q_PROPERTY(AudioCodec audioCodec READ audioCodec WRITE setAudioCodec)
Q_PROPERTY(VideoCodec videoCodec READ videoCodec WRITE setVideoCodec)
+ Q_CLASSINFO("RegisterEnumClassesUnscoped", "false")
public:
enum FileFormat {
UnspecifiedFormat = -1,
@@ -151,13 +152,13 @@ public:
QMimeType mimeType() const;
- Q_INVOKABLE QList<QMediaFormat::FileFormat> supportedFileFormats(ConversionMode m);
- Q_INVOKABLE QList<QMediaFormat::VideoCodec> supportedVideoCodecs(ConversionMode m);
- Q_INVOKABLE QList<QMediaFormat::AudioCodec> supportedAudioCodecs(ConversionMode m);
+ Q_INVOKABLE QList<FileFormat> supportedFileFormats(ConversionMode m);
+ Q_INVOKABLE QList<VideoCodec> supportedVideoCodecs(ConversionMode m);
+ Q_INVOKABLE QList<AudioCodec> supportedAudioCodecs(ConversionMode m);
- static QString fileFormatName(QMediaFormat::FileFormat c);
- static QString audioCodecName(QMediaFormat::AudioCodec c);
- static QString videoCodecName(QMediaFormat::VideoCodec c);
+ Q_INVOKABLE static QString fileFormatName(FileFormat c);
+ Q_INVOKABLE static QString audioCodecName(AudioCodec c);
+ Q_INVOKABLE static QString videoCodecName(VideoCodec c);
static QString fileFormatDescription(QMediaFormat::FileFormat c);
static QString audioCodecDescription(QMediaFormat::AudioCodec c);
diff --git a/src/multimedia/recording/qmediarecorder.h b/src/multimedia/recording/qmediarecorder.h
index d65d516b1..993aa0062 100644
--- a/src/multimedia/recording/qmediarecorder.h
+++ b/src/multimedia/recording/qmediarecorder.h
@@ -71,7 +71,7 @@ class Q_MULTIMEDIA_EXPORT QMediaRecorder : public QObject
Q_PROPERTY(QMediaMetaData metaData READ metaData WRITE setMetaData NOTIFY metaDataChanged)
Q_PROPERTY(QMediaRecorder::Error error READ error NOTIFY errorChanged)
Q_PROPERTY(QString errorString READ errorString NOTIFY errorChanged)
- Q_PROPERTY(QMediaFormat mediaFormat READ mediaFormat WRITE setMediaFormat)
+ Q_PROPERTY(QMediaFormat mediaFormat READ mediaFormat WRITE setMediaFormat NOTIFY mediaFormatChanged)
Q_PROPERTY(Quality quality READ quality WRITE setQuality)
public:
enum Quality
diff --git a/src/multimediaquick/qtmultimediaquicktypes_p.h b/src/multimediaquick/qtmultimediaquicktypes_p.h
index dc4de9450..66f3c6ac7 100644
--- a/src/multimediaquick/qtmultimediaquicktypes_p.h
+++ b/src/multimediaquick/qtmultimediaquicktypes_p.h
@@ -148,6 +148,13 @@ struct QMediaFormatForeign
QML_NAMED_ELEMENT(mediaFormat)
};
+namespace QMediaFormatNamespaceForeign
+{
+ Q_NAMESPACE
+ QML_FOREIGN_NAMESPACE(QMediaFormat)
+ QML_NAMED_ELEMENT(MediaFormat)
+};
+
QT_END_NAMESPACE
#endif