From: Alfred Agrell floating@muncher.se
--- dlls/quartz/vmr9.c | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-)
diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index 9ea3374ca96..b278bfa8ce9 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -95,6 +95,7 @@ struct quartz_vmr */ VMR9Mode mode; BITMAPINFOHEADER bmiheader; + const GUID *current_subtype;
HMODULE hD3d9;
@@ -441,6 +442,7 @@ static HRESULT allocate_surfaces(struct quartz_vmr *filter, const AM_MEDIA_TYPE if (IsEqualGUID(&mt->subtype, formats[i].subtype)) { info.Format = formats[i].format; + filter->current_subtype = formats[i].subtype;
if (formats[i].flags & VMR9AllocFlag_TextureSurface) { @@ -2003,12 +2005,37 @@ static HRESULT WINAPI VMR9SurfaceAllocatorNotify_ChangeD3DDevice(IVMRSurfaceAllo { struct quartz_vmr *This = impl_from_IVMRSurfaceAllocatorNotify9(iface);
- FIXME("(%p/%p)->(...) semi-stub\n", iface, This); if (This->allocator_d3d9_dev) IDirect3DDevice9_Release(This->allocator_d3d9_dev); This->allocator_d3d9_dev = device; IDirect3DDevice9_AddRef(This->allocator_d3d9_dev);
+ if (This->num_surfaces) + { + VIDEOINFOHEADER hd = { + { 0, 0, This->bmiheader.biWidth, This->bmiheader.biHeight }, + { 0, 0, This->bmiheader.biWidth, This->bmiheader.biHeight }, + This->bmiheader.biSizeImage, + 0, + 0, + This->bmiheader + }; + AM_MEDIA_TYPE mt = { + MEDIATYPE_Video, + *This->current_subtype, + TRUE, + TRUE, + This->bmiheader.biSizeImage, + FORMAT_VideoInfo, + NULL, + sizeof(hd), + (BYTE *)&hd + }; + + vmr_disconnect(&This->renderer); + vmr_connect(&This->renderer, &mt); + } + return S_OK; }