21 Q_PROPERTY(FileFormat fileFormat READ fileFormat WRITE setFileFormat)
22 Q_PROPERTY(AudioCodec audioCodec READ audioCodec WRITE setAudioCodec)
23 Q_PROPERTY(VideoCodec videoCodec READ videoCodec WRITE setVideoCodec)
24 Q_CLASSINFO(
"RegisterEnumClassesUnscoped",
"false")
27 UnspecifiedFormat = -1,
47 enum class AudioCodec {
64 enum class VideoCodec {
77 LastVideoCodec = MotionJPEG
85 Q_ENUM(ConversionMode)
93 QMediaFormat(FileFormat format = UnspecifiedFormat);
95 QMediaFormat(
const QMediaFormat &other)
noexcept;
96 QMediaFormat &operator=(
const QMediaFormat &other)
noexcept;
98 QMediaFormat(QMediaFormat &&other)
noexcept =
default;
99 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QMediaFormat)
100 void swap(QMediaFormat &other)
noexcept
102 std::swap(fmt, other.fmt);
103 std::swap(audio, other.audio);
104 std::swap(video, other.video);
108 FileFormat fileFormat()
const {
return fmt; }
109 void setFileFormat(FileFormat f) { fmt = f; }
111 void setVideoCodec(VideoCodec codec) { video = codec; }
112 VideoCodec videoCodec()
const {
return video; }
114 void setAudioCodec(AudioCodec codec) { audio = codec; }
115 AudioCodec audioCodec()
const {
return audio; }
117 Q_INVOKABLE
bool isSupported(ConversionMode mode)
const;
119 QMimeType mimeType()
const;
121 Q_INVOKABLE QList<FileFormat> supportedFileFormats(ConversionMode m);
122 Q_INVOKABLE QList<VideoCodec> supportedVideoCodecs(ConversionMode m);
123 Q_INVOKABLE QList<AudioCodec> supportedAudioCodecs(ConversionMode m);
125 Q_INVOKABLE
static QString fileFormatName(FileFormat fileFormat);
126 Q_INVOKABLE
static QString audioCodecName(AudioCodec codec);
127 Q_INVOKABLE
static QString videoCodecName(VideoCodec codec);
129 Q_INVOKABLE
static QString fileFormatDescription(QMediaFormat::FileFormat fileFormat);
130 Q_INVOKABLE
static QString audioCodecDescription(QMediaFormat::AudioCodec codec);
131 Q_INVOKABLE
static QString videoCodecDescription(QMediaFormat::VideoCodec codec);
133 bool operator==(
const QMediaFormat &other)
const;
134 bool operator!=(
const QMediaFormat &other)
const
135 {
return !operator==(other); }
137 void resolveForEncoding(ResolveFlags flags);
140 friend class QMediaFormatPrivate;
142 AudioCodec audio = AudioCodec::Unspecified;
143 VideoCodec video = VideoCodec::Unspecified;
144 QExplicitlySharedDataPointer<QMediaFormatPrivate> d;