14QVideoFrameFormat::PixelFormat QWindowsMultimediaUtils::pixelFormatFromMediaSubtype(
const GUID &subtype)
16 if (subtype == MFVideoFormat_ARGB32)
17#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
18 return QVideoFrameFormat::Format_BGRA8888;
20 return QVideoFrameFormat::Format_ARGB8888;
22 if (subtype == MFVideoFormat_RGB32)
23#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
24 return QVideoFrameFormat::Format_BGRX8888;
26 return QVideoFrameFormat::Format_XRGB8888;
28 if (subtype == MFVideoFormat_AYUV)
29 return QVideoFrameFormat::Format_AYUV;
30 if (subtype == MFVideoFormat_I420)
31 return QVideoFrameFormat::Format_YUV420P;
32 if (subtype == MFVideoFormat_UYVY)
33 return QVideoFrameFormat::Format_UYVY;
34 if (subtype == MFVideoFormat_YV12)
35 return QVideoFrameFormat::Format_YV12;
36 if (subtype == MFVideoFormat_NV12)
37 return QVideoFrameFormat::Format_NV12;
38 if (subtype == MFVideoFormat_YUY2)
39 return QVideoFrameFormat::Format_YUYV;
40 if (subtype == MFVideoFormat_P010)
41 return QVideoFrameFormat::Format_P010;
42 if (subtype == MFVideoFormat_P016)
43 return QVideoFrameFormat::Format_P016;
44 if (subtype == MFVideoFormat_L8)
45 return QVideoFrameFormat::Format_Y8;
46 if (subtype == MFVideoFormat_L16)
47 return QVideoFrameFormat::Format_Y16;
48 if (subtype == MFVideoFormat_MJPG)
49 return QVideoFrameFormat::Format_Jpeg;
51 return QVideoFrameFormat::Format_Invalid;
84 case QMediaFormat::VideoCodec::MPEG1:
85 return MFVideoFormat_MPG1;
86 case QMediaFormat::VideoCodec::MPEG2:
87 return MFVideoFormat_MPEG2;
88 case QMediaFormat::VideoCodec::MPEG4:
89 return MFVideoFormat_MP4V;
90 case QMediaFormat::VideoCodec::H264:
91 return MFVideoFormat_H264;
92 case QMediaFormat::VideoCodec::H265:
93 return MFVideoFormat_H265;
94 case QMediaFormat::VideoCodec::VP8:
95 return MFVideoFormat_VP80;
96 case QMediaFormat::VideoCodec::VP9:
97 return MFVideoFormat_VP90;
98 case QMediaFormat::VideoCodec::AV1:
99 return MFVideoFormat_AV1;
100 case QMediaFormat::VideoCodec::WMV:
101 return MFVideoFormat_WMV3;
102 case QMediaFormat::VideoCodec::MotionJPEG:
103 return MFVideoFormat_MJPG;
105 return MFVideoFormat_H264;
111 if (format == MFVideoFormat_MPG1)
112 return QMediaFormat::VideoCodec::MPEG1;
113 if (format == MFVideoFormat_MPEG2)
114 return QMediaFormat::VideoCodec::MPEG2;
115 if (format == MFVideoFormat_MP4V
116 || format == MFVideoFormat_M4S2
117 || format == MFVideoFormat_MP4S
118 || format == MFVideoFormat_MP43)
119 return QMediaFormat::VideoCodec::MPEG4;
120 if (format == MFVideoFormat_H264)
121 return QMediaFormat::VideoCodec::H264;
122 if (format == MFVideoFormat_H265)
123 return QMediaFormat::VideoCodec::H265;
124 if (format == MFVideoFormat_VP80)
125 return QMediaFormat::VideoCodec::VP8;
126 if (format == MFVideoFormat_VP90)
127 return QMediaFormat::VideoCodec::VP9;
128 if (format == MFVideoFormat_AV1)
129 return QMediaFormat::VideoCodec::AV1;
130 if (format == MFVideoFormat_WMV1
131 || format == MFVideoFormat_WMV2
132 || format == MFVideoFormat_WMV3)
133 return QMediaFormat::VideoCodec::WMV;
134 if (format == MFVideoFormat_MJPG)
135 return QMediaFormat::VideoCodec::MotionJPEG;
136 return QMediaFormat::VideoCodec::Unspecified;
142 case QMediaFormat::AudioCodec::MP3:
143 return MFAudioFormat_MP3;
144 case QMediaFormat::AudioCodec::AAC:
145 return MFAudioFormat_AAC;
146 case QMediaFormat::AudioCodec::ALAC:
147 return MFAudioFormat_ALAC;
148 case QMediaFormat::AudioCodec::FLAC:
149 return MFAudioFormat_FLAC;
150 case QMediaFormat::AudioCodec::Vorbis:
151 return MFAudioFormat_Vorbis;
152 case QMediaFormat::AudioCodec::Wave:
153 return MFAudioFormat_PCM;
154 case QMediaFormat::AudioCodec::Opus:
155 return MFAudioFormat_Opus;
156 case QMediaFormat::AudioCodec::AC3:
157 return MFAudioFormat_Dolby_AC3;
158 case QMediaFormat::AudioCodec::EAC3:
159 return MFAudioFormat_Dolby_DDPlus;
160 case QMediaFormat::AudioCodec::WMA:
161 return MFAudioFormat_WMAudioV9;
163 return MFAudioFormat_AAC;
169 if (format == MFAudioFormat_MP3)
170 return QMediaFormat::AudioCodec::MP3;
171 if (format == MFAudioFormat_AAC)
172 return QMediaFormat::AudioCodec::AAC;
173 if (format == MFAudioFormat_ALAC)
174 return QMediaFormat::AudioCodec::ALAC;
175 if (format == MFAudioFormat_FLAC)
176 return QMediaFormat::AudioCodec::FLAC;
177 if (format == MFAudioFormat_Vorbis)
178 return QMediaFormat::AudioCodec::Vorbis;
179 if (format == MFAudioFormat_PCM)
180 return QMediaFormat::AudioCodec::Wave;
181 if (format == MFAudioFormat_Opus)
182 return QMediaFormat::AudioCodec::Opus;
183 if (format == MFAudioFormat_Dolby_AC3)
184 return QMediaFormat::AudioCodec::AC3;
185 if (format == MFAudioFormat_Dolby_DDPlus)
186 return QMediaFormat::AudioCodec::EAC3;
187 if (format == MFAudioFormat_WMAudioV8
188 || format == MFAudioFormat_WMAudioV9
189 || format == MFAudioFormat_WMAudio_Lossless)
190 return QMediaFormat::AudioCodec::WMA;
191 return QMediaFormat::AudioCodec::Unspecified;
197 case QMediaFormat::FileFormat::MPEG4:
198 return MFTranscodeContainerType_MPEG4;
199 case QMediaFormat::FileFormat::WMV:
200 return MFTranscodeContainerType_ASF;
201 case QMediaFormat::FileFormat::AVI:
202 return MFTranscodeContainerType_AVI;
204 return MFTranscodeContainerType_MPEG4;
211 case QMediaFormat::FileFormat::MP3:
212 return MFTranscodeContainerType_MP3;
213 case QMediaFormat::FileFormat::AAC:
214 return MFTranscodeContainerType_ADTS;
215 case QMediaFormat::FileFormat::Mpeg4Audio:
216 return MFTranscodeContainerType_MPEG4;
217 case QMediaFormat::FileFormat::WMA:
218 return MFTranscodeContainerType_ASF;
219 case QMediaFormat::FileFormat::FLAC:
220 return MFTranscodeContainerType_FLAC;
221 case QMediaFormat::FileFormat::Wave:
222 return MFTranscodeContainerType_WAVE;
224 return MFTranscodeContainerType_MPEG4;