2 * Copyright 2020 Nikolay Sivov
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #include "wine/test.h"
26 static unsigned int get_refcount(void *object
)
28 IUnknown
*iface
= object
;
29 IUnknown_AddRef(iface
);
30 return IUnknown_Release(iface
);
33 static HWND
create_window(void)
35 RECT r
= {0, 0, 640, 480};
37 AdjustWindowRect(&r
, WS_OVERLAPPEDWINDOW
| WS_VISIBLE
, FALSE
);
39 return CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW
| WS_VISIBLE
,
40 0, 0, r
.right
- r
.left
, r
.bottom
- r
.top
, NULL
, NULL
, NULL
, NULL
);
43 static IDirect3DDevice9
*create_device(IDirect3D9
*d3d9
, HWND focus_window
)
45 D3DPRESENT_PARAMETERS present_parameters
= {0};
46 IDirect3DDevice9
*device
= NULL
;
48 present_parameters
.BackBufferWidth
= 640;
49 present_parameters
.BackBufferHeight
= 480;
50 present_parameters
.BackBufferFormat
= D3DFMT_A8R8G8B8
;
51 present_parameters
.SwapEffect
= D3DSWAPEFFECT_DISCARD
;
52 present_parameters
.hDeviceWindow
= focus_window
;
53 present_parameters
.Windowed
= TRUE
;
54 present_parameters
.EnableAutoDepthStencil
= TRUE
;
55 present_parameters
.AutoDepthStencilFormat
= D3DFMT_D24S8
;
57 IDirect3D9_CreateDevice(d3d9
, D3DADAPTER_DEFAULT
, D3DDEVTYPE_HAL
, focus_window
,
58 D3DCREATE_HARDWARE_VERTEXPROCESSING
, &present_parameters
, &device
);
63 static void test_surface_desc(IDirect3DSurface9
*surface
)
65 D3DSURFACE_DESC desc
= { 0 };
68 hr
= IDirect3DSurface9_GetDesc(surface
, &desc
);
69 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
71 ok(desc
.Format
== D3DFMT_X8R8G8B8
, "Unexpected format %d.\n", desc
.Format
);
72 ok(desc
.Type
== D3DRTYPE_SURFACE
, "Unexpected type %d.\n", desc
.Type
);
73 ok(desc
.Usage
== 0, "Unexpected usage %d.\n", desc
.Usage
);
74 ok(desc
.Pool
== D3DPOOL_DEFAULT
, "Unexpected pool %d.\n", desc
.Pool
);
75 ok(desc
.MultiSampleType
== D3DMULTISAMPLE_NONE
, "Unexpected multisample type %d.\n", desc
.MultiSampleType
);
76 ok(desc
.MultiSampleQuality
== 0, "Unexpected multisample quality %d.\n", desc
.MultiSampleQuality
);
77 ok(desc
.Width
== 64, "Unexpected width %u.\n", desc
.Width
);
78 ok(desc
.Height
== 64, "Unexpected height %u.\n", desc
.Height
);
81 static void init_video_desc(DXVA2_VideoDesc
*video_desc
, D3DFORMAT format
)
83 memset(video_desc
, 0, sizeof(*video_desc
));
84 video_desc
->SampleWidth
= 64;
85 video_desc
->SampleHeight
= 64;
86 video_desc
->Format
= format
;
89 static void test_device_manager(void)
91 IDirectXVideoProcessorService
*processor_service
;
92 IDirectXVideoAccelerationService
*accel_service
;
93 IDirect3DDevice9
*device
, *device2
, *device3
;
94 IDirectXVideoProcessorService
*proc_service
;
95 IDirect3DDeviceManager9
*manager
;
96 IDirect3DSurface9
*surfaces
[2];
97 DXVA2_VideoDesc video_desc
;
98 int refcount
, refcount2
;
99 HANDLE handle
, handle1
;
109 static const D3DFORMAT rt_formats
[] =
114 MAKEFOURCC('A','Y','U','V'),
116 static const D3DFORMAT rt_unsupported_formats
[] =
127 window
= create_window();
128 d3d
= Direct3DCreate9(D3D_SDK_VERSION
);
129 ok(!!d3d
, "Failed to create a D3D object.\n");
130 if (!(device
= create_device(d3d
, window
)))
132 skip("Failed to create a D3D device, skipping tests.\n");
136 hr
= DXVA2CreateDirect3DDeviceManager9(&token
, &manager
);
137 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
139 hr
= IDirect3DDeviceManager9_OpenDeviceHandle(manager
, &handle
);
140 ok(hr
== DXVA2_E_NOT_INITIALIZED
, "Unexpected hr %#x.\n", hr
);
142 hr
= IDirect3DDeviceManager9_LockDevice(manager
, 0, &device2
, FALSE
);
143 ok(hr
== DXVA2_E_NOT_INITIALIZED
, "Unexpected hr %#x.\n", hr
);
145 hr
= IDirect3DDeviceManager9_CloseDeviceHandle(manager
, 0);
146 ok(hr
== E_HANDLE
, "Unexpected hr %#x.\n", hr
);
149 hr
= IDirect3DDeviceManager9_ResetDevice(manager
, device
, token
+ 1);
150 ok(hr
== E_INVALIDARG
, "Unexpected hr %#x.\n", hr
);
152 hr
= IDirect3DDeviceManager9_ResetDevice(manager
, device
, token
);
153 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
154 refcount
= get_refcount(device
);
156 hr
= IDirect3DDeviceManager9_CloseDeviceHandle(manager
, 0);
157 ok(hr
== E_HANDLE
, "Unexpected hr %#x.\n", hr
);
160 hr
= IDirect3DDeviceManager9_OpenDeviceHandle(manager
, &handle1
);
161 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
162 ok(!!handle1
, "Unexpected handle value.\n");
164 refcount2
= get_refcount(device
);
165 ok(refcount2
== refcount
, "Unexpected refcount %d.\n", refcount
);
168 hr
= IDirect3DDeviceManager9_OpenDeviceHandle(manager
, &handle
);
169 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
170 ok(handle
!= handle1
, "Unexpected handle.\n");
172 hr
= IDirect3DDeviceManager9_CloseDeviceHandle(manager
, handle
);
173 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
175 /* Already closed. */
176 hr
= IDirect3DDeviceManager9_CloseDeviceHandle(manager
, handle
);
177 ok(hr
== E_HANDLE
, "Unexpected hr %#x.\n", hr
);
180 hr
= IDirect3DDeviceManager9_OpenDeviceHandle(manager
, &handle
);
181 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
183 hr
= IDirect3DDeviceManager9_CloseDeviceHandle(manager
, handle1
);
184 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
186 hr
= IDirect3DDeviceManager9_TestDevice(manager
, handle1
);
187 ok(hr
== E_HANDLE
, "Unexpected hr %#x.\n", hr
);
189 hr
= IDirect3DDeviceManager9_TestDevice(manager
, 0);
190 ok(hr
== E_HANDLE
, "Unexpected hr %#x.\n", hr
);
193 hr
= IDirect3DDeviceManager9_OpenDeviceHandle(manager
, &handle
);
194 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
197 hr
= IDirect3DDeviceManager9_OpenDeviceHandle(manager
, &handle1
);
198 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
200 hr
= IDirect3DDeviceManager9_GetVideoService(manager
, handle
, &IID_IDirectXVideoProcessorService
,
201 (void **)&processor_service
);
202 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
203 IDirectXVideoProcessorService_Release(processor_service
);
205 device2
= create_device(d3d
, window
);
207 hr
= IDirect3DDeviceManager9_ResetDevice(manager
, device2
, token
);
208 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
210 hr
= IDirect3DDeviceManager9_GetVideoService(manager
, handle
, &IID_IDirectXVideoProcessorService
,
211 (void **)&processor_service
);
212 ok(hr
== DXVA2_E_NEW_VIDEO_DEVICE
, "Unexpected hr %#x.\n", hr
);
214 hr
= IDirect3DDeviceManager9_TestDevice(manager
, handle
);
215 ok(hr
== DXVA2_E_NEW_VIDEO_DEVICE
, "Unexpected hr %#x.\n", hr
);
217 hr
= IDirect3DDeviceManager9_CloseDeviceHandle(manager
, handle
);
218 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
221 hr
= IDirect3DDeviceManager9_OpenDeviceHandle(manager
, &handle
);
222 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
224 hr
= IDirect3DDeviceManager9_LockDevice(manager
, handle
, &device3
, FALSE
);
225 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
226 ok(device2
== device3
, "Unexpected device pointer.\n");
227 IDirect3DDevice9_Release(device3
);
229 hr
= IDirect3DDeviceManager9_UnlockDevice(manager
, handle
, FALSE
);
230 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
232 hr
= IDirect3DDeviceManager9_UnlockDevice(manager
, handle
, FALSE
);
233 ok(hr
== E_INVALIDARG
, "Unexpected hr %#x.\n", hr
);
235 hr
= IDirect3DDeviceManager9_UnlockDevice(manager
, (HANDLE
)((ULONG_PTR
)handle
+ 100), FALSE
);
236 ok(hr
== E_INVALIDARG
, "Unexpected hr %#x.\n", hr
);
238 /* Locked with one handle, unlock with another. */
239 hr
= IDirect3DDeviceManager9_OpenDeviceHandle(manager
, &handle1
);
240 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
242 hr
= IDirect3DDeviceManager9_LockDevice(manager
, handle
, &device3
, FALSE
);
243 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
244 ok(device2
== device3
, "Unexpected device pointer.\n");
245 IDirect3DDevice9_Release(device3
);
247 hr
= IDirect3DDeviceManager9_UnlockDevice(manager
, handle1
, FALSE
);
248 ok(hr
== E_INVALIDARG
, "Unexpected hr %#x.\n", hr
);
250 /* Closing unlocks the device. */
251 hr
= IDirect3DDeviceManager9_CloseDeviceHandle(manager
, handle
);
252 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
254 hr
= IDirect3DDeviceManager9_LockDevice(manager
, handle1
, &device3
, FALSE
);
255 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
256 ok(device2
== device3
, "Unexpected device pointer.\n");
257 IDirect3DDevice9_Release(device3
);
259 hr
= IDirect3DDeviceManager9_CloseDeviceHandle(manager
, handle1
);
260 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
262 /* Open two handles. */
263 hr
= IDirect3DDeviceManager9_OpenDeviceHandle(manager
, &handle
);
264 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
266 hr
= IDirect3DDeviceManager9_OpenDeviceHandle(manager
, &handle1
);
267 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
269 hr
= IDirect3DDeviceManager9_LockDevice(manager
, handle
, &device3
, FALSE
);
270 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
271 ok(device2
== device3
, "Unexpected device pointer.\n");
272 IDirect3DDevice9_Release(device3
);
274 hr
= IDirect3DDeviceManager9_LockDevice(manager
, handle1
, &device3
, FALSE
);
275 ok(hr
== DXVA2_E_VIDEO_DEVICE_LOCKED
, "Unexpected hr %#x.\n", hr
);
277 hr
= IDirect3DDeviceManager9_CloseDeviceHandle(manager
, handle1
);
278 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
280 hr
= IDirect3DDeviceManager9_CloseDeviceHandle(manager
, handle
);
281 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
283 /* State saving function. */
284 hr
= IDirect3DDeviceManager9_OpenDeviceHandle(manager
, &handle
);
285 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
287 hr
= IDirect3DDeviceManager9_LockDevice(manager
, handle
, &device3
, FALSE
);
288 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
289 ok(device2
== device3
, "Unexpected device pointer.\n");
291 SetRect(&rect
, 50, 60, 70, 80);
292 hr
= IDirect3DDevice9_SetScissorRect(device3
, &rect
);
293 ok(SUCCEEDED(hr
), "Failed to set scissor rect, hr %#x.\n", hr
);
295 hr
= IDirect3DDeviceManager9_UnlockDevice(manager
, handle
, TRUE
);
296 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
298 SetRect(&rect
, 30, 60, 70, 80);
299 hr
= IDirect3DDevice9_SetScissorRect(device3
, &rect
);
300 ok(SUCCEEDED(hr
), "Failed to set scissor rect, hr %#x.\n", hr
);
302 IDirect3DDevice9_Release(device3
);
304 hr
= IDirect3DDeviceManager9_LockDevice(manager
, handle
, &device3
, FALSE
);
305 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
306 ok(device2
== device3
, "Unexpected device pointer.\n");
308 hr
= IDirect3DDevice9_GetScissorRect(device3
, &rect
);
309 ok(SUCCEEDED(hr
), "Failed to get scissor rect, hr %#x.\n", hr
);
310 ok(rect
.left
== 50 && rect
.top
== 60 && rect
.right
== 70 && rect
.bottom
== 80,
311 "Got unexpected scissor rect %s.\n", wine_dbgstr_rect(&rect
));
313 IDirect3DDevice9_Release(device3
);
315 hr
= IDirect3DDeviceManager9_UnlockDevice(manager
, handle
, TRUE
);
316 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
318 hr
= IDirect3DDeviceManager9_CloseDeviceHandle(manager
, handle
);
319 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
321 /* Acceleration service. */
322 hr
= DXVA2CreateVideoService(device
, &IID_IDirectXVideoAccelerationService
, (void **)&accel_service
);
323 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
325 surfaces
[0] = surfaces
[1] = NULL
;
326 hr
= IDirectXVideoAccelerationService_CreateSurface(accel_service
, 64, 64, 0, D3DFMT_X8R8G8B8
,
327 D3DPOOL_DEFAULT
, 0, DXVA2_VideoProcessorRenderTarget
, surfaces
, NULL
);
328 ok(hr
== S_OK
, "Failed to create a surface, hr %#x.\n", hr
);
329 ok(!!surfaces
[0] && !surfaces
[1], "Unexpected surfaces.\n");
330 IDirect3DSurface9_Release(surfaces
[0]);
332 hr
= IDirectXVideoAccelerationService_CreateSurface(accel_service
, 64, 64, 1, D3DFMT_X8R8G8B8
,
333 D3DPOOL_DEFAULT
, 0, DXVA2_VideoProcessorRenderTarget
, surfaces
, NULL
);
334 ok(hr
== S_OK
, "Failed to create a surface, hr %#x.\n", hr
);
335 ok(!!surfaces
[0] && !!surfaces
[1], "Unexpected surfaces.\n");
336 test_surface_desc(surfaces
[0]);
337 IDirect3DSurface9_Release(surfaces
[0]);
338 IDirect3DSurface9_Release(surfaces
[1]);
340 IDirectXVideoAccelerationService_Release(accel_service
);
343 hr
= DXVA2CreateVideoService(device
, &IID_IDirectXVideoProcessorService
, (void **)&proc_service
);
344 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
346 init_video_desc(&video_desc
, D3DFMT_A8R8G8B8
);
348 hr
= IDirectXVideoProcessorService_GetVideoProcessorDeviceGuids(proc_service
, &video_desc
, &count
, &guids
);
349 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
350 ok(count
, "Unexpected format count %u.\n", count
);
351 CoTaskMemFree(guids
);
353 for (i
= 0; i
< ARRAY_SIZE(rt_formats
); ++i
)
355 init_video_desc(&video_desc
, rt_formats
[i
]);
358 hr
= IDirectXVideoProcessorService_GetVideoProcessorDeviceGuids(proc_service
, &video_desc
, &count
, &guids
);
359 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
360 ok(count
> 0, "Unexpected device count.\n");
361 CoTaskMemFree(guids
);
364 hr
= IDirectXVideoProcessorService_GetVideoProcessorRenderTargets(proc_service
, &DXVA2_VideoProcSoftwareDevice
,
365 &video_desc
, &count
, &formats
);
366 ok(hr
== S_OK
, "Unexpected hr %#x, format %d.\n", hr
, rt_formats
[i
]);
367 ok(count
== 2, "Unexpected format count %u.\n", count
);
369 ok(formats
[0] == D3DFMT_X8R8G8B8
&& formats
[1] == D3DFMT_A8R8G8B8
, "Unexpected formats %d,%d.\n",
370 formats
[0], formats
[1]);
371 CoTaskMemFree(formats
);
374 for (i
= 0; i
< ARRAY_SIZE(rt_unsupported_formats
); ++i
)
376 init_video_desc(&video_desc
, rt_unsupported_formats
[i
]);
378 hr
= IDirectXVideoProcessorService_GetVideoProcessorRenderTargets(proc_service
, &DXVA2_VideoProcSoftwareDevice
,
379 &video_desc
, &count
, &formats
);
380 ok(hr
== E_FAIL
, "Unexpected hr %#x, format %d.\n", hr
, rt_unsupported_formats
[i
]);
383 IDirectXVideoProcessorService_Release(proc_service
);
385 hr
= IDirect3DDeviceManager9_OpenDeviceHandle(manager
, &handle
);
386 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
388 hr
= IDirect3DDeviceManager9_GetVideoService(manager
, handle
, &IID_IDirectXVideoAccelerationService
,
389 (void **)&accel_service
);
390 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
392 hr
= IDirect3DDeviceManager9_CloseDeviceHandle(manager
, handle
);
393 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
395 hr
= IDirectXVideoAccelerationService_CreateSurface(accel_service
, 64, 64, 0, D3DFMT_X8R8G8B8
,
396 D3DPOOL_DEFAULT
, 0, DXVA2_VideoProcessorRenderTarget
, surfaces
, NULL
);
397 ok(hr
== S_OK
, "Failed to create a surface, hr %#x.\n", hr
);
399 hr
= IDirect3DSurface9_GetDevice(surfaces
[0], &device3
);
400 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
401 ok(device2
== device3
, "Unexpected device.\n");
402 IDirect3DDevice9_Release(device3
);
404 IDirect3DSurface9_Release(surfaces
[0]);
406 IDirectXVideoAccelerationService_Release(accel_service
);
408 IDirect3DDevice9_Release(device
);
409 IDirect3DDevice9_Release(device2
);
411 IDirect3DDeviceManager9_Release(manager
);
414 IDirect3D9_Release(d3d
);
415 DestroyWindow(window
);
418 static void test_video_processor(void)
420 IDirectXVideoProcessorService
*service
, *service2
;
421 IDirect3DDevice9
*device
;
422 IDirect3DDeviceManager9
*manager
;
423 HANDLE handle
, handle1
;
428 IDirectXVideoProcessor
*processor
, *processor2
;
429 DXVA2_VideoDesc video_desc
;
433 window
= create_window();
434 d3d
= Direct3DCreate9(D3D_SDK_VERSION
);
435 ok(!!d3d
, "Failed to create a D3D object.\n");
436 if (!(device
= create_device(d3d
, window
)))
438 skip("Failed to create a D3D device, skipping tests.\n");
442 hr
= DXVA2CreateDirect3DDeviceManager9(&token
, &manager
);
443 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
445 hr
= IDirect3DDeviceManager9_ResetDevice(manager
, device
, token
);
446 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
449 hr
= IDirect3DDeviceManager9_OpenDeviceHandle(manager
, &handle
);
450 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
453 hr
= IDirect3DDeviceManager9_OpenDeviceHandle(manager
, &handle1
);
454 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
456 ok(get_refcount(manager
) == 1, "Unexpected refcount %u.\n", get_refcount(manager
));
458 hr
= IDirect3DDeviceManager9_GetVideoService(manager
, handle
, &IID_IDirectXVideoProcessorService
,
460 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
462 memset(&video_desc
, 0, sizeof(video_desc
));
463 video_desc
.SampleWidth
= 64;
464 video_desc
.SampleHeight
= 64;
465 video_desc
.Format
= D3DFMT_A8R8G8B8
;
467 hr
= IDirectXVideoProcessorService_CreateVideoProcessor(service
, &DXVA2_VideoProcSoftwareDevice
, &video_desc
,
468 D3DFMT_A8R8G8B8
, 1, &processor
);
469 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
471 hr
= IDirectXVideoProcessorService_CreateVideoProcessor(service
, &DXVA2_VideoProcSoftwareDevice
, &video_desc
,
472 D3DFMT_A8R8G8B8
, 1, &processor2
);
473 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
474 ok(processor2
!= processor
, "Unexpected instance.\n");
476 hr
= IDirectXVideoProcessor_GetCreationParameters(processor
, NULL
, NULL
, NULL
, NULL
);
477 ok(hr
== E_INVALIDARG
, "Unexpected hr %#x.\n", hr
);
479 hr
= IDirectXVideoProcessor_GetCreationParameters(processor
, &guid
, NULL
, NULL
, NULL
);
480 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
481 ok(IsEqualGUID(&guid
, &DXVA2_VideoProcSoftwareDevice
), "Unexpected device guid.\n");
483 hr
= IDirectXVideoProcessor_GetCreationParameters(processor
, NULL
, NULL
, &format
, NULL
);
484 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
485 ok(format
== D3DFMT_A8R8G8B8
, "Unexpected format %u.\n", format
);
487 IDirectXVideoProcessor_Release(processor
);
488 IDirectXVideoProcessor_Release(processor2
);
490 hr
= IDirect3DDeviceManager9_GetVideoService(manager
, handle
, &IID_IDirectXVideoProcessorService
,
492 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
493 ok(service
== service2
, "Unexpected pointer.\n");
495 IDirectXVideoProcessorService_Release(service2
);
496 IDirectXVideoProcessorService_Release(service
);
498 hr
= IDirect3DDeviceManager9_CloseDeviceHandle(manager
, handle
);
499 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
501 hr
= IDirect3DDeviceManager9_CloseDeviceHandle(manager
, handle1
);
502 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
504 IDirect3DDevice9_Release(device
);
505 IDirect3DDeviceManager9_Release(manager
);
508 IDirect3D9_Release(d3d
);
509 DestroyWindow(window
);
514 test_device_manager();
515 test_video_processor();