summaryrefslogtreecommitdiffstats
path: root/src/multimedia/qmediaformat.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2021-06-03 16:14:32 +0200
committerLars Knoll <lars.knoll@qt.io>2021-06-04 11:08:42 +0200
commitcd7ce2ac58aabd3cbca3aed87bbedd2118834a4e (patch)
tree3fbd6a8d9486aec76720198c946d0a7579880e0d /src/multimedia/qmediaformat.h
parentda0d0950ac072f4d1e7ffe6dd83e4725849e42df (diff)
Remove the inheritance between QMediaEncoderSettings and QMediaFormat
Inheriting from value classes is not a good principle for our APIs, and it doesn't work for the QML side neither. Instead, simply give QMediaEncoderSettings a QMediaFormat member. Change-Id: Ib2cd8b04c09e89f8f57a91898ce987c199d66c75 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/multimedia/qmediaformat.h')
-rw-r--r--src/multimedia/qmediaformat.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/multimedia/qmediaformat.h b/src/multimedia/qmediaformat.h
index c8bfaf6c5..2a3d62917 100644
--- a/src/multimedia/qmediaformat.h
+++ b/src/multimedia/qmediaformat.h
@@ -54,6 +54,13 @@ QT_DECLARE_QESDP_SPECIALIZATION_DTOR_WITH_EXPORT(QMediaFormatPrivate, Q_MULTIMED
class Q_MULTIMEDIA_EXPORT QMediaFormat
{
+ Q_GADGET
+ 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_ENUMS(FileFormat)
+ Q_ENUMS(AudioCodec)
+ Q_ENUMS(VideoCodec)
public:
enum FileFormat {
UnspecifiedFormat = -1,
@@ -110,6 +117,12 @@ public:
Decode
};
+ enum ResolveFlags
+ {
+ NoFlags,
+ RequiresVideo
+ };
+
QMediaFormat(FileFormat format = UnspecifiedFormat);
~QMediaFormat();
QMediaFormat(const QMediaFormat &other) noexcept;
@@ -120,8 +133,8 @@ public:
void swap(QMediaFormat &other) noexcept
{ qSwap(d, other.d); }
- FileFormat format() const { return fmt; }
- void setFormat(FileFormat f) { fmt = f; }
+ FileFormat fileFormat() const { return fmt; }
+ void setFileFormat(FileFormat f) { fmt = f; }
void setVideoCodec(VideoCodec codec) { video = codec; }
VideoCodec videoCodec() const { return video; }
@@ -149,6 +162,8 @@ public:
bool operator!=(const QMediaFormat &other) const
{ return !operator==(other); }
+ void resolveForEncoding(ResolveFlags flags);
+
protected:
friend class QMediaFormatPrivate;
FileFormat fmt;