Zebediah Figura : quartz/vmr9: Create the window on the same thread as the filter.
Alexandre Julliard
julliard at winehq.org
Thu Oct 3 16:44:00 CDT 2019
Module: wine
Branch: master
Commit: ff5644174e7e6e82e4f7575a95cf09e11bc52abd
URL: https://source.winehq.org/git/wine.git/?a=commit;h=ff5644174e7e6e82e4f7575a95cf09e11bc52abd
Author: Zebediah Figura <z.figura12 at gmail.com>
Date: Wed Oct 2 22:01:09 2019 -0500
quartz/vmr9: Create the window on the same thread as the filter.
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/quartz/vmr9.c | 44 +-------------------------------------------
1 file changed, 1 insertion(+), 43 deletions(-)
diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c
index 2c9c825b50..cc7ef69810 100644
--- a/dlls/quartz/vmr9.c
+++ b/dlls/quartz/vmr9.c
@@ -153,10 +153,6 @@ typedef struct
LONG refCount;
- HANDLE ack;
- DWORD tid;
- HANDLE hWndThread;
-
IDirect3DDevice9 *d3d9_dev;
IDirect3D9 *d3d9_ptr;
IDirect3DSurface9 **d3d9_surfaces;
@@ -2238,7 +2234,6 @@ static ULONG WINAPI VMR9_ImagePresenter_Release(IVMRImagePresenter9 *iface)
{
DWORD i;
TRACE("Destroying\n");
- CloseHandle(This->ack);
IDirect3D9_Release(This->d3d9_ptr);
TRACE("Number of surfaces: %u\n", This->num_surfaces);
@@ -2476,32 +2471,6 @@ static HRESULT VMR9_SurfaceAllocator_SetAllocationSettings(VMR9DefaultAllocatorP
return hr;
}
-static DWORD WINAPI MessageLoop(LPVOID lpParameter)
-{
- MSG msg;
- BOOL fGotMessage;
- VMR9DefaultAllocatorPresenterImpl *This = lpParameter;
-
- TRACE("Starting message loop\n");
-
- if (FAILED(BaseWindowImpl_PrepareWindow(&This->pVMR9->baseControlWindow.baseWindow)))
- {
- FIXME("Failed to prepare window\n");
- return FALSE;
- }
-
- SetEvent(This->ack);
- while ((fGotMessage = GetMessageW(&msg, NULL, 0, 0)) != 0 && fGotMessage != -1)
- {
- TranslateMessage(&msg);
- DispatchMessageW(&msg);
- }
-
- TRACE("End of message loop\n");
-
- return 0;
-}
-
static UINT d3d9_adapter_from_hwnd(IDirect3D9 *d3d9, HWND hwnd, HMONITOR *mon_out)
{
UINT d3d9_adapter;
@@ -2533,14 +2502,9 @@ static BOOL CreateRenderingWindow(VMR9DefaultAllocatorPresenterImpl *This, VMR9A
TRACE("(%p)->()\n", This);
- This->hWndThread = CreateThread(NULL, 0, MessageLoop, This, 0, &This->tid);
- if (!This->hWndThread)
+ if (FAILED(BaseWindowImpl_PrepareWindow(&This->pVMR9->baseControlWindow.baseWindow)))
return FALSE;
- WaitForSingleObject(This->ack, INFINITE);
-
- if (!This->pVMR9->baseControlWindow.baseWindow.hWnd) return FALSE;
-
/* Obtain a monitor and d3d9 device */
d3d9_adapter = d3d9_adapter_from_hwnd(This->d3d9_ptr, This->pVMR9->baseControlWindow.baseWindow.hWnd, &This->hMon);
@@ -2617,10 +2581,6 @@ static HRESULT WINAPI VMR9_SurfaceAllocator_TerminateDevice(IVMRSurfaceAllocator
return S_OK;
}
- SendMessageW(This->pVMR9->baseControlWindow.baseWindow.hWnd, WM_CLOSE, 0, 0);
- PostThreadMessageW(This->tid, WM_QUIT, 0, 0);
- WaitForSingleObject(This->hWndThread, INFINITE);
- This->hWndThread = NULL;
BaseWindowImpl_DoneWithWindow(&This->pVMR9->baseControlWindow.baseWindow);
return S_OK;
@@ -2839,8 +2799,6 @@ static HRESULT VMR9DefaultAllocatorPresenterImpl_create(struct quartz_vmr *paren
This->hMon = 0;
This->d3d9_vertex = NULL;
This->num_surfaces = 0;
- This->hWndThread = NULL;
- This->ack = CreateEventW(NULL, 0, 0, NULL);
This->SurfaceAllocatorNotify = NULL;
This->reset = FALSE;
More information about the wine-cvs
mailing list