summaryrefslogtreecommitdiffstats
path: root/src/multimedia/qmediaformat.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2021-02-02 20:36:06 +0100
committerLars Knoll <lars.knoll@qt.io>2021-02-09 14:34:35 +0000
commitb010b331e52890b5d9be0218aa91c849adb1f63f (patch)
tree13815d4854deef4fd8e0f6867e4223324b571826 /src/multimedia/qmediaformat.h
parentd9fcf2ab6ac24cdba9a9ff3f0e32a39938216cee (diff)
Use the new QMediaEncoderSettings in QMediaRecorder
Switch the backends for Android (compiles but untested), AFFoundation and GStreamer over to use the new QMediaEncoderSettings. Get rid of the old *EncoderControl classes and associated infrastructure. Change-Id: Ic75ff43eab55aeb0ab53d7248f7f5ff70b14c05f Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/multimedia/qmediaformat.h')
-rw-r--r--src/multimedia/qmediaformat.h24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/multimedia/qmediaformat.h b/src/multimedia/qmediaformat.h
index baf4d90eb..69e795545 100644
--- a/src/multimedia/qmediaformat.h
+++ b/src/multimedia/qmediaformat.h
@@ -46,11 +46,19 @@
QT_BEGIN_NAMESPACE
-class QMediaFormatPrivate;
+class QMediaFormat;
+class QMediaEncoderSettings;
+class QMediaFormatPrivate
+{
+ friend class QMediaEncoderSettings;
+ static void resolveForEncoding(QMediaFormat *fmt, bool audioOnly);
+};
+
class Q_MULTIMEDIA_EXPORT QMediaFormat
{
public:
enum FileFormat {
+ UnspecifiedFormat = -1,
// Video Formats
ASF,
AVI,
@@ -71,7 +79,7 @@ public:
};
enum class AudioCodec {
- Invalid = -1,
+ Unspecified = -1,
MP3,
AAC,
AC3,
@@ -86,7 +94,7 @@ public:
};
enum class VideoCodec {
- Invalid = -1,
+ Unspecified = -1,
MPEG1,
MPEG2,
MPEG4,
@@ -100,12 +108,13 @@ public:
LastVideoCodec = MotionJPEG
};
- QMediaFormat(FileFormat format);
+ QMediaFormat(FileFormat format = UnspecifiedFormat);
~QMediaFormat();
QMediaFormat(const QMediaFormat &other);
QMediaFormat &operator=(const QMediaFormat &other);
FileFormat format() const { return fmt; }
+ void setFormat(FileFormat f) { fmt = f; }
bool setVideoCodec(VideoCodec codec);
VideoCodec videoCodec() const { return video; }
@@ -126,10 +135,11 @@ public:
static QString audioCodecDescription(QMediaFormat::AudioCodec c);
static QString videoCodecDescription(QMediaFormat::VideoCodec c);
-private:
+protected:
+ friend class QMediaFormatPrivate;
FileFormat fmt;
- AudioCodec audio = AudioCodec::Invalid;
- VideoCodec video = VideoCodec::Invalid;
+ AudioCodec audio = AudioCodec::Unspecified;
+ VideoCodec video = VideoCodec::Unspecified;
QMediaFormatPrivate *d = nullptr;
};