Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/tests/vmr9.c | 116 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+)
diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c index 656f943ca35..2416d2c0d19 100644 --- a/dlls/quartz/tests/vmr9.c +++ b/dlls/quartz/tests/vmr9.c @@ -3729,6 +3729,121 @@ out: ok(!ref, "Got outstanding refcount %d.\n", ref); }
+static void test_windowless_size(void) +{ + VIDEOINFOHEADER vih = + { + .bmiHeader.biSize = sizeof(BITMAPINFOHEADER), + .bmiHeader.biWidth = 32, + .bmiHeader.biHeight = 16, + .bmiHeader.biBitCount = 32, + .bmiHeader.biPlanes = 1, + }; + AM_MEDIA_TYPE mt = + { + .majortype = MEDIATYPE_Video, + .subtype = MEDIASUBTYPE_RGB32, + .formattype = FORMAT_VideoInfo, + .cbFormat = sizeof(vih), + .pbFormat = (BYTE *)&vih, + }; + IBaseFilter *filter = create_vmr9(VMR9Mode_Windowless); + LONG width, height, aspect_width, aspect_height; + IVMRWindowlessControl9 *windowless_control; + IFilterGraph2 *graph = create_graph(); + struct testfilter source; + RECT src, dst, expect; + IMemInputPin *input; + HWND window; + HRESULT hr; + ULONG ref; + IPin *pin; + + IBaseFilter_QueryInterface(filter, &IID_IVMRWindowlessControl9, (void **)&windowless_control); + IBaseFilter_FindPin(filter, L"VMR Input0", &pin); + IPin_QueryInterface(pin, &IID_IMemInputPin, (void **)&input); + testfilter_init(&source); + IFilterGraph2_AddFilter(graph, &source.filter.IBaseFilter_iface, L"source"); + IFilterGraph2_AddFilter(graph, filter, L"vmr9"); + window = CreateWindowA("static", "quartz_test", WS_OVERLAPPEDWINDOW, 0, 0, 640, 480, 0, 0, 0, 0); + ok(!!window, "Failed to create a window.\n"); + + hr = IVMRWindowlessControl9_SetVideoClippingWindow(windowless_control, window); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IFilterGraph2_ConnectDirect(graph, &source.source.pin.IPin_iface, pin, &mt); + ok(hr == S_OK, "Got hr %#x.\n", hr); + test_allocator(input); + + hr = IVMRWindowlessControl9_GetNativeVideoSize(windowless_control, NULL, &height, &aspect_width, &aspect_height); + ok(hr == E_POINTER, "Got hr %#x.\n", hr); + hr = IVMRWindowlessControl9_GetNativeVideoSize(windowless_control, &width, NULL, &aspect_width, &aspect_height); + ok(hr == E_POINTER, "Got hr %#x.\n", hr); + + width = height = 0xdeadbeef; + hr = IVMRWindowlessControl9_GetNativeVideoSize(windowless_control, &width, &height, NULL, NULL); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(width == 32, "Got width %d.\n", width); + todo_wine ok(height == 16, "Got height %d.\n", height); + + aspect_width = aspect_height = 0xdeadbeef; + hr = IVMRWindowlessControl9_GetNativeVideoSize(windowless_control, &width, &height, &aspect_width, &aspect_height); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(aspect_width == 32, "Got width %d.\n", aspect_width); + ok(aspect_height == 16, "Got height %d.\n", aspect_height); + + memset(&src, 0xcc, sizeof(src)); + hr = IVMRWindowlessControl9_GetVideoPosition(windowless_control, &src, NULL); + ok(hr == S_OK, "Got hr %#x.\n", hr); + SetRect(&expect, 0, 0, 32, 16); + ok(EqualRect(&src, &expect), "Got source rect %s.\n", wine_dbgstr_rect(&src)); + + memset(&dst, 0xcc, sizeof(dst)); + hr = IVMRWindowlessControl9_GetVideoPosition(windowless_control, NULL, &dst); + ok(hr == S_OK, "Got hr %#x.\n", hr); + SetRect(&expect, 0, 0, 0, 0); + todo_wine ok(EqualRect(&dst, &expect), "Got dest rect %s.\n", wine_dbgstr_rect(&dst)); + + SetRect(&src, 4, 6, 16, 12); + hr = IVMRWindowlessControl9_SetVideoPosition(windowless_control, &src, NULL); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + memset(&src, 0xcc, sizeof(src)); + memset(&dst, 0xcc, sizeof(dst)); + hr = IVMRWindowlessControl9_GetVideoPosition(windowless_control, &src, &dst); + ok(hr == S_OK, "Got hr %#x.\n", hr); + SetRect(&expect, 4, 6, 16, 12); + ok(EqualRect(&src, &expect), "Got source rect %s.\n", wine_dbgstr_rect(&src)); + SetRect(&expect, 0, 0, 0, 0); + todo_wine ok(EqualRect(&dst, &expect), "Got dest rect %s.\n", wine_dbgstr_rect(&dst)); + + SetRect(&dst, 40, 60, 120, 160); + hr = IVMRWindowlessControl9_SetVideoPosition(windowless_control, NULL, &dst); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + memset(&src, 0xcc, sizeof(src)); + memset(&dst, 0xcc, sizeof(dst)); + hr = IVMRWindowlessControl9_GetVideoPosition(windowless_control, &src, &dst); + ok(hr == S_OK, "Got hr %#x.\n", hr); + SetRect(&expect, 4, 6, 16, 12); + ok(EqualRect(&src, &expect), "Got source rect %s.\n", wine_dbgstr_rect(&src)); + SetRect(&expect, 40, 60, 120, 160); + todo_wine ok(EqualRect(&dst, &expect), "Got dest rect %s.\n", wine_dbgstr_rect(&dst)); + + GetWindowRect(window, &src); + SetRect(&expect, 0, 0, 640, 480); + ok(EqualRect(&src, &expect), "Got window rect %s.\n", wine_dbgstr_rect(&src)); + + ref = IFilterGraph2_Release(graph); + ok(!ref, "Got outstanding refcount %d.\n", ref); + IMemInputPin_Release(input); + IPin_Release(pin); + IVMRWindowlessControl9_Release(windowless_control); + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %d.\n", ref); + DestroyWindow(window); +} + START_TEST(vmr9) { IBaseFilter *filter; @@ -3762,6 +3877,7 @@ START_TEST(vmr9) test_clipping_window(); test_surface_allocator_notify_refcount(); test_basic_video(); + test_windowless_size();
CoUninitialize(); }
These will be identical to the source rect at connection time, but not necessarily if we ever need to recreate the surfaces (due to a lost device, for example), and we still want to use the source image dimensions in that case.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/vmr9.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index 758ede61554..29be5aaa814 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -409,14 +409,10 @@ static HRESULT allocate_surfaces(struct quartz_vmr *filter, const AM_MEDIA_TYPE if (filter->mode == VMR9Mode_Windowless && !filter->hWndClippingWindow) return S_OK;
- info.dwWidth = filter->window.src.right; - info.dwHeight = filter->window.src.bottom; info.Pool = D3DPOOL_DEFAULT; info.MinBuffers = 1; - info.szAspectRatio.cx = info.dwWidth; - info.szAspectRatio.cy = info.dwHeight; - info.szNativeSize.cx = filter->bmiheader.biWidth; - info.szNativeSize.cy = filter->bmiheader.biHeight; + info.dwWidth = info.szAspectRatio.cx = info.szNativeSize.cx = filter->bmiheader.biWidth; + info.dwHeight = info.szAspectRatio.cy = info.szNativeSize.cy = filter->bmiheader.biHeight;
filter->cur_surface = 0;
StretchRect() should be good enough for presenting both kinds of surfaces.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/vmr9.c | 125 +-------------------------------------------- 1 file changed, 2 insertions(+), 123 deletions(-)
diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index 29be5aaa814..342c44bdadc 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -179,7 +179,6 @@ struct default_presenter IDirect3DDevice9 *d3d9_dev; IDirect3D9 *d3d9_ptr; IDirect3DSurface9 **d3d9_surfaces; - IDirect3DVertexBuffer9 *d3d9_vertex; HMONITOR hMon; DWORD num_surfaces;
@@ -2379,11 +2378,6 @@ static ULONG WINAPI VMR9_ImagePresenter_Release(IVMRImagePresenter9 *iface) free(This->d3d9_surfaces); This->d3d9_surfaces = NULL; This->num_surfaces = 0; - if (This->d3d9_vertex) - { - IDirect3DVertexBuffer9_Release(This->d3d9_vertex); - This->d3d9_vertex = NULL; - } free(This); return 0; } @@ -2406,57 +2400,10 @@ static HRESULT WINAPI VMR9_ImagePresenter_StopPresenting(IVMRImagePresenter9 *if return S_OK; }
-#define USED_FVF (D3DFVF_XYZRHW | D3DFVF_TEX1) -struct VERTEX { float x, y, z, rhw, u, v; }; - -static HRESULT VMR9_ImagePresenter_PresentTexture(struct default_presenter *This, IDirect3DSurface9 *surface) -{ - IDirect3DTexture9 *texture = NULL; - HRESULT hr; - - hr = IDirect3DDevice9_SetFVF(This->d3d9_dev, USED_FVF); - if (FAILED(hr)) - { - FIXME("SetFVF: %08x\n", hr); - return hr; - } - - hr = IDirect3DDevice9_SetStreamSource(This->d3d9_dev, 0, This->d3d9_vertex, 0, sizeof(struct VERTEX)); - if (FAILED(hr)) - { - FIXME("SetStreamSource: %08x\n", hr); - return hr; - } - - hr = IDirect3DSurface9_GetContainer(surface, &IID_IDirect3DTexture9, (void **) &texture); - if (FAILED(hr)) - { - FIXME("IDirect3DSurface9_GetContainer failed\n"); - return hr; - } - hr = IDirect3DDevice9_SetTexture(This->d3d9_dev, 0, (IDirect3DBaseTexture9 *)texture); - IDirect3DTexture9_Release(texture); - if (FAILED(hr)) - { - FIXME("SetTexture: %08x\n", hr); - return hr; - } - - hr = IDirect3DDevice9_DrawPrimitive(This->d3d9_dev, D3DPT_TRIANGLESTRIP, 0, 2); - if (FAILED(hr)) - { - FIXME("DrawPrimitive: %08x\n", hr); - return hr; - } - - return S_OK; -} - static HRESULT VMR9_ImagePresenter_PresentOffscreenSurface(struct default_presenter *This, IDirect3DSurface9 *surface) { HRESULT hr; IDirect3DSurface9 *target = NULL; - RECT target_rect;
hr = IDirect3DDevice9_GetBackBuffer(This->d3d9_dev, 0, 0, D3DBACKBUFFER_TYPE_MONO, &target); if (FAILED(hr)) @@ -2465,12 +2412,8 @@ static HRESULT VMR9_ImagePresenter_PresentOffscreenSurface(struct default_presen return hr; }
- /* Move rect to origin and flip it */ - SetRect(&target_rect, 0, This->pVMR9->window.dst.bottom - This->pVMR9->window.dst.top, - This->pVMR9->window.dst.right - This->pVMR9->window.dst.left, 0); - hr = IDirect3DDevice9_StretchRect(This->d3d9_dev, surface, - &This->pVMR9->window.src, target, &target_rect, D3DTEXF_LINEAR); + &This->pVMR9->window.src, target, NULL, D3DTEXF_LINEAR); if (FAILED(hr)) ERR("IDirect3DDevice9_StretchRect -- %08x\n", hr); IDirect3DSurface9_Release(target); @@ -2500,10 +2443,7 @@ static HRESULT WINAPI VMR9_ImagePresenter_PresentImage(IVMRImagePresenter9 *ifac hr = IDirect3DDevice9_BeginScene(This->d3d9_dev); if (SUCCEEDED(hr)) { - if (This->d3d9_vertex) - hr = VMR9_ImagePresenter_PresentTexture(This, info->lpSurf); - else - hr = VMR9_ImagePresenter_PresentOffscreenSurface(This, info->lpSurf); + hr = VMR9_ImagePresenter_PresentOffscreenSurface(This, info->lpSurf); render = SUCCEEDED(hr); } else @@ -2589,13 +2529,6 @@ static HRESULT VMR9_SurfaceAllocator_SetAllocationSettings(struct default_presen FIXME("Square texture support required..\n"); }
- hr = IDirect3DDevice9_CreateVertexBuffer(This->d3d9_dev, 4 * sizeof(struct VERTEX), D3DUSAGE_WRITEONLY, USED_FVF, allocinfo->Pool, &This->d3d9_vertex, NULL); - if (FAILED(hr)) - { - ERR("Couldn't create vertex buffer: %08x\n", hr); - return hr; - } - This->reset = TRUE; allocinfo->dwHeight = height; allocinfo->dwWidth = width; @@ -2709,10 +2642,7 @@ static HRESULT WINAPI VMR9_SurfaceAllocator_TerminateDevice(IVMRSurfaceAllocator /* Recreate all surfaces (If allocated as D3DPOOL_DEFAULT) and survive! */ static HRESULT VMR9_SurfaceAllocator_UpdateDeviceReset(struct default_presenter *This) { - struct VERTEX t_vert[4]; - UINT width, height; unsigned int i; - void *bits = NULL; D3DPRESENT_PARAMETERS d3dpp; HRESULT hr;
@@ -2721,11 +2651,6 @@ static HRESULT VMR9_SurfaceAllocator_UpdateDeviceReset(struct default_presenter
This->reset = FALSE; TRACE("RESETTING\n"); - if (This->d3d9_vertex) - { - IDirect3DVertexBuffer9_Release(This->d3d9_vertex); - This->d3d9_vertex = NULL; - }
for (i = 0; i < This->num_surfaces; ++i) { @@ -2765,52 +2690,6 @@ static HRESULT VMR9_SurfaceAllocator_UpdateDeviceReset(struct default_presenter
This->reset = FALSE;
- if (!(This->info.dwFlags & VMR9AllocFlag_TextureSurface)) - return S_OK; - - hr = IDirect3DDevice9_CreateVertexBuffer(This->d3d9_dev, 4 * sizeof(struct VERTEX), D3DUSAGE_WRITEONLY, USED_FVF, - This->info.Pool, &This->d3d9_vertex, NULL); - - width = This->info.dwWidth; - height = This->info.dwHeight; - - for (i = 0; i < ARRAY_SIZE(t_vert); ++i) - { - if (i % 2) - { - t_vert[i].x = (float)This->pVMR9->window.dst.right - (float)This->pVMR9->window.dst.left - 0.5f; - t_vert[i].u = (float)This->pVMR9->window.src.right / (float)width; - } - else - { - t_vert[i].x = -0.5f; - t_vert[i].u = (float)This->pVMR9->window.src.left / (float)width; - } - - if (i % 4 < 2) - { - t_vert[i].y = -0.5f; - t_vert[i].v = (float)This->pVMR9->window.src.bottom / (float)height; - } - else - { - t_vert[i].y = (float)This->pVMR9->window.dst.bottom - (float)This->pVMR9->window.dst.top - 0.5f; - t_vert[i].v = (float)This->pVMR9->window.src.top / (float)height; - } - t_vert[i].z = 0.0f; - t_vert[i].rhw = 1.0f; - } - - FIXME("Vertex rectangle:\n"); - FIXME("X, Y: %f, %f\n", t_vert[0].x, t_vert[0].y); - FIXME("X, Y: %f, %f\n", t_vert[3].x, t_vert[3].y); - FIXME("TOP, LEFT: %f, %f\n", t_vert[0].u, t_vert[0].v); - FIXME("DOWN, BOTTOM: %f, %f\n", t_vert[3].u, t_vert[3].v); - - IDirect3DVertexBuffer9_Lock(This->d3d9_vertex, 0, sizeof(t_vert), &bits, 0); - memcpy(bits, t_vert, sizeof(t_vert)); - IDirect3DVertexBuffer9_Unlock(This->d3d9_vertex); - return S_OK; }
On Mon, 11 May 2020 at 09:47, Zebediah Figura z.figura12@gmail.com wrote:
StretchRect() should be good enough for presenting both kinds of surfaces.
It's probably not worth worrying about because Wine (like pretty much all current drivers) always supports it, but note that StretchRect() with a texture as source and/or destination surface depends on D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES.
On 5/11/20 6:28 AM, Henri Verbeet wrote:
On Mon, 11 May 2020 at 09:47, Zebediah Figura z.figura12@gmail.com wrote:
StretchRect() should be good enough for presenting both kinds of surfaces.
It's probably not worth worrying about because Wine (like pretty much all current drivers) always supports it, but note that StretchRect() with a texture as source and/or destination surface depends on D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES.
Sure; I think I can send a separate patch to check for that bit at creation time.
It's not clear that this ever did something useful, but at least since d6a70366e this had the effect of always resetting immediately after creating the device.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/vmr9.c | 58 ---------------------------------------------- 1 file changed, 58 deletions(-)
diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index 342c44bdadc..a8d4b67d7b5 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -182,7 +182,6 @@ struct default_presenter HMONITOR hMon; DWORD num_surfaces;
- BOOL reset; VMR9AllocationInfo info;
struct quartz_vmr* pVMR9; @@ -2529,7 +2528,6 @@ static HRESULT VMR9_SurfaceAllocator_SetAllocationSettings(struct default_presen FIXME("Square texture support required..\n"); }
- This->reset = TRUE; allocinfo->dwHeight = height; allocinfo->dwWidth = width;
@@ -2639,60 +2637,6 @@ static HRESULT WINAPI VMR9_SurfaceAllocator_TerminateDevice(IVMRSurfaceAllocator return S_OK; }
-/* Recreate all surfaces (If allocated as D3DPOOL_DEFAULT) and survive! */ -static HRESULT VMR9_SurfaceAllocator_UpdateDeviceReset(struct default_presenter *This) -{ - unsigned int i; - D3DPRESENT_PARAMETERS d3dpp; - HRESULT hr; - - if (!This->d3d9_surfaces || !This->reset) - return S_OK; - - This->reset = FALSE; - TRACE("RESETTING\n"); - - for (i = 0; i < This->num_surfaces; ++i) - { - IDirect3DSurface9 *surface = This->d3d9_surfaces[i]; - TRACE("Releasing surface %p\n", surface); - if (surface) - IDirect3DSurface9_Release(surface); - } - ZeroMemory(This->d3d9_surfaces, sizeof(IDirect3DSurface9 *) * This->num_surfaces); - - /* Now try to create the d3d9 device */ - ZeroMemory(&d3dpp, sizeof(d3dpp)); - d3dpp.Windowed = TRUE; - d3dpp.hDeviceWindow = This->pVMR9->window.hwnd; - d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; - - if (This->d3d9_dev) - IDirect3DDevice9_Release(This->d3d9_dev); - This->d3d9_dev = NULL; - hr = IDirect3D9_CreateDevice(This->d3d9_ptr, d3d9_adapter_from_hwnd(This->d3d9_ptr, - This->pVMR9->window.hwnd, &This->hMon), D3DDEVTYPE_HAL, NULL, - D3DCREATE_HARDWARE_VERTEXPROCESSING, &d3dpp, &This->d3d9_dev); - if (FAILED(hr)) - { - hr = IDirect3D9_CreateDevice(This->d3d9_ptr, d3d9_adapter_from_hwnd(This->d3d9_ptr, - This->pVMR9->window.hwnd, &This->hMon), D3DDEVTYPE_HAL, NULL, - D3DCREATE_MIXED_VERTEXPROCESSING, &d3dpp, &This->d3d9_dev); - if (FAILED(hr)) - { - ERR("--> Creating device: %08x\n", hr); - return S_OK; - } - } - IVMRSurfaceAllocatorNotify9_ChangeD3DDevice(This->SurfaceAllocatorNotify, This->d3d9_dev, This->hMon); - - IVMRSurfaceAllocatorNotify9_AllocateSurfaceHelper(This->SurfaceAllocatorNotify, &This->info, &This->num_surfaces, This->d3d9_surfaces); - - This->reset = FALSE; - - return S_OK; -} - static HRESULT WINAPI VMR9_SurfaceAllocator_GetSurface(IVMRSurfaceAllocatorEx9 *iface, DWORD_PTR id, DWORD surfaceindex, DWORD flags, IDirect3DSurface9 **surface) { struct default_presenter *This = impl_from_IVMRSurfaceAllocatorEx9(iface); @@ -2704,8 +2648,6 @@ static HRESULT WINAPI VMR9_SurfaceAllocator_GetSurface(IVMRSurfaceAllocatorEx9 * return E_FAIL; }
- VMR9_SurfaceAllocator_UpdateDeviceReset(This); - if (surfaceindex >= This->num_surfaces) { ERR("surfaceindex is greater than num_surfaces\n");
This fixes resizing the window after connection time, especially when using a custom destination rect.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/tests/vmr9.c | 14 ++++---------- dlls/quartz/vmr9.c | 12 ++++++------ 2 files changed, 10 insertions(+), 16 deletions(-)
diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c index 2416d2c0d19..ee6210072d1 100644 --- a/dlls/quartz/tests/vmr9.c +++ b/dlls/quartz/tests/vmr9.c @@ -1500,11 +1500,8 @@ static void test_current_image(IBaseFilter *filter, IMemInputPin *input, ok(hr == S_OK, "Got hr %#x.\n", hr); ok(size == sizeof(buffer), "Got size %d.\n", size); ok(!memcmp(bih, &expect_bih, sizeof(BITMAPINFOHEADER)), "Bitmap headers didn't match.\n"); - if (0) /* FIXME: Rendering is currently broken on Wine. */ - { - for (i = 0; i < 32 * 16; ++i) - ok((data[i] & 0xffffff) == 0x7f007f, "Got unexpected color %08x at %u.\n", data[i], i); - } + for (i = 0; i < 32 * 16; ++i) + ok((data[i] & 0xffffff) == 0x7f007f, "Got unexpected color %08x at %u.\n", data[i], i);
hr = IMediaControl_Run(control); ok(hr == S_OK, "Got hr %#x.\n", hr); @@ -1516,11 +1513,8 @@ static void test_current_image(IBaseFilter *filter, IMemInputPin *input, ok(hr == S_OK, "Got hr %#x.\n", hr); ok(size == sizeof(buffer), "Got size %d.\n", size); ok(!memcmp(bih, &expect_bih, sizeof(BITMAPINFOHEADER)), "Bitmap headers didn't match.\n"); - if (0) /* FIXME: Rendering is currently broken on Wine. */ - { - for (i = 0; i < 32 * 16; ++i) - ok((data[i] & 0xffffff) == 0x7f007f, "Got unexpected color %08x at %u.\n", data[i], i); - } + for (i = 0; i < 32 * 16; ++i) + ok((data[i] & 0xffffff) == 0x7f007f, "Got unexpected color %08x at %u.\n", data[i], i);
hr = IMediaControl_Stop(control); ok(hr == S_OK, "Got hr %#x.\n", hr); diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index a8d4b67d7b5..c7ebdc6c573 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -2411,8 +2411,7 @@ static HRESULT VMR9_ImagePresenter_PresentOffscreenSurface(struct default_presen return hr; }
- hr = IDirect3DDevice9_StretchRect(This->d3d9_dev, surface, - &This->pVMR9->window.src, target, NULL, D3DTEXF_LINEAR); + hr = IDirect3DDevice9_StretchRect(This->d3d9_dev, surface, NULL, target, NULL, D3DTEXF_POINT); if (FAILED(hr)) ERR("IDirect3DDevice9_StretchRect -- %08x\n", hr); IDirect3DSurface9_Release(target); @@ -2450,7 +2449,8 @@ static HRESULT WINAPI VMR9_ImagePresenter_PresentImage(IVMRImagePresenter9 *ifac hr = IDirect3DDevice9_EndScene(This->d3d9_dev); if (render && SUCCEEDED(hr)) { - hr = IDirect3DDevice9_Present(This->d3d9_dev, NULL, NULL, This->pVMR9->window.hwnd, NULL); + hr = IDirect3DDevice9_Present(This->d3d9_dev, &This->pVMR9->window.src, + &This->pVMR9->window.dst, This->pVMR9->window.hwnd, NULL); if (FAILED(hr)) FIXME("Presenting image: %08x\n", hr); } @@ -2572,9 +2572,9 @@ static BOOL CreateRenderingWindow(struct default_presenter *This, VMR9Allocation ZeroMemory(&d3dpp, sizeof(d3dpp)); d3dpp.Windowed = TRUE; d3dpp.hDeviceWindow = This->pVMR9->window.hwnd; - d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; - d3dpp.BackBufferHeight = This->pVMR9->window.dst.bottom - This->pVMR9->window.dst.top; - d3dpp.BackBufferWidth = This->pVMR9->window.dst.right - This->pVMR9->window.dst.left; + d3dpp.SwapEffect = D3DSWAPEFFECT_COPY; + d3dpp.BackBufferWidth = info->dwWidth; + d3dpp.BackBufferHeight = info->dwHeight;
hr = IDirect3D9_CreateDevice(This->d3d9_ptr, d3d9_adapter, D3DDEVTYPE_HAL, NULL, D3DCREATE_MIXED_VERTEXPROCESSING, &d3dpp, &This->d3d9_dev); if (FAILED(hr))
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=71457
Your paranoid android.
=== w8 (32 bit report) ===
quartz: vmr9.c:3690: Test failed: Got frame rate 1.9999999552965164e-002. vmr9.c:927: Test failed: Got hr 0x80004005. vmr9.c:3780: Test failed: Got width 0. vmr9.c:3781: Test failed: Got height 0. vmr9.c:3786: Test failed: Got width 0. vmr9.c:3787: Test failed: Got height 0. vmr9.c:3793: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3803: Test failed: Got hr 0x80070057. vmr9.c:3810: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3823: Test failed: Got source rect (0,0)-(0,0).
=== w8adm (32 bit report) ===
quartz: vmr9.c:927: Test failed: Got hr 0x80004005. vmr9.c:3780: Test failed: Got width 0. vmr9.c:3781: Test failed: Got height 0. vmr9.c:3786: Test failed: Got width 0. vmr9.c:3787: Test failed: Got height 0. vmr9.c:3793: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3803: Test failed: Got hr 0x80070057. vmr9.c:3810: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3823: Test failed: Got source rect (0,0)-(0,0).
=== w1064v1507 (32 bit report) ===
quartz: vmr9.c:927: Test failed: Got hr 0x80004005. vmr9.c:3780: Test failed: Got width 0. vmr9.c:3781: Test failed: Got height 0. vmr9.c:3786: Test failed: Got width 0. vmr9.c:3787: Test failed: Got height 0. vmr9.c:3793: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3803: Test failed: Got hr 0x80070057. vmr9.c:3810: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3823: Test failed: Got source rect (0,0)-(0,0).
=== w1064v1809 (32 bit report) ===
quartz: vmr9.c:927: Test failed: Got hr 0x80004005. vmr9.c:3780: Test failed: Got width 0. vmr9.c:3781: Test failed: Got height 0. vmr9.c:3786: Test failed: Got width 0. vmr9.c:3787: Test failed: Got height 0. vmr9.c:3793: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3803: Test failed: Got hr 0x80070057. vmr9.c:3810: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3823: Test failed: Got source rect (0,0)-(0,0).
=== w1064v1809_2scr (32 bit report) ===
quartz: vmr9.c:927: Test failed: Got hr 0x80004005. vmr9.c:3780: Test failed: Got width 0. vmr9.c:3781: Test failed: Got height 0. vmr9.c:3786: Test failed: Got width 0. vmr9.c:3787: Test failed: Got height 0. vmr9.c:3793: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3803: Test failed: Got hr 0x80070057. vmr9.c:3810: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3823: Test failed: Got source rect (0,0)-(0,0).
=== w1064v1809_ar (32 bit report) ===
quartz: vmr9.c:927: Test failed: Got hr 0x80004005. vmr9.c:3780: Test failed: Got width 0. vmr9.c:3781: Test failed: Got height 0. vmr9.c:3786: Test failed: Got width 0. vmr9.c:3787: Test failed: Got height 0. vmr9.c:3793: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3803: Test failed: Got hr 0x80070057. vmr9.c:3810: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3823: Test failed: Got source rect (0,0)-(0,0).
=== w1064v1809_he (32 bit report) ===
quartz: vmr9.c:927: Test failed: Got hr 0x80004005. vmr9.c:3780: Test failed: Got width 0. vmr9.c:3781: Test failed: Got height 0. vmr9.c:3786: Test failed: Got width 0. vmr9.c:3787: Test failed: Got height 0. vmr9.c:3793: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3803: Test failed: Got hr 0x80070057. vmr9.c:3810: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3823: Test failed: Got source rect (0,0)-(0,0).
=== w1064v1809_ja (32 bit report) ===
quartz: vmr9.c:927: Test failed: Got hr 0x80004005. vmr9.c:3780: Test failed: Got width 0. vmr9.c:3781: Test failed: Got height 0. vmr9.c:3786: Test failed: Got width 0. vmr9.c:3787: Test failed: Got height 0. vmr9.c:3793: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3803: Test failed: Got hr 0x80070057. vmr9.c:3810: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3823: Test failed: Got source rect (0,0)-(0,0).
=== w1064v1809_zh_CN (32 bit report) ===
quartz: vmr9.c:927: Test failed: Got hr 0x80004005. vmr9.c:3780: Test failed: Got width 0. vmr9.c:3781: Test failed: Got height 0. vmr9.c:3786: Test failed: Got width 0. vmr9.c:3787: Test failed: Got height 0. vmr9.c:3793: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3803: Test failed: Got hr 0x80070057. vmr9.c:3810: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3823: Test failed: Got source rect (0,0)-(0,0).
=== w864 (64 bit report) ===
quartz: vmr9.c:927: Test failed: Got hr 0x80004005. vmr9.c:3780: Test failed: Got width 0. vmr9.c:3781: Test failed: Got height 0. vmr9.c:3786: Test failed: Got width 0. vmr9.c:3787: Test failed: Got height 0. vmr9.c:3793: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3803: Test failed: Got hr 0x80070057. vmr9.c:3810: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3823: Test failed: Got source rect (0,0)-(0,0).
=== w1064v1507 (64 bit report) ===
quartz: vmr9.c:927: Test failed: Got hr 0x80004005. vmr9.c:3780: Test failed: Got width 0. vmr9.c:3781: Test failed: Got height 0. vmr9.c:3786: Test failed: Got width 0. vmr9.c:3787: Test failed: Got height 0. vmr9.c:3793: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3803: Test failed: Got hr 0x80070057. vmr9.c:3810: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3823: Test failed: Got source rect (0,0)-(0,0).
=== w1064v1809 (64 bit report) ===
quartz: vmr9.c:927: Test failed: Got hr 0x80004005. vmr9.c:3780: Test failed: Got width 0. vmr9.c:3781: Test failed: Got height 0. vmr9.c:3786: Test failed: Got width 0. vmr9.c:3787: Test failed: Got height 0. vmr9.c:3793: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3803: Test failed: Got hr 0x80070057. vmr9.c:3810: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3823: Test failed: Got source rect (0,0)-(0,0).
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=71453
Your paranoid android.
=== w8 (32 bit report) ===
quartz: vmr9.c:3696: Test failed: Got frame rate 1.9999999552965164e-002. vmr9.c:927: Test failed: Got hr 0x80004005. vmr9.c:3786: Test failed: Got width 0. vmr9.c:3787: Test failed: Got height 0. vmr9.c:3792: Test failed: Got width 0. vmr9.c:3793: Test failed: Got height 0. vmr9.c:3799: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3809: Test failed: Got hr 0x80070057. vmr9.c:3816: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3829: Test failed: Got source rect (0,0)-(0,0).
=== w8adm (32 bit report) ===
quartz: vmr9.c:927: Test failed: Got hr 0x80004005. vmr9.c:3786: Test failed: Got width 0. vmr9.c:3787: Test failed: Got height 0. vmr9.c:3792: Test failed: Got width 0. vmr9.c:3793: Test failed: Got height 0. vmr9.c:3799: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3809: Test failed: Got hr 0x80070057. vmr9.c:3816: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3829: Test failed: Got source rect (0,0)-(0,0).
=== w1064v1507 (32 bit report) ===
quartz: vmr9.c:927: Test failed: Got hr 0x80004005. vmr9.c:3786: Test failed: Got width 0. vmr9.c:3787: Test failed: Got height 0. vmr9.c:3792: Test failed: Got width 0. vmr9.c:3793: Test failed: Got height 0. vmr9.c:3799: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3809: Test failed: Got hr 0x80070057. vmr9.c:3816: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3829: Test failed: Got source rect (0,0)-(0,0).
=== w1064v1809 (32 bit report) ===
quartz: vmr9.c:927: Test failed: Got hr 0x80004005. vmr9.c:3786: Test failed: Got width 0. vmr9.c:3787: Test failed: Got height 0. vmr9.c:3792: Test failed: Got width 0. vmr9.c:3793: Test failed: Got height 0. vmr9.c:3799: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3809: Test failed: Got hr 0x80070057. vmr9.c:3816: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3829: Test failed: Got source rect (0,0)-(0,0).
=== w1064v1809_2scr (32 bit report) ===
quartz: vmr9.c:927: Test failed: Got hr 0x80004005. vmr9.c:3786: Test failed: Got width 0. vmr9.c:3787: Test failed: Got height 0. vmr9.c:3792: Test failed: Got width 0. vmr9.c:3793: Test failed: Got height 0. vmr9.c:3799: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3809: Test failed: Got hr 0x80070057. vmr9.c:3816: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3829: Test failed: Got source rect (0,0)-(0,0).
=== w1064v1809_ar (32 bit report) ===
quartz: vmr9.c:927: Test failed: Got hr 0x80004005. vmr9.c:3786: Test failed: Got width 0. vmr9.c:3787: Test failed: Got height 0. vmr9.c:3792: Test failed: Got width 0. vmr9.c:3793: Test failed: Got height 0. vmr9.c:3799: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3809: Test failed: Got hr 0x80070057. vmr9.c:3816: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3829: Test failed: Got source rect (0,0)-(0,0).
=== w1064v1809_he (32 bit report) ===
quartz: vmr9.c:927: Test failed: Got hr 0x80004005. vmr9.c:3786: Test failed: Got width 0. vmr9.c:3787: Test failed: Got height 0. vmr9.c:3792: Test failed: Got width 0. vmr9.c:3793: Test failed: Got height 0. vmr9.c:3799: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3809: Test failed: Got hr 0x80070057. vmr9.c:3816: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3829: Test failed: Got source rect (0,0)-(0,0).
=== w1064v1809_ja (32 bit report) ===
quartz: vmr9.c:927: Test failed: Got hr 0x80004005. vmr9.c:3786: Test failed: Got width 0. vmr9.c:3787: Test failed: Got height 0. vmr9.c:3792: Test failed: Got width 0. vmr9.c:3793: Test failed: Got height 0. vmr9.c:3799: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3809: Test failed: Got hr 0x80070057. vmr9.c:3816: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3829: Test failed: Got source rect (0,0)-(0,0).
=== w1064v1809_zh_CN (32 bit report) ===
quartz: vmr9.c:927: Test failed: Got hr 0x80004005. vmr9.c:3786: Test failed: Got width 0. vmr9.c:3787: Test failed: Got height 0. vmr9.c:3792: Test failed: Got width 0. vmr9.c:3793: Test failed: Got height 0. vmr9.c:3799: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3809: Test failed: Got hr 0x80070057. vmr9.c:3816: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3829: Test failed: Got source rect (0,0)-(0,0).
=== w864 (64 bit report) ===
quartz: vmr9.c:927: Test failed: Got hr 0x80004005. vmr9.c:3786: Test failed: Got width 0. vmr9.c:3787: Test failed: Got height 0. vmr9.c:3792: Test failed: Got width 0. vmr9.c:3793: Test failed: Got height 0. vmr9.c:3799: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3809: Test failed: Got hr 0x80070057. vmr9.c:3816: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3829: Test failed: Got source rect (0,0)-(0,0).
=== w1064v1507 (64 bit report) ===
quartz: vmr9.c:927: Test failed: Got hr 0x80004005. vmr9.c:3786: Test failed: Got width 0. vmr9.c:3787: Test failed: Got height 0. vmr9.c:3792: Test failed: Got width 0. vmr9.c:3793: Test failed: Got height 0. vmr9.c:3799: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3809: Test failed: Got hr 0x80070057. vmr9.c:3816: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3829: Test failed: Got source rect (0,0)-(0,0).
=== w1064v1809 (64 bit report) ===
quartz: vmr9.c:927: Test failed: Got hr 0x80004005. vmr9.c:3786: Test failed: Got width 0. vmr9.c:3787: Test failed: Got height 0. vmr9.c:3792: Test failed: Got width 0. vmr9.c:3793: Test failed: Got height 0. vmr9.c:3799: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3809: Test failed: Got hr 0x80070057. vmr9.c:3816: Test failed: Got source rect (0,0)-(0,0). vmr9.c:3829: Test failed: Got source rect (0,0)-(0,0).