ReactOS 0.4.17-dev-923-g4c9a150
main.c
Go to the documentation of this file.
1/*
2 * Copyright 2014 Michael Müller for Pipelight
3 *
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.
8 *
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.
13 *
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
17 */
18
19#define COBJMACROS
20
21#include <stdarg.h>
22#include <limits.h>
23#include "windef.h"
24#include "winbase.h"
25#include "d3d9.h"
29#include "initguid.h"
30#include "dxva2api.h"
31#include "dxvahd.h"
32
33#include "wine/debug.h"
34
36
37#define D3DFMT_NV12 MAKEFOURCC('N','V','1','2')
38
40{
43};
44
46{
47 unsigned int flags;
48 IDirect3DStateBlock9 *state_block;
49};
50
52{
57
60
62 size_t count;
63 size_t capacity;
64
66
68 CONDITION_VARIABLE lock;
69};
70
72{
75
80 unsigned int max_substreams;
81};
82
83static BOOL dxva_array_reserve(void **elements, size_t *capacity, size_t count, size_t size)
84{
85 size_t new_capacity, max_capacity;
86 void *new_elements;
87
88 if (count <= *capacity)
89 return TRUE;
90
91 max_capacity = ~(SIZE_T)0 / size;
92 if (count > max_capacity)
93 return FALSE;
94
95 new_capacity = max(4, *capacity);
96 while (new_capacity < count && new_capacity <= max_capacity / 2)
97 new_capacity *= 2;
98 if (new_capacity < count)
99 new_capacity = max_capacity;
100
101 if (!(new_elements = realloc(*elements, new_capacity * size)))
102 return FALSE;
103
104 *elements = new_elements;
105 *capacity = new_capacity;
106
107 return TRUE;
108}
109
111{
113}
114
116{
118}
119
121{
123}
124
126{
128}
129
131{
133 .InputPool = D3DPOOL_SYSTEMMEM,
134 .VideoProcessorOperations = DXVA2_VideoProcess_PlanarAlpha | DXVA2_VideoProcess_YUV2RGB |
137};
138
140{
142 .InputPool = D3DPOOL_DEFAULT,
144};
145
147{
148 if (IsEqualIID(riid, &IID_IDirectXVideoProcessor) ||
150 {
151 *obj = iface;
152 IDirectXVideoProcessor_AddRef(iface);
153 return S_OK;
154 }
155
156 WARN("Unsupported interface %s.\n", debugstr_guid(riid));
157 *obj = NULL;
158 return E_NOINTERFACE;
159}
160
162{
163 struct video_processor *processor = impl_from_IDirectXVideoProcessor(iface);
165
166 TRACE("%p, refcount %lu.\n", iface, refcount);
167
168 return refcount;
169}
170
172{
173 struct video_processor *processor = impl_from_IDirectXVideoProcessor(iface);
175
176 TRACE("%p, refcount %lu.\n", iface, refcount);
177
178 if (!refcount)
179 {
180 IDirectXVideoProcessorService_Release(processor->service);
181 free(processor);
182 }
183
184 return refcount;
185}
186
189{
190 struct video_processor *processor = impl_from_IDirectXVideoProcessor(iface);
191
192 TRACE("%p, %p.\n", iface, service);
193
194 *service = processor->service;
195 IDirectXVideoProcessorService_AddRef(*service);
196
197 return S_OK;
198}
199
202{
203 struct video_processor *processor = impl_from_IDirectXVideoProcessor(iface);
204
205 TRACE("%p, %p, %p, %p, %p.\n", iface, device, video_desc, rt_format, max_substreams);
206
207 if (!device && !video_desc && !rt_format && !max_substreams)
208 return E_INVALIDARG;
209
210 if (device)
211 *device = processor->device;
212 if (video_desc)
213 *video_desc = processor->video_desc;
214 if (rt_format)
215 *rt_format = processor->rt_format;
216 if (max_substreams)
217 *max_substreams = processor->max_substreams;
218
219 return S_OK;
220}
221
224{
225 struct video_processor *processor = impl_from_IDirectXVideoProcessor(iface);
226
227 TRACE("%p, %p.\n", iface, caps);
228
229 if (IsEqualGUID(&processor->device, &DXVA2_VideoProcSoftwareDevice))
230 {
232 }
233 else if (IsEqualGUID(&processor->device, &DXVA2_VideoProcProgressiveDevice))
234 {
236 }
237 else
238 {
239 FIXME("Unsupported device %s.\n", debugstr_guid(&processor->device));
240 return E_FAIL;
241 }
242
243 return S_OK;
244}
245
247{
248 FIXME("%p, %u, %p.\n", iface, cap, range);
249
250 return E_NOTIMPL;
251}
252
255{
256 FIXME("%p, %u, %p.\n", iface, setting, range);
257
258 return E_NOTIMPL;
259}
260
261static BOOL intersect_rect(RECT *dest, const RECT *src1, const RECT *src2)
262{
263 if (IsRectEmpty(src1) || IsRectEmpty(src2) ||
264 (src1->left >= src2->right) || (src2->left >= src1->right) ||
265 (src1->top >= src2->bottom) || (src2->top >= src1->bottom))
266 {
268 return FALSE;
269 }
270 dest->left = max(src1->left, src2->left);
271 dest->right = min(src1->right, src2->right);
272 dest->top = max(src1->top, src2->top);
273 dest->bottom = min(src1->bottom, src2->bottom);
274
275 return TRUE;
276}
277
279{
280 float y, cb, cr;
281 BYTE r, g, b;
282
283 y = (ayuv->Y >> 8) - 16;
284 cb = (ayuv->Cb >> 8) - 128;
285 cr = (ayuv->Cr >> 8) - 128;
286
287 y = 255.0f * y / 219.0f;
288 cb = 255.0f * cb / 224.0f;
289 cr = 255.0f * cr / 224.0f;
290
291 r = y + 1.402 * cr;
292 g = y - 0.344 * cb - 0.714 * cr;
293 b = y + 1.772 * cb;
294
295 return D3DCOLOR_XRGB(r, g, b);
296}
297
300 HANDLE *complete_handle)
301{
303 unsigned int i;
304 RECT dst_rect;
305 HRESULT hr;
306
307 TRACE("%p, %p, %p, %p, %u, %p.\n", iface, rt, params, samples, sample_count, complete_handle);
308
309 if (params->BackgroundColor.Alpha != 0xffff)
310 {
311 WARN("Unexpected background alpha %#x.\n", params->BackgroundColor.Alpha);
312 return E_INVALIDARG;
313 }
314
316 {
317 WARN("Failed to get surface device, hr %#lx.\n", hr);
318 return hr;
319 }
320
322
323 for (i = 0; i < sample_count; ++i)
324 {
325 dst_rect = params->TargetRect;
326
327 if (!intersect_rect(&dst_rect, &dst_rect, &samples[i].DstRect))
328 continue;
329
330 if (FAILED(hr = IDirect3DDevice9_StretchRect(device, samples[i].SrcSurface, &samples[i].SrcRect,
331 rt, &dst_rect, D3DTEXF_POINT)))
332 {
333 WARN("Failed to copy sample %u, hr %#lx.\n", i, hr);
334 }
335 }
336
338
339 return S_OK;
340}
341
342static const IDirectXVideoProcessorVtbl video_processor_vtbl =
343{
353};
354
356 REFIID riid, void **obj)
357{
359
360 if (IsEqualIID(riid, &IID_IDirectXVideoProcessorService) ||
361 IsEqualIID(riid, &IID_IDirectXVideoAccelerationService) ||
363 {
364 *obj = iface;
365 }
366 else if (IsEqualIID(riid, &IID_IDirectXVideoDecoderService))
367 {
369 }
370 else
371 {
372 WARN("Unsupported interface %s.\n", debugstr_guid(riid));
373 *obj = NULL;
374 return E_NOINTERFACE;
375 }
376
377 IUnknown_AddRef((IUnknown *)*obj);
378 return S_OK;
379}
380
382{
384 return IDirect3DDeviceManager9_AddRef(&manager->IDirect3DDeviceManager9_iface);
385}
386
388{
390 return IDirect3DDeviceManager9_Release(&manager->IDirect3DDeviceManager9_iface);
391}
392
394 UINT width, UINT height, UINT backbuffers, D3DFORMAT format, D3DPOOL pool, DWORD usage, DWORD dxvaType,
395 IDirect3DSurface9 **surfaces, HANDLE *shared_handle)
396{
398 unsigned int i, j;
399 HRESULT hr;
400
401 TRACE("%p, %u, %u, %u, %u, %u, %lu, %lu, %p, %p.\n", iface, width, height, backbuffers, format, pool, usage, dxvaType,
402 surfaces, shared_handle);
403
404 if (backbuffers >= UINT_MAX)
405 return E_INVALIDARG;
406
407 memset(surfaces, 0, (backbuffers + 1) * sizeof(*surfaces));
408
409 for (i = 0; i < backbuffers + 1; ++i)
410 {
412 pool, &surfaces[i], NULL)))
413 break;
414 }
415
416 if (FAILED(hr))
417 {
418 for (j = 0; j < i; ++j)
419 {
420 if (surfaces[j])
421 {
423 surfaces[j] = NULL;
424 }
425 }
426 }
427
428 return hr;
429}
430
432 IDirectXVideoProcessorService *iface, void *callbacks)
433{
434 FIXME("%p, %p.\n", iface, callbacks);
435
436 return E_NOTIMPL;
437}
438
440{
441 const GUID *guid;
443};
444
446{
448};
449
451{
453};
454
456{
457 { &DXVA2_VideoProcProgressiveDevice, progressive_processor_input_formats },
458 { &DXVA2_VideoProcSoftwareDevice, software_processor_input_formats },
459};
460
462{
463 while (*formats)
464 {
465 if (*formats == video_desc->Format) return TRUE;
466 formats++;
467 }
468
469 return FALSE;
470}
471
473 IDirectXVideoProcessorService *iface, const DXVA2_VideoDesc *video_desc, UINT *count, GUID **guids)
474{
475 unsigned int i;
476
477 FIXME("%p, %p, %p, %p semi-stub.\n", iface, video_desc, count, guids);
478
479 *count = 0;
480
481 if (!(*guids = CoTaskMemAlloc(ARRAY_SIZE(processor_devices) * sizeof(**guids))))
482 return E_OUTOFMEMORY;
483
484 for (i = 0; i < ARRAY_SIZE(processor_devices); ++i)
485 {
487 {
488 (*guids)[*count] = *processor_devices[i].guid;
489 *count += 1;
490 }
491 }
492
493 if (!*count)
494 {
496 *guids = NULL;
497 return E_FAIL;
498 }
499
500 return S_OK;
501}
502
504 IDirectXVideoProcessorService *iface, REFGUID deviceguid, const DXVA2_VideoDesc *video_desc, UINT *count,
506{
507 TRACE("%p, %s, %p, %p, %p.\n", iface, debugstr_guid(deviceguid), video_desc, count, formats);
508
509 if (IsEqualGUID(deviceguid, &DXVA2_VideoProcSoftwareDevice))
510 {
512 {
513 WARN("Unsupported content format %#x.\n", video_desc->Format);
514 return E_FAIL;
515 }
516
517 if (!(*formats = CoTaskMemAlloc(2 * sizeof(**formats))))
518 return E_OUTOFMEMORY;
519
520 *count = 2;
521 (*formats)[0] = D3DFMT_X8R8G8B8;
522 (*formats)[1] = D3DFMT_A8R8G8B8;
523
524 return S_OK;
525 }
526 else if (IsEqualGUID(deviceguid, &DXVA2_VideoProcProgressiveDevice))
527 {
529 {
530 WARN("Unsupported content format %#x.\n", video_desc->Format);
531 return E_FAIL;
532 }
533
534 if (!(*formats = CoTaskMemAlloc(2 * sizeof(**formats))))
535 return E_OUTOFMEMORY;
536
537 *count = 2;
538 (*formats)[0] = D3DFMT_X8R8G8B8;
539 (*formats)[1] = D3DFMT_NV12;
540
541 return S_OK;
542 }
543 else
544 FIXME("Unsupported device %s.\n", debugstr_guid(deviceguid));
545
546 return E_NOTIMPL;
547}
548
550 IDirectXVideoProcessorService *iface, REFGUID deviceguid, const DXVA2_VideoDesc *video_desc,
551 D3DFORMAT rt_format, UINT *count, D3DFORMAT **formats)
552{
553 FIXME("%p, %s, %p, %u, %p, %p.\n", iface, debugstr_guid(deviceguid), video_desc, rt_format, count, formats);
554
555 return E_NOTIMPL;
556}
557
560 D3DFORMAT rt_format, DXVA2_VideoProcessorCaps *caps)
561{
562 TRACE("%p, %s, %p, %u, %p.\n", iface, debugstr_guid(device), video_desc, rt_format, caps);
563
564 if (IsEqualGUID(device, &DXVA2_VideoProcSoftwareDevice))
565 {
567 }
568 else if (IsEqualGUID(device, &DXVA2_VideoProcProgressiveDevice))
569 {
571 }
572 else
573 {
574 FIXME("Unrecognized device %s.\n", debugstr_guid(device));
575 return E_NOTIMPL;
576 }
577
578 return S_OK;
579}
580
582 IDirectXVideoProcessorService *iface, REFGUID deviceguid, const DXVA2_VideoDesc *video_desc,
583 D3DFORMAT rt_format, UINT ProcAmpCap, DXVA2_ValueRange *range)
584{
585 FIXME("%p, %s, %p, %u, %u, %p.\n", iface, debugstr_guid(deviceguid), video_desc, rt_format, ProcAmpCap, range);
586
587 return E_NOTIMPL;
588}
589
591 IDirectXVideoProcessorService *iface, REFGUID deviceguid, const DXVA2_VideoDesc *video_desc,
592 D3DFORMAT rt_format, UINT filter_setting, DXVA2_ValueRange *range)
593{
594 FIXME("%p, %s, %p, %d, %d, %p.\n", iface, debugstr_guid(deviceguid), video_desc, rt_format, filter_setting, range);
595
596 return E_NOTIMPL;
597}
598
600 REFGUID device, const DXVA2_VideoDesc *video_desc, D3DFORMAT rt_format, UINT max_substreams,
601 IDirectXVideoProcessor **processor)
602{
603 struct video_processor *object;
604
605 FIXME("%p, %s, %p, %d, %u, %p.\n", iface, debugstr_guid(device), video_desc, rt_format, max_substreams,
606 processor);
607
608 /* FIXME: validate render target format */
609
610 if (max_substreams >= 16)
611 {
612 WARN("Invalid substreams count %u.\n", max_substreams);
613 return E_INVALIDARG;
614 }
615
616 if (!(object = calloc(1, sizeof(*object))))
617 return E_OUTOFMEMORY;
618
619 object->IDirectXVideoProcessor_iface.lpVtbl = &video_processor_vtbl;
620 object->refcount = 1;
621 object->service = iface;
622 IDirectXVideoProcessorService_AddRef(object->service);
623 object->device = *device;
624 object->video_desc = *video_desc;
625 object->rt_format = rt_format;
626 object->max_substreams = max_substreams;
627
628 *processor = &object->IDirectXVideoProcessor_iface;
629
630 return S_OK;
631}
632
633static const IDirectXVideoProcessorServiceVtbl device_manager_processor_service_vtbl =
634{
647};
648
650 REFIID riid, void **obj)
651{
652 if (IsEqualIID(riid, &IID_IDirectXVideoDecoderService) ||
653 IsEqualIID(riid, &IID_IDirectXVideoAccelerationService) ||
655 {
656 *obj = iface;
657 IDirectXVideoDecoderService_AddRef(iface);
658 return S_OK;
659 }
660
661 WARN("Unsupported interface %s.\n", debugstr_guid(riid));
662 *obj = NULL;
663 return E_NOINTERFACE;
664}
665
667{
669 return IDirect3DDeviceManager9_AddRef(&manager->IDirect3DDeviceManager9_iface);
670}
671
673{
675 return IDirect3DDeviceManager9_Release(&manager->IDirect3DDeviceManager9_iface);
676}
677
679 UINT width, UINT height, UINT backbuffers, D3DFORMAT format, D3DPOOL pool, DWORD usage, DWORD dxvaType,
680 IDirect3DSurface9 **surfaces, HANDLE *shared_handle)
681{
682 FIXME("%p, %u, %u, %u, %#x, %d, %ld, %ld, %p, %p.\n", iface, width, height, backbuffers, format, pool, usage,
683 dxvaType, surfaces, shared_handle);
684
685 return E_NOTIMPL;
686}
687
689 UINT *count, GUID **guids)
690{
691 FIXME("%p, %p, %p.\n", iface, count, guids);
692
693 return E_NOTIMPL;
694}
695
698{
699 FIXME("%p, %s, %p, %p.\n", iface, debugstr_guid(guid), count, formats);
700
701 return E_NOTIMPL;
702}
703
705 REFGUID guid, const DXVA2_VideoDesc *video_desc, void *reserved, UINT *count, DXVA2_ConfigPictureDecode **configs)
706{
707 FIXME("%p, %s, %p, %p, %p, %p.\n", iface, debugstr_guid(guid), video_desc, reserved, count, configs);
708
709 return E_NOTIMPL;
710}
711
714 UINT num_surfaces, IDirectXVideoDecoder **decoder)
715{
716 FIXME("%p, %s, %p, %p, %p, %u, %p.\n", iface, debugstr_guid(guid), video_desc, config, rts, num_surfaces,
717 decoder);
718
719 return E_NOTIMPL;
720}
721
722static const IDirectXVideoDecoderServiceVtbl device_manager_decoder_service_vtbl =
723{
732};
733
735{
736 TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), obj);
737
738 if (IsEqualIID(&IID_IDirect3DDeviceManager9, riid) ||
740 {
741 *obj = iface;
742 IDirect3DDeviceManager9_AddRef(iface);
743 return S_OK;
744 }
745
746 WARN("Unsupported interface %s.\n", debugstr_guid(riid));
747 *obj = NULL;
748 return E_NOINTERFACE;
749}
750
752{
753 struct device_manager *manager = impl_from_IDirect3DDeviceManager9(iface);
755
756 TRACE("%p, refcount %lu.\n", iface, refcount);
757
758 return refcount;
759}
760
762{
763 struct device_manager *manager = impl_from_IDirect3DDeviceManager9(iface);
765 size_t i;
766
767 TRACE("%p, refcount %lu.\n", iface, refcount);
768
769 if (!refcount)
770 {
771 if (manager->device)
773 DeleteCriticalSection(&manager->cs);
774 for (i = 0; i < manager->count; ++i)
775 {
776 if (manager->handles[i].state_block)
777 IDirect3DStateBlock9_Release(manager->handles[i].state_block);
778 }
779 free(manager->handles);
780 free(manager);
781 }
782
783 return refcount;
784}
785
787 UINT token)
788{
789 struct device_manager *manager = impl_from_IDirect3DDeviceManager9(iface);
790 size_t i;
791
792 TRACE("%p, %p, %#x.\n", iface, device, token);
793
794 if (token != manager->token)
795 return E_INVALIDARG;
796
797 EnterCriticalSection(&manager->cs);
798 if (manager->device)
799 {
800 for (i = 0; i < manager->count; ++i)
801 {
802 if (manager->handles[i].state_block)
803 IDirect3DStateBlock9_Release(manager->handles[i].state_block);
804 manager->handles[i].state_block = NULL;
805 manager->handles[i].flags |= HANDLE_FLAG_INVALID;
806 }
807 manager->locking_handle = NULL;
809 }
810 manager->device = device;
812 LeaveCriticalSection(&manager->cs);
813
815
816 return S_OK;
817}
818
820{
821 struct device_manager *manager = impl_from_IDirect3DDeviceManager9(iface);
822 HRESULT hr = S_OK;
823 size_t i;
824
825 TRACE("%p, %p.\n", iface, hdevice);
826
827 *hdevice = NULL;
828
829 EnterCriticalSection(&manager->cs);
830 if (!manager->device)
831 hr = DXVA2_E_NOT_INITIALIZED;
832 else
833 {
834 for (i = 0; i < manager->count; ++i)
835 {
836 if (!(manager->handles[i].flags & HANDLE_FLAG_OPEN))
837 {
838 manager->handles[i].flags |= HANDLE_FLAG_OPEN;
839 *hdevice = ULongToHandle(i + 1);
840 break;
841 }
842 }
843
844 if (dxva_array_reserve((void **)&manager->handles, &manager->capacity, manager->count + 1,
845 sizeof(*manager->handles)))
846 {
847 *hdevice = ULongToHandle(manager->count + 1);
848 manager->handles[manager->count].flags = HANDLE_FLAG_OPEN;
849 manager->handles[manager->count].state_block = NULL;
850 manager->count++;
851 }
852 else
854 }
855 LeaveCriticalSection(&manager->cs);
856
857 return hr;
858}
859
860static HRESULT device_manager_get_handle_index(struct device_manager *manager, HANDLE hdevice, size_t *idx)
861{
862 if (!hdevice || hdevice > ULongToHandle(manager->count))
863 return E_HANDLE;
864 *idx = (ULONG_PTR)hdevice - 1;
865 return S_OK;
866}
867
869{
870 struct device_manager *manager = impl_from_IDirect3DDeviceManager9(iface);
871 HRESULT hr;
872 size_t idx;
873
874 TRACE("%p, %p.\n", iface, hdevice);
875
876 EnterCriticalSection(&manager->cs);
877 if (SUCCEEDED(hr = device_manager_get_handle_index(manager, hdevice, &idx)))
878 {
879 if (manager->handles[idx].flags & HANDLE_FLAG_OPEN)
880 {
881 if (manager->locking_handle == hdevice)
882 manager->locking_handle = NULL;
883 manager->handles[idx].flags = 0;
884 if (idx == manager->count - 1)
885 manager->count--;
886 if (manager->handles[idx].state_block)
887 IDirect3DStateBlock9_Release(manager->handles[idx].state_block);
888 manager->handles[idx].state_block = NULL;
889 }
890 else
891 hr = E_HANDLE;
892 }
893 LeaveCriticalSection(&manager->cs);
894
896
897 return hr;
898}
899
901{
902 struct device_manager *manager = impl_from_IDirect3DDeviceManager9(iface);
903 HRESULT hr;
904 size_t idx;
905
906 TRACE("%p, %p.\n", iface, hdevice);
907
908 EnterCriticalSection(&manager->cs);
909 if (SUCCEEDED(hr = device_manager_get_handle_index(manager, hdevice, &idx)))
910 {
911 unsigned int flags = manager->handles[idx].flags;
912
914 hr = DXVA2_E_NEW_VIDEO_DEVICE;
915 else if (!(flags & HANDLE_FLAG_OPEN))
916 hr = E_HANDLE;
917 }
918 LeaveCriticalSection(&manager->cs);
919
920 return hr;
921}
922
925{
926 struct device_manager *manager = impl_from_IDirect3DDeviceManager9(iface);
927 HRESULT hr;
928 size_t idx;
929
930 TRACE("%p, %p, %p, %d.\n", iface, hdevice, device, block);
931
932 EnterCriticalSection(&manager->cs);
933 if (!manager->device)
934 hr = DXVA2_E_NOT_INITIALIZED;
935 else if (SUCCEEDED(hr = device_manager_get_handle_index(manager, hdevice, &idx)))
936 {
937 if (manager->locking_handle && !block)
938 hr = DXVA2_E_VIDEO_DEVICE_LOCKED;
939 else
940 {
941 while (manager->locking_handle && block)
942 {
943 SleepConditionVariableCS(&manager->lock, &manager->cs, INFINITE);
944 }
945
946 if (SUCCEEDED(hr = device_manager_get_handle_index(manager, hdevice, &idx)))
947 {
948 if (manager->handles[idx].flags & HANDLE_FLAG_INVALID)
949 hr = DXVA2_E_NEW_VIDEO_DEVICE;
950 else
951 {
952 if (manager->handles[idx].state_block)
953 {
954 if (FAILED(IDirect3DStateBlock9_Apply(manager->handles[idx].state_block)))
955 WARN("Failed to apply state.\n");
956 IDirect3DStateBlock9_Release(manager->handles[idx].state_block);
957 manager->handles[idx].state_block = NULL;
958 }
959 *device = manager->device;
961 manager->locking_handle = hdevice;
962 }
963 }
964 }
965 }
966 LeaveCriticalSection(&manager->cs);
967
968 return hr;
969}
970
972{
973 struct device_manager *manager = impl_from_IDirect3DDeviceManager9(iface);
974 HRESULT hr;
975 size_t idx;
976
977 TRACE("%p, %p, %d.\n", iface, hdevice, savestate);
978
979 EnterCriticalSection(&manager->cs);
980
981 if (hdevice != manager->locking_handle)
983 else if (SUCCEEDED(hr = device_manager_get_handle_index(manager, hdevice, &idx)))
984 {
985 manager->locking_handle = NULL;
986 if (savestate)
987 IDirect3DDevice9_CreateStateBlock(manager->device, D3DSBT_ALL, &manager->handles[idx].state_block);
988 }
989
990 LeaveCriticalSection(&manager->cs);
991
993
994 return hr;
995}
996
998 void **obj)
999{
1000 struct device_manager *manager = impl_from_IDirect3DDeviceManager9(iface);
1001 HRESULT hr;
1002 size_t idx;
1003
1004 TRACE("%p, %p, %s, %p.\n", iface, hdevice, debugstr_guid(riid), obj);
1005
1006 EnterCriticalSection(&manager->cs);
1007 if (SUCCEEDED(hr = device_manager_get_handle_index(manager, hdevice, &idx)))
1008 {
1009 unsigned int flags = manager->handles[idx].flags;
1010
1012 hr = DXVA2_E_NEW_VIDEO_DEVICE;
1013 else if (!(flags & HANDLE_FLAG_OPEN))
1014 hr = E_HANDLE;
1015 else
1016 hr = IDirectXVideoProcessorService_QueryInterface(&manager->IDirectXVideoProcessorService_iface,
1017 riid, obj);
1018 }
1019 LeaveCriticalSection(&manager->cs);
1020
1021 return hr;
1022}
1023
1024static const IDirect3DDeviceManager9Vtbl device_manager_vtbl =
1025{
1036};
1037
1039{
1040 FIXME("%p, %p, %ld: stub.\n", monitor, buffer, length);
1041
1043 return FALSE;
1044}
1045
1047{
1048 struct device_manager *object;
1049
1050 TRACE("%p, %p.\n", token, manager);
1051
1052 *manager = NULL;
1053
1054 if (!(object = calloc(1, sizeof(*object))))
1055 return E_OUTOFMEMORY;
1056
1057 object->IDirect3DDeviceManager9_iface.lpVtbl = &device_manager_vtbl;
1058 object->IDirectXVideoProcessorService_iface.lpVtbl = &device_manager_processor_service_vtbl;
1059 object->IDirectXVideoDecoderService_iface.lpVtbl = &device_manager_decoder_service_vtbl;
1060 object->refcount = 1;
1061 object->token = GetTickCount();
1064
1065 *token = object->token;
1066 *manager = &object->IDirect3DDeviceManager9_iface;
1067
1068 return S_OK;
1069}
1070
1072{
1073 IDirect3DDeviceManager9 *manager;
1074 HANDLE handle;
1075 HRESULT hr;
1076 UINT token;
1077
1078 TRACE("%p, %s, %p.\n", device, debugstr_guid(riid), obj);
1079
1081 return hr;
1082
1083 if (FAILED(hr = IDirect3DDeviceManager9_ResetDevice(manager, device, token)))
1084 goto done;
1085
1086 if (FAILED(hr = IDirect3DDeviceManager9_OpenDeviceHandle(manager, &handle)))
1087 goto done;
1088
1089 hr = IDirect3DDeviceManager9_GetVideoService(manager, handle, riid, obj);
1090 IDirect3DDeviceManager9_CloseDeviceHandle(manager, handle);
1091
1092done:
1093 IDirect3DDeviceManager9_Release(manager);
1094
1095 return hr;
1096}
1097
1099{
1100 FIXME("(%p): stub\n", monitor);
1101
1103 return FALSE;
1104}
1105
1107{
1108 FIXME("(%p): stub\n", monitor);
1109
1111 return FALSE;
1112}
1113
1115{
1116 FIXME("%lu, %p: stub.\n", arraySize, array);
1117
1119 return FALSE;
1120}
1121
1123{
1124 FIXME("(%p, %p): stub\n", monitor, length);
1125
1127 return FALSE;
1128}
1129
1131{
1132 FIXME("(%p, %p, %p, %p): stub\n", monitor, minimum, current, maximum);
1133
1135 return FALSE;
1136}
1137
1138BOOL WINAPI GetMonitorCapabilities( HMONITOR monitor, LPDWORD capabilities, LPDWORD temperatures )
1139{
1140 FIXME("(%p, %p, %p): stub\n", monitor, capabilities, temperatures);
1141
1143 return FALSE;
1144}
1145
1146
1148{
1149 FIXME("(%p, %p): stub\n", monitor, temperature);
1150
1152 return FALSE;
1153}
1154
1156{
1157 FIXME("(%p, %p, %p, %p): stub\n", monitor, minimum, current, maximum);
1158
1160 return FALSE;
1161}
1162
1164 LPDWORD current, LPDWORD maximum )
1165{
1166 FIXME("(%p, 0x%x, %p, %p, %p): stub\n", monitor, type, minimum, current, maximum);
1167
1169 return FALSE;
1170}
1171
1173 LPDWORD current, LPDWORD maximum )
1174{
1175 FIXME("(%p, 0x%x, %p, %p, %p): stub\n", monitor, type, minimum, current, maximum);
1176
1178 return FALSE;
1179}
1180
1182 LPDWORD current, LPDWORD maximum )
1183{
1184 FIXME("(%p, 0x%x, %p, %p, %p): stub\n", monitor, type, minimum, current, maximum);
1185
1187 return FALSE;
1188}
1189
1191 LPDWORD current, LPDWORD maximum )
1192{
1193 FIXME("(%p, 0x%x, %p, %p, %p): stub\n", monitor, type, minimum, current, maximum);
1194
1196 return FALSE;
1197}
1198
1200{
1201 FIXME("(%p, %p): stub\n", monitor, type);
1202
1204 return FALSE;
1205}
1206
1208{
1209 FIXME("(%p, %p): stub\n", monitor, number);
1210
1212 return FALSE;
1213}
1214
1216{
1217 FIXME("(%p, %p): stub\n", device, number);
1218
1219 return E_NOTIMPL;
1220}
1221
1223{
1224 FIXME("%p, %lu, %p: stub.\n", monitor, arraySize, array);
1225
1227 return FALSE;
1228}
1229
1231{
1232 FIXME("%p, %lu, %p: stub.\n", device, arraySize, array);
1233
1234 return E_NOTIMPL;
1235}
1236
1238{
1239 FIXME("(%p, %p): stub\n", monitor, timingReport);
1240
1242 return FALSE;
1243}
1244
1246 LPDWORD current, LPDWORD maximum )
1247{
1248 FIXME("(%p, 0x%02x, %p, %p, %p): stub\n", monitor, vcpCode, pvct, current, maximum);
1249
1251 return FALSE;
1252}
1253
1254HRESULT WINAPI OPMGetVideoOutputsFromHMONITOR( HMONITOR monitor, /* OPM_VIDEO_OUTPUT_SEMANTICS */ int vos,
1255 ULONG *numVideoOutputs, /* IOPMVideoOutput */ void ***videoOutputs )
1256{
1257 FIXME("(%p, 0x%x, %p, %p): stub\n", monitor, vos, numVideoOutputs, videoOutputs);
1258
1259 return E_NOTIMPL;
1260}
1261
1263 ULONG *numVideoOutputs, /* IOPMVideoOutput */ void ***videoOutputs )
1264{
1265 FIXME("(%p, 0x%x, %p, %p): stub\n", device, vos, numVideoOutputs, videoOutputs);
1266
1267 return E_NOTIMPL;
1268}
1269
1271{
1272 FIXME("(%p): stub\n", monitor);
1273
1275 return FALSE;
1276}
1277
1279{
1280 FIXME("(%p): stub\n", monitor);
1281
1283 return FALSE;
1284}
1285
1287{
1288 FIXME("(%p): stub\n", monitor);
1289
1291 return FALSE;
1292}
1293
1295{
1296 FIXME("(%p): stub\n", monitor);
1297
1299 return FALSE;
1300}
1301
1303{
1304 FIXME("%p, %#lx: stub.\n", monitor, brightness);
1305
1307 return FALSE;
1308}
1309
1311{
1312 FIXME("(%p, 0x%x): stub\n", monitor, temperature);
1313
1315 return FALSE;
1316}
1317
1319{
1320 FIXME("%p, %#lx: stub.\n", monitor, contrast);
1321
1323 return FALSE;
1324}
1325
1327{
1328 FIXME("%p, 0x%x, %#lx: stub.\n", monitor, type, position);
1329
1331 return FALSE;
1332}
1333
1335{
1336 FIXME("%p, 0x%x, %#lx: stub.\n", monitor, type, size);
1337
1339 return FALSE;
1340}
1341
1343{
1344 FIXME("%p, 0x%x, %#lx: stub.\n", monitor, type, drive);
1345
1347 return FALSE;
1348}
1349
1351{
1352 FIXME("%p, 0x%x, %#lx: stub.\n", monitor, type, gain);
1353
1355 return FALSE;
1356}
1357
1359{
1360 FIXME("%p, 0x%02x, %#lx: stub.\n", monitor, vcpCode, value);
1361
1363 return FALSE;
1364}
1365
1366
1369{
1370 FIXME("d3d9_device %p, desc %p, usage %u, plugin %p, device %p, stub!\n", d3d9_device, desc, usage, plugin, device);
1371
1372 return E_NOTIMPL;
1373}
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define ARRAY_SIZE(A)
Definition: main.h:20
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
#define ULongToHandle(h)
Definition: basetsd.h:75
const GUID IID_IUnknown
@ D3DTEXF_POINT
Definition: d3d8types.h:871
@ D3DFMT_YUY2
Definition: d3d8types.h:633
@ D3DFMT_A8R8G8B8
Definition: d3d8types.h:604
@ D3DFMT_X8R8G8B8
Definition: d3d8types.h:605
enum _D3DPOOL D3DPOOL
@ D3DSBT_ALL
Definition: d3d8types.h:830
@ D3DPOOL_DEFAULT
Definition: d3d8types.h:709
@ D3DPOOL_SYSTEMMEM
Definition: d3d8types.h:711
enum _D3DFORMAT D3DFORMAT
#define D3DCOLOR_XRGB(r, g, b)
Definition: d3d8types.h:44
#define IDirect3DSurface9_GetDevice(p, a)
Definition: d3d9.h:452
#define IDirect3DDevice9_ColorFill(p, a, b, c)
Definition: d3d9.h:1370
#define IDirect3DStateBlock9_Release(p)
Definition: d3d9.h:1128
#define IDirect3DDevice9_StretchRect(p, a, b, c, d, e)
Definition: d3d9.h:1369
#define IDirect3DDevice9_Release(p)
Definition: d3d9.h:1336
#define IDirect3DStateBlock9_Apply(p)
Definition: d3d9.h:1132
#define IDirect3DDevice9_CreateStateBlock(p, a, b)
Definition: d3d9.h:1394
#define IDirect3DSurface9_Release(p)
Definition: d3d9.h:450
#define IDirect3DDevice9_AddRef(p)
Definition: d3d9.h:1335
#define IDirect3DDevice9_CreateOffscreenPlainSurface(p, a, b, c, d, e, f)
Definition: d3d9.h:1371
range
Definition: d3dx9_private.h:58
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
#define realloc
Definition: debug_ros.c:6
#define free
Definition: debug_ros.c:5
HRESULT hr
Definition: delayimp.cpp:582
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static const struct pixel_format_desc formats[]
Definition: util.c:31
HRESULT WINAPI GetNumberOfPhysicalMonitorsFromIDirect3DDevice9(IDirect3DDevice9 *device, LPDWORD number)
Definition: main.c:1215
static HRESULT WINAPI video_processor_GetProcAmpRange(IDirectXVideoProcessor *iface, UINT cap, DXVA2_ValueRange *range)
Definition: main.c:246
BOOL WINAPI RestoreMonitorFactoryDefaults(HMONITOR monitor)
Definition: main.c:1278
BOOL WINAPI RestoreMonitorFactoryColorDefaults(HMONITOR monitor)
Definition: main.c:1270
BOOL WINAPI SetMonitorRedGreenOrBlueGain(HMONITOR monitor, MC_GAIN_TYPE type, DWORD gain)
Definition: main.c:1350
BOOL WINAPI GetTimingReport(HMONITOR monitor, LPMC_TIMING_REPORT timingReport)
Definition: main.c:1237
static HRESULT WINAPI device_manager_processor_service_QueryInterface(IDirectXVideoProcessorService *iface, REFIID riid, void **obj)
Definition: main.c:355
BOOL WINAPI GetNumberOfPhysicalMonitorsFromHMONITOR(HMONITOR monitor, LPDWORD number)
Definition: main.c:1207
static HRESULT WINAPI device_manager_processor_service_GetVideoProcessorSubStreamFormats(IDirectXVideoProcessorService *iface, REFGUID deviceguid, const DXVA2_VideoDesc *video_desc, D3DFORMAT rt_format, UINT *count, D3DFORMAT **formats)
Definition: main.c:549
static struct video_processor * impl_from_IDirectXVideoProcessor(IDirectXVideoProcessor *iface)
Definition: main.c:125
BOOL WINAPI DegaussMonitor(HMONITOR monitor)
Definition: main.c:1098
static ULONG WINAPI video_processor_AddRef(IDirectXVideoProcessor *iface)
Definition: main.c:161
BOOL WINAPI GetPhysicalMonitorsFromHMONITOR(HMONITOR monitor, DWORD arraySize, LPPHYSICAL_MONITOR array)
Definition: main.c:1222
static const IDirect3DDeviceManager9Vtbl device_manager_vtbl
Definition: main.c:1024
static ULONG WINAPI device_manager_processor_service_AddRef(IDirectXVideoProcessorService *iface)
Definition: main.c:381
static ULONG WINAPI video_processor_Release(IDirectXVideoProcessor *iface)
Definition: main.c:171
static const D3DFORMAT progressive_processor_input_formats[]
Definition: main.c:450
HRESULT WINAPI DXVA2CreateDirect3DDeviceManager9(UINT *token, IDirect3DDeviceManager9 **manager)
Definition: main.c:1046
static HRESULT WINAPI video_processor_GetVideoProcessorCaps(IDirectXVideoProcessor *iface, DXVA2_VideoProcessorCaps *caps)
Definition: main.c:222
BOOL WINAPI SetMonitorDisplayAreaPosition(HMONITOR monitor, MC_POSITION_TYPE type, DWORD position)
Definition: main.c:1326
BOOL WINAPI GetVCPFeatureAndVCPFeatureReply(HMONITOR monitor, BYTE vcpCode, LPMC_VCP_CODE_TYPE pvct, LPDWORD current, LPDWORD maximum)
Definition: main.c:1245
BOOL WINAPI CapabilitiesRequestAndCapabilitiesReply(HMONITOR monitor, LPSTR buffer, DWORD length)
Definition: main.c:1038
static HRESULT WINAPI device_manager_processor_service_GetProcAmpRange(IDirectXVideoProcessorService *iface, REFGUID deviceguid, const DXVA2_VideoDesc *video_desc, D3DFORMAT rt_format, UINT ProcAmpCap, DXVA2_ValueRange *range)
Definition: main.c:581
HRESULT WINAPI DXVA2CreateVideoService(IDirect3DDevice9 *device, REFIID riid, void **obj)
Definition: main.c:1071
static HRESULT WINAPI video_processor_GetVideoProcessorService(IDirectXVideoProcessor *iface, IDirectXVideoProcessorService **service)
Definition: main.c:187
BOOL WINAPI GetMonitorContrast(HMONITOR monitor, LPDWORD minimum, LPDWORD current, LPDWORD maximum)
Definition: main.c:1155
static HRESULT WINAPI device_manager_processor_service_RegisterVideoProcessorSoftwareDevice(IDirectXVideoProcessorService *iface, void *callbacks)
Definition: main.c:431
static ULONG WINAPI device_manager_processor_service_Release(IDirectXVideoProcessorService *iface)
Definition: main.c:387
device_handle_flags
Definition: main.c:40
@ HANDLE_FLAG_OPEN
Definition: main.c:41
@ HANDLE_FLAG_INVALID
Definition: main.c:42
BOOL WINAPI GetMonitorTechnologyType(HMONITOR monitor, LPMC_DISPLAY_TECHNOLOGY_TYPE type)
Definition: main.c:1199
BOOL WINAPI DestroyPhysicalMonitor(HMONITOR monitor)
Definition: main.c:1106
HRESULT WINAPI OPMGetVideoOutputsFromIDirect3DDevice9Object(IDirect3DDevice9 *device, int vos, ULONG *numVideoOutputs, void ***videoOutputs)
Definition: main.c:1262
static HRESULT WINAPI device_manager_decoder_service_QueryInterface(IDirectXVideoDecoderService *iface, REFIID riid, void **obj)
Definition: main.c:649
BOOL WINAPI DestroyPhysicalMonitors(DWORD arraySize, LPPHYSICAL_MONITOR array)
Definition: main.c:1114
BOOL WINAPI SetMonitorRedGreenOrBlueDrive(HMONITOR monitor, MC_DRIVE_TYPE type, DWORD drive)
Definition: main.c:1342
HRESULT WINAPI GetPhysicalMonitorsFromIDirect3DDevice9(IDirect3DDevice9 *device, DWORD arraySize, LPPHYSICAL_MONITOR array)
Definition: main.c:1230
static const DXVA2_VideoProcessorCaps software_processor_caps
Definition: main.c:130
BOOL WINAPI GetMonitorRedGreenOrBlueGain(HMONITOR monitor, MC_GAIN_TYPE type, LPDWORD minimum, LPDWORD current, LPDWORD maximum)
Definition: main.c:1190
static HRESULT WINAPI video_processor_GetFilterPropertyRange(IDirectXVideoProcessor *iface, UINT setting, DXVA2_ValueRange *range)
Definition: main.c:253
BOOL WINAPI SaveCurrentMonitorSettings(HMONITOR monitor)
Definition: main.c:1286
static HRESULT WINAPI device_manager_QueryInterface(IDirect3DDeviceManager9 *iface, REFIID riid, void **obj)
Definition: main.c:734
BOOL WINAPI SetMonitorDisplayAreaSize(HMONITOR monitor, MC_SIZE_TYPE type, DWORD size)
Definition: main.c:1334
BOOL WINAPI SetMonitorBrightness(HMONITOR monitor, DWORD brightness)
Definition: main.c:1302
BOOL WINAPI SetMonitorColorTemperature(HMONITOR monitor, MC_COLOR_TEMPERATURE temperature)
Definition: main.c:1310
static HRESULT WINAPI device_manager_OpenDeviceHandle(IDirect3DDeviceManager9 *iface, HANDLE *hdevice)
Definition: main.c:819
static const IDirectXVideoProcessorServiceVtbl device_manager_processor_service_vtbl
Definition: main.c:633
static struct device_manager * impl_from_IDirectXVideoDecoderService(IDirectXVideoDecoderService *iface)
Definition: main.c:120
static BOOL intersect_rect(RECT *dest, const RECT *src1, const RECT *src2)
Definition: main.c:261
static HRESULT WINAPI device_manager_processor_service_GetVideoProcessorDeviceGuids(IDirectXVideoProcessorService *iface, const DXVA2_VideoDesc *video_desc, UINT *count, GUID **guids)
Definition: main.c:472
static HRESULT WINAPI device_manager_decoder_service_GetDecoderDeviceGuids(IDirectXVideoDecoderService *iface, UINT *count, GUID **guids)
Definition: main.c:688
static BOOL dxva_array_reserve(void **elements, size_t *capacity, size_t count, size_t size)
Definition: main.c:83
#define D3DFMT_NV12
Definition: main.c:37
static HRESULT WINAPI device_manager_GetVideoService(IDirect3DDeviceManager9 *iface, HANDLE hdevice, REFIID riid, void **obj)
Definition: main.c:997
BOOL WINAPI GetMonitorCapabilities(HMONITOR monitor, LPDWORD capabilities, LPDWORD temperatures)
Definition: main.c:1138
static HRESULT WINAPI device_manager_processor_service_GetVideoProcessorRenderTargets(IDirectXVideoProcessorService *iface, REFGUID deviceguid, const DXVA2_VideoDesc *video_desc, UINT *count, D3DFORMAT **formats)
Definition: main.c:503
static HRESULT WINAPI device_manager_LockDevice(IDirect3DDeviceManager9 *iface, HANDLE hdevice, IDirect3DDevice9 **device, BOOL block)
Definition: main.c:923
BOOL WINAPI GetCapabilitiesStringLength(HMONITOR monitor, LPDWORD length)
Definition: main.c:1122
static const struct dxva_processor_device_desc processor_devices[]
Definition: main.c:455
static HRESULT WINAPI device_manager_decoder_service_CreateSurface(IDirectXVideoDecoderService *iface, UINT width, UINT height, UINT backbuffers, D3DFORMAT format, D3DPOOL pool, DWORD usage, DWORD dxvaType, IDirect3DSurface9 **surfaces, HANDLE *shared_handle)
Definition: main.c:678
static HRESULT WINAPI device_manager_processor_service_CreateSurface(IDirectXVideoProcessorService *iface, UINT width, UINT height, UINT backbuffers, D3DFORMAT format, D3DPOOL pool, DWORD usage, DWORD dxvaType, IDirect3DSurface9 **surfaces, HANDLE *shared_handle)
Definition: main.c:393
BOOL WINAPI GetMonitorBrightness(HMONITOR monitor, LPDWORD minimum, LPDWORD current, LPDWORD maximum)
Definition: main.c:1130
BOOL WINAPI GetMonitorDisplayAreaSize(HMONITOR monitor, MC_SIZE_TYPE type, LPDWORD minimum, LPDWORD current, LPDWORD maximum)
Definition: main.c:1172
static HRESULT WINAPI device_manager_decoder_service_GetDecoderRenderTargets(IDirectXVideoDecoderService *iface, REFGUID guid, UINT *count, D3DFORMAT **formats)
Definition: main.c:696
static HRESULT WINAPI device_manager_ResetDevice(IDirect3DDeviceManager9 *iface, IDirect3DDevice9 *device, UINT token)
Definition: main.c:786
static struct device_manager * impl_from_IDirectXVideoProcessorService(IDirectXVideoProcessorService *iface)
Definition: main.c:115
static const D3DFORMAT software_processor_input_formats[]
Definition: main.c:445
static HRESULT WINAPI device_manager_processor_service_GetFilterPropertyRange(IDirectXVideoProcessorService *iface, REFGUID deviceguid, const DXVA2_VideoDesc *video_desc, D3DFORMAT rt_format, UINT filter_setting, DXVA2_ValueRange *range)
Definition: main.c:590
static HRESULT WINAPI video_processor_VideoProcessBlt(IDirectXVideoProcessor *iface, IDirect3DSurface9 *rt, const DXVA2_VideoProcessBltParams *params, const DXVA2_VideoSample *samples, UINT sample_count, HANDLE *complete_handle)
Definition: main.c:298
static HRESULT WINAPI device_manager_decoder_service_GetDecoderConfigurations(IDirectXVideoDecoderService *iface, REFGUID guid, const DXVA2_VideoDesc *video_desc, void *reserved, UINT *count, DXVA2_ConfigPictureDecode **configs)
Definition: main.c:704
static ULONG WINAPI device_manager_AddRef(IDirect3DDeviceManager9 *iface)
Definition: main.c:751
BOOL WINAPI GetMonitorColorTemperature(HMONITOR monitor, LPMC_COLOR_TEMPERATURE temperature)
Definition: main.c:1147
static HRESULT WINAPI device_manager_processor_service_CreateVideoProcessor(IDirectXVideoProcessorService *iface, REFGUID device, const DXVA2_VideoDesc *video_desc, D3DFORMAT rt_format, UINT max_substreams, IDirectXVideoProcessor **processor)
Definition: main.c:599
static D3DCOLOR video_processor_get_background_color(const DXVA2_AYUVSample16 *ayuv)
Definition: main.c:278
static HRESULT WINAPI device_manager_TestDevice(IDirect3DDeviceManager9 *iface, HANDLE hdevice)
Definition: main.c:900
static struct device_manager * impl_from_IDirect3DDeviceManager9(IDirect3DDeviceManager9 *iface)
Definition: main.c:110
HRESULT WINAPI OPMGetVideoOutputsFromHMONITOR(HMONITOR monitor, int vos, ULONG *numVideoOutputs, void ***videoOutputs)
Definition: main.c:1254
BOOL WINAPI SetVCPFeature(HMONITOR monitor, BYTE vcpCode, DWORD value)
Definition: main.c:1358
static ULONG WINAPI device_manager_decoder_service_AddRef(IDirectXVideoDecoderService *iface)
Definition: main.c:666
static HRESULT WINAPI device_manager_UnlockDevice(IDirect3DDeviceManager9 *iface, HANDLE hdevice, BOOL savestate)
Definition: main.c:971
HRESULT WINAPI DXVAHD_CreateDevice(IDirect3DDevice9Ex *d3d9_device, const DXVAHD_CONTENT_DESC *desc, DXVAHD_DEVICE_USAGE usage, PDXVAHDSW_Plugin plugin, IDXVAHD_Device **device)
Definition: main.c:1367
BOOL WINAPI SetMonitorContrast(HMONITOR monitor, DWORD contrast)
Definition: main.c:1318
BOOL WINAPI GetMonitorRedGreenOrBlueDrive(HMONITOR monitor, MC_DRIVE_TYPE type, LPDWORD minimum, LPDWORD current, LPDWORD maximum)
Definition: main.c:1181
static HRESULT WINAPI video_processor_GetCreationParameters(IDirectXVideoProcessor *iface, GUID *device, DXVA2_VideoDesc *video_desc, D3DFORMAT *rt_format, UINT *max_substreams)
Definition: main.c:200
BOOL WINAPI GetMonitorDisplayAreaPosition(HMONITOR monitor, MC_POSITION_TYPE type, LPDWORD minimum, LPDWORD current, LPDWORD maximum)
Definition: main.c:1163
static const IDirectXVideoDecoderServiceVtbl device_manager_decoder_service_vtbl
Definition: main.c:722
static HRESULT WINAPI device_manager_CloseDeviceHandle(IDirect3DDeviceManager9 *iface, HANDLE hdevice)
Definition: main.c:868
static const DXVA2_VideoProcessorCaps progressive_processor_caps
Definition: main.c:139
static HRESULT WINAPI device_manager_processor_service_GetVideoProcessorCaps(IDirectXVideoProcessorService *iface, REFGUID device, const DXVA2_VideoDesc *video_desc, D3DFORMAT rt_format, DXVA2_VideoProcessorCaps *caps)
Definition: main.c:558
static ULONG WINAPI device_manager_decoder_service_Release(IDirectXVideoDecoderService *iface)
Definition: main.c:672
static const IDirectXVideoProcessorVtbl video_processor_vtbl
Definition: main.c:342
static ULONG WINAPI device_manager_Release(IDirect3DDeviceManager9 *iface)
Definition: main.c:761
static HRESULT WINAPI device_manager_decoder_service_CreateVideoDecoder(IDirectXVideoDecoderService *iface, REFGUID guid, const DXVA2_VideoDesc *video_desc, const DXVA2_ConfigPictureDecode *config, IDirect3DSurface9 **rts, UINT num_surfaces, IDirectXVideoDecoder **decoder)
Definition: main.c:712
static HRESULT WINAPI video_processor_QueryInterface(IDirectXVideoProcessor *iface, REFIID riid, void **obj)
Definition: main.c:146
static HRESULT device_manager_get_handle_index(struct device_manager *manager, HANDLE hdevice, size_t *idx)
Definition: main.c:860
BOOL WINAPI SaveCurrentSettings(HMONITOR monitor)
Definition: main.c:1294
static BOOL dxva_is_supported_stream_format(const DXVA2_VideoDesc *video_desc, const D3DFORMAT *formats)
Definition: main.c:461
unsigned int idx
Definition: utils.c:40
void *WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: malloc.c:381
void WINAPI CoTaskMemFree(void *ptr)
Definition: malloc.c:389
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102
#define SetLastError(x)
Definition: compat.h:752
BOOL WINAPI SleepConditionVariableCS(PCONDITION_VARIABLE ConditionVariable, PCRITICAL_SECTION CriticalSection, DWORD Timeout)
Definition: sync.c:59
VOID WINAPI WakeAllConditionVariable(PCONDITION_VARIABLE ConditionVariable)
Definition: sync.c:91
VOID WINAPI InitializeConditionVariable(PCONDITION_VARIABLE ConditionVariable)
Definition: sync.c:22
const struct sortguid * guids
Definition: locale.c:422
ULONG WINAPI DECLSPEC_HOTPATCH GetTickCount(void)
Definition: sync.c:182
GUID guid
Definition: version.c:147
static MonoProfilerRuntimeShutdownBeginCallback cb
Definition: metahost.c:118
#define UINT_MAX
Definition: limits.h:27
r reserved
Definition: btrfs.c:3006
#define INFINITE
Definition: serial.h:102
#define ULONG_PTR
Definition: config.h:101
DWORD IDirect3DSurface9
Definition: dxva2api.idl:23
DWORD IDirect3DDevice9
Definition: dxva2api.idl:22
@ DXVA2_VPDev_HardwareDevice
Definition: dxva2api.idl:381
@ DXVA2_VPDev_SoftwareDevice
Definition: dxva2api.idl:383
@ DXVA2_VideoProcess_StretchX
Definition: dxva2api.idl:361
@ DXVA2_VideoProcess_YUV2RGBExtended
Definition: dxva2api.idl:367
@ DXVA2_VideoProcess_SubStreamsExtended
Definition: dxva2api.idl:366
@ DXVA2_VideoProcess_StretchY
Definition: dxva2api.idl:362
@ DXVA2_VideoProcess_SubRects
Definition: dxva2api.idl:364
@ DXVA2_VideoProcess_SubStreams
Definition: dxva2api.idl:365
@ DXVA2_VideoProcess_PlanarAlpha
Definition: dxva2api.idl:372
@ DXVA2_VideoProcess_YUV2RGB
Definition: dxva2api.idl:360
HRESULT(__stdcall * PDXVAHDSW_Plugin)(UINT size, void *callbacks)
Definition: dxvahd.idl:167
enum _DXVAHD_DEVICE_USAGE DXVAHD_DEVICE_USAGE
DWORD IDirect3DDevice9Ex
Definition: dxvahd.idl:22
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLint GLint GLsizei width
Definition: gl.h:1546
GLsizei samples
Definition: glext.h:7006
GLuint buffer
Definition: glext.h:5915
GLsizeiptr size
Definition: glext.h:5919
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLenum const GLfloat * params
Definition: glext.h:5645
const GLvdpauSurfaceNV * surfaces
Definition: glext.h:11586
GLbitfield flags
Definition: glext.h:7161
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
GLboolean GLboolean g
Definition: glext.h:6204
GLenum cap
Definition: glext.h:9639
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat token
Definition: glfuncs.h:210
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
unsigned int UINT
Definition: sysinfo.c:13
enum _MC_GAIN_TYPE MC_GAIN_TYPE
enum _MC_SIZE_TYPE MC_SIZE_TYPE
enum _MC_DISPLAY_TECHNOLOGY_TYPE * LPMC_DISPLAY_TECHNOLOGY_TYPE
enum _MC_COLOR_TEMPERATURE * LPMC_COLOR_TEMPERATURE
enum _MC_DRIVE_TYPE MC_DRIVE_TYPE
enum _MC_COLOR_TEMPERATURE MC_COLOR_TEMPERATURE
enum _MC_POSITION_TYPE MC_POSITION_TYPE
REFIID riid
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
#define b
Definition: ke_i.h:79
#define debugstr_guid
Definition: kernel32.h:35
enum _MC_VCP_CODE_TYPE * LPMC_VCP_CODE_TYPE
struct task_struct * current
Definition: linux.c:32
D3D11_SHADER_VARIABLE_DESC desc
Definition: reflection.c:1683
static unsigned int number
Definition: dsound.c:1479
static char * dest
Definition: rtl.c:149
#define min(a, b)
Definition: monoChain.cc:55
long LONG
Definition: pedump.c:60
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define REFIID
Definition: guiddef.h:118
BOOL WINAPI IsRectEmpty(_In_ LPCRECT)
BOOL WINAPI SetRectEmpty(_Out_ LPRECT)
#define calloc
Definition: rosglue.h:14
#define memset(x, y, z)
Definition: compat.h:39
#define TRACE(s)
Definition: solgame.cpp:4
Definition: dcommon.idl:28
long bottom
Definition: dcommon.idl:29
long right
Definition: dcommon.idl:29
long left
Definition: dcommon.idl:29
long top
Definition: dcommon.idl:29
D3DFORMAT Format
Definition: dxva2api.idl:289
Definition: scsiwmi.h:51
Definition: undname.c:54
unsigned int flags
Definition: main.c:47
IDirect3DStateBlock9 * state_block
Definition: main.c:48
size_t count
Definition: main.c:62
size_t capacity
Definition: main.c:63
IDirectXVideoProcessorService IDirectXVideoProcessorService_iface
Definition: main.c:54
HANDLE locking_handle
Definition: main.c:65
CONDITION_VARIABLE lock
Definition: main.c:68
CRITICAL_SECTION cs
Definition: main.c:67
IDirectXVideoDecoderService IDirectXVideoDecoderService_iface
Definition: main.c:55
IDirect3DDevice9 * device
Definition: main.c:58
struct device_handle * handles
Definition: main.c:61
UINT token
Definition: main.c:59
LONG refcount
Definition: main.c:56
IDirect3DDeviceManager9 IDirect3DDeviceManager9_iface
Definition: main.c:53
Definition: devices.h:37
const GUID * guid
Definition: main.c:441
const D3DFORMAT * input_formats
Definition: main.c:442
D3DFORMAT rt_format
Definition: main.c:79
unsigned int max_substreams
Definition: main.c:80
LONG refcount
Definition: main.c:74
GUID device
Definition: main.c:77
IDirectXVideoProcessorService * service
Definition: main.c:76
DXVA2_VideoDesc video_desc
Definition: main.c:78
IDirectXVideoProcessor IDirectXVideoProcessor_iface
Definition: main.c:73
#define max(a, b)
Definition: svc.c:63
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:687
ULONG_PTR SIZE_T
Definition: typedefs.h:80
uint32_t * LPDWORD
Definition: typedefs.h:59
char * LPSTR
Definition: typedefs.h:51
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
Definition: pdh_main.c:64
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
#define WINAPI
Definition: msvc.h:6
#define E_NOINTERFACE
Definition: winerror.h:3479
#define E_HANDLE
Definition: winerror.h:4117
static unsigned int block
Definition: xmlmemory.c:101
unsigned char BYTE
Definition: xxhash.c:193