Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qwindowsmultimediautils.cpp
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#if defined(WINVER) && WINVER < _WIN32_WINNT_WIN10
5# undef WINVER
6#endif
7#if !defined(WINVER)
8# define WINVER _WIN32_WINNT_WIN10 // Enables newer audio formats.
9#endif
10
12
13#include <initguid.h>
14#include <mfapi.h>
15#include <mfidl.h>
16#include <qwindowsmfdefs_p.h>
17#include <system_error>
18
20
22{
23 if (subtype == MFVideoFormat_ARGB32)
24#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
26#else
28#endif
29 if (subtype == MFVideoFormat_RGB32)
30#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
32#else
34#endif
35 if (subtype == MFVideoFormat_AYUV)
37 if (subtype == MFVideoFormat_I420)
39 if (subtype == MFVideoFormat_UYVY)
41 if (subtype == MFVideoFormat_YV12)
43 if (subtype == MFVideoFormat_NV12)
45 if (subtype == MFVideoFormat_YUY2)
47 if (subtype == MFVideoFormat_P010)
49 if (subtype == MFVideoFormat_P016)
51 if (subtype == MFVideoFormat_L8)
53 if (subtype == MFVideoFormat_L16)
55 if (subtype == MFVideoFormat_MJPG)
57
59}
60
62{
63 switch (codec) {
65 return MFVideoFormat_MPG1;
67 return MFVideoFormat_MPEG2;
69 return MFVideoFormat_MP4V;
71 return MFVideoFormat_H264;
73 return MFVideoFormat_H265;
75 return MFVideoFormat_VP80;
77 return MFVideoFormat_VP90;
79 return MFVideoFormat_AV1;
81 return MFVideoFormat_WMV3;
83 return MFVideoFormat_MJPG;
84 default:
85 return MFVideoFormat_H264;
86 }
87}
88
90{
91 if (format == MFVideoFormat_MPG1)
93 if (format == MFVideoFormat_MPEG2)
95 if (format == MFVideoFormat_MP4V
96 || format == MFVideoFormat_M4S2
97 || format == MFVideoFormat_MP4S
98 || format == MFVideoFormat_MP43)
100 if (format == MFVideoFormat_H264)
102 if (format == MFVideoFormat_H265)
104 if (format == MFVideoFormat_VP80)
106 if (format == MFVideoFormat_VP90)
108 if (format == MFVideoFormat_AV1)
110 if (format == MFVideoFormat_WMV1
111 || format == MFVideoFormat_WMV2
112 || format == MFVideoFormat_WMV3)
114 if (format == MFVideoFormat_MJPG)
117}
118
120{
121 switch (codec) {
123 return MFAudioFormat_MP3;
125 return MFAudioFormat_AAC;
127 return MFAudioFormat_ALAC;
129 return MFAudioFormat_FLAC;
131 return MFAudioFormat_Vorbis;
133 return MFAudioFormat_PCM;
135 return MFAudioFormat_Opus;
137 return MFAudioFormat_Dolby_AC3;
139 return MFAudioFormat_Dolby_DDPlus;
141 return MFAudioFormat_WMAudioV9;
142 default:
143 return MFAudioFormat_AAC;
144 }
145}
146
148{
149 if (format == MFAudioFormat_MP3)
151 if (format == MFAudioFormat_AAC)
153 if (format == MFAudioFormat_ALAC)
155 if (format == MFAudioFormat_FLAC)
157 if (format == MFAudioFormat_Vorbis)
159 if (format == MFAudioFormat_PCM)
161 if (format == MFAudioFormat_Opus)
163 if (format == MFAudioFormat_Dolby_AC3)
165 if (format == MFAudioFormat_Dolby_DDPlus)
167 if (format == MFAudioFormat_WMAudioV8
168 || format == MFAudioFormat_WMAudioV9
169 || format == MFAudioFormat_WMAudio_Lossless)
172}
173
187
207
209{
210 return QStringLiteral("%1 %2")
211 .arg(quint32(hr), 8, 16)
212 .arg(QString::fromStdString(std::system_category().message(hr)));
213}
214
AudioCodec
\qmlproperty enumeration QtMultimedia::mediaFormat::fileFormat
FileFormat
Describes the container format used in a multimedia file or stream.
VideoCodec
\qmlproperty enumeration QtMultimedia::mediaFormat::audioCodec
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
static QString fromStdString(const std::string &s)
Definition qstring.h:1447
PixelFormat
Enumerates video data types.
Combined button and popup list for selecting options.
Q_MULTIMEDIA_EXPORT GUID containerForAudioFileFormat(QMediaFormat::FileFormat format)
Q_MULTIMEDIA_EXPORT QString errorString(HRESULT hr)
Q_MULTIMEDIA_EXPORT QVideoFrameFormat::PixelFormat pixelFormatFromMediaSubtype(const GUID &subtype)
Q_MULTIMEDIA_EXPORT GUID audioFormatForCodec(QMediaFormat::AudioCodec codec)
Q_MULTIMEDIA_EXPORT GUID videoFormatForCodec(QMediaFormat::VideoCodec codec)
Q_MULTIMEDIA_EXPORT GUID containerForVideoFileFormat(QMediaFormat::FileFormat format)
Q_MULTIMEDIA_EXPORT QMediaFormat::AudioCodec codecForAudioFormat(GUID format)
Q_MULTIMEDIA_EXPORT QMediaFormat::VideoCodec codecForVideoFormat(GUID format)
QMediaFormat::AudioCodec codec
GLuint GLsizei const GLchar * message
GLint GLsizei GLsizei GLenum format
#define QStringLiteral(str)
unsigned int quint32
Definition qtypes.h:50
long HRESULT
const GUID QMM_MFTranscodeContainerType_AVI
const GUID QMM_MFTranscodeContainerType_ADTS
const GUID QMM_MFTranscodeContainerType_ASF
const GUID QMM_MFTranscodeContainerType_FLAC
const GUID QMM_MFTranscodeContainerType_WAVE
const GUID QMM_MFTranscodeContainerType_MPEG4
const GUID QMM_MFTranscodeContainerType_MP3