23 Q_PROPERTY(FileFormat fileFormat READ fileFormat WRITE setFileFormat)
24 Q_PROPERTY(AudioCodec audioCodec READ audioCodec WRITE setAudioCodec)
25 Q_PROPERTY(VideoCodec videoCodec READ videoCodec WRITE setVideoCodec)
26 Q_CLASSINFO(
"RegisterEnumClassesUnscoped",
"false")
29 UnspecifiedFormat = -1,
49 enum class AudioCodec {
66 enum class VideoCodec {
79 LastVideoCodec = MotionJPEG
87 Q_ENUM(ConversionMode)
95 QMediaFormat(FileFormat format = UnspecifiedFormat);
97 QMediaFormat(
const QMediaFormat &other)
noexcept;
98 QMediaFormat &operator=(
const QMediaFormat &other)
noexcept;
100 QMediaFormat(QMediaFormat &&other)
noexcept =
default;
101 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QMediaFormat)
102 void swap(QMediaFormat &other)
noexcept
104 std::swap(fmt, other.fmt);
105 std::swap(audio, other.audio);
106 std::swap(video, other.video);
110 FileFormat fileFormat()
const {
return fmt; }
111 void setFileFormat(FileFormat f) { fmt = f; }
113 void setVideoCodec(VideoCodec codec) { video = codec; }
114 VideoCodec videoCodec()
const {
return video; }
116 void setAudioCodec(AudioCodec codec) { audio = codec; }
117 AudioCodec audioCodec()
const {
return audio; }
119 Q_INVOKABLE
bool isSupported(ConversionMode mode)
const;
121#if QT_CONFIG(mimetype)
122 QMimeType mimeType()
const;
125 Q_INVOKABLE QList<FileFormat> supportedFileFormats(ConversionMode m);
126 Q_INVOKABLE QList<VideoCodec> supportedVideoCodecs(ConversionMode m);
127 Q_INVOKABLE QList<AudioCodec> supportedAudioCodecs(ConversionMode m);
129 Q_INVOKABLE
static QString fileFormatName(FileFormat fileFormat);
130 Q_INVOKABLE
static QString audioCodecName(AudioCodec codec);
131 Q_INVOKABLE
static QString videoCodecName(VideoCodec codec);
133 Q_INVOKABLE
static QString fileFormatDescription(QMediaFormat::FileFormat fileFormat);
134 Q_INVOKABLE
static QString audioCodecDescription(QMediaFormat::AudioCodec codec);
135 Q_INVOKABLE
static QString videoCodecDescription(QMediaFormat::VideoCodec codec);
137 bool operator==(
const QMediaFormat &other)
const;
138 bool operator!=(
const QMediaFormat &other)
const
139 {
return !operator==(other); }
141 void resolveForEncoding(ResolveFlags flags);
144 friend class QMediaFormatPrivate;
146 AudioCodec audio = AudioCodec::Unspecified;
147 VideoCodec video = VideoCodec::Unspecified;
148 QExplicitlySharedDataPointer<QMediaFormatPrivate> d;