From: Elizabeth Figura zfigura@codeweavers.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54935 --- dlls/quartz/tests/vmr7.c | 12 ++++++------ dlls/quartz/vmr7_presenter.c | 25 +++++++++++++++++++++++-- 2 files changed, 29 insertions(+), 8 deletions(-)
diff --git a/dlls/quartz/tests/vmr7.c b/dlls/quartz/tests/vmr7.c index 23bcbdce790..ff15ad9c81d 100644 --- a/dlls/quartz/tests/vmr7.c +++ b/dlls/quartz/tests/vmr7.c @@ -3895,15 +3895,15 @@ static void test_default_presenter_window(void)
width = height = 0xdeadbeef; hr = IVMRWindowlessControl_GetNativeVideoSize(control, &width, &height, NULL, NULL); - todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); - todo_wine ok(width == 420, "Got width %ld.\n", width); - todo_wine ok(height == 180, "Got height %ld.\n", height); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(width == 420, "Got width %ld.\n", width); + ok(height == 180, "Got height %ld.\n", height);
width = height = 0xdeadbeef; hr = IVMRWindowlessControl_GetNativeVideoSize(control, NULL, NULL, &width, &height); - todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); - todo_wine ok(width == 400, "Got width %ld.\n", width); - todo_wine ok(height == 200, "Got height %ld.\n", height); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(width == 400, "Got width %ld.\n", width); + ok(height == 200, "Got height %ld.\n", height);
hr = IVMRSurfaceAllocator_FreeSurface(allocator, 0); ok(hr == S_OK, "Got hr %#lx.\n", hr); diff --git a/dlls/quartz/vmr7_presenter.c b/dlls/quartz/vmr7_presenter.c index 406c9ead52a..c244c86236a 100644 --- a/dlls/quartz/vmr7_presenter.c +++ b/dlls/quartz/vmr7_presenter.c @@ -35,6 +35,8 @@ struct vmr7_presenter IDirectDrawSurface7 *frontbuffer; IDirectDrawSurface7 *primary; HWND window; + + SIZE native_size, aspect_ratio; };
static struct vmr7_presenter *impl_from_IVMRImagePresenter(IVMRImagePresenter *iface) @@ -213,6 +215,10 @@ static HRESULT WINAPI surface_allocator_AllocateSurface(IVMRSurfaceAllocator *if } *surface = presenter->frontbuffer; ++*count; + + presenter->native_size = info->szNativeSize; + presenter->aspect_ratio = info->szAspectRatio; + return S_OK; }
@@ -286,9 +292,24 @@ static ULONG WINAPI windowless_control_Release(IVMRWindowlessControl *iface) static HRESULT WINAPI windowless_control_GetNativeVideoSize(IVMRWindowlessControl *iface, LONG *width, LONG *height, LONG *aspect_width, LONG *aspect_height) { - FIXME("iface %p, width %p, height %p, aspect_width %p, aspect_height %p.\n", + struct vmr7_presenter *presenter = impl_from_IVMRWindowlessControl(iface); + + TRACE("iface %p, width %p, height %p, aspect_width %p, aspect_height %p.\n", iface, width, height, aspect_width, aspect_height); - return E_NOTIMPL; + + if (width) + *width = presenter->native_size.cx; + if (height) + *height = presenter->native_size.cy; + if (aspect_width) + *aspect_width = presenter->aspect_ratio.cx; + if (aspect_height) + *aspect_height = presenter->aspect_ratio.cy; + + TRACE("Returning size (%ld, %ld), aspect ratio (%ld, %ld).\n", + presenter->native_size.cx, presenter->native_size.cy, + presenter->aspect_ratio.cx, presenter->aspect_ratio.cy); + return S_OK; }
static HRESULT WINAPI windowless_control_GetMinIdealVideoSize(