Commit e88a2535 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

mf: Assign node id on creation.

parent 50cef896
......@@ -57,11 +57,10 @@ static void test_topology(void)
ok(hr == S_OK, "Failed to create topology node, hr %#x.\n", hr);
hr = IMFTopologyNode_GetTopoNodeID(node, &id);
todo_wine
ok(hr == S_OK, "Failed to get node id, hr %#x.\n", hr);
ok(((id >> 32) == GetCurrentProcessId()) && !!(id & 0xffff), "Unexpected node id %s.\n", wine_dbgstr_longlong(id));
hr = IMFTopologyNode_SetTopoNodeID(node2, id);
todo_wine
ok(hr == S_OK, "Failed to set node id, hr %#x.\n", hr);
count = 1;
......@@ -96,7 +95,6 @@ todo_wine {
/* Change node id, add it again. */
hr = IMFTopologyNode_SetTopoNodeID(node, ++id);
todo_wine
ok(hr == S_OK, "Failed to set node id, hr %#x.\n", hr);
hr = IMFTopology_GetNodeByID(topology, id, &node2);
......@@ -148,7 +146,6 @@ todo_wine {
hr = MFCreateTopologyNode(MF_TOPOLOGY_TEE_NODE, &node2);
ok(hr == S_OK, "Failed to create topology node, hr %#x.\n", hr);
hr = IMFTopologyNode_SetTopoNodeID(node2, id);
todo_wine
ok(hr == S_OK, "Failed to set node id, hr %#x.\n", hr);
hr = IMFTopology_RemoveNode(topology, node2);
todo_wine
......@@ -179,6 +176,9 @@ todo_wine {
todo_wine
ok(hr == S_OK, "Failed to clear topology, hr %#x.\n", hr);
hr = IMFTopologyNode_SetTopoNodeID(node, 123);
ok(hr == S_OK, "Failed to set node id, hr %#x.\n", hr);
IMFTopologyNode_Release(node);
IMFTopology_Release(topology);
}
......
......@@ -32,6 +32,8 @@
WINE_DEFAULT_DEBUG_CHANNEL(mfplat);
static LONG next_node_id;
struct topology
{
IMFTopology IMFTopology_iface;
......@@ -45,6 +47,7 @@ struct topology_node
LONG refcount;
IMFAttributes *attributes;
MF_TOPOLOGY_TYPE node_type;
TOPOID id;
};
struct seq_source
......@@ -887,16 +890,24 @@ static HRESULT WINAPI topology_node_GetNodeType(IMFTopologyNode *iface, MF_TOPOL
static HRESULT WINAPI topology_node_GetTopoNodeID(IMFTopologyNode *iface, TOPOID *id)
{
FIXME("(%p)->(%p)\n", iface, id);
struct topology_node *node = impl_from_IMFTopologyNode(iface);
return E_NOTIMPL;
TRACE("(%p)->(%p)\n", iface, id);
*id = node->id;
return S_OK;
}
static HRESULT WINAPI topology_node_SetTopoNodeID(IMFTopologyNode *iface, TOPOID id)
{
FIXME("(%p)->(%s)\n", iface, wine_dbgstr_longlong(id));
struct topology_node *node = impl_from_IMFTopologyNode(iface);
return E_NOTIMPL;
TRACE("(%p)->(%s)\n", iface, wine_dbgstr_longlong(id));
node->id = id;
return S_OK;
}
static HRESULT WINAPI topology_node_GetInputCount(IMFTopologyNode *iface, DWORD *count)
......@@ -1058,6 +1069,7 @@ HRESULT WINAPI MFCreateTopologyNode(MF_TOPOLOGY_TYPE node_type, IMFTopologyNode
heap_free(object);
return hr;
}
object->id = ((TOPOID)GetCurrentProcessId() << 32) | InterlockedIncrement(&next_node_id);
*node = &object->IMFTopologyNode_iface;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment