mf/topoloader: Set MF_TOPONODE_TRANSFORM_OBJECTID for created transforms when CLSID is available.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2020-12-01 15:16:26 +03:00 committed by Alexandre Julliard
parent a343a31710
commit a50bd9d12f
2 changed files with 15 additions and 4 deletions

View File

@ -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);

View File

@ -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;
}