quartz: Implement IVMRWindowlessControl::GetNativeVideoSize().

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54935
This commit is contained in:
Elizabeth Figura 2024-06-25 19:03:04 -05:00 committed by Alexandre Julliard
parent 626b0faf30
commit 2b6035fcff
2 changed files with 29 additions and 8 deletions

View file

@ -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);

View file

@ -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(