12#include <propvarutil.h>
15#include "private/qwindowsmultimediautils_p.h"
40 if (!FileTimeToSystemTime(&
var.filetime, &
t))
44 QTime(
t.wHour,
t.wMinute,
t.wSecond,
t.wMilliseconds),
50 if (FAILED(
var.pStream->Stat(&stat, STATFLAG_NONAME)))
52 void *
data = malloc(stat.cbSize.QuadPart);
54 if (FAILED(
var.pStream->Read(
data, stat.cbSize.QuadPart, &
read))) {
62 case VT_VECTOR | VT_LPWSTR:
64 for (ULONG
i = 0;
i <
var.calpwstr.cElems; ++
i)
77 PropVariantInit(&
var);
80 hr = content->GetValue(
key, &
var);
86 if (
value.isValid() && content) {
87 if (
key == PKEY_Media_ClassPrimaryID ) {
91 else if (
v ==
QLatin1String(
"{DB9830BD-3AB3-4FAB-8A37-1A995F7FF74B}"))
93 else if (
v ==
QLatin1String(
"{01CD0F29-DA4E-4157-897B-6275D50C4F11}"))
95 else if (
v ==
QLatin1String(
"{FCF24A76-9A57-4036-990D-E35DD8B244E1}"))
97 }
else if (
key == PKEY_Media_Duration) {
100 }
else if (
key == PKEY_Video_Compression) {
102 }
else if (
key == PKEY_Audio_Format) {
104 }
else if (
key == PKEY_Video_FrameHeight ) {
107 if (content && SUCCEEDED(content->GetValue(PKEY_Video_FrameWidth, &
var)))
110 }
else if (
key == PKEY_Video_Orientation) {
111 uint orientation = 0;
112 if (content && SUCCEEDED(content->GetValue(PKEY_Video_Orientation, &
var)))
115 }
else if (
key == PKEY_Video_FrameRate) {
121 PropVariantClear(&
var);
129 IPropertyStore *content =
nullptr;
130 if (!SUCCEEDED(MFGetService(mediaSource, MF_PROPERTY_HANDLER_SERVICE, IID_PPV_ARGS(&content))))
135 if (SUCCEEDED(content->GetCount(&cProps))) {
136 for (DWORD
i = 0;
i < cProps;
i++)
139 if (FAILED(content->GetAt(
i, &
key)))
142 if (
key == PKEY_Author) {
144 }
else if (
key == PKEY_Title) {
150 }
else if (
key == PKEY_Media_EncodingSettings) {
152 }
else if (
key == PKEY_Copyright) {
154 }
else if (
key == PKEY_Comment) {
156 }
else if (
key == PKEY_Media_ProviderStyle) {
158 }
else if (
key == PKEY_Media_DateEncoded) {
164 }
else if (
key == PKEY_Language) {
166 }
else if (
key == PKEY_Media_Publisher) {
168 }
else if (
key == PKEY_Media_ClassPrimaryID) {
170 }
else if (
key == PKEY_Media_Duration) {
172 }
else if (
key == PKEY_Audio_EncodingBitrate) {
174 }
else if (
key == PKEY_Audio_Format) {
184 }
else if (
key == PKEY_Music_AlbumTitle) {
186 }
else if (
key == PKEY_Music_AlbumArtist) {
188 }
else if (
key == PKEY_Music_Artist) {
190 }
else if (
key == PKEY_Music_Composer) {
198 }
else if (
key == PKEY_Music_TrackNumber) {
200 }
else if (
key == PKEY_Music_Genre) {
202 }
else if (
key == PKEY_ThumbnailStream) {
204 }
else if (
key == PKEY_Video_FrameHeight) {
206 }
else if (
key == PKEY_Video_Orientation) {
208 }
else if (
key == PKEY_Video_FrameRate) {
210 }
else if (
key == PKEY_Video_EncodingBitrate) {
212 }
else if (
key == PKEY_Video_Compression) {
240 return PKEY_Music_Genre;
242 return PKEY_Copyright;
244 return PKEY_Media_Publisher;
246 return PKEY_Media_AuthorUrl;
248 return PKEY_Music_AlbumTitle;
250 return PKEY_Music_AlbumArtist;
252 return PKEY_Music_TrackNumber;
254 return PKEY_Media_DateEncoded;
256 return PKEY_Music_Composer;
258 return PKEY_Media_Duration;
260 return PKEY_Language;
262 return PKEY_Media_EncodingSettings;
264 return PKEY_Audio_EncodingBitrate;
266 return PKEY_Music_Artist;
268 return PKEY_ThumbnailStream;
270 return PKEY_Video_Orientation;
272 return PKEY_Video_FrameRate;
274 return PKEY_Video_EncodingBitrate;
276 return PKEY_Media_ClassPrimaryID;
284 PROPVARIANT propValue = {};
285 if (SUCCEEDED(InitPropVariantFromString(
reinterpret_cast<LPCWSTR
>(
value.utf16()), &propValue))) {
286 if (SUCCEEDED(PSCoerceToCanonicalValue(
key, &propValue)))
287 content->SetValue(
key, propValue);
288 PropVariantClear(&propValue);
294 PROPVARIANT propValue = {};
295 if (SUCCEEDED(InitPropVariantFromUInt32(ULONG(
value), &propValue))) {
296 if (SUCCEEDED(PSCoerceToCanonicalValue(
key, &propValue)))
297 content->SetValue(
key, propValue);
298 PropVariantClear(&propValue);
304 PROPVARIANT propValue = {};
305 if (SUCCEEDED(InitPropVariantFromUInt64(ULONGLONG(
value), &propValue))) {
306 if (SUCCEEDED(PSCoerceToCanonicalValue(
key, &propValue)))
307 content->SetValue(
key, propValue);
308 PropVariantClear(&propValue);
314 PROPVARIANT propValue = {};
315 if (SUCCEEDED(InitPropVariantFromFileTime(ft, &propValue))) {
316 if (SUCCEEDED(PSCoerceToCanonicalValue(
key, &propValue)))
317 content->SetValue(
key, propValue);
318 PropVariantClear(&propValue);
326 for (
const auto &
key : metaData.
keys()) {
383 ULARGE_INTEGER
t = {};
384 t.QuadPart = ULONGLONG(
value.toDateTime().toUTC().toMSecsSinceEpoch() * 10000
385 + 116444736000000000LL);
388 ft.dwHighDateTime =
t.HighPart;
389 ft.dwLowDateTime =
t.LowPart;
\inmodule QtCore\reentrant
\inmodule QtCore \reentrant
static QImage fromData(QByteArrayView data, const char *format=nullptr)
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromUtf16(const char16_t *, qsizetype size=-1)
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
\inmodule QtCore \reentrant
uint toUInt(bool *ok=nullptr) const
Returns the variant as an unsigned int if the variant has userType() \l QMetaType::UInt,...
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLsizei const GLfloat * v
[13]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
QLatin1StringView QLatin1String
#define QStringLiteral(str)
unsigned long long quint64
ReturnedValue read(const char *data)