Nikolay Sivov (@nsivov) commented about dlls/mfmediaengine/main.c:
- for (i = 0; i < engine->video_effects.count; ++i)
- {
IMFTopologyNode *node = NULL;
if (FAILED(hr = MFCreateTopologyNode(MF_TOPOLOGY_TRANSFORM_NODE, &node)))
goto failed;
IMFTopologyNode_SetObject(node, (IUnknown *)engine->video_effects.effects[i].object);
IMFTopologyNode_SetUINT32(node, &MF_TOPONODE_NOSHUTDOWN_ON_REMOVE, FALSE);
if (engine->video_effects.effects[i].optional)
IMFTopologyNode_SetUINT32(node, &MF_TOPONODE_CONNECT_METHOD, MF_CONNECT_AS_OPTIONAL);
(*nodes)[i] = node;
- }
I think this could be shortened, by doing IMFTopologyNode_ConnectOutput() right here, instead of allocating array, setting pointers, returning it, connecting nodes, freeing.