Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mf/tests/mf.c | 6 ++++++ dlls/mf/topology.c | 13 +++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c index d7d7fdfa60e..4d4c6283be8 100644 --- a/dlls/mf/tests/mf.c +++ b/dlls/mf/tests/mf.c @@ -2045,6 +2045,9 @@ todo_wine { ok(value == 1, "Unexpected value.\n"); }
+ hr = IMFTopologyNode_GetItem(mft_node, &MF_TOPONODE_TRANSFORM_OBJECTID, NULL); + ok(hr == S_OK, "Failed to get attribute, hr %#x.\n", hr); + hr = IUnknown_QueryInterface(node_object, &IID_IMFTransform, (void **)&transform); ok(hr == S_OK, "Failed to get IMFTransform from transform node's object, hr %#x.\n", hr); IUnknown_Release(node_object); @@ -2068,6 +2071,9 @@ todo_wine { ok(hr == S_OK, "Failed to get transform node type in resolved topology, hr %#x.\n", hr); ok(node_type == MF_TOPOLOGY_TRANSFORM_NODE, "Unexpected node type %u.\n", node_type);
+ hr = IMFTopologyNode_GetItem(mft_node, &MF_TOPONODE_TRANSFORM_OBJECTID, NULL); + ok(hr == S_OK, "Failed to get attribute, hr %#x.\n", hr); + hr = IMFTopologyNode_GetObject(mft_node, &node_object); ok(hr == S_OK, "Failed to get object of transform node, hr %#x.\n", hr);
diff --git a/dlls/mf/topology.c b/dlls/mf/topology.c index efa28e9f457..77baa1128c4 100644 --- a/dlls/mf/topology.c +++ b/dlls/mf/topology.c @@ -1996,7 +1996,7 @@ struct transform_output_type { IMFMediaType *type; IMFTransform *transform; - const GUID *category; + IMFActivate *activate; };
struct connect_context @@ -2054,7 +2054,7 @@ static HRESULT topology_loader_enumerate_output_types(const GUID *category, IMFM unsigned int output_count = 0;
output_type.transform = transform; - output_type.category = category; + output_type.activate = activates[i]; while (SUCCEEDED(IMFTransform_GetOutputAvailableType(transform, 0, output_count++, &output_type.type))) { hr = connect_func(&output_type, context); @@ -2079,17 +2079,22 @@ static HRESULT topology_loader_create_transform(const struct transform_output_ty IMFTopologyNode **node) { HRESULT hr; + GUID guid;
if (FAILED(hr = MFCreateTopologyNode(MF_TOPOLOGY_TRANSFORM_NODE, node))) return hr;
IMFTopologyNode_SetObject(*node, (IUnknown *)output_type->transform); - if (IsEqualGUID(output_type->category, &MFT_CATEGORY_AUDIO_DECODER) || - IsEqualGUID(output_type->category, &MFT_CATEGORY_VIDEO_DECODER)) + + if (SUCCEEDED(IMFActivate_GetGUID(output_type->activate, &MF_TRANSFORM_CATEGORY_Attribute, &guid)) && + (IsEqualGUID(&guid, &MFT_CATEGORY_AUDIO_DECODER) || IsEqualGUID(&guid, &MFT_CATEGORY_VIDEO_DECODER))) { IMFTopologyNode_SetUINT32(*node, &MF_TOPONODE_DECODER, 1); }
+ if (SUCCEEDED(IMFActivate_GetGUID(output_type->activate, &MFT_TRANSFORM_CLSID_Attribute, &guid))) + IMFTopologyNode_SetGUID(*node, &MF_TOPONODE_TRANSFORM_OBJECTID, &guid); + return hr; }