3 * Copyright 2014 Austin English
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
35 #include "wine/debug.h"
36 #include "wine/unicode.h"
38 WINE_DEFAULT_DEBUG_CHANNEL(mfplat
);
40 static const WCHAR transform_keyW
[] = {'M','e','d','i','a','F','o','u','n','d','a','t','i','o','n','\\',
41 'T','r','a','n','s','f','o','r','m','s',0};
42 static const WCHAR categories_keyW
[] = {'M','e','d','i','a','F','o','u','n','d','a','t','i','o','n','\\',
43 'T','r','a','n','s','f','o','r','m','s','\\',
44 'C','a','t','e','g','o','r','i','e','s',0};
45 static const WCHAR inputtypesW
[] = {'I','n','p','u','t','T','y','p','e','s',0};
46 static const WCHAR outputtypesW
[] = {'O','u','t','p','u','t','T','y','p','e','s',0};
47 static const WCHAR szGUIDFmt
[] =
49 '%','0','8','x','-','%','0','4','x','-','%','0','4','x','-','%','0',
50 '2','x','%','0','2','x','-','%','0','2','x','%','0','2','x','%','0','2',
51 'x','%','0','2','x','%','0','2','x','%','0','2','x',0
54 static const BYTE guid_conv_table
[256] =
56 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 */
57 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */
58 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
59 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 0, /* 0x30 */
60 0, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
61 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
62 0, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf /* 0x60 */
65 static WCHAR
* GUIDToString(WCHAR
*str
, REFGUID guid
)
67 sprintfW(str
, szGUIDFmt
, guid
->Data1
, guid
->Data2
,
68 guid
->Data3
, guid
->Data4
[0], guid
->Data4
[1],
69 guid
->Data4
[2], guid
->Data4
[3], guid
->Data4
[4],
70 guid
->Data4
[5], guid
->Data4
[6], guid
->Data4
[7]);
75 static inline BOOL
is_valid_hex(WCHAR c
)
77 if (!(((c
>= '0') && (c
<= '9')) ||
78 ((c
>= 'a') && (c
<= 'f')) ||
79 ((c
>= 'A') && (c
<= 'F'))))
84 static BOOL
GUIDFromString(LPCWSTR s
, GUID
*id
)
88 /* in form XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX */
91 for (i
= 0; i
< 8; i
++)
93 if (!is_valid_hex(s
[i
])) return FALSE
;
94 id
->Data1
= (id
->Data1
<< 4) | guid_conv_table
[s
[i
]];
96 if (s
[8]!='-') return FALSE
;
99 for (i
= 9; i
< 13; i
++)
101 if (!is_valid_hex(s
[i
])) return FALSE
;
102 id
->Data2
= (id
->Data2
<< 4) | guid_conv_table
[s
[i
]];
104 if (s
[13]!='-') return FALSE
;
107 for (i
= 14; i
< 18; i
++)
109 if (!is_valid_hex(s
[i
])) return FALSE
;
110 id
->Data3
= (id
->Data3
<< 4) | guid_conv_table
[s
[i
]];
112 if (s
[18]!='-') return FALSE
;
114 for (i
= 19; i
< 36; i
+=2)
118 if (s
[i
]!='-') return FALSE
;
121 if (!is_valid_hex(s
[i
]) || !is_valid_hex(s
[i
+1])) return FALSE
;
122 id
->Data4
[(i
-19)/2] = guid_conv_table
[s
[i
]] << 4 | guid_conv_table
[s
[i
+1]];
125 if (!s
[37]) return TRUE
;
129 BOOL WINAPI
DllMain(HINSTANCE instance
, DWORD reason
, LPVOID reserved
)
133 case DLL_WINE_PREATTACH
:
134 return FALSE
; /* prefer native version */
135 case DLL_PROCESS_ATTACH
:
136 DisableThreadLibraryCalls(instance
);
143 static HRESULT
register_transform(CLSID
*clsid
, WCHAR
*name
,
144 UINT32 cinput
, MFT_REGISTER_TYPE_INFO
*input_types
,
145 UINT32 coutput
, MFT_REGISTER_TYPE_INFO
*output_types
)
147 static const WCHAR reg_format
[] = {'%','s','\\','%','s',0};
153 GUIDToString(buffer
, clsid
);
154 sprintfW(str
, reg_format
, transform_keyW
, buffer
);
156 if (RegCreateKeyW(HKEY_CLASSES_ROOT
, str
, &hclsid
))
159 size
= (strlenW(name
) + 1) * sizeof(WCHAR
);
160 if (RegSetValueExW(hclsid
, NULL
, 0, REG_SZ
, (BYTE
*)name
, size
))
163 if (cinput
&& input_types
)
165 size
= cinput
* sizeof(MFT_REGISTER_TYPE_INFO
);
166 if (RegSetValueExW(hclsid
, inputtypesW
, 0, REG_BINARY
, (BYTE
*)input_types
, size
))
170 if (coutput
&& output_types
)
172 size
= coutput
* sizeof(MFT_REGISTER_TYPE_INFO
);
173 if (RegSetValueExW(hclsid
, outputtypesW
, 0, REG_BINARY
, (BYTE
*)output_types
, size
))
185 static HRESULT
register_category(CLSID
*clsid
, GUID
*category
)
187 static const WCHAR reg_format
[] = {'%','s','\\','%','s','\\','%','s',0};
189 WCHAR guid1
[64], guid2
[64];
192 GUIDToString(guid1
, category
);
193 GUIDToString(guid2
, clsid
);
195 sprintfW(str
, reg_format
, categories_keyW
, guid1
, guid2
);
197 if (RegCreateKeyW(HKEY_CLASSES_ROOT
, str
, &htmp1
))
204 /***********************************************************************
205 * MFTRegister (mfplat.@)
207 HRESULT WINAPI
MFTRegister(CLSID clsid
, GUID category
, LPWSTR name
, UINT32 flags
, UINT32 cinput
,
208 MFT_REGISTER_TYPE_INFO
*input_types
, UINT32 coutput
,
209 MFT_REGISTER_TYPE_INFO
*output_types
, IMFAttributes
*attributes
)
213 TRACE("(%s, %s, %s, %x, %u, %p, %u, %p, %p)\n", debugstr_guid(&clsid
), debugstr_guid(&category
),
214 debugstr_w(name
), flags
, cinput
, input_types
,
215 coutput
, output_types
, attributes
);
218 FIXME("attributes not yet supported.\n");
221 FIXME("flags not yet supported.\n");
223 hr
= register_transform(&clsid
, name
, cinput
, input_types
, coutput
, output_types
);
225 ERR("Failed to write register transform\n");
228 hr
= register_category(&clsid
, &category
);
233 static BOOL
match_type(const WCHAR
*clsid_str
, const WCHAR
*type_str
, MFT_REGISTER_TYPE_INFO
*type
)
235 HKEY htransform
, hfilter
;
236 DWORD reg_type
, size
;
238 MFT_REGISTER_TYPE_INFO
*info
= NULL
;
241 if (RegOpenKeyW(HKEY_CLASSES_ROOT
, transform_keyW
, &htransform
))
244 if (RegOpenKeyW(htransform
, clsid_str
, &hfilter
))
246 RegCloseKey(htransform
);
250 if (RegQueryValueExW(hfilter
, type_str
, NULL
, ®_type
, NULL
, &size
) != ERROR_SUCCESS
)
253 if (reg_type
!= REG_BINARY
)
256 if (!size
|| size
% (sizeof(MFT_REGISTER_TYPE_INFO
)) != 0)
259 info
= HeapAlloc(GetProcessHeap(), 0, size
);
263 if (RegQueryValueExW(hfilter
, type_str
, NULL
, ®_type
, (LPBYTE
)info
, &size
) != ERROR_SUCCESS
)
266 for (i
= 0; i
< size
/ sizeof(MFT_REGISTER_TYPE_INFO
); i
++)
268 if (IsEqualGUID(&info
[i
].guidMajorType
, &type
->guidMajorType
) &&
269 IsEqualGUID(&info
[i
].guidSubtype
, &type
->guidSubtype
))
277 HeapFree(GetProcessHeap(), 0, info
);
278 RegCloseKey(hfilter
);
279 RegCloseKey(htransform
);
283 /***********************************************************************
286 HRESULT WINAPI
MFTEnum(GUID category
, UINT32 flags
, MFT_REGISTER_TYPE_INFO
*input_type
,
287 MFT_REGISTER_TYPE_INFO
*output_type
, IMFAttributes
*attributes
,
288 CLSID
**pclsids
, UINT32
*pcount
)
290 WCHAR buffer
[64], clsid_str
[MAX_PATH
] = {0};
291 HKEY hcategory
, hlist
;
293 DWORD size
= MAX_PATH
;
294 CLSID
*clsids
= NULL
;
298 TRACE("(%s, %x, %p, %p, %p, %p, %p)\n", debugstr_guid(&category
), flags
, input_type
,
299 output_type
, attributes
, pclsids
, pcount
);
301 if (!pclsids
|| !pcount
)
304 if (RegOpenKeyW(HKEY_CLASSES_ROOT
, categories_keyW
, &hcategory
))
307 GUIDToString(buffer
, &category
);
309 ret
= RegOpenKeyW(hcategory
, buffer
, &hlist
);
310 RegCloseKey(hcategory
);
311 if (ret
) return E_FAIL
;
313 while (RegEnumKeyExW(hlist
, index
, clsid_str
, &size
, NULL
, NULL
, NULL
, NULL
) == ERROR_SUCCESS
)
318 if (!GUIDFromString(clsid_str
, &clsid
))
321 if (output_type
&& !match_type(clsid_str
, outputtypesW
, output_type
))
324 if (input_type
&& !match_type(clsid_str
, inputtypesW
, input_type
))
327 tmp
= CoTaskMemRealloc(clsids
, (count
+ 1) * sizeof(GUID
));
330 CoTaskMemFree(clsids
);
332 return E_OUTOFMEMORY
;
336 clsids
[count
++] = clsid
;
350 /***********************************************************************
351 * MFTEnumEx (mfplat.@)
353 HRESULT WINAPI
MFTEnumEx(GUID category
, UINT32 flags
, const MFT_REGISTER_TYPE_INFO
*input_type
,
354 const MFT_REGISTER_TYPE_INFO
*output_type
, IMFActivate
***activate
,
357 FIXME("(%s, %x, %p, %p, %p, %p): stub\n", debugstr_guid(&category
), flags
, input_type
,
358 output_type
, activate
, pcount
);
364 /***********************************************************************
365 * MFTUnregister (mfplat.@)
367 HRESULT WINAPI
MFTUnregister(CLSID clsid
)
369 WCHAR buffer
[64], category
[MAX_PATH
];
370 HKEY htransform
, hcategory
, htmp
;
371 DWORD size
= MAX_PATH
;
374 TRACE("(%s)\n", debugstr_guid(&clsid
));
376 GUIDToString(buffer
, &clsid
);
378 if (!RegOpenKeyW(HKEY_CLASSES_ROOT
, transform_keyW
, &htransform
))
380 RegDeleteKeyW(htransform
, buffer
);
381 RegCloseKey(htransform
);
384 if (!RegOpenKeyW(HKEY_CLASSES_ROOT
, categories_keyW
, &hcategory
))
386 while (RegEnumKeyExW(hcategory
, index
, category
, &size
, NULL
, NULL
, NULL
, NULL
) == ERROR_SUCCESS
)
388 if (!RegOpenKeyW(hcategory
, category
, &htmp
))
390 RegDeleteKeyW(htmp
, buffer
);
396 RegCloseKey(hcategory
);
402 /***********************************************************************
403 * MFStartup (mfplat.@)
405 HRESULT WINAPI
MFStartup(ULONG version
, DWORD flags
)
407 FIXME("(%u, %u): stub\n", version
, flags
);
408 return MF_E_BAD_STARTUP_VERSION
;
411 /***********************************************************************
412 * MFShutdown (mfplat.@)
414 HRESULT WINAPI
MFShutdown(void)
420 static HRESULT WINAPI
MFPluginControl_QueryInterface(IMFPluginControl
*iface
, REFIID riid
, void **ppv
)
422 if(IsEqualGUID(riid
, &IID_IUnknown
)) {
423 TRACE("(IID_IUnknown %p)\n", ppv
);
425 }else if(IsEqualGUID(riid
, &IID_IMFPluginControl
)) {
426 TRACE("(IID_IMFPluginControl %p)\n", ppv
);
429 FIXME("(%s %p)\n", debugstr_guid(riid
), ppv
);
431 return E_NOINTERFACE
;
434 IUnknown_AddRef((IUnknown
*)*ppv
);
438 static ULONG WINAPI
MFPluginControl_AddRef(IMFPluginControl
*iface
)
444 static ULONG WINAPI
MFPluginControl_Release(IMFPluginControl
*iface
)
450 static HRESULT WINAPI
MFPluginControl_GetPreferredClsid(IMFPluginControl
*iface
, DWORD plugin_type
,
451 const WCHAR
*selector
, CLSID
*clsid
)
453 FIXME("(%d %s %p)\n", plugin_type
, debugstr_w(selector
), clsid
);
457 static HRESULT WINAPI
MFPluginControl_GetPreferredClsidByIndex(IMFPluginControl
*iface
, DWORD plugin_type
,
458 DWORD index
, WCHAR
**selector
, CLSID
*clsid
)
460 FIXME("(%d %d %p %p)\n", plugin_type
, index
, selector
, clsid
);
464 static HRESULT WINAPI
MFPluginControl_SetPreferredClsid(IMFPluginControl
*iface
, DWORD plugin_type
,
465 const WCHAR
*selector
, const CLSID
*clsid
)
467 FIXME("(%d %s %s)\n", plugin_type
, debugstr_w(selector
), debugstr_guid(clsid
));
471 static HRESULT WINAPI
MFPluginControl_IsDisabled(IMFPluginControl
*iface
, DWORD plugin_type
, REFCLSID clsid
)
473 FIXME("(%d %s)\n", plugin_type
, debugstr_guid(clsid
));
477 static HRESULT WINAPI
MFPluginControl_GetDisabledByIndex(IMFPluginControl
*iface
, DWORD plugin_type
, DWORD index
, CLSID
*clsid
)
479 FIXME("(%d %d %p)\n", plugin_type
, index
, clsid
);
483 static HRESULT WINAPI
MFPluginControl_SetDisabled(IMFPluginControl
*iface
, DWORD plugin_type
, REFCLSID clsid
, BOOL disabled
)
485 FIXME("(%d %s %x)\n", plugin_type
, debugstr_guid(clsid
), disabled
);
489 static const IMFPluginControlVtbl MFPluginControlVtbl
= {
490 MFPluginControl_QueryInterface
,
491 MFPluginControl_AddRef
,
492 MFPluginControl_Release
,
493 MFPluginControl_GetPreferredClsid
,
494 MFPluginControl_GetPreferredClsidByIndex
,
495 MFPluginControl_SetPreferredClsid
,
496 MFPluginControl_IsDisabled
,
497 MFPluginControl_GetDisabledByIndex
,
498 MFPluginControl_SetDisabled
501 static IMFPluginControl plugin_control
= { &MFPluginControlVtbl
};
503 /***********************************************************************
504 * MFGetPluginControl (mfplat.@)
506 HRESULT WINAPI
MFGetPluginControl(IMFPluginControl
**ret
)
508 TRACE("(%p)\n", ret
);
510 *ret
= &plugin_control
;
514 typedef struct _mfattributes
516 IMFAttributes IMFAttributes_iface
;
520 static inline mfattributes
*impl_from_IMFAttributes(IMFAttributes
*iface
)
522 return CONTAINING_RECORD(iface
, mfattributes
, IMFAttributes_iface
);
525 static HRESULT WINAPI
mfattributes_QueryInterface(IMFAttributes
*iface
, REFIID riid
, void **out
)
527 mfattributes
*This
= impl_from_IMFAttributes(iface
);
529 TRACE("(%p)->(%s %p)\n", This
, debugstr_guid(riid
), out
);
531 if(IsEqualGUID(riid
, &IID_IUnknown
) ||
532 IsEqualGUID(riid
, &IID_IMFAttributes
))
534 *out
= &This
->IMFAttributes_iface
;
538 FIXME("(%s, %p)\n", debugstr_guid(riid
), out
);
540 return E_NOINTERFACE
;
543 IUnknown_AddRef((IUnknown
*)*out
);
547 static ULONG WINAPI
mfattributes_AddRef(IMFAttributes
*iface
)
549 mfattributes
*This
= impl_from_IMFAttributes(iface
);
550 ULONG ref
= InterlockedIncrement(&This
->ref
);
552 TRACE("(%p) ref=%u\n", This
, ref
);
557 static ULONG WINAPI
mfattributes_Release(IMFAttributes
*iface
)
559 mfattributes
*This
= impl_from_IMFAttributes(iface
);
560 ULONG ref
= InterlockedDecrement(&This
->ref
);
562 TRACE("(%p) ref=%u\n", This
, ref
);
566 HeapFree(GetProcessHeap(), 0, This
);
572 static HRESULT WINAPI
mfattributes_GetItem(IMFAttributes
*iface
, REFGUID key
, PROPVARIANT
*value
)
574 mfattributes
*This
= impl_from_IMFAttributes(iface
);
576 FIXME("%p, %s, %p\n", This
, debugstr_guid(key
), value
);
581 static HRESULT WINAPI
mfattributes_GetItemType(IMFAttributes
*iface
, REFGUID key
, MF_ATTRIBUTE_TYPE
*type
)
583 mfattributes
*This
= impl_from_IMFAttributes(iface
);
585 FIXME("%p, %s, %p\n", This
, debugstr_guid(key
), type
);
590 static HRESULT WINAPI
mfattributes_CompareItem(IMFAttributes
*iface
, REFGUID key
, REFPROPVARIANT value
, BOOL
*result
)
592 mfattributes
*This
= impl_from_IMFAttributes(iface
);
594 FIXME("%p, %s, %p, %p\n", This
, debugstr_guid(key
), value
, result
);
599 static HRESULT WINAPI
mfattributes_Compare(IMFAttributes
*iface
, IMFAttributes
*theirs
, MF_ATTRIBUTES_MATCH_TYPE type
,
602 mfattributes
*This
= impl_from_IMFAttributes(iface
);
604 FIXME("%p, %p, %d, %p\n", This
, theirs
, type
, result
);
609 static HRESULT WINAPI
mfattributes_GetUINT32(IMFAttributes
*iface
, REFGUID key
, UINT32
*value
)
611 mfattributes
*This
= impl_from_IMFAttributes(iface
);
613 FIXME("%p, %s, %p\n", This
, debugstr_guid(key
), value
);
618 static HRESULT WINAPI
mfattributes_GetUINT64(IMFAttributes
*iface
, REFGUID key
, UINT64
*value
)
620 mfattributes
*This
= impl_from_IMFAttributes(iface
);
622 FIXME("%p, %s, %p\n", This
, debugstr_guid(key
), value
);
627 static HRESULT WINAPI
mfattributes_GetDouble(IMFAttributes
*iface
, REFGUID key
, double *value
)
629 mfattributes
*This
= impl_from_IMFAttributes(iface
);
631 FIXME("%p, %s, %p\n", This
, debugstr_guid(key
), value
);
636 static HRESULT WINAPI
mfattributes_GetGUID(IMFAttributes
*iface
, REFGUID key
, GUID
*value
)
638 mfattributes
*This
= impl_from_IMFAttributes(iface
);
640 FIXME("%p, %s, %p\n", This
, debugstr_guid(key
), value
);
645 static HRESULT WINAPI
mfattributes_GetStringLength(IMFAttributes
*iface
, REFGUID key
, UINT32
*length
)
647 mfattributes
*This
= impl_from_IMFAttributes(iface
);
649 FIXME("%p, %s, %p\n", This
, debugstr_guid(key
), length
);
654 static HRESULT WINAPI
mfattributes_GetString(IMFAttributes
*iface
, REFGUID key
, WCHAR
*value
,
655 UINT32 size
, UINT32
*length
)
657 mfattributes
*This
= impl_from_IMFAttributes(iface
);
659 FIXME("%p, %s, %p, %d, %p\n", This
, debugstr_guid(key
), value
, size
, length
);
664 static HRESULT WINAPI
mfattributes_GetAllocatedString(IMFAttributes
*iface
, REFGUID key
,
665 WCHAR
**value
, UINT32
*length
)
667 mfattributes
*This
= impl_from_IMFAttributes(iface
);
669 FIXME("%p, %s, %p, %p\n", This
, debugstr_guid(key
), value
, length
);
674 static HRESULT WINAPI
mfattributes_GetBlobSize(IMFAttributes
*iface
, REFGUID key
, UINT32
*size
)
676 mfattributes
*This
= impl_from_IMFAttributes(iface
);
678 FIXME("%p, %s, %p\n", This
, debugstr_guid(key
), size
);
683 static HRESULT WINAPI
mfattributes_GetBlob(IMFAttributes
*iface
, REFGUID key
, UINT8
*buf
,
684 UINT32 bufsize
, UINT32
*blobsize
)
686 mfattributes
*This
= impl_from_IMFAttributes(iface
);
688 FIXME("%p, %s, %p, %d, %p\n", This
, debugstr_guid(key
), buf
, bufsize
, blobsize
);
693 static HRESULT WINAPI
mfattributes_GetAllocatedBlob(IMFAttributes
*iface
, REFGUID key
, UINT8
**buf
, UINT32
*size
)
695 mfattributes
*This
= impl_from_IMFAttributes(iface
);
697 FIXME("%p, %s, %p, %p\n", This
, debugstr_guid(key
), buf
, size
);
702 static HRESULT WINAPI
mfattributes_GetUnknown(IMFAttributes
*iface
, REFGUID key
, REFIID riid
, void **ppv
)
704 mfattributes
*This
= impl_from_IMFAttributes(iface
);
706 FIXME("%p, %s, %s, %p\n", This
, debugstr_guid(key
), debugstr_guid(riid
), ppv
);
711 static HRESULT WINAPI
mfattributes_SetItem(IMFAttributes
*iface
, REFGUID key
, REFPROPVARIANT Value
)
713 mfattributes
*This
= impl_from_IMFAttributes(iface
);
715 FIXME("%p, %s, %p\n", This
, debugstr_guid(key
), Value
);
720 static HRESULT WINAPI
mfattributes_DeleteItem(IMFAttributes
*iface
, REFGUID key
)
722 mfattributes
*This
= impl_from_IMFAttributes(iface
);
724 FIXME("%p, %s\n", This
, debugstr_guid(key
));
729 static HRESULT WINAPI
mfattributes_DeleteAllItems(IMFAttributes
*iface
)
731 mfattributes
*This
= impl_from_IMFAttributes(iface
);
738 static HRESULT WINAPI
mfattributes_SetUINT32(IMFAttributes
*iface
, REFGUID key
, UINT32 value
)
740 mfattributes
*This
= impl_from_IMFAttributes(iface
);
742 FIXME("%p, %s, %d\n", This
, debugstr_guid(key
), value
);
747 static HRESULT WINAPI
mfattributes_SetUINT64(IMFAttributes
*iface
, REFGUID key
, UINT64 value
)
749 mfattributes
*This
= impl_from_IMFAttributes(iface
);
751 FIXME("%p, %s, %s\n", This
, debugstr_guid(key
), wine_dbgstr_longlong(value
));
756 static HRESULT WINAPI
mfattributes_SetDouble(IMFAttributes
*iface
, REFGUID key
, double value
)
758 mfattributes
*This
= impl_from_IMFAttributes(iface
);
760 FIXME("%p, %s, %f\n", This
, debugstr_guid(key
), value
);
765 static HRESULT WINAPI
mfattributes_SetGUID(IMFAttributes
*iface
, REFGUID key
, REFGUID value
)
767 mfattributes
*This
= impl_from_IMFAttributes(iface
);
769 FIXME("%p, %s, %s\n", This
, debugstr_guid(key
), debugstr_guid(value
));
774 static HRESULT WINAPI
mfattributes_SetString(IMFAttributes
*iface
, REFGUID key
, const WCHAR
*value
)
776 mfattributes
*This
= impl_from_IMFAttributes(iface
);
778 FIXME("%p, %s, %s\n", This
, debugstr_guid(key
), debugstr_w(value
));
783 static HRESULT WINAPI
mfattributes_SetBlob(IMFAttributes
*iface
, REFGUID key
, const UINT8
*buf
, UINT32 size
)
785 mfattributes
*This
= impl_from_IMFAttributes(iface
);
787 FIXME("%p, %s, %p, %d\n", This
, debugstr_guid(key
), buf
, size
);
792 static HRESULT WINAPI
mfattributes_SetUnknown(IMFAttributes
*iface
, REFGUID key
, IUnknown
*unknown
)
794 mfattributes
*This
= impl_from_IMFAttributes(iface
);
796 FIXME("%p, %s, %p\n", This
, debugstr_guid(key
), unknown
);
801 static HRESULT WINAPI
mfattributes_LockStore(IMFAttributes
*iface
)
803 mfattributes
*This
= impl_from_IMFAttributes(iface
);
810 static HRESULT WINAPI
mfattributes_UnlockStore(IMFAttributes
*iface
)
812 mfattributes
*This
= impl_from_IMFAttributes(iface
);
819 static HRESULT WINAPI
mfattributes_GetCount(IMFAttributes
*iface
, UINT32
*items
)
821 mfattributes
*This
= impl_from_IMFAttributes(iface
);
823 FIXME("%p, %p\n", This
, items
);
831 static HRESULT WINAPI
mfattributes_GetItemByIndex(IMFAttributes
*iface
, UINT32 index
, GUID
*key
, PROPVARIANT
*value
)
833 mfattributes
*This
= impl_from_IMFAttributes(iface
);
835 FIXME("%p, %d, %p, %p\n", This
, index
, key
, value
);
840 static HRESULT WINAPI
mfattributes_CopyAllItems(IMFAttributes
*iface
, IMFAttributes
*dest
)
842 mfattributes
*This
= impl_from_IMFAttributes(iface
);
844 FIXME("%p, %p\n", This
, dest
);
849 static const IMFAttributesVtbl mfattributes_vtbl
=
851 mfattributes_QueryInterface
,
853 mfattributes_Release
,
854 mfattributes_GetItem
,
855 mfattributes_GetItemType
,
856 mfattributes_CompareItem
,
857 mfattributes_Compare
,
858 mfattributes_GetUINT32
,
859 mfattributes_GetUINT64
,
860 mfattributes_GetDouble
,
861 mfattributes_GetGUID
,
862 mfattributes_GetStringLength
,
863 mfattributes_GetString
,
864 mfattributes_GetAllocatedString
,
865 mfattributes_GetBlobSize
,
866 mfattributes_GetBlob
,
867 mfattributes_GetAllocatedBlob
,
868 mfattributes_GetUnknown
,
869 mfattributes_SetItem
,
870 mfattributes_DeleteItem
,
871 mfattributes_DeleteAllItems
,
872 mfattributes_SetUINT32
,
873 mfattributes_SetUINT64
,
874 mfattributes_SetDouble
,
875 mfattributes_SetGUID
,
876 mfattributes_SetString
,
877 mfattributes_SetBlob
,
878 mfattributes_SetUnknown
,
879 mfattributes_LockStore
,
880 mfattributes_UnlockStore
,
881 mfattributes_GetCount
,
882 mfattributes_GetItemByIndex
,
883 mfattributes_CopyAllItems
886 /***********************************************************************
887 * MFCreateAttributes (mfplat.@)
889 HRESULT WINAPI
MFCreateAttributes(IMFAttributes
**attributes
, UINT32 size
)
891 mfattributes
*object
;
893 TRACE("%p, %d\n", attributes
, size
);
895 object
= HeapAlloc( GetProcessHeap(), 0, sizeof(*object
) );
897 return E_OUTOFMEMORY
;
900 object
->IMFAttributes_iface
.lpVtbl
= &mfattributes_vtbl
;
902 *attributes
= &object
->IMFAttributes_iface
;
906 typedef struct _mfsourceresolver
908 IMFSourceResolver IMFSourceResolver_iface
;
912 static inline mfsourceresolver
*impl_from_IMFSourceResolver(IMFSourceResolver
*iface
)
914 return CONTAINING_RECORD(iface
, mfsourceresolver
, IMFSourceResolver_iface
);
917 static HRESULT WINAPI
mfsourceresolver_QueryInterface(IMFSourceResolver
*iface
, REFIID riid
, void **obj
)
919 mfsourceresolver
*This
= impl_from_IMFSourceResolver(iface
);
921 TRACE("(%p->(%s, %p)\n", This
, debugstr_guid(riid
), obj
);
923 if (IsEqualIID(riid
, &IID_IMFSourceResolver
) ||
924 IsEqualIID(riid
, &IID_IUnknown
))
926 *obj
= &This
->IMFSourceResolver_iface
;
931 FIXME("unsupported interface %s\n", debugstr_guid(riid
));
932 return E_NOINTERFACE
;
935 IUnknown_AddRef((IUnknown
*)*obj
);
939 static ULONG WINAPI
mfsourceresolver_AddRef(IMFSourceResolver
*iface
)
941 mfsourceresolver
*This
= impl_from_IMFSourceResolver(iface
);
942 ULONG ref
= InterlockedIncrement(&This
->ref
);
944 TRACE("(%p)->(%u)\n", This
, ref
);
949 static ULONG WINAPI
mfsourceresolver_Release(IMFSourceResolver
*iface
)
951 mfsourceresolver
*This
= impl_from_IMFSourceResolver(iface
);
952 ULONG ref
= InterlockedDecrement(&This
->ref
);
954 TRACE("(%p)->(%u)\n", This
, ref
);
957 HeapFree(GetProcessHeap(), 0, This
);
962 static HRESULT WINAPI
mfsourceresolver_CreateObjectFromURL(IMFSourceResolver
*iface
, const WCHAR
*url
,
963 DWORD flags
, IPropertyStore
*props
, MF_OBJECT_TYPE
*obj_type
, IUnknown
**object
)
965 mfsourceresolver
*This
= impl_from_IMFSourceResolver(iface
);
967 FIXME("(%p)->(%s, %#x, %p, %p, %p): stub\n", This
, debugstr_w(url
), flags
, props
, obj_type
, object
);
972 static HRESULT WINAPI
mfsourceresolver_CreateObjectFromByteStream(IMFSourceResolver
*iface
, IMFByteStream
*stream
,
973 const WCHAR
*url
, DWORD flags
, IPropertyStore
*props
, MF_OBJECT_TYPE
*obj_type
, IUnknown
**object
)
975 mfsourceresolver
*This
= impl_from_IMFSourceResolver(iface
);
977 FIXME("(%p)->(%p, %s, %#x, %p, %p, %p): stub\n", This
, stream
, debugstr_w(url
), flags
, props
, obj_type
, object
);
982 static HRESULT WINAPI
mfsourceresolver_BeginCreateObjectFromURL(IMFSourceResolver
*iface
, const WCHAR
*url
,
983 DWORD flags
, IPropertyStore
*props
, IUnknown
**cancel_cookie
, IMFAsyncCallback
*callback
, IUnknown
*unk_state
)
985 mfsourceresolver
*This
= impl_from_IMFSourceResolver(iface
);
987 FIXME("(%p)->(%s, %#x, %p, %p, %p, %p): stub\n", This
, debugstr_w(url
), flags
, props
, cancel_cookie
,
988 callback
, unk_state
);
993 static HRESULT WINAPI
mfsourceresolver_EndCreateObjectFromURL(IMFSourceResolver
*iface
, IMFAsyncResult
*result
,
994 MF_OBJECT_TYPE
*obj_type
, IUnknown
**object
)
996 mfsourceresolver
*This
= impl_from_IMFSourceResolver(iface
);
998 FIXME("(%p)->(%p, %p, %p): stub\n", This
, result
, obj_type
, object
);
1003 static HRESULT WINAPI
mfsourceresolver_BeginCreateObjectFromByteStream(IMFSourceResolver
*iface
, IMFByteStream
*stream
,
1004 const WCHAR
*url
, DWORD flags
, IPropertyStore
*props
, IUnknown
**cancel_cookie
, IMFAsyncCallback
*callback
,
1005 IUnknown
*unk_state
)
1007 mfsourceresolver
*This
= impl_from_IMFSourceResolver(iface
);
1009 FIXME("(%p)->(%p, %s, %#x, %p, %p, %p, %p): stub\n", This
, stream
, debugstr_w(url
), flags
, props
, cancel_cookie
,
1010 callback
, unk_state
);
1015 static HRESULT WINAPI
mfsourceresolver_EndCreateObjectFromByteStream(IMFSourceResolver
*iface
, IMFAsyncResult
*result
,
1016 MF_OBJECT_TYPE
*obj_type
, IUnknown
**object
)
1018 mfsourceresolver
*This
= impl_from_IMFSourceResolver(iface
);
1020 FIXME("(%p)->(%p, %p, %p): stub\n", This
, result
, obj_type
, object
);
1025 static HRESULT WINAPI
mfsourceresolver_CancelObjectCreation(IMFSourceResolver
*iface
, IUnknown
*cancel_cookie
)
1027 mfsourceresolver
*This
= impl_from_IMFSourceResolver(iface
);
1029 FIXME("(%p)->(%p): stub\n", This
, cancel_cookie
);
1034 static const IMFSourceResolverVtbl mfsourceresolvervtbl
=
1036 mfsourceresolver_QueryInterface
,
1037 mfsourceresolver_AddRef
,
1038 mfsourceresolver_Release
,
1039 mfsourceresolver_CreateObjectFromURL
,
1040 mfsourceresolver_CreateObjectFromByteStream
,
1041 mfsourceresolver_BeginCreateObjectFromURL
,
1042 mfsourceresolver_EndCreateObjectFromURL
,
1043 mfsourceresolver_BeginCreateObjectFromByteStream
,
1044 mfsourceresolver_EndCreateObjectFromByteStream
,
1045 mfsourceresolver_CancelObjectCreation
,
1048 /***********************************************************************
1049 * MFCreateSourceResolver (mfplat.@)
1051 HRESULT WINAPI
MFCreateSourceResolver(IMFSourceResolver
**resolver
)
1053 mfsourceresolver
*object
;
1055 TRACE("%p\n", resolver
);
1060 object
= HeapAlloc( GetProcessHeap(), 0, sizeof(*object
) );
1062 return E_OUTOFMEMORY
;
1064 object
->IMFSourceResolver_iface
.lpVtbl
= &mfsourceresolvervtbl
;
1067 *resolver
= &object
->IMFSourceResolver_iface
;
1071 typedef struct _mfmediatype
1073 IMFMediaType IMFMediaType_iface
;
1077 static inline mfmediatype
*impl_from_IMFMediaType(IMFMediaType
*iface
)
1079 return CONTAINING_RECORD(iface
, mfmediatype
, IMFMediaType_iface
);
1082 static HRESULT WINAPI
mediatype_QueryInterface(IMFMediaType
*iface
, REFIID riid
, void **object
)
1084 mfmediatype
*This
= impl_from_IMFMediaType(iface
);
1086 TRACE("(%p)->(%s %p)\n", This
, debugstr_guid(riid
), object
);
1088 if(IsEqualGUID(riid
, &IID_IUnknown
) ||
1089 IsEqualGUID(riid
, &IID_IMFAttributes
) ||
1090 IsEqualGUID(riid
, &IID_IMFMediaType
))
1092 *object
= &This
->IMFMediaType_iface
;
1096 FIXME("(%s, %p)\n", debugstr_guid(riid
), object
);
1098 return E_NOINTERFACE
;
1101 IUnknown_AddRef((IUnknown
*)*object
);
1105 static ULONG WINAPI
mediatype_AddRef(IMFMediaType
*iface
)
1107 mfmediatype
*This
= impl_from_IMFMediaType(iface
);
1108 ULONG ref
= InterlockedIncrement(&This
->ref
);
1110 TRACE("(%p) ref=%u\n", This
, ref
);
1115 static ULONG WINAPI
mediatype_Release(IMFMediaType
*iface
)
1117 mfmediatype
*This
= impl_from_IMFMediaType(iface
);
1118 ULONG ref
= InterlockedDecrement(&This
->ref
);
1120 TRACE("(%p) ref=%u\n", This
, ref
);
1124 HeapFree(GetProcessHeap(), 0, This
);
1130 static HRESULT WINAPI
mediatype_GetItem(IMFMediaType
*iface
, REFGUID key
, PROPVARIANT
*value
)
1132 mfmediatype
*This
= impl_from_IMFMediaType(iface
);
1134 FIXME("%p, %s, %p\n", This
, debugstr_guid(key
), value
);
1139 static HRESULT WINAPI
mediatype_GetItemType(IMFMediaType
*iface
, REFGUID key
, MF_ATTRIBUTE_TYPE
*type
)
1141 mfmediatype
*This
= impl_from_IMFMediaType(iface
);
1143 FIXME("%p, %s, %p\n", This
, debugstr_guid(key
), type
);
1148 static HRESULT WINAPI
mediatype_CompareItem(IMFMediaType
*iface
, REFGUID key
, REFPROPVARIANT value
, BOOL
*result
)
1150 mfmediatype
*This
= impl_from_IMFMediaType(iface
);
1152 FIXME("%p, %s, %p, %p\n", This
, debugstr_guid(key
), value
, result
);
1157 static HRESULT WINAPI
mediatype_Compare(IMFMediaType
*iface
, IMFAttributes
*attrs
, MF_ATTRIBUTES_MATCH_TYPE type
,
1160 mfmediatype
*This
= impl_from_IMFMediaType(iface
);
1162 FIXME("%p, %p, %d, %p\n", This
, attrs
, type
, result
);
1167 static HRESULT WINAPI
mediatype_GetUINT32(IMFMediaType
*iface
, REFGUID key
, UINT32
*value
)
1169 mfmediatype
*This
= impl_from_IMFMediaType(iface
);
1171 FIXME("%p, %s, %p\n", This
, debugstr_guid(key
), value
);
1176 static HRESULT WINAPI
mediatype_GetUINT64(IMFMediaType
*iface
, REFGUID key
, UINT64
*value
)
1178 mfmediatype
*This
= impl_from_IMFMediaType(iface
);
1180 FIXME("%p, %s, %p\n", This
, debugstr_guid(key
), value
);
1185 static HRESULT WINAPI
mediatype_GetDouble(IMFMediaType
*iface
, REFGUID key
, double *value
)
1187 mfmediatype
*This
= impl_from_IMFMediaType(iface
);
1189 FIXME("%p, %s, %p\n", This
, debugstr_guid(key
), value
);
1194 static HRESULT WINAPI
mediatype_GetGUID(IMFMediaType
*iface
, REFGUID key
, GUID
*value
)
1196 mfmediatype
*This
= impl_from_IMFMediaType(iface
);
1198 FIXME("%p, %s, %p\n", This
, debugstr_guid(key
), value
);
1203 static HRESULT WINAPI
mediatype_GetStringLength(IMFMediaType
*iface
, REFGUID key
, UINT32
*length
)
1205 mfmediatype
*This
= impl_from_IMFMediaType(iface
);
1207 FIXME("%p, %s, %p\n", This
, debugstr_guid(key
), length
);
1212 static HRESULT WINAPI
mediatype_GetString(IMFMediaType
*iface
, REFGUID key
, WCHAR
*value
,
1213 UINT32 size
, UINT32
*length
)
1215 mfmediatype
*This
= impl_from_IMFMediaType(iface
);
1217 FIXME("%p, %s, %p, %d, %p\n", This
, debugstr_guid(key
), value
, size
, length
);
1222 static HRESULT WINAPI
mediatype_GetAllocatedString(IMFMediaType
*iface
, REFGUID key
,
1223 WCHAR
**value
, UINT32
*length
)
1225 mfmediatype
*This
= impl_from_IMFMediaType(iface
);
1227 FIXME("%p, %s, %p, %p\n", This
, debugstr_guid(key
), value
, length
);
1232 static HRESULT WINAPI
mediatype_GetBlobSize(IMFMediaType
*iface
, REFGUID key
, UINT32
*size
)
1234 mfmediatype
*This
= impl_from_IMFMediaType(iface
);
1236 FIXME("%p, %s, %p\n", This
, debugstr_guid(key
), size
);
1241 static HRESULT WINAPI
mediatype_GetBlob(IMFMediaType
*iface
, REFGUID key
, UINT8
*buf
,
1242 UINT32 bufsize
, UINT32
*blobsize
)
1244 mfmediatype
*This
= impl_from_IMFMediaType(iface
);
1246 FIXME("%p, %s, %p, %d, %p\n", This
, debugstr_guid(key
), buf
, bufsize
, blobsize
);
1251 static HRESULT WINAPI
mediatype_GetAllocatedBlob(IMFMediaType
*iface
, REFGUID key
, UINT8
**buf
, UINT32
*size
)
1253 mfmediatype
*This
= impl_from_IMFMediaType(iface
);
1255 FIXME("%p, %s, %p, %p\n", This
, debugstr_guid(key
), buf
, size
);
1260 static HRESULT WINAPI
mediatype_GetUnknown(IMFMediaType
*iface
, REFGUID key
, REFIID riid
, void **ppv
)
1262 mfmediatype
*This
= impl_from_IMFMediaType(iface
);
1264 FIXME("%p, %s, %s, %p\n", This
, debugstr_guid(key
), debugstr_guid(riid
), ppv
);
1269 static HRESULT WINAPI
mediatype_SetItem(IMFMediaType
*iface
, REFGUID key
, REFPROPVARIANT value
)
1271 mfmediatype
*This
= impl_from_IMFMediaType(iface
);
1273 FIXME("%p, %s, %p\n", This
, debugstr_guid(key
), value
);
1278 static HRESULT WINAPI
mediatype_DeleteItem(IMFMediaType
*iface
, REFGUID key
)
1280 mfmediatype
*This
= impl_from_IMFMediaType(iface
);
1282 FIXME("%p, %s\n", This
, debugstr_guid(key
));
1287 static HRESULT WINAPI
mediatype_DeleteAllItems(IMFMediaType
*iface
)
1289 mfmediatype
*This
= impl_from_IMFMediaType(iface
);
1291 FIXME("%p\n", This
);
1296 static HRESULT WINAPI
mediatype_SetUINT32(IMFMediaType
*iface
, REFGUID key
, UINT32 value
)
1298 mfmediatype
*This
= impl_from_IMFMediaType(iface
);
1300 FIXME("%p, %s, %d\n", This
, debugstr_guid(key
), value
);
1305 static HRESULT WINAPI
mediatype_SetUINT64(IMFMediaType
*iface
, REFGUID key
, UINT64 value
)
1307 mfmediatype
*This
= impl_from_IMFMediaType(iface
);
1309 FIXME("%p, %s, %s\n", This
, debugstr_guid(key
), wine_dbgstr_longlong(value
));
1314 static HRESULT WINAPI
mediatype_SetDouble(IMFMediaType
*iface
, REFGUID key
, double value
)
1316 mfmediatype
*This
= impl_from_IMFMediaType(iface
);
1318 FIXME("%p, %s, %f\n", This
, debugstr_guid(key
), value
);
1323 static HRESULT WINAPI
mediatype_SetGUID(IMFMediaType
*iface
, REFGUID key
, REFGUID value
)
1325 mfmediatype
*This
= impl_from_IMFMediaType(iface
);
1327 FIXME("%p, %s, %s\n", This
, debugstr_guid(key
), debugstr_guid(value
));
1332 static HRESULT WINAPI
mediatype_SetString(IMFMediaType
*iface
, REFGUID key
, const WCHAR
*value
)
1334 mfmediatype
*This
= impl_from_IMFMediaType(iface
);
1336 FIXME("%p, %s, %s\n", This
, debugstr_guid(key
), debugstr_w(value
));
1341 static HRESULT WINAPI
mediatype_SetBlob(IMFMediaType
*iface
, REFGUID key
, const UINT8
*buf
, UINT32 size
)
1343 mfmediatype
*This
= impl_from_IMFMediaType(iface
);
1345 FIXME("%p, %s, %p, %d\n", This
, debugstr_guid(key
), buf
, size
);
1350 static HRESULT WINAPI
mediatype_SetUnknown(IMFMediaType
*iface
, REFGUID key
, IUnknown
*unknown
)
1352 mfmediatype
*This
= impl_from_IMFMediaType(iface
);
1354 FIXME("%p, %s, %p\n", This
, debugstr_guid(key
), unknown
);
1359 static HRESULT WINAPI
mediatype_LockStore(IMFMediaType
*iface
)
1361 mfmediatype
*This
= impl_from_IMFMediaType(iface
);
1363 FIXME("%p\n", This
);
1368 static HRESULT WINAPI
mediatype_UnlockStore(IMFMediaType
*iface
)
1370 mfmediatype
*This
= impl_from_IMFMediaType(iface
);
1372 FIXME("%p\n", This
);
1377 static HRESULT WINAPI
mediatype_GetCount(IMFMediaType
*iface
, UINT32
*items
)
1379 mfmediatype
*This
= impl_from_IMFMediaType(iface
);
1381 FIXME("%p, %p\n", This
, items
);
1389 static HRESULT WINAPI
mediatype_GetItemByIndex(IMFMediaType
*iface
, UINT32 index
, GUID
*key
, PROPVARIANT
*value
)
1391 mfmediatype
*This
= impl_from_IMFMediaType(iface
);
1393 FIXME("%p, %d, %p, %p\n", This
, index
, key
, value
);
1398 static HRESULT WINAPI
mediatype_CopyAllItems(IMFMediaType
*iface
, IMFAttributes
*dest
)
1400 mfmediatype
*This
= impl_from_IMFMediaType(iface
);
1402 FIXME("%p, %p\n", This
, dest
);
1407 static HRESULT WINAPI
mediatype_GetMajorType(IMFMediaType
*iface
, GUID
*guid
)
1409 mfmediatype
*This
= impl_from_IMFMediaType(iface
);
1411 FIXME("%p, %p\n", This
, guid
);
1416 static HRESULT WINAPI
mediatype_IsCompressedFormat(IMFMediaType
*iface
, BOOL
*compressed
)
1418 mfmediatype
*This
= impl_from_IMFMediaType(iface
);
1420 FIXME("%p, %p\n", This
, compressed
);
1425 static HRESULT WINAPI
mediatype_IsEqual(IMFMediaType
*iface
, IMFMediaType
*type
, DWORD
*flags
)
1427 mfmediatype
*This
= impl_from_IMFMediaType(iface
);
1429 FIXME("%p, %p, %p\n", This
, type
, flags
);
1434 static HRESULT WINAPI
mediatype_GetRepresentation(IMFMediaType
*iface
, GUID guid
, void **representation
)
1436 mfmediatype
*This
= impl_from_IMFMediaType(iface
);
1438 FIXME("%p, %s, %p\n", This
, debugstr_guid(&guid
), representation
);
1443 static HRESULT WINAPI
mediatype_FreeRepresentation(IMFMediaType
*iface
, GUID guid
, void *representation
)
1445 mfmediatype
*This
= impl_from_IMFMediaType(iface
);
1447 FIXME("%p, %s, %p\n", This
, debugstr_guid(&guid
), representation
);
1452 static const IMFMediaTypeVtbl mediatype_vtbl
=
1454 mediatype_QueryInterface
,
1458 mediatype_GetItemType
,
1459 mediatype_CompareItem
,
1461 mediatype_GetUINT32
,
1462 mediatype_GetUINT64
,
1463 mediatype_GetDouble
,
1465 mediatype_GetStringLength
,
1466 mediatype_GetString
,
1467 mediatype_GetAllocatedString
,
1468 mediatype_GetBlobSize
,
1470 mediatype_GetAllocatedBlob
,
1471 mediatype_GetUnknown
,
1473 mediatype_DeleteItem
,
1474 mediatype_DeleteAllItems
,
1475 mediatype_SetUINT32
,
1476 mediatype_SetUINT64
,
1477 mediatype_SetDouble
,
1479 mediatype_SetString
,
1481 mediatype_SetUnknown
,
1482 mediatype_LockStore
,
1483 mediatype_UnlockStore
,
1485 mediatype_GetItemByIndex
,
1486 mediatype_CopyAllItems
,
1487 mediatype_GetMajorType
,
1488 mediatype_IsCompressedFormat
,
1490 mediatype_GetRepresentation
,
1491 mediatype_FreeRepresentation
1494 /***********************************************************************
1495 * MFCreateMediaType (mfplat.@)
1497 HRESULT WINAPI
MFCreateMediaType(IMFMediaType
**type
)
1499 mfmediatype
*object
;
1501 TRACE("%p\n", type
);
1504 return E_INVALIDARG
;
1506 object
= HeapAlloc( GetProcessHeap(), 0, sizeof(*object
) );
1508 return E_OUTOFMEMORY
;
1511 object
->IMFMediaType_iface
.lpVtbl
= &mediatype_vtbl
;
1513 *type
= &object
->IMFMediaType_iface
;
1517 typedef struct _mfeventqueue
1519 IMFMediaEventQueue IMFMediaEventQueue_iface
;
1523 static inline mfeventqueue
*impl_from_IMFMediaEventQueue(IMFMediaEventQueue
*iface
)
1525 return CONTAINING_RECORD(iface
, mfeventqueue
, IMFMediaEventQueue_iface
);
1528 static HRESULT WINAPI
mfeventqueue_QueryInterface(IMFMediaEventQueue
*iface
, REFIID riid
, void **out
)
1530 mfeventqueue
*This
= impl_from_IMFMediaEventQueue(iface
);
1532 TRACE("(%p)->(%s %p)\n", This
, debugstr_guid(riid
), out
);
1534 if(IsEqualGUID(riid
, &IID_IUnknown
) ||
1535 IsEqualGUID(riid
, &IID_IMFMediaEventQueue
))
1537 *out
= &This
->IMFMediaEventQueue_iface
;
1541 FIXME("(%s, %p)\n", debugstr_guid(riid
), out
);
1543 return E_NOINTERFACE
;
1546 IUnknown_AddRef((IUnknown
*)*out
);
1550 static ULONG WINAPI
mfeventqueue_AddRef(IMFMediaEventQueue
*iface
)
1552 mfeventqueue
*This
= impl_from_IMFMediaEventQueue(iface
);
1553 ULONG ref
= InterlockedIncrement(&This
->ref
);
1555 TRACE("(%p) ref=%u\n", This
, ref
);
1560 static ULONG WINAPI
mfeventqueue_Release(IMFMediaEventQueue
*iface
)
1562 mfeventqueue
*This
= impl_from_IMFMediaEventQueue(iface
);
1563 ULONG ref
= InterlockedDecrement(&This
->ref
);
1565 TRACE("(%p) ref=%u\n", This
, ref
);
1569 HeapFree(GetProcessHeap(), 0, This
);
1575 static HRESULT WINAPI
mfeventqueue_GetEvent(IMFMediaEventQueue
*iface
, DWORD flags
, IMFMediaEvent
**event
)
1577 mfeventqueue
*This
= impl_from_IMFMediaEventQueue(iface
);
1579 FIXME("%p, %p\n", This
, event
);
1584 static HRESULT WINAPI
mfeventqueue_BeginGetEvent(IMFMediaEventQueue
*iface
, IMFAsyncCallback
*callback
, IUnknown
*state
)
1586 mfeventqueue
*This
= impl_from_IMFMediaEventQueue(iface
);
1588 FIXME("%p, %p, %p\n", This
, callback
, state
);
1593 static HRESULT WINAPI
mfeventqueue_EndGetEvent(IMFMediaEventQueue
*iface
, IMFAsyncResult
*result
, IMFMediaEvent
**event
)
1595 mfeventqueue
*This
= impl_from_IMFMediaEventQueue(iface
);
1597 FIXME("%p, %p, %p\n", This
, result
, event
);
1602 static HRESULT WINAPI
mfeventqueue_QueueEvent(IMFMediaEventQueue
*iface
, IMFMediaEvent
*event
)
1604 mfeventqueue
*This
= impl_from_IMFMediaEventQueue(iface
);
1606 FIXME("%p, %p\n", This
, event
);
1611 static HRESULT WINAPI
mfeventqueue_QueueEventParamVar(IMFMediaEventQueue
*iface
, MediaEventType met
,
1612 REFGUID type
, HRESULT status
, const PROPVARIANT
*value
)
1614 mfeventqueue
*This
= impl_from_IMFMediaEventQueue(iface
);
1616 FIXME("%p, %d, %s, 0x%08x, %p\n", This
, met
, debugstr_guid(type
), status
, value
);
1621 static HRESULT WINAPI
mfeventqueue_QueueEventParamUnk(IMFMediaEventQueue
*iface
, MediaEventType met
, REFGUID type
,
1622 HRESULT status
, IUnknown
*unk
)
1624 mfeventqueue
*This
= impl_from_IMFMediaEventQueue(iface
);
1626 FIXME("%p, %d, %s, 0x%08x, %p\n", This
, met
, debugstr_guid(type
), status
, unk
);
1631 static HRESULT WINAPI
mfeventqueue_Shutdown(IMFMediaEventQueue
*iface
)
1633 mfeventqueue
*This
= impl_from_IMFMediaEventQueue(iface
);
1635 FIXME("%p\n", This
);
1640 static const IMFMediaEventQueueVtbl mfeventqueue_vtbl
=
1642 mfeventqueue_QueryInterface
,
1643 mfeventqueue_AddRef
,
1644 mfeventqueue_Release
,
1645 mfeventqueue_GetEvent
,
1646 mfeventqueue_BeginGetEvent
,
1647 mfeventqueue_EndGetEvent
,
1648 mfeventqueue_QueueEvent
,
1649 mfeventqueue_QueueEventParamVar
,
1650 mfeventqueue_QueueEventParamUnk
,
1651 mfeventqueue_Shutdown
1654 /***********************************************************************
1655 * MFCreateEventQueue (mfplat.@)
1657 HRESULT WINAPI
MFCreateEventQueue(IMFMediaEventQueue
**queue
)
1659 mfeventqueue
*object
;
1661 TRACE("%p\n", queue
);
1663 object
= HeapAlloc( GetProcessHeap(), 0, sizeof(*object
) );
1665 return E_OUTOFMEMORY
;
1668 object
->IMFMediaEventQueue_iface
.lpVtbl
= &mfeventqueue_vtbl
;
1670 *queue
= &object
->IMFMediaEventQueue_iface
;
1675 typedef struct _mfdescriptor
1677 IMFStreamDescriptor IMFStreamDescriptor_iface
;
1681 static inline mfdescriptor
*impl_from_IMFStreamDescriptor(IMFStreamDescriptor
*iface
)
1683 return CONTAINING_RECORD(iface
, mfdescriptor
, IMFStreamDescriptor_iface
);
1686 static HRESULT WINAPI
mfdescriptor_QueryInterface(IMFStreamDescriptor
*iface
, REFIID riid
, void **out
)
1688 mfdescriptor
*This
= impl_from_IMFStreamDescriptor(iface
);
1690 TRACE("(%p)->(%s %p)\n", This
, debugstr_guid(riid
), out
);
1692 if(IsEqualGUID(riid
, &IID_IUnknown
) ||
1693 IsEqualGUID(riid
, &IID_IMFAttributes
) ||
1694 IsEqualGUID(riid
, &IID_IMFStreamDescriptor
))
1696 *out
= &This
->IMFStreamDescriptor_iface
;
1700 FIXME("(%s, %p)\n", debugstr_guid(riid
), out
);
1702 return E_NOINTERFACE
;
1705 IUnknown_AddRef((IUnknown
*)*out
);
1709 static ULONG WINAPI
mfdescriptor_AddRef(IMFStreamDescriptor
*iface
)
1711 mfdescriptor
*This
= impl_from_IMFStreamDescriptor(iface
);
1712 ULONG ref
= InterlockedIncrement(&This
->ref
);
1714 TRACE("(%p) ref=%u\n", This
, ref
);
1719 static ULONG WINAPI
mfdescriptor_Release(IMFStreamDescriptor
*iface
)
1721 mfdescriptor
*This
= impl_from_IMFStreamDescriptor(iface
);
1722 ULONG ref
= InterlockedDecrement(&This
->ref
);
1724 TRACE("(%p) ref=%u\n", This
, ref
);
1728 HeapFree(GetProcessHeap(), 0, This
);
1734 static HRESULT WINAPI
mfdescriptor_GetItem(IMFStreamDescriptor
*iface
, REFGUID key
, PROPVARIANT
*value
)
1736 mfdescriptor
*This
= impl_from_IMFStreamDescriptor(iface
);
1738 FIXME("%p, %s, %p\n", This
, debugstr_guid(key
), value
);
1743 static HRESULT WINAPI
mfdescriptor_GetItemType(IMFStreamDescriptor
*iface
, REFGUID key
, MF_ATTRIBUTE_TYPE
*type
)
1745 mfdescriptor
*This
= impl_from_IMFStreamDescriptor(iface
);
1747 FIXME("%p, %s, %p\n", This
, debugstr_guid(key
), type
);
1752 static HRESULT WINAPI
mfdescriptor_CompareItem(IMFStreamDescriptor
*iface
, REFGUID key
, REFPROPVARIANT value
, BOOL
*result
)
1754 mfdescriptor
*This
= impl_from_IMFStreamDescriptor(iface
);
1756 FIXME("%p, %s, %p, %p\n", This
, debugstr_guid(key
), value
, result
);
1761 static HRESULT WINAPI
mfdescriptor_Compare(IMFStreamDescriptor
*iface
, IMFAttributes
*theirs
, MF_ATTRIBUTES_MATCH_TYPE type
,
1764 mfdescriptor
*This
= impl_from_IMFStreamDescriptor(iface
);
1766 FIXME("%p, %p, %d, %p\n", This
, theirs
, type
, result
);
1771 static HRESULT WINAPI
mfdescriptor_GetUINT32(IMFStreamDescriptor
*iface
, REFGUID key
, UINT32
*value
)
1773 mfdescriptor
*This
= impl_from_IMFStreamDescriptor(iface
);
1775 FIXME("%p, %s, %p\n", This
, debugstr_guid(key
), value
);
1780 static HRESULT WINAPI
mfdescriptor_GetUINT64(IMFStreamDescriptor
*iface
, REFGUID key
, UINT64
*value
)
1782 mfdescriptor
*This
= impl_from_IMFStreamDescriptor(iface
);
1784 FIXME("%p, %s, %p\n", This
, debugstr_guid(key
), value
);
1789 static HRESULT WINAPI
mfdescriptor_GetDouble(IMFStreamDescriptor
*iface
, REFGUID key
, double *value
)
1791 mfdescriptor
*This
= impl_from_IMFStreamDescriptor(iface
);
1793 FIXME("%p, %s, %p\n", This
, debugstr_guid(key
), value
);
1798 static HRESULT WINAPI
mfdescriptor_GetGUID(IMFStreamDescriptor
*iface
, REFGUID key
, GUID
*value
)
1800 mfdescriptor
*This
= impl_from_IMFStreamDescriptor(iface
);
1802 FIXME("%p, %s, %p\n", This
, debugstr_guid(key
), value
);
1807 static HRESULT WINAPI
mfdescriptor_GetStringLength(IMFStreamDescriptor
*iface
, REFGUID key
, UINT32
*length
)
1809 mfdescriptor
*This
= impl_from_IMFStreamDescriptor(iface
);
1811 FIXME("%p, %s, %p\n", This
, debugstr_guid(key
), length
);
1816 static HRESULT WINAPI
mfdescriptor_GetString(IMFStreamDescriptor
*iface
, REFGUID key
, WCHAR
*value
,
1817 UINT32 size
, UINT32
*length
)
1819 mfdescriptor
*This
= impl_from_IMFStreamDescriptor(iface
);
1821 FIXME("%p, %s, %p, %d, %p\n", This
, debugstr_guid(key
), value
, size
, length
);
1826 static HRESULT WINAPI
mfdescriptor_GetAllocatedString(IMFStreamDescriptor
*iface
, REFGUID key
,
1827 WCHAR
**value
, UINT32
*length
)
1829 mfdescriptor
*This
= impl_from_IMFStreamDescriptor(iface
);
1831 FIXME("%p, %s, %p, %p\n", This
, debugstr_guid(key
), value
, length
);
1836 static HRESULT WINAPI
mfdescriptor_GetBlobSize(IMFStreamDescriptor
*iface
, REFGUID key
, UINT32
*size
)
1838 mfdescriptor
*This
= impl_from_IMFStreamDescriptor(iface
);
1840 FIXME("%p, %s, %p\n", This
, debugstr_guid(key
), size
);
1845 static HRESULT WINAPI
mfdescriptor_GetBlob(IMFStreamDescriptor
*iface
, REFGUID key
, UINT8
*buf
,
1846 UINT32 bufsize
, UINT32
*blobsize
)
1848 mfdescriptor
*This
= impl_from_IMFStreamDescriptor(iface
);
1850 FIXME("%p, %s, %p, %d, %p\n", This
, debugstr_guid(key
), buf
, bufsize
, blobsize
);
1855 static HRESULT WINAPI
mfdescriptor_GetAllocatedBlob(IMFStreamDescriptor
*iface
, REFGUID key
, UINT8
**buf
, UINT32
*size
)
1857 mfdescriptor
*This
= impl_from_IMFStreamDescriptor(iface
);
1859 FIXME("%p, %s, %p, %p\n", This
, debugstr_guid(key
), buf
, size
);
1864 static HRESULT WINAPI
mfdescriptor_GetUnknown(IMFStreamDescriptor
*iface
, REFGUID key
, REFIID riid
, void **ppv
)
1866 mfdescriptor
*This
= impl_from_IMFStreamDescriptor(iface
);
1868 FIXME("%p, %s, %s, %p\n", This
, debugstr_guid(key
), debugstr_guid(riid
), ppv
);
1873 static HRESULT WINAPI
mfdescriptor_SetItem(IMFStreamDescriptor
*iface
, REFGUID key
, REFPROPVARIANT Value
)
1875 mfdescriptor
*This
= impl_from_IMFStreamDescriptor(iface
);
1877 FIXME("%p, %s, %p\n", This
, debugstr_guid(key
), Value
);
1882 static HRESULT WINAPI
mfdescriptor_DeleteItem(IMFStreamDescriptor
*iface
, REFGUID key
)
1884 mfdescriptor
*This
= impl_from_IMFStreamDescriptor(iface
);
1886 FIXME("%p, %s\n", This
, debugstr_guid(key
));
1891 static HRESULT WINAPI
mfdescriptor_DeleteAllItems(IMFStreamDescriptor
*iface
)
1893 mfdescriptor
*This
= impl_from_IMFStreamDescriptor(iface
);
1895 FIXME("%p\n", This
);
1900 static HRESULT WINAPI
mfdescriptor_SetUINT32(IMFStreamDescriptor
*iface
, REFGUID key
, UINT32 value
)
1902 mfdescriptor
*This
= impl_from_IMFStreamDescriptor(iface
);
1904 FIXME("%p, %s, %d\n", This
, debugstr_guid(key
), value
);
1909 static HRESULT WINAPI
mfdescriptor_SetUINT64(IMFStreamDescriptor
*iface
, REFGUID key
, UINT64 value
)
1911 mfdescriptor
*This
= impl_from_IMFStreamDescriptor(iface
);
1913 FIXME("%p, %s, %s\n", This
, debugstr_guid(key
), wine_dbgstr_longlong(value
));
1918 static HRESULT WINAPI
mfdescriptor_SetDouble(IMFStreamDescriptor
*iface
, REFGUID key
, double value
)
1920 mfdescriptor
*This
= impl_from_IMFStreamDescriptor(iface
);
1922 FIXME("%p, %s, %f\n", This
, debugstr_guid(key
), value
);
1927 static HRESULT WINAPI
mfdescriptor_SetGUID(IMFStreamDescriptor
*iface
, REFGUID key
, REFGUID value
)
1929 mfdescriptor
*This
= impl_from_IMFStreamDescriptor(iface
);
1931 FIXME("%p, %s, %s\n", This
, debugstr_guid(key
), debugstr_guid(value
));
1936 static HRESULT WINAPI
mfdescriptor_SetString(IMFStreamDescriptor
*iface
, REFGUID key
, const WCHAR
*value
)
1938 mfdescriptor
*This
= impl_from_IMFStreamDescriptor(iface
);
1940 FIXME("%p, %s, %s\n", This
, debugstr_guid(key
), debugstr_w(value
));
1945 static HRESULT WINAPI
mfdescriptor_SetBlob(IMFStreamDescriptor
*iface
, REFGUID key
, const UINT8
*buf
, UINT32 size
)
1947 mfdescriptor
*This
= impl_from_IMFStreamDescriptor(iface
);
1949 FIXME("%p, %s, %p, %d\n", This
, debugstr_guid(key
), buf
, size
);
1954 static HRESULT WINAPI
mfdescriptor_SetUnknown(IMFStreamDescriptor
*iface
, REFGUID key
, IUnknown
*unknown
)
1956 mfdescriptor
*This
= impl_from_IMFStreamDescriptor(iface
);
1958 FIXME("%p, %s, %p\n", This
, debugstr_guid(key
), unknown
);
1963 static HRESULT WINAPI
mfdescriptor_LockStore(IMFStreamDescriptor
*iface
)
1965 mfdescriptor
*This
= impl_from_IMFStreamDescriptor(iface
);
1967 FIXME("%p\n", This
);
1972 static HRESULT WINAPI
mfdescriptor_UnlockStore(IMFStreamDescriptor
*iface
)
1974 mfdescriptor
*This
= impl_from_IMFStreamDescriptor(iface
);
1976 FIXME("%p\n", This
);
1981 static HRESULT WINAPI
mfdescriptor_GetCount(IMFStreamDescriptor
*iface
, UINT32
*items
)
1983 mfdescriptor
*This
= impl_from_IMFStreamDescriptor(iface
);
1985 FIXME("%p, %p\n", This
, items
);
1993 static HRESULT WINAPI
mfdescriptor_GetItemByIndex(IMFStreamDescriptor
*iface
, UINT32 index
, GUID
*key
, PROPVARIANT
*value
)
1995 mfdescriptor
*This
= impl_from_IMFStreamDescriptor(iface
);
1997 FIXME("%p, %d, %p, %p\n", This
, index
, key
, value
);
2002 static HRESULT WINAPI
mfdescriptor_CopyAllItems(IMFStreamDescriptor
*iface
, IMFAttributes
*dest
)
2004 mfdescriptor
*This
= impl_from_IMFStreamDescriptor(iface
);
2006 FIXME("%p, %p\n", This
, dest
);
2011 static HRESULT WINAPI
mfdescriptor_GetStreamIdentifier(IMFStreamDescriptor
*iface
, DWORD
*identifier
)
2013 mfdescriptor
*This
= impl_from_IMFStreamDescriptor(iface
);
2015 FIXME("%p, %p\n", This
, identifier
);
2020 static HRESULT WINAPI
mfdescriptor_GetMediaTypeHandler(IMFStreamDescriptor
*iface
, IMFMediaTypeHandler
**handler
)
2022 mfdescriptor
*This
= impl_from_IMFStreamDescriptor(iface
);
2024 FIXME("%p, %p\n", This
, handler
);
2029 static const IMFStreamDescriptorVtbl mfdescriptor_vtbl
=
2031 mfdescriptor_QueryInterface
,
2032 mfdescriptor_AddRef
,
2033 mfdescriptor_Release
,
2034 mfdescriptor_GetItem
,
2035 mfdescriptor_GetItemType
,
2036 mfdescriptor_CompareItem
,
2037 mfdescriptor_Compare
,
2038 mfdescriptor_GetUINT32
,
2039 mfdescriptor_GetUINT64
,
2040 mfdescriptor_GetDouble
,
2041 mfdescriptor_GetGUID
,
2042 mfdescriptor_GetStringLength
,
2043 mfdescriptor_GetString
,
2044 mfdescriptor_GetAllocatedString
,
2045 mfdescriptor_GetBlobSize
,
2046 mfdescriptor_GetBlob
,
2047 mfdescriptor_GetAllocatedBlob
,
2048 mfdescriptor_GetUnknown
,
2049 mfdescriptor_SetItem
,
2050 mfdescriptor_DeleteItem
,
2051 mfdescriptor_DeleteAllItems
,
2052 mfdescriptor_SetUINT32
,
2053 mfdescriptor_SetUINT64
,
2054 mfdescriptor_SetDouble
,
2055 mfdescriptor_SetGUID
,
2056 mfdescriptor_SetString
,
2057 mfdescriptor_SetBlob
,
2058 mfdescriptor_SetUnknown
,
2059 mfdescriptor_LockStore
,
2060 mfdescriptor_UnlockStore
,
2061 mfdescriptor_GetCount
,
2062 mfdescriptor_GetItemByIndex
,
2063 mfdescriptor_CopyAllItems
,
2064 mfdescriptor_GetStreamIdentifier
,
2065 mfdescriptor_GetMediaTypeHandler
2068 HRESULT WINAPI
MFCreateStreamDescriptor(DWORD identifier
, DWORD count
,
2069 IMFMediaType
**types
, IMFStreamDescriptor
**descriptor
)
2071 mfdescriptor
*object
;
2073 TRACE("%d, %d, %p, %p\n", identifier
, count
, types
, descriptor
);
2075 object
= HeapAlloc( GetProcessHeap(), 0, sizeof(*object
) );
2077 return E_OUTOFMEMORY
;
2080 object
->IMFStreamDescriptor_iface
.lpVtbl
= &mfdescriptor_vtbl
;
2082 *descriptor
= &object
->IMFStreamDescriptor_iface
;