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

mf/evr: Actually use custom mixer when available.

parent cc66d5de
...@@ -734,7 +734,7 @@ static HRESULT video_renderer_create_mixer(struct video_renderer *renderer, IMFA ...@@ -734,7 +734,7 @@ static HRESULT video_renderer_create_mixer(struct video_renderer *renderer, IMFA
CLSID clsid; CLSID clsid;
HRESULT hr; HRESULT hr;
if (SUCCEEDED(IMFAttributes_GetUnknown(attributes, &MF_ACTIVATE_CUSTOM_VIDEO_MIXER_ACTIVATE, if (SUCCEEDED(hr = IMFAttributes_GetUnknown(attributes, &MF_ACTIVATE_CUSTOM_VIDEO_MIXER_ACTIVATE,
&IID_IMFActivate, (void **)&activate))) &IID_IMFActivate, (void **)&activate)))
{ {
IMFAttributes_GetUINT32(attributes, &MF_ACTIVATE_CUSTOM_VIDEO_MIXER_FLAGS, &flags); IMFAttributes_GetUINT32(attributes, &MF_ACTIVATE_CUSTOM_VIDEO_MIXER_FLAGS, &flags);
...@@ -744,11 +744,20 @@ static HRESULT video_renderer_create_mixer(struct video_renderer *renderer, IMFA ...@@ -744,11 +744,20 @@ static HRESULT video_renderer_create_mixer(struct video_renderer *renderer, IMFA
return hr; return hr;
} }
/* Activation object failed, use class activation. */
if (FAILED(hr))
{
if (FAILED(IMFAttributes_GetGUID(attributes, &MF_ACTIVATE_CUSTOM_VIDEO_MIXER_CLSID, &clsid))) if (FAILED(IMFAttributes_GetGUID(attributes, &MF_ACTIVATE_CUSTOM_VIDEO_MIXER_CLSID, &clsid)))
memcpy(&clsid, &CLSID_MFVideoMixer9, sizeof(clsid)); memcpy(&clsid, &CLSID_MFVideoMixer9, sizeof(clsid));
hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IMFTransform, (void **)out);
}
if (SUCCEEDED(hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IMFTransform, (void **)out))) if (FAILED(hr))
{ {
WARN("Failed to create a mixer object, hr %#x.\n", hr);
return hr;
}
if (SUCCEEDED(hr = IMFTransform_QueryInterface(*out, &IID_IMFTopologyServiceLookupClient, if (SUCCEEDED(hr = IMFTransform_QueryInterface(*out, &IID_IMFTopologyServiceLookupClient,
(void **)&lookup_client))) (void **)&lookup_client)))
{ {
...@@ -761,7 +770,6 @@ static HRESULT video_renderer_create_mixer(struct video_renderer *renderer, IMFA ...@@ -761,7 +770,6 @@ static HRESULT video_renderer_create_mixer(struct video_renderer *renderer, IMFA
renderer->flags &= ~EVR_INIT_SERVICES; renderer->flags &= ~EVR_INIT_SERVICES;
IMFTopologyServiceLookupClient_Release(lookup_client); IMFTopologyServiceLookupClient_Release(lookup_client);
} }
}
return hr; return hr;
} }
......
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