shcore: Implement Get/SetProcessDpiAwareness().
[wine.git] / dlls / mf / topology.c
blob924d3863c85b32feabd7e5abfa262269c9d3cb4e
1 /*
2 * Copyright 2017 Nikolay Sivov
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18 #include "config.h"
20 #include <stdarg.h>
22 #define COBJMACROS
24 #include "windef.h"
25 #include "winbase.h"
26 #include "initguid.h"
27 #include "mfidl.h"
29 #include "wine/debug.h"
31 WINE_DEFAULT_DEBUG_CHANNEL(mfplat);
33 typedef struct mftopology
35 IMFTopology IMFTopology_iface;
36 LONG ref;
37 } mftopology;
39 static inline mftopology *impl_from_IMFTopology(IMFTopology *iface)
41 return CONTAINING_RECORD(iface, mftopology, IMFTopology_iface);
44 static HRESULT WINAPI mftopology_QueryInterface(IMFTopology *iface, REFIID riid, void **out)
46 mftopology *This = impl_from_IMFTopology(iface);
48 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), out);
50 if (IsEqualIID(riid, &IID_IMFTopology) ||
51 IsEqualIID(riid, &IID_IMFAttributes) ||
52 IsEqualIID(riid, &IID_IUnknown))
54 *out = &This->IMFTopology_iface;
56 else
58 FIXME("(%s, %p)\n", debugstr_guid(riid), out);
59 *out = NULL;
60 return E_NOINTERFACE;
63 IUnknown_AddRef((IUnknown*)*out);
64 return S_OK;
67 static ULONG WINAPI mftopology_AddRef(IMFTopology *iface)
69 mftopology *This = impl_from_IMFTopology(iface);
70 ULONG ref = InterlockedIncrement(&This->ref);
72 TRACE("(%p) ref=%u\n", This, ref);
74 return ref;
77 static ULONG WINAPI mftopology_Release(IMFTopology *iface)
79 mftopology *This = impl_from_IMFTopology(iface);
80 ULONG ref = InterlockedDecrement(&This->ref);
82 TRACE("(%p) ref=%u\n", This, ref);
84 if (!ref)
86 HeapFree(GetProcessHeap(), 0, This);
89 return ref;
92 static HRESULT WINAPI mftopology_GetItem(IMFTopology *iface, REFGUID key, PROPVARIANT *value)
94 mftopology *This = impl_from_IMFTopology(iface);
96 FIXME("(%p)->(%s, %p)\n", This, debugstr_guid(key), value);
98 return E_NOTIMPL;
101 static HRESULT WINAPI mftopology_GetItemType(IMFTopology *iface, REFGUID key, MF_ATTRIBUTE_TYPE *type)
103 mftopology *This = impl_from_IMFTopology(iface);
105 FIXME("(%p)->(%s, %p)\n", This, debugstr_guid(key), type);
107 return E_NOTIMPL;
110 static HRESULT WINAPI mftopology_CompareItem(IMFTopology *iface, REFGUID key, REFPROPVARIANT value, BOOL *result)
112 mftopology *This = impl_from_IMFTopology(iface);
114 FIXME("(%p)->(%s, %p, %p)\n", This, debugstr_guid(key), value, result);
116 return E_NOTIMPL;
119 static HRESULT WINAPI mftopology_Compare(IMFTopology *iface, IMFAttributes *theirs, MF_ATTRIBUTES_MATCH_TYPE type,
120 BOOL *result)
122 mftopology *This = impl_from_IMFTopology(iface);
124 FIXME("(%p)->(%p, %d, %p)\n", This, theirs, type, result);
126 return E_NOTIMPL;
129 static HRESULT WINAPI mftopology_GetUINT32(IMFTopology *iface, REFGUID key, UINT32 *value)
131 mftopology *This = impl_from_IMFTopology(iface);
133 FIXME("(%p)->(%s, %p)\n", This, debugstr_guid(key), value);
135 return E_NOTIMPL;
138 static HRESULT WINAPI mftopology_GetUINT64(IMFTopology *iface, REFGUID key, UINT64 *value)
140 mftopology *This = impl_from_IMFTopology(iface);
142 FIXME("(%p)->(%s, %p)\n", This, debugstr_guid(key), value);
144 return E_NOTIMPL;
147 static HRESULT WINAPI mftopology_GetDouble(IMFTopology *iface, REFGUID key, double *value)
149 mftopology *This = impl_from_IMFTopology(iface);
151 FIXME("(%p)->(%s, %p)\n", This, debugstr_guid(key), value);
153 return E_NOTIMPL;
156 static HRESULT WINAPI mftopology_GetGUID(IMFTopology *iface, REFGUID key, GUID *value)
158 mftopology *This = impl_from_IMFTopology(iface);
160 FIXME("(%p)->(%s, %p)\n", This, debugstr_guid(key), value);
162 return E_NOTIMPL;
165 static HRESULT WINAPI mftopology_GetStringLength(IMFTopology *iface, REFGUID key, UINT32 *length)
167 mftopology *This = impl_from_IMFTopology(iface);
169 FIXME("(%p)->(%s, %p)\n", This, debugstr_guid(key), length);
171 return E_NOTIMPL;
174 static HRESULT WINAPI mftopology_GetString(IMFTopology *iface, REFGUID key, WCHAR *value,
175 UINT32 size, UINT32 *length)
177 mftopology *This = impl_from_IMFTopology(iface);
179 FIXME("(%p)->(%s, %p, %d, %p)\n", This, debugstr_guid(key), value, size, length);
181 return E_NOTIMPL;
184 static HRESULT WINAPI mftopology_GetAllocatedString(IMFTopology *iface, REFGUID key,
185 WCHAR **value, UINT32 *length)
187 mftopology *This = impl_from_IMFTopology(iface);
189 FIXME("(%p)->(%s, %p, %p)\n", This, debugstr_guid(key), value, length);
191 return E_NOTIMPL;
194 static HRESULT WINAPI mftopology_GetBlobSize(IMFTopology *iface, REFGUID key, UINT32 *size)
196 mftopology *This = impl_from_IMFTopology(iface);
198 FIXME("(%p)->(%s, %p)\n", This, debugstr_guid(key), size);
200 return E_NOTIMPL;
203 static HRESULT WINAPI mftopology_GetBlob(IMFTopology *iface, REFGUID key, UINT8 *buf,
204 UINT32 bufsize, UINT32 *blobsize)
206 mftopology *This = impl_from_IMFTopology(iface);
208 FIXME("(%p)->(%s, %p, %d, %p)\n", This, debugstr_guid(key), buf, bufsize, blobsize);
210 return E_NOTIMPL;
213 static HRESULT WINAPI mftopology_GetAllocatedBlob(IMFTopology *iface, REFGUID key, UINT8 **buf, UINT32 *size)
215 mftopology *This = impl_from_IMFTopology(iface);
217 FIXME("(%p)->(%s, %p, %p)\n", This, debugstr_guid(key), buf, size);
219 return E_NOTIMPL;
222 static HRESULT WINAPI mftopology_GetUnknown(IMFTopology *iface, REFGUID key, REFIID riid, void **ppv)
224 mftopology *This = impl_from_IMFTopology(iface);
226 FIXME("(%p)->(%s, %s, %p)\n", This, debugstr_guid(key), debugstr_guid(riid), ppv);
228 return E_NOTIMPL;
231 static HRESULT WINAPI mftopology_SetItem(IMFTopology *iface, REFGUID key, REFPROPVARIANT Value)
233 mftopology *This = impl_from_IMFTopology(iface);
235 FIXME("(%p)->(%s, %p)\n", This, debugstr_guid(key), Value);
237 return E_NOTIMPL;
240 static HRESULT WINAPI mftopology_DeleteItem(IMFTopology *iface, REFGUID key)
242 mftopology *This = impl_from_IMFTopology(iface);
244 FIXME("(%p)->(%s)\n", This, debugstr_guid(key));
246 return E_NOTIMPL;
249 static HRESULT WINAPI mftopology_DeleteAllItems(IMFTopology *iface)
251 mftopology *This = impl_from_IMFTopology(iface);
253 FIXME("(%p)\n", This);
255 return E_NOTIMPL;
258 static HRESULT WINAPI mftopology_SetUINT32(IMFTopology *iface, REFGUID key, UINT32 value)
260 mftopology *This = impl_from_IMFTopology(iface);
262 FIXME("(%p)->(%s, %d)\n", This, debugstr_guid(key), value);
264 return E_NOTIMPL;
267 static HRESULT WINAPI mftopology_SetUINT64(IMFTopology *iface, REFGUID key, UINT64 value)
269 mftopology *This = impl_from_IMFTopology(iface);
271 FIXME("(%p)->(%s, %s)\n", This, debugstr_guid(key), wine_dbgstr_longlong(value));
273 return E_NOTIMPL;
276 static HRESULT WINAPI mftopology_SetDouble(IMFTopology *iface, REFGUID key, double value)
278 mftopology *This = impl_from_IMFTopology(iface);
280 FIXME("(%p)->(%s, %f)\n", This, debugstr_guid(key), value);
282 return E_NOTIMPL;
285 static HRESULT WINAPI mftopology_SetGUID(IMFTopology *iface, REFGUID key, REFGUID value)
287 mftopology *This = impl_from_IMFTopology(iface);
289 FIXME("(%p)->(%s, %s)\n", This, debugstr_guid(key), debugstr_guid(value));
291 return E_NOTIMPL;
294 static HRESULT WINAPI mftopology_SetString(IMFTopology *iface, REFGUID key, const WCHAR *value)
296 mftopology *This = impl_from_IMFTopology(iface);
298 FIXME("(%p)->(%s, %s)\n", This, debugstr_guid(key), debugstr_w(value));
300 return E_NOTIMPL;
303 static HRESULT WINAPI mftopology_SetBlob(IMFTopology *iface, REFGUID key, const UINT8 *buf, UINT32 size)
305 mftopology *This = impl_from_IMFTopology(iface);
307 FIXME("(%p)->(%s, %p, %d)\n", This, debugstr_guid(key), buf, size);
309 return E_NOTIMPL;
312 static HRESULT WINAPI mftopology_SetUnknown(IMFTopology *iface, REFGUID key, IUnknown *unknown)
314 mftopology *This = impl_from_IMFTopology(iface);
316 FIXME("(%p)->(%s, %p)\n", This, debugstr_guid(key), unknown);
318 return E_NOTIMPL;
321 static HRESULT WINAPI mftopology_LockStore(IMFTopology *iface)
323 mftopology *This = impl_from_IMFTopology(iface);
325 FIXME("(%p)\n", This);
327 return E_NOTIMPL;
330 static HRESULT WINAPI mftopology_UnlockStore(IMFTopology *iface)
332 mftopology *This = impl_from_IMFTopology(iface);
334 FIXME("(%p)\n", This);
336 return E_NOTIMPL;
339 static HRESULT WINAPI mftopology_GetCount(IMFTopology *iface, UINT32 *count)
341 mftopology *This = impl_from_IMFTopology(iface);
343 FIXME("(%p)->(%p)\n", This, count);
345 return E_NOTIMPL;
348 static HRESULT WINAPI mftopology_GetItemByIndex(IMFTopology *iface, UINT32 index, GUID *key, PROPVARIANT *value)
350 mftopology *This = impl_from_IMFTopology(iface);
352 FIXME("(%p)->(%u, %p, %p)\n", This, index, key, value);
354 return E_NOTIMPL;
357 static HRESULT WINAPI mftopology_CopyAllItems(IMFTopology *iface, IMFAttributes *dest)
359 mftopology *This = impl_from_IMFTopology(iface);
361 FIXME("(%p)->(%p)\n", This, dest);
363 return E_NOTIMPL;
366 static HRESULT WINAPI mftopology_GetTopologyID(IMFTopology *iface, TOPOID *id)
368 mftopology *This = impl_from_IMFTopology(iface);
370 FIXME("(%p)->(%p)\n", This, id);
372 return E_NOTIMPL;
375 static HRESULT WINAPI mftopology_AddNode(IMFTopology *iface, IMFTopologyNode *node)
377 mftopology *This = impl_from_IMFTopology(iface);
379 FIXME("(%p)->(%p)\n", This, node);
381 return E_NOTIMPL;
384 static HRESULT WINAPI mftopology_RemoveNode(IMFTopology *iface, IMFTopologyNode *node)
386 mftopology *This = impl_from_IMFTopology(iface);
388 FIXME("(%p)->(%p)\n", This, node);
390 return E_NOTIMPL;
393 static HRESULT WINAPI mftopology_GetNodeCount(IMFTopology *iface, WORD *count)
395 mftopology *This = impl_from_IMFTopology(iface);
397 FIXME("(%p)->(%p)\n", This, count);
399 return E_NOTIMPL;
402 static HRESULT WINAPI mftopology_GetNode(IMFTopology *iface, WORD index, IMFTopologyNode **node)
404 mftopology *This = impl_from_IMFTopology(iface);
406 FIXME("(%p)->(%u, %p)\n", This, index, node);
408 return E_NOTIMPL;
411 static HRESULT WINAPI mftopology_Clear(IMFTopology *iface)
413 mftopology *This = impl_from_IMFTopology(iface);
415 FIXME("(%p)\n", This);
417 return E_NOTIMPL;
420 static HRESULT WINAPI mftopology_CloneFrom(IMFTopology *iface, IMFTopology *topology)
422 mftopology *This = impl_from_IMFTopology(iface);
424 FIXME("(%p)->(%p)\n", This, topology);
426 return E_NOTIMPL;
429 static HRESULT WINAPI mftopology_GetNodeByID(IMFTopology *iface, TOPOID id, IMFTopologyNode **node)
431 mftopology *This = impl_from_IMFTopology(iface);
433 FIXME("(%p)->(%p)\n", This, node);
435 return E_NOTIMPL;
438 static HRESULT WINAPI mftopology_GetSourceNodeCollection(IMFTopology *iface, IMFCollection **collection)
440 mftopology *This = impl_from_IMFTopology(iface);
442 FIXME("(%p)->(%p)\n", This, collection);
444 return E_NOTIMPL;
447 static HRESULT WINAPI mftopology_GetOutputNodeCollection(IMFTopology *iface, IMFCollection **collection)
449 mftopology *This = impl_from_IMFTopology(iface);
451 FIXME("(%p)->(%p)\n", This, collection);
453 return E_NOTIMPL;
456 static const IMFTopologyVtbl mftopologyvtbl =
458 mftopology_QueryInterface,
459 mftopology_AddRef,
460 mftopology_Release,
461 mftopology_GetItem,
462 mftopology_GetItemType,
463 mftopology_CompareItem,
464 mftopology_Compare,
465 mftopology_GetUINT32,
466 mftopology_GetUINT64,
467 mftopology_GetDouble,
468 mftopology_GetGUID,
469 mftopology_GetStringLength,
470 mftopology_GetString,
471 mftopology_GetAllocatedString,
472 mftopology_GetBlobSize,
473 mftopology_GetBlob,
474 mftopology_GetAllocatedBlob,
475 mftopology_GetUnknown,
476 mftopology_SetItem,
477 mftopology_DeleteItem,
478 mftopology_DeleteAllItems,
479 mftopology_SetUINT32,
480 mftopology_SetUINT64,
481 mftopology_SetDouble,
482 mftopology_SetGUID,
483 mftopology_SetString,
484 mftopology_SetBlob,
485 mftopology_SetUnknown,
486 mftopology_LockStore,
487 mftopology_UnlockStore,
488 mftopology_GetCount,
489 mftopology_GetItemByIndex,
490 mftopology_CopyAllItems,
491 mftopology_GetTopologyID,
492 mftopology_AddNode,
493 mftopology_RemoveNode,
494 mftopology_GetNodeCount,
495 mftopology_GetNode,
496 mftopology_Clear,
497 mftopology_CloneFrom,
498 mftopology_GetNodeByID,
499 mftopology_GetSourceNodeCollection,
500 mftopology_GetOutputNodeCollection,
503 /***********************************************************************
504 * MFCreateTopology (mf.@)
506 HRESULT WINAPI MFCreateTopology(IMFTopology **topology)
508 mftopology *object;
510 if (!topology)
511 return E_POINTER;
513 object = HeapAlloc(GetProcessHeap(), 0, sizeof(*object));
514 if (!object)
515 return E_OUTOFMEMORY;
517 object->IMFTopology_iface.lpVtbl = &mftopologyvtbl;
518 object->ref = 1;
520 *topology = &object->IMFTopology_iface;
522 return S_OK;