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
29 #include "wine/debug.h"
31 WINE_DEFAULT_DEBUG_CHANNEL(mfplat
);
33 typedef struct mftopology
35 IMFTopology IMFTopology_iface
;
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
;
58 FIXME("(%s, %p)\n", debugstr_guid(riid
), out
);
63 IUnknown_AddRef((IUnknown
*)*out
);
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
);
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
);
86 HeapFree(GetProcessHeap(), 0, This
);
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
);
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
);
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
);
119 static HRESULT WINAPI
mftopology_Compare(IMFTopology
*iface
, IMFAttributes
*theirs
, MF_ATTRIBUTES_MATCH_TYPE type
,
122 mftopology
*This
= impl_from_IMFTopology(iface
);
124 FIXME("(%p)->(%p, %d, %p)\n", This
, theirs
, type
, result
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
));
249 static HRESULT WINAPI
mftopology_DeleteAllItems(IMFTopology
*iface
)
251 mftopology
*This
= impl_from_IMFTopology(iface
);
253 FIXME("(%p)\n", This
);
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
);
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
));
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
);
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
));
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
));
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
);
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
);
321 static HRESULT WINAPI
mftopology_LockStore(IMFTopology
*iface
)
323 mftopology
*This
= impl_from_IMFTopology(iface
);
325 FIXME("(%p)\n", This
);
330 static HRESULT WINAPI
mftopology_UnlockStore(IMFTopology
*iface
)
332 mftopology
*This
= impl_from_IMFTopology(iface
);
334 FIXME("(%p)\n", This
);
339 static HRESULT WINAPI
mftopology_GetCount(IMFTopology
*iface
, UINT32
*count
)
341 mftopology
*This
= impl_from_IMFTopology(iface
);
343 FIXME("(%p)->(%p)\n", This
, count
);
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
);
357 static HRESULT WINAPI
mftopology_CopyAllItems(IMFTopology
*iface
, IMFAttributes
*dest
)
359 mftopology
*This
= impl_from_IMFTopology(iface
);
361 FIXME("(%p)->(%p)\n", This
, dest
);
366 static HRESULT WINAPI
mftopology_GetTopologyID(IMFTopology
*iface
, TOPOID
*id
)
368 mftopology
*This
= impl_from_IMFTopology(iface
);
370 FIXME("(%p)->(%p)\n", This
, id
);
375 static HRESULT WINAPI
mftopology_AddNode(IMFTopology
*iface
, IMFTopologyNode
*node
)
377 mftopology
*This
= impl_from_IMFTopology(iface
);
379 FIXME("(%p)->(%p)\n", This
, node
);
384 static HRESULT WINAPI
mftopology_RemoveNode(IMFTopology
*iface
, IMFTopologyNode
*node
)
386 mftopology
*This
= impl_from_IMFTopology(iface
);
388 FIXME("(%p)->(%p)\n", This
, node
);
393 static HRESULT WINAPI
mftopology_GetNodeCount(IMFTopology
*iface
, WORD
*count
)
395 mftopology
*This
= impl_from_IMFTopology(iface
);
397 FIXME("(%p)->(%p)\n", This
, count
);
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
);
411 static HRESULT WINAPI
mftopology_Clear(IMFTopology
*iface
)
413 mftopology
*This
= impl_from_IMFTopology(iface
);
415 FIXME("(%p)\n", This
);
420 static HRESULT WINAPI
mftopology_CloneFrom(IMFTopology
*iface
, IMFTopology
*topology
)
422 mftopology
*This
= impl_from_IMFTopology(iface
);
424 FIXME("(%p)->(%p)\n", This
, topology
);
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
);
438 static HRESULT WINAPI
mftopology_GetSourceNodeCollection(IMFTopology
*iface
, IMFCollection
**collection
)
440 mftopology
*This
= impl_from_IMFTopology(iface
);
442 FIXME("(%p)->(%p)\n", This
, collection
);
447 static HRESULT WINAPI
mftopology_GetOutputNodeCollection(IMFTopology
*iface
, IMFCollection
**collection
)
449 mftopology
*This
= impl_from_IMFTopology(iface
);
451 FIXME("(%p)->(%p)\n", This
, collection
);
456 static const IMFTopologyVtbl mftopologyvtbl
=
458 mftopology_QueryInterface
,
462 mftopology_GetItemType
,
463 mftopology_CompareItem
,
465 mftopology_GetUINT32
,
466 mftopology_GetUINT64
,
467 mftopology_GetDouble
,
469 mftopology_GetStringLength
,
470 mftopology_GetString
,
471 mftopology_GetAllocatedString
,
472 mftopology_GetBlobSize
,
474 mftopology_GetAllocatedBlob
,
475 mftopology_GetUnknown
,
477 mftopology_DeleteItem
,
478 mftopology_DeleteAllItems
,
479 mftopology_SetUINT32
,
480 mftopology_SetUINT64
,
481 mftopology_SetDouble
,
483 mftopology_SetString
,
485 mftopology_SetUnknown
,
486 mftopology_LockStore
,
487 mftopology_UnlockStore
,
489 mftopology_GetItemByIndex
,
490 mftopology_CopyAllItems
,
491 mftopology_GetTopologyID
,
493 mftopology_RemoveNode
,
494 mftopology_GetNodeCount
,
497 mftopology_CloneFrom
,
498 mftopology_GetNodeByID
,
499 mftopology_GetSourceNodeCollection
,
500 mftopology_GetOutputNodeCollection
,
503 /***********************************************************************
504 * MFCreateTopology (mf.@)
506 HRESULT WINAPI
MFCreateTopology(IMFTopology
**topology
)
513 object
= HeapAlloc(GetProcessHeap(), 0, sizeof(*object
));
515 return E_OUTOFMEMORY
;
517 object
->IMFTopology_iface
.lpVtbl
= &mftopologyvtbl
;
520 *topology
= &object
->IMFTopology_iface
;