Commit 39489e4d authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

quartz/vmr9: Don't query for IVMRSurfaceAllocatorEx9.

parent f020fe05
...@@ -2852,6 +2852,7 @@ static HRESULT WINAPI allocator_QueryInterface(IVMRSurfaceAllocator9 *iface, REF ...@@ -2852,6 +2852,7 @@ static HRESULT WINAPI allocator_QueryInterface(IVMRSurfaceAllocator9 *iface, REF
IVMRImagePresenter9_AddRef(&presenter_iface); IVMRImagePresenter9_AddRef(&presenter_iface);
return S_OK; return S_OK;
} }
ok(!IsEqualGUID(iid, &IID_IVMRSurfaceAllocatorEx9), "Unexpected query for IVMRSurfaceAllocatorEx9.\n");
*out = NULL; *out = NULL;
return E_NOTIMPL; return E_NOTIMPL;
} }
......
...@@ -79,9 +79,8 @@ struct quartz_vmr ...@@ -79,9 +79,8 @@ struct quartz_vmr
IOverlay IOverlay_iface; IOverlay IOverlay_iface;
IVMRSurfaceAllocatorEx9 *allocator; IVMRSurfaceAllocator9 *allocator;
IVMRImagePresenter9 *presenter; IVMRImagePresenter9 *presenter;
BOOL allocator_is_ex;
DWORD stream_count; DWORD stream_count;
DWORD mixing_prefs; DWORD mixing_prefs;
...@@ -345,7 +344,7 @@ static HRESULT initialize_device(struct quartz_vmr *filter, VMR9AllocationInfo * ...@@ -345,7 +344,7 @@ static HRESULT initialize_device(struct quartz_vmr *filter, VMR9AllocationInfo *
HRESULT hr; HRESULT hr;
DWORD i; DWORD i;
if (FAILED(hr = IVMRSurfaceAllocatorEx9_InitializeDevice(filter->allocator, if (FAILED(hr = IVMRSurfaceAllocator9_InitializeDevice(filter->allocator,
filter->cookie, info, &count))) filter->cookie, info, &count)))
{ {
WARN("Failed to initialize device (flags %#x), hr %#x.\n", info->dwFlags, hr); WARN("Failed to initialize device (flags %#x), hr %#x.\n", info->dwFlags, hr);
...@@ -354,13 +353,13 @@ static HRESULT initialize_device(struct quartz_vmr *filter, VMR9AllocationInfo * ...@@ -354,13 +353,13 @@ static HRESULT initialize_device(struct quartz_vmr *filter, VMR9AllocationInfo *
for (i = 0; i < count; ++i) for (i = 0; i < count; ++i)
{ {
if (FAILED(hr = IVMRSurfaceAllocatorEx9_GetSurface(filter->allocator, if (FAILED(hr = IVMRSurfaceAllocator9_GetSurface(filter->allocator,
filter->cookie, i, 0, &filter->surfaces[i]))) filter->cookie, i, 0, &filter->surfaces[i])))
{ {
ERR("Failed to get surface %u, hr %#x.\n", i, hr); ERR("Failed to get surface %u, hr %#x.\n", i, hr);
while (i--) while (i--)
IDirect3DSurface9_Release(filter->surfaces[i]); IDirect3DSurface9_Release(filter->surfaces[i]);
IVMRSurfaceAllocatorEx9_TerminateDevice(filter->allocator, filter->cookie); IVMRSurfaceAllocator9_TerminateDevice(filter->allocator, filter->cookie);
return hr; return hr;
} }
} }
...@@ -533,7 +532,7 @@ static HRESULT WINAPI VMR9_BreakConnect(struct strmbase_renderer *This) ...@@ -533,7 +532,7 @@ static HRESULT WINAPI VMR9_BreakConnect(struct strmbase_renderer *This)
for (i = 0; i < pVMR9->num_surfaces; ++i) for (i = 0; i < pVMR9->num_surfaces; ++i)
IDirect3DSurface9_Release(pVMR9->surfaces[i]); IDirect3DSurface9_Release(pVMR9->surfaces[i]);
free(pVMR9->surfaces); free(pVMR9->surfaces);
IVMRSurfaceAllocatorEx9_TerminateDevice(pVMR9->allocator, pVMR9->cookie); IVMRSurfaceAllocator9_TerminateDevice(pVMR9->allocator, pVMR9->cookie);
pVMR9->num_surfaces = 0; pVMR9->num_surfaces = 0;
} }
return hr; return hr;
...@@ -558,8 +557,8 @@ static void vmr_destroy(struct strmbase_renderer *iface) ...@@ -558,8 +557,8 @@ static void vmr_destroy(struct strmbase_renderer *iface)
if (filter->allocator) if (filter->allocator)
{ {
IVMRSurfaceAllocatorEx9_TerminateDevice(filter->allocator, filter->cookie); IVMRSurfaceAllocator9_TerminateDevice(filter->allocator, filter->cookie);
IVMRSurfaceAllocatorEx9_Release(filter->allocator); IVMRSurfaceAllocator9_Release(filter->allocator);
} }
if (filter->presenter) if (filter->presenter)
IVMRImagePresenter9_Release(filter->presenter); IVMRImagePresenter9_Release(filter->presenter);
...@@ -1353,7 +1352,7 @@ static HRESULT WINAPI VMR9FilterConfig_SetRenderingMode(IVMRFilterConfig9 *iface ...@@ -1353,7 +1352,7 @@ static HRESULT WINAPI VMR9FilterConfig_SetRenderingMode(IVMRFilterConfig9 *iface
} }
if (This->allocator) if (This->allocator)
IVMRSurfaceAllocatorEx9_Release(This->allocator); IVMRSurfaceAllocator9_Release(This->allocator);
if (This->presenter) if (This->presenter)
IVMRImagePresenter9_Release(This->presenter); IVMRImagePresenter9_Release(This->presenter);
...@@ -1364,7 +1363,6 @@ static HRESULT WINAPI VMR9FilterConfig_SetRenderingMode(IVMRFilterConfig9 *iface ...@@ -1364,7 +1363,6 @@ static HRESULT WINAPI VMR9FilterConfig_SetRenderingMode(IVMRFilterConfig9 *iface
{ {
case VMR9Mode_Windowed: case VMR9Mode_Windowed:
case VMR9Mode_Windowless: case VMR9Mode_Windowless:
This->allocator_is_ex = 0;
This->cookie = ~0; This->cookie = ~0;
hr = VMR9DefaultAllocatorPresenterImpl_create(This, (LPVOID*)&This->presenter); hr = VMR9DefaultAllocatorPresenterImpl_create(This, (LPVOID*)&This->presenter);
...@@ -1378,7 +1376,7 @@ static HRESULT WINAPI VMR9FilterConfig_SetRenderingMode(IVMRFilterConfig9 *iface ...@@ -1378,7 +1376,7 @@ static HRESULT WINAPI VMR9FilterConfig_SetRenderingMode(IVMRFilterConfig9 *iface
This->presenter = NULL; This->presenter = NULL;
} }
else else
hr = IVMRSurfaceAllocatorEx9_AdviseNotify(This->allocator, &This->IVMRSurfaceAllocatorNotify9_iface); hr = IVMRSurfaceAllocator9_AdviseNotify(This->allocator, &This->IVMRSurfaceAllocatorNotify9_iface);
break; break;
case VMR9Mode_Renderless: case VMR9Mode_Renderless:
break; break;
...@@ -1971,15 +1969,8 @@ static HRESULT WINAPI VMR9SurfaceAllocatorNotify_AdviseSurfaceAllocator( ...@@ -1971,15 +1969,8 @@ static HRESULT WINAPI VMR9SurfaceAllocatorNotify_AdviseSurfaceAllocator(
if (FAILED(IVMRSurfaceAllocator9_QueryInterface(allocator, &IID_IVMRImagePresenter9, (void **)&filter->presenter))) if (FAILED(IVMRSurfaceAllocator9_QueryInterface(allocator, &IID_IVMRImagePresenter9, (void **)&filter->presenter)))
return E_NOINTERFACE; return E_NOINTERFACE;
if (SUCCEEDED(IVMRSurfaceAllocator9_QueryInterface(allocator, filter->allocator = allocator;
&IID_IVMRSurfaceAllocatorEx9, (void **)&filter->allocator))) IVMRSurfaceAllocator9_AddRef(allocator);
filter->allocator_is_ex = 1;
else
{
filter->allocator = (IVMRSurfaceAllocatorEx9 *)allocator;
IVMRSurfaceAllocator9_AddRef(allocator);
filter->allocator_is_ex = 0;
}
return S_OK; return S_OK;
} }
...@@ -2827,7 +2818,7 @@ static BOOL CreateRenderingWindow(struct default_presenter *This, VMR9Allocation ...@@ -2827,7 +2818,7 @@ static BOOL CreateRenderingWindow(struct default_presenter *This, VMR9Allocation
if (FAILED(hr)) if (FAILED(hr))
{ {
IVMRSurfaceAllocatorEx9_TerminateDevice(This->pVMR9->allocator, This->pVMR9->cookie); IVMRSurfaceAllocator9_TerminateDevice(This->pVMR9->allocator, This->pVMR9->cookie);
return FALSE; return FALSE;
} }
......
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