ReactOS 0.4.15-dev-8116-gf69e256
vmr9.c
Go to the documentation of this file.
1/*
2 * Video Mixing Renderer for dx9
3 *
4 * Copyright 2004 Christian Costa
5 * Copyright 2008 Maarten Lankhorst
6 * Copyright 2012 Aric Stewart
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 */
22
23#include "config.h"
24
25#include "quartz_private.h"
26
27#include "uuids.h"
28#include "vfwmsgs.h"
29#include "amvideo.h"
30#include "windef.h"
31#include "winbase.h"
32#include "dshow.h"
33#include "evcode.h"
34#include "strmif.h"
35#include "ddraw.h"
36#include "dvdmedia.h"
37#include "d3d9.h"
38#include "vmr9.h"
39#include "pin.h"
40
41#include "wine/unicode.h"
42#include "wine/debug.h"
43
45
47{
49 BaseControlWindow baseControlWindow;
50 BaseControlVideo baseControlVideo;
51
63
67
68 /*
69 * The Video Mixing Renderer supports 3 modes, renderless, windowless and windowed
70 * What I do is implement windowless as a special case of renderless, and then
71 * windowed also as a special case of windowless. This is probably the easiest way.
72 */
78
80
81 /* Presentation related members */
82 IDirect3DDevice9 *allocator_d3d9_dev;
87
88 /* for Windowless Mode */
90
95};
96
97static inline struct quartz_vmr *impl_from_inner_IUnknown(IUnknown *iface)
98{
99 return CONTAINING_RECORD(iface, struct quartz_vmr, IUnknown_inner);
100}
101
102static inline struct quartz_vmr *impl_from_BaseWindow(BaseWindow *wnd)
103{
104 return CONTAINING_RECORD(wnd, struct quartz_vmr, baseControlWindow.baseWindow);
105}
106
107static inline struct quartz_vmr *impl_from_IVideoWindow(IVideoWindow *iface)
108{
109 return CONTAINING_RECORD(iface, struct quartz_vmr, baseControlWindow.IVideoWindow_iface);
110}
111
112static inline struct quartz_vmr *impl_from_BaseControlVideo(BaseControlVideo *cvid)
113{
114 return CONTAINING_RECORD(cvid, struct quartz_vmr, baseControlVideo);
115}
116
117static inline struct quartz_vmr *impl_from_IBasicVideo(IBasicVideo *iface)
118{
119 return CONTAINING_RECORD(iface, struct quartz_vmr, baseControlVideo.IBasicVideo_iface);
120}
121
123{
125}
126
128{
130}
131
133{
135}
136
138{
140}
141
143{
145}
146
148{
150}
151
153{
155}
156
158{
160}
161
163{
165}
166
168{
170}
171
172typedef struct
173{
176
178
182
183 IDirect3DDevice9 *d3d9_dev;
184 IDirect3D9 *d3d9_ptr;
185 IDirect3DSurface9 **d3d9_surfaces;
186 IDirect3DVertexBuffer9 *d3d9_vertex;
189
192
196
198{
199 return CONTAINING_RECORD(iface, VMR9DefaultAllocatorPresenterImpl, IVMRImagePresenter9_iface);
200}
201
203{
204 return CONTAINING_RECORD(iface, VMR9DefaultAllocatorPresenterImpl, IVMRSurfaceAllocatorEx9_iface);
205}
206
208
210 DWORD size)
211{
212 AM_MEDIA_TYPE *amt;
213 HRESULT hr = S_OK;
214 int width;
215 int height;
216 BITMAPINFOHEADER *bmiHeader;
218
219 TRACE("%p %p %d\n", This, data, size);
220
221 amt = &This->renderer.pInputPin->pin.mtCurrent;
222
223 if (IsEqualIID(&amt->formattype, &FORMAT_VideoInfo))
224 {
225 bmiHeader = &((VIDEOINFOHEADER *)amt->pbFormat)->bmiHeader;
226 }
227 else if (IsEqualIID(&amt->formattype, &FORMAT_VideoInfo2))
228 {
229 bmiHeader = &((VIDEOINFOHEADER2 *)amt->pbFormat)->bmiHeader;
230 }
231 else
232 {
233 FIXME("Unknown type %s\n", debugstr_guid(&amt->subtype));
234 return VFW_E_RUNTIME_ERROR;
235 }
236
237 TRACE("biSize = %d\n", bmiHeader->biSize);
238 TRACE("biWidth = %d\n", bmiHeader->biWidth);
239 TRACE("biHeight = %d\n", bmiHeader->biHeight);
240 TRACE("biPlanes = %d\n", bmiHeader->biPlanes);
241 TRACE("biBitCount = %d\n", bmiHeader->biBitCount);
242 TRACE("biCompression = %s\n", debugstr_an((LPSTR)&(bmiHeader->biCompression), 4));
243 TRACE("biSizeImage = %d\n", bmiHeader->biSizeImage);
244
245 width = bmiHeader->biWidth;
246 height = bmiHeader->biHeight;
247
248 TRACE("Src Rect: %s\n", wine_dbgstr_rect(&This->source_rect));
249 TRACE("Dst Rect: %s\n", wine_dbgstr_rect(&This->target_rect));
250
252 if (FAILED(hr))
253 {
254 ERR("IDirect3DSurface9_LockRect failed (%x)\n",hr);
255 return hr;
256 }
257
258 if (height > 0) {
259 /* Bottom up image needs inverting */
260 lock.pBits = (char *)lock.pBits + (height * lock.Pitch);
261 while (height--)
262 {
263 lock.pBits = (char *)lock.pBits - lock.Pitch;
264 memcpy(lock.pBits, data, width * bmiHeader->biBitCount / 8);
265 data = data + width * bmiHeader->biBitCount / 8;
266 }
267 }
268 else if (lock.Pitch != width * bmiHeader->biBitCount / 8)
269 {
270 WARN("Slow path! %u/%u\n", lock.Pitch, width * bmiHeader->biBitCount/8);
271
272 while (height--)
273 {
274 memcpy(lock.pBits, data, width * bmiHeader->biBitCount / 8);
275 data = data + width * bmiHeader->biBitCount / 8;
276 lock.pBits = (char *)lock.pBits + lock.Pitch;
277 }
278 }
279 else memcpy(lock.pBits, data, size);
280
282
283 hr = IVMRImagePresenter9_PresentImage(This->presenter, This->cookie, info);
284 return hr;
285}
286
288{
289 struct quartz_vmr *This = (struct quartz_vmr*)iface;
290 LPBYTE pbSrcStream = NULL;
291 long cbSrcStream = 0;
292 REFERENCE_TIME tStart, tStop;
294 HRESULT hr;
295
296 TRACE("%p %p\n", iface, pSample);
297
298 /* It is possible that there is no device at this point */
299
300 if (!This->allocator || !This->presenter)
301 {
302 ERR("NO PRESENTER!!\n");
303 return S_FALSE;
304 }
305
306 hr = IMediaSample_GetTime(pSample, &tStart, &tStop);
307 if (FAILED(hr))
309 else
311
312 if (IMediaSample_IsDiscontinuity(pSample) == S_OK)
314
315 if (IMediaSample_IsPreroll(pSample) == S_OK)
316 info.dwFlags |= VMR9Sample_Preroll;
317
318 if (IMediaSample_IsSyncPoint(pSample) == S_OK)
319 info.dwFlags |= VMR9Sample_SyncPoint;
320
321 /* If we render ourselves, and this is a preroll sample, discard it */
322 if (This->baseControlWindow.baseWindow.hWnd && (info.dwFlags & VMR9Sample_Preroll))
323 {
324 return S_OK;
325 }
326
327 hr = IMediaSample_GetPointer(pSample, &pbSrcStream);
328 if (FAILED(hr))
329 {
330 ERR("Cannot get pointer to sample data (%x)\n", hr);
331 return hr;
332 }
333
334 cbSrcStream = IMediaSample_GetActualDataLength(pSample);
335
336 info.rtStart = tStart;
337 info.rtEnd = tStop;
338 info.szAspectRatio.cx = This->bmiheader.biWidth;
339 info.szAspectRatio.cy = This->bmiheader.biHeight;
340
341 hr = IVMRSurfaceAllocatorEx9_GetSurface(This->allocator, This->cookie, (++This->cur_surface)%This->num_surfaces, 0, &info.lpSurf);
342
343 if (FAILED(hr))
344 return hr;
345
346 VMR9_SendSampleData(This, &info, pbSrcStream, cbSrcStream);
348
349 return hr;
350}
351
353{
354 struct quartz_vmr *This = (struct quartz_vmr*)iface;
355
356 if (!IsEqualIID(&pmt->majortype, &MEDIATYPE_Video) || !pmt->pbFormat)
357 return S_FALSE;
358
359 /* Ignore subtype, test for bicompression instead */
360 if (IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo))
361 {
362 VIDEOINFOHEADER *format = (VIDEOINFOHEADER *)pmt->pbFormat;
363
364 This->bmiheader = format->bmiHeader;
365 TRACE("Resolution: %dx%d\n", format->bmiHeader.biWidth, format->bmiHeader.biHeight);
366 This->VideoWidth = format->bmiHeader.biWidth;
367 This->VideoHeight = format->bmiHeader.biHeight;
368 SetRect(&This->source_rect, 0, 0, This->VideoWidth, This->VideoHeight);
369 }
370 else if (IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo2))
371 {
372 VIDEOINFOHEADER2 *format = (VIDEOINFOHEADER2 *)pmt->pbFormat;
373
374 This->bmiheader = format->bmiHeader;
375
376 TRACE("Resolution: %dx%d\n", format->bmiHeader.biWidth, format->bmiHeader.biHeight);
377 This->VideoWidth = format->bmiHeader.biWidth;
378 This->VideoHeight = format->bmiHeader.biHeight;
379 SetRect(&This->source_rect, 0, 0, This->VideoWidth, This->VideoHeight);
380 }
381 else
382 {
383 ERR("Format type %s not supported\n", debugstr_guid(&pmt->formattype));
384 return S_FALSE;
385 }
386 if (This->bmiheader.biCompression != BI_RGB)
387 return S_FALSE;
388 return S_OK;
389}
390
392{
395 HRESULT hr;
396
397 TRACE("my mode: %u, my window: %p, my last window: %p\n", This->mode, This->baseControlWindow.baseWindow.hWnd, This->hWndClippingWindow);
398 if (This->baseControlWindow.baseWindow.hWnd || !This->renderer.pInputPin->pin.pConnectedTo)
399 return S_OK;
400
401 if (This->mode == VMR9Mode_Windowless && !This->hWndClippingWindow)
402 return (force ? VFW_E_RUNTIME_ERROR : S_OK);
403
404 TRACE("Initializing\n");
406 info.dwHeight = This->source_rect.bottom;
407 info.dwWidth = This->source_rect.right;
408 info.Pool = D3DPOOL_DEFAULT;
409 info.MinBuffers = 2;
410 FIXME("Reduce ratio to least common denominator\n");
411 info.szAspectRatio.cx = info.dwWidth;
412 info.szAspectRatio.cy = info.dwHeight;
413 info.szNativeSize.cx = This->bmiheader.biWidth;
414 info.szNativeSize.cy = This->bmiheader.biHeight;
415 buffers = 2;
416
417 switch (This->bmiheader.biBitCount)
418 {
419 case 8: info.Format = D3DFMT_R3G3B2; break;
420 case 15: info.Format = D3DFMT_X1R5G5B5; break;
421 case 16: info.Format = D3DFMT_R5G6B5; break;
422 case 24: info.Format = D3DFMT_R8G8B8; break;
423 case 32: info.Format = D3DFMT_X8R8G8B8; break;
424 default:
425 FIXME("Unknown bpp %u\n", This->bmiheader.biBitCount);
427 }
428
429 This->cur_surface = 0;
430 if (This->num_surfaces)
431 {
432 ERR("num_surfaces or d3d9_surfaces not 0\n");
433 return E_FAIL;
434 }
435
436 hr = IVMRSurfaceAllocatorEx9_InitializeDevice(This->allocator, This->cookie, &info, &buffers);
437 if (SUCCEEDED(hr))
438 {
439 SetRect(&This->source_rect, 0, 0, This->bmiheader.biWidth, This->bmiheader.biHeight);
440
441 This->num_surfaces = buffers;
442 }
443 return hr;
444}
445
447{
448 struct quartz_vmr *This = (struct quartz_vmr*)iface;
449
450 TRACE("(%p)\n", This);
451
453 IVMRImagePresenter9_StartPresenting(This->presenter, This->cookie);
454 SetWindowPos(This->baseControlWindow.baseWindow.hWnd, NULL,
455 This->source_rect.left,
456 This->source_rect.top,
457 This->source_rect.right - This->source_rect.left,
458 This->source_rect.bottom - This->source_rect.top,
460 ShowWindow(This->baseControlWindow.baseWindow.hWnd, SW_SHOW);
461 GetClientRect(This->baseControlWindow.baseWindow.hWnd, &This->target_rect);
462}
463
465{
466 struct quartz_vmr *This = (struct quartz_vmr*)iface;
467
468 TRACE("(%p)\n", This);
469
470 if (This->renderer.filter.state == State_Running)
471 IVMRImagePresenter9_StopPresenting(This->presenter, This->cookie);
472}
473
475{
476 /* Preroll means the sample isn't shown, this is used for key frames and things like that */
477 if (IMediaSample_IsPreroll(pSample) == S_OK)
478 return E_FAIL;
479 return S_FALSE;
480}
481
483{
484 struct quartz_vmr *pVMR9 = (struct quartz_vmr*)This;
485 HRESULT hr;
486
487 TRACE("(%p)\n", This);
488
489 if (pVMR9->mode ||
490 SUCCEEDED(hr = IVMRFilterConfig9_SetRenderingMode(&pVMR9->IVMRFilterConfig9_iface, VMR9Mode_Windowed)))
491 hr = VMR9_maybe_init(pVMR9, FALSE);
492
493 return hr;
494}
495
497{
498 struct quartz_vmr *pVMR9 = (struct quartz_vmr*)This;
499 HRESULT hr = S_OK;
500
501 if (!pVMR9->mode)
502 return S_FALSE;
503 if (This->pInputPin->pin.pConnectedTo && pVMR9->allocator && pVMR9->presenter)
504 {
505 if (pVMR9->renderer.filter.state != State_Stopped)
506 {
507 ERR("Disconnecting while not stopped! UNTESTED!!\n");
508 }
509 if (pVMR9->renderer.filter.state == State_Running)
510 hr = IVMRImagePresenter9_StopPresenting(pVMR9->presenter, pVMR9->cookie);
511 IVMRSurfaceAllocatorEx9_TerminateDevice(pVMR9->allocator, pVMR9->cookie);
512 pVMR9->num_surfaces = 0;
513 }
514 return hr;
515}
516
520
521 NULL,
522 NULL,
523 NULL,
526 NULL,
527 NULL,
528 NULL,
530 NULL,
531
534 NULL,
535 NULL,
536 NULL,
537};
538
539static LPWSTR WINAPI VMR9_GetClassWindowStyles(BaseWindow *This, DWORD *pClassStyles, DWORD *pWindowStyles, DWORD *pWindowStylesEx)
540{
541 static WCHAR classnameW[] = { 'I','V','M','R','9',' ','C','l','a','s','s', 0 };
542
543 *pClassStyles = 0;
544 *pWindowStyles = WS_SIZEBOX;
545 *pWindowStylesEx = 0;
546
547 return classnameW;
548}
549
551{
552 struct quartz_vmr* pVMR9 = impl_from_BaseWindow(This);
553 static RECT defRect;
554
555 SetRect(&defRect, 0, 0, pVMR9->VideoWidth, pVMR9->VideoHeight);
556
557 return defRect;
558}
559
561{
562 struct quartz_vmr* pVMR9 = impl_from_BaseWindow(This);
563
564 TRACE("WM_SIZE %d %d\n", Width, Height);
565 GetClientRect(This->hWnd, &pVMR9->target_rect);
566 TRACE("WM_SIZING: DestRect=(%d,%d),(%d,%d)\n",
567 pVMR9->target_rect.left,
568 pVMR9->target_rect.top,
569 pVMR9->target_rect.right - pVMR9->target_rect.left,
570 pVMR9->target_rect.bottom - pVMR9->target_rect.top);
572}
573
577 NULL,
580};
581
582static HRESULT WINAPI VMR9_GetSourceRect(BaseControlVideo* This, RECT *pSourceRect)
583{
585 CopyRect(pSourceRect,&pVMR9->source_rect);
586 return S_OK;
587}
588
589static HRESULT WINAPI VMR9_GetStaticImage(BaseControlVideo* This, LONG *pBufferSize, LONG *pDIBImage)
590{
592 BITMAPINFOHEADER *bmiHeader;
593 LONG needed_size;
595 char *ptr;
596
597 FIXME("(%p/%p)->(%p, %p): partial stub\n", pVMR9, This, pBufferSize, pDIBImage);
598
600
601 if (!pVMR9->renderer.pMediaSample)
602 {
604 return (pVMR9->renderer.filter.state == State_Paused ? E_UNEXPECTED : VFW_E_NOT_PAUSED);
605 }
606
607 if (IsEqualIID(&amt->formattype, &FORMAT_VideoInfo))
608 {
609 bmiHeader = &((VIDEOINFOHEADER *)amt->pbFormat)->bmiHeader;
610 }
611 else if (IsEqualIID(&amt->formattype, &FORMAT_VideoInfo2))
612 {
613 bmiHeader = &((VIDEOINFOHEADER2 *)amt->pbFormat)->bmiHeader;
614 }
615 else
616 {
617 FIXME("Unknown type %s\n", debugstr_guid(&amt->subtype));
619 return VFW_E_RUNTIME_ERROR;
620 }
621
622 needed_size = bmiHeader->biSize;
623 needed_size += IMediaSample_GetActualDataLength(pVMR9->renderer.pMediaSample);
624
625 if (!pDIBImage)
626 {
627 *pBufferSize = needed_size;
629 return S_OK;
630 }
631
632 if (needed_size < *pBufferSize)
633 {
634 ERR("Buffer too small %u/%u\n", needed_size, *pBufferSize);
636 return E_FAIL;
637 }
638 *pBufferSize = needed_size;
639
640 memcpy(pDIBImage, bmiHeader, bmiHeader->biSize);
641 IMediaSample_GetPointer(pVMR9->renderer.pMediaSample, (BYTE **)&ptr);
642 memcpy((char *)pDIBImage + bmiHeader->biSize, ptr, IMediaSample_GetActualDataLength(pVMR9->renderer.pMediaSample));
643
645 return S_OK;
646}
647
648static HRESULT WINAPI VMR9_GetTargetRect(BaseControlVideo* This, RECT *pTargetRect)
649{
651 CopyRect(pTargetRect,&pVMR9->target_rect);
652 return S_OK;
653}
654
656{
658 AM_MEDIA_TYPE *pmt;
659
660 TRACE("(%p/%p)\n", pVMR9, This);
661
662 pmt = &pVMR9->renderer.pInputPin->pin.mtCurrent;
663 if (IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo)) {
664 return (VIDEOINFOHEADER*)pmt->pbFormat;
665 } else if (IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo2)) {
666 static VIDEOINFOHEADER vih;
667 VIDEOINFOHEADER2 *vih2 = (VIDEOINFOHEADER2*)pmt->pbFormat;
668 memcpy(&vih,vih2,sizeof(VIDEOINFOHEADER));
669 memcpy(&vih.bmiHeader, &vih2->bmiHeader, sizeof(BITMAPINFOHEADER));
670 return &vih;
671 } else {
672 ERR("Unknown format type %s\n", qzdebugstr_guid(&pmt->formattype));
673 return NULL;
674 }
675}
676
678{
680 FIXME("(%p/%p)->(): stub !!!\n", pVMR9, This);
681
682 return S_OK;
683}
684
686{
688 FIXME("(%p/%p)->(): stub !!!\n", pVMR9, This);
689
690 return S_OK;
691}
692
694{
696
697 SetRect(&pVMR9->source_rect, 0, 0, pVMR9->VideoWidth, pVMR9->VideoHeight);
698
699 return S_OK;
700}
701
703{
704 RECT rect;
706
707 if (!GetClientRect(pVMR9->baseControlWindow.baseWindow.hWnd, &rect))
708 return E_FAIL;
709
710 SetRect(&pVMR9->target_rect, 0, 0, rect.right, rect.bottom);
711
712 return S_OK;
713}
714
715static HRESULT WINAPI VMR9_SetSourceRect(BaseControlVideo* This, RECT *pSourceRect)
716{
718 CopyRect(&pVMR9->source_rect,pSourceRect);
719 return S_OK;
720}
721
722static HRESULT WINAPI VMR9_SetTargetRect(BaseControlVideo* This, RECT *pTargetRect)
723{
725 CopyRect(&pVMR9->target_rect,pTargetRect);
726 return S_OK;
727}
728
729static const BaseControlVideoFuncTable renderer_BaseControlVideoFuncTable = {
740};
741
743{
745 TRACE("(%p/%p)->(%s, %p)\n", This, iface, qzdebugstr_guid(riid), ppv);
746
747 if (This->bAggregatable)
748 This->bUnkOuterValid = TRUE;
749
750 *ppv = NULL;
751
753 *ppv = &This->IUnknown_inner;
754 else if (IsEqualIID(riid, &IID_IVideoWindow))
755 *ppv = &This->baseControlWindow.IVideoWindow_iface;
756 else if (IsEqualIID(riid, &IID_IBasicVideo))
757 *ppv = &This->baseControlVideo.IBasicVideo_iface;
758 else if (IsEqualIID(riid, &IID_IAMCertifiedOutputProtection))
759 *ppv = &This->IAMCertifiedOutputProtection_iface;
760 else if (IsEqualIID(riid, &IID_IAMFilterMiscFlags))
761 *ppv = &This->IAMFilterMiscFlags_iface;
762 else if (IsEqualIID(riid, &IID_IVMRFilterConfig))
763 *ppv = &This->IVMRFilterConfig_iface;
764 else if (IsEqualIID(riid, &IID_IVMRFilterConfig9))
765 *ppv = &This->IVMRFilterConfig9_iface;
766 else if (IsEqualIID(riid, &IID_IVMRMonitorConfig))
767 *ppv = &This->IVMRMonitorConfig_iface;
768 else if (IsEqualIID(riid, &IID_IVMRMonitorConfig9))
769 *ppv = &This->IVMRMonitorConfig9_iface;
770 else if (IsEqualIID(riid, &IID_IVMRSurfaceAllocatorNotify) && This->mode == (VMR9Mode)VMRMode_Renderless)
771 *ppv = &This->IVMRSurfaceAllocatorNotify_iface;
772 else if (IsEqualIID(riid, &IID_IVMRSurfaceAllocatorNotify9) && This->mode == VMR9Mode_Renderless)
773 *ppv = &This->IVMRSurfaceAllocatorNotify9_iface;
774 else if (IsEqualIID(riid, &IID_IVMRWindowlessControl) && This->mode == (VMR9Mode)VMRMode_Windowless)
775 *ppv = &This->IVMRWindowlessControl_iface;
776 else if (IsEqualIID(riid, &IID_IVMRWindowlessControl9) && This->mode == VMR9Mode_Windowless)
777 *ppv = &This->IVMRWindowlessControl9_iface;
778 else
779 {
780 HRESULT hr;
781 hr = BaseRendererImpl_QueryInterface(&This->renderer.filter.IBaseFilter_iface, riid, ppv);
782 if (SUCCEEDED(hr))
783 return hr;
784 }
785
786 if (*ppv)
787 {
788 IUnknown_AddRef((IUnknown *)(*ppv));
789 return S_OK;
790 }
791
792 else if (IsEqualIID(riid, &IID_IBasicVideo2))
793 FIXME("No interface for IID_IBasicVideo2\n");
794 else if (IsEqualIID(riid, &IID_IVMRWindowlessControl9))
795 ;
796 else if (IsEqualIID(riid, &IID_IVMRSurfaceAllocatorNotify9))
797 ;
798 else if (IsEqualIID(riid, &IID_IMediaPosition))
799 FIXME("No interface for IID_IMediaPosition\n");
800 else if (IsEqualIID(riid, &IID_IQualProp))
801 FIXME("No interface for IID_IQualProp\n");
802 else if (IsEqualIID(riid, &IID_IVMRAspectRatioControl9))
803 FIXME("No interface for IID_IVMRAspectRatioControl9\n");
804 else if (IsEqualIID(riid, &IID_IVMRDeinterlaceControl9))
805 FIXME("No interface for IID_IVMRDeinterlaceControl9\n");
806 else if (IsEqualIID(riid, &IID_IVMRMixerBitmap9))
807 FIXME("No interface for IID_IVMRMixerBitmap9\n");
808 else if (IsEqualIID(riid, &IID_IVMRMixerControl9))
809 FIXME("No interface for IID_IVMRMixerControl9\n");
810 else
811 FIXME("No interface for %s\n", debugstr_guid(riid));
812
813 return E_NOINTERFACE;
814}
815
817{
819 ULONG refCount = BaseFilterImpl_AddRef(&This->renderer.filter.IBaseFilter_iface);
820
821 TRACE("(%p/%p)->() AddRef from %d\n", This, iface, refCount - 1);
822
823 return refCount;
824}
825
827{
829 ULONG refCount = BaseRendererImpl_Release(&This->renderer.filter.IBaseFilter_iface);
830
831 TRACE("(%p/%p)->() Release from %d\n", This, iface, refCount + 1);
832
833 if (!refCount)
834 {
835 TRACE("Destroying\n");
836 BaseControlWindow_Destroy(&This->baseControlWindow);
837 FreeLibrary(This->hD3d9);
838
839 if (This->allocator)
840 IVMRSurfaceAllocatorEx9_Release(This->allocator);
841 if (This->presenter)
842 IVMRImagePresenter9_Release(This->presenter);
843
844 This->num_surfaces = 0;
845 if (This->allocator_d3d9_dev)
846 {
847 IDirect3DDevice9_Release(This->allocator_d3d9_dev);
848 This->allocator_d3d9_dev = NULL;
849 }
850
852 }
853 return refCount;
854}
855
856static const IUnknownVtbl IInner_VTable =
857{
861};
862
864{
865 struct quartz_vmr *This = (struct quartz_vmr*)iface;
866
867 if (This->bAggregatable)
868 This->bUnkOuterValid = TRUE;
869
870 if (This->outer_unk)
871 {
872 if (This->bAggregatable)
873 return IUnknown_QueryInterface(This->outer_unk, riid, ppv);
874
876 {
877 HRESULT hr;
878
879 IUnknown_AddRef(&This->IUnknown_inner);
880 hr = IUnknown_QueryInterface(&This->IUnknown_inner, riid, ppv);
881 IUnknown_Release(&This->IUnknown_inner);
882 This->bAggregatable = TRUE;
883 return hr;
884 }
885
886 *ppv = NULL;
887 return E_NOINTERFACE;
888 }
889
890 return IUnknown_QueryInterface(&This->IUnknown_inner, riid, ppv);
891}
892
894{
895 struct quartz_vmr *This = (struct quartz_vmr*)iface;
896 LONG ret;
897
898 if (This->outer_unk && This->bUnkOuterValid)
899 ret = IUnknown_AddRef(This->outer_unk);
900 else
901 ret = IUnknown_AddRef(&This->IUnknown_inner);
902
903 TRACE("(%p)->AddRef from %d\n", iface, ret - 1);
904
905 return ret;
906}
907
909{
910 struct quartz_vmr *This = (struct quartz_vmr*)iface;
911 LONG ret;
912
913 if (This->outer_unk && This->bUnkOuterValid)
914 ret = IUnknown_Release(This->outer_unk);
915 else
916 ret = IUnknown_Release(&This->IUnknown_inner);
917
918 TRACE("(%p)->Release from %d\n", iface, ret + 1);
919
920 if (ret)
921 return ret;
922 return 0;
923}
924
925static const IBaseFilterVtbl VMR_Vtbl =
926{
942};
943
944/*** IUnknown methods ***/
945static HRESULT WINAPI Videowindow_QueryInterface(IVideoWindow *iface, REFIID riid, LPVOID*ppvObj)
946{
947 struct quartz_vmr *This = impl_from_IVideoWindow(iface);
948
949 TRACE("(%p/%p)->(%s, %p)\n", This, iface, debugstr_guid(riid), ppvObj);
950
951 return VMR9_QueryInterface(&This->renderer.filter.IBaseFilter_iface, riid, ppvObj);
952}
953
954static ULONG WINAPI Videowindow_AddRef(IVideoWindow *iface)
955{
956 struct quartz_vmr *This = impl_from_IVideoWindow(iface);
957
958 TRACE("(%p/%p)->()\n", This, iface);
959
960 return VMR9_AddRef(&This->renderer.filter.IBaseFilter_iface);
961}
962
963static ULONG WINAPI Videowindow_Release(IVideoWindow *iface)
964{
965 struct quartz_vmr *This = impl_from_IVideoWindow(iface);
966
967 TRACE("(%p/%p)->()\n", This, iface);
968
969 return VMR9_Release(&This->renderer.filter.IBaseFilter_iface);
970}
971
972static const IVideoWindowVtbl IVideoWindow_VTable =
973{
1020};
1021
1022/*** IUnknown methods ***/
1023static HRESULT WINAPI Basicvideo_QueryInterface(IBasicVideo *iface, REFIID riid, LPVOID * ppvObj)
1024{
1025 struct quartz_vmr *This = impl_from_IBasicVideo(iface);
1026
1027 TRACE("(%p/%p)->(%s, %p)\n", This, iface, debugstr_guid(riid), ppvObj);
1028
1029 return VMR9_QueryInterface(&This->renderer.filter.IBaseFilter_iface, riid, ppvObj);
1030}
1031
1032static ULONG WINAPI Basicvideo_AddRef(IBasicVideo *iface)
1033{
1034 struct quartz_vmr *This = impl_from_IBasicVideo(iface);
1035
1036 TRACE("(%p/%p)->()\n", This, iface);
1037
1038 return VMR9_AddRef(&This->renderer.filter.IBaseFilter_iface);
1039}
1040
1041static ULONG WINAPI Basicvideo_Release(IBasicVideo *iface)
1042{
1043 struct quartz_vmr *This = impl_from_IBasicVideo(iface);
1044
1045 TRACE("(%p/%p)->()\n", This, iface);
1046
1047 return VMR9_Release(&This->renderer.filter.IBaseFilter_iface);
1048}
1049
1050static const IBasicVideoVtbl IBasicVideo_VTable =
1051{
1091};
1092
1094 REFIID riid, void **ppv)
1095{
1097 return VMR9_QueryInterface(&This->renderer.filter.IBaseFilter_iface, riid, ppv);
1098}
1099
1101{
1103 return VMR9_AddRef(&This->renderer.filter.IBaseFilter_iface);
1104}
1105
1107{
1109 return VMR9_Release(&This->renderer.filter.IBaseFilter_iface);
1110}
1111
1113 GUID* pRandom, BYTE** VarLenCertGH,
1114 DWORD* pdwLengthCertGH)
1115{
1117
1118 FIXME("(%p/%p)->(%p, %p, %p) stub\n", iface, This, pRandom, VarLenCertGH, pdwLengthCertGH);
1119 return VFW_E_NO_COPP_HW;
1120}
1121
1123 AMCOPPSignature* pSig)
1124{
1126
1127 FIXME("(%p/%p)->(%p) stub\n", iface, This, pSig);
1128 return VFW_E_NO_COPP_HW;
1129}
1130
1132 const AMCOPPCommand* cmd)
1133{
1135
1136 FIXME("(%p/%p)->(%p) stub\n", iface, This, cmd);
1137 return VFW_E_NO_COPP_HW;
1138}
1139
1141 const AMCOPPStatusInput* pStatusInput,
1142 AMCOPPStatusOutput* pStatusOutput)
1143{
1145
1146 FIXME("(%p/%p)->(%p, %p) stub\n", iface, This, pStatusInput, pStatusOutput);
1147 return VFW_E_NO_COPP_HW;
1148}
1149
1150static const IAMCertifiedOutputProtectionVtbl IAMCertifiedOutputProtection_Vtbl =
1151{
1159};
1160
1163 return VMR9_QueryInterface(&This->renderer.filter.IBaseFilter_iface, riid, ppv);
1164}
1165
1168 return VMR9_AddRef(&This->renderer.filter.IBaseFilter_iface);
1169}
1170
1173 return VMR9_Release(&This->renderer.filter.IBaseFilter_iface);
1174}
1175
1178}
1179
1180static const IAMFilterMiscFlagsVtbl IAMFilterMiscFlags_Vtbl = {
1185};
1186
1188 void** ppv)
1189{
1191 return VMR9_QueryInterface(&This->renderer.filter.IBaseFilter_iface, riid, ppv);
1192}
1193
1195{
1197 return VMR9_AddRef(&This->renderer.filter.IBaseFilter_iface);
1198}
1199
1201{
1203 return VMR9_Release(&This->renderer.filter.IBaseFilter_iface);
1204}
1205
1207 IVMRImageCompositor *compositor)
1208{
1210
1211 FIXME("(%p/%p)->(%p) stub\n", iface, This, compositor);
1212 return E_NOTIMPL;
1213}
1214
1216{
1218
1219 FIXME("(%p/%p)->(%u) stub\n", iface, This, max);
1220 return E_NOTIMPL;
1221}
1222
1224{
1226
1227 FIXME("(%p/%p)->(%p) stub\n", iface, This, max);
1228 return E_NOTIMPL;
1229}
1230
1232{
1234
1235 FIXME("(%p/%p)->(%u) stub\n", iface, This, renderflags);
1236 return E_NOTIMPL;
1237}
1238
1240{
1242
1243 FIXME("(%p/%p)->(%p) stub\n", iface, This, renderflags);
1244 return E_NOTIMPL;
1245}
1246
1248{
1250
1251 FIXME("(%p/%p)->(%u) stub\n", iface, This, mode);
1252 return E_NOTIMPL;
1253}
1254
1256{
1258
1259 TRACE("(%p/%p)->(%p)\n", iface, This, mode);
1260 if (!mode) return E_POINTER;
1261
1262 if (This->mode)
1263 *mode = This->mode;
1264 else
1266
1267 return S_OK;
1268}
1269
1270static const IVMRFilterConfigVtbl VMR7_FilterConfig_Vtbl =
1271{
1282};
1283
1285{
1290};
1291
1293{
1296
1297 if (args->info7 || args->info9)
1298 {
1299
1300 if (!args->arraysize)
1301 return FALSE;
1302
1303 mi.cbSize = sizeof(mi);
1305 return TRUE;
1306
1307 /* fill VMRMONITORINFO struct */
1308 if (args->info7)
1309 {
1310 VMRMONITORINFO *info = args->info7++;
1311 memset(info, 0, sizeof(*info));
1312
1313 if (args->numdev > 0)
1314 {
1315 info->guid.pGUID = &info->guid.GUID;
1316 info->guid.GUID.Data4[7] = args->numdev;
1317 }
1318 else
1319 info->guid.pGUID = NULL;
1320
1321 info->rcMonitor = mi.rcMonitor;
1322 info->hMon = hmon;
1323 info->dwFlags = mi.dwFlags;
1324
1325 lstrcpynW(info->szDevice, mi.szDevice, sizeof(info->szDevice)/sizeof(WCHAR));
1326
1327 /* FIXME: how to get these values? */
1328 info->szDescription[0] = 0;
1329 }
1330
1331 /* fill VMR9MonitorInfo struct */
1332 if (args->info9)
1333 {
1334 VMR9MonitorInfo *info = args->info9++;
1335 memset(info, 0, sizeof(*info));
1336
1337 info->uDevID = 0; /* FIXME */
1338 info->rcMonitor = mi.rcMonitor;
1339 info->hMon = hmon;
1340 info->dwFlags = mi.dwFlags;
1341
1342 lstrcpynW(info->szDevice, mi.szDevice, sizeof(info->szDevice)/sizeof(WCHAR));
1343
1344 /* FIXME: how to get these values? */
1345 info->szDescription[0] = 0;
1346 info->dwVendorId = 0;
1347 info->dwDeviceId = 0;
1348 info->dwSubSysId = 0;
1349 info->dwRevision = 0;
1350 }
1351
1352 args->arraysize--;
1353 }
1354
1355 args->numdev++;
1356 return TRUE;
1357}
1358
1360 LPVOID * ppv)
1361{
1363 return VMR9_QueryInterface(&This->renderer.filter.IBaseFilter_iface, riid, ppv);
1364}
1365
1367{
1369 return VMR9_AddRef(&This->renderer.filter.IBaseFilter_iface);
1370}
1371
1373{
1375 return VMR9_Release(&This->renderer.filter.IBaseFilter_iface);
1376}
1377
1379{
1381
1382 FIXME("(%p/%p)->(%p) stub\n", iface, This, pGUID);
1383
1384 if (!pGUID)
1385 return E_POINTER;
1386
1387 return S_OK;
1388}
1389
1391{
1393
1394 FIXME("(%p/%p)->(%p) stub\n", iface, This, pGUID);
1395
1396 if (!pGUID)
1397 return E_POINTER;
1398
1399 pGUID->pGUID = NULL; /* default DirectDraw device */
1400 return S_OK;
1401}
1402
1404 const VMRGUID *pGUID)
1405{
1407
1408 FIXME("(%p/%p)->(%p) stub\n", iface, This, pGUID);
1409
1410 if (!pGUID)
1411 return E_POINTER;
1412
1413 return S_OK;
1414}
1415
1417{
1419
1420 FIXME("(%p/%p)->(%p) stub\n", iface, This, pGUID);
1421
1422 if (!pGUID)
1423 return E_POINTER;
1424
1425 pGUID->pGUID = NULL; /* default DirectDraw device */
1426 return S_OK;
1427}
1428
1430 VMRMONITORINFO *info, DWORD arraysize,
1431 DWORD *numdev)
1432{
1435
1436 FIXME("(%p/%p)->(%p, %u, %p) semi-stub\n", iface, This, info, arraysize, numdev);
1437
1438 if (!numdev)
1439 return E_POINTER;
1440
1441 if (info && arraysize == 0)
1442 return E_INVALIDARG;
1443
1444 args.info7 = info;
1445 args.info9 = NULL;
1446 args.arraysize = arraysize;
1447 args.numdev = 0;
1449
1450 *numdev = args.numdev;
1451 return S_OK;
1452}
1453
1454static const IVMRMonitorConfigVtbl VMR7_MonitorConfig_Vtbl =
1455{
1464};
1465
1467 LPVOID * ppv)
1468{
1470 return VMR9_QueryInterface(&This->renderer.filter.IBaseFilter_iface, riid, ppv);
1471}
1472
1474{
1476 return VMR9_AddRef(&This->renderer.filter.IBaseFilter_iface);
1477}
1478
1480{
1482 return VMR9_Release(&This->renderer.filter.IBaseFilter_iface);
1483}
1484
1486{
1488
1489 FIXME("(%p/%p)->(%u) stub\n", iface, This, uDev);
1490
1491 return S_OK;
1492}
1493
1495{
1497
1498 FIXME("(%p/%p)->(%p) stub\n", iface, This, uDev);
1499
1500 if (!uDev)
1501 return E_POINTER;
1502
1503 *uDev = 0;
1504 return S_OK;
1505}
1506
1508{
1510
1511 FIXME("(%p/%p)->(%u) stub\n", iface, This, uDev);
1512
1513 return S_OK;
1514}
1515
1517{
1519
1520 FIXME("(%p/%p)->(%p) stub\n", iface, This, uDev);
1521
1522 if (!uDev)
1523 return E_POINTER;
1524
1525 *uDev = 0;
1526 return S_OK;
1527}
1528
1530 VMR9MonitorInfo *info, DWORD arraysize,
1531 DWORD *numdev)
1532{
1535
1536 FIXME("(%p/%p)->(%p, %u, %p) semi-stub\n", iface, This, info, arraysize, numdev);
1537
1538 if (!numdev)
1539 return E_POINTER;
1540
1541 if (info && arraysize == 0)
1542 return E_INVALIDARG;
1543
1544 args.info7 = NULL;
1545 args.info9 = info;
1546 args.arraysize = arraysize;
1547 args.numdev = 0;
1549
1550 *numdev = args.numdev;
1551 return S_OK;
1552}
1553
1554static const IVMRMonitorConfig9Vtbl VMR9_MonitorConfig_Vtbl =
1555{
1564};
1565
1567{
1569 return VMR9_QueryInterface(&This->renderer.filter.IBaseFilter_iface, riid, ppv);
1570}
1571
1573{
1575 return VMR9_AddRef(&This->renderer.filter.IBaseFilter_iface);
1576}
1577
1579{
1581 return VMR9_Release(&This->renderer.filter.IBaseFilter_iface);
1582}
1583
1585{
1587
1588 FIXME("(%p/%p)->(%p) stub\n", iface, This, compositor);
1589 return E_NOTIMPL;
1590}
1591
1593{
1595
1596 FIXME("(%p/%p)->(%u) stub\n", iface, This, max);
1597 return E_NOTIMPL;
1598}
1599
1601{
1603
1604 FIXME("(%p/%p)->(%p) stub\n", iface, This, max);
1605 return E_NOTIMPL;
1606}
1607
1609{
1611
1612 FIXME("(%p/%p)->(%u) stub\n", iface, This, renderflags);
1613 return E_NOTIMPL;
1614}
1615
1617{
1619
1620 FIXME("(%p/%p)->(%p) stub\n", iface, This, renderflags);
1621 return E_NOTIMPL;
1622}
1623
1625{
1626 HRESULT hr = S_OK;
1628
1629 TRACE("(%p/%p)->(%u)\n", iface, This, mode);
1630
1631 EnterCriticalSection(&This->renderer.filter.csFilter);
1632 if (This->mode)
1633 {
1634 LeaveCriticalSection(&This->renderer.filter.csFilter);
1635 return VFW_E_WRONG_STATE;
1636 }
1637
1638 if (This->allocator)
1639 IVMRSurfaceAllocatorEx9_Release(This->allocator);
1640 if (This->presenter)
1641 IVMRImagePresenter9_Release(This->presenter);
1642
1643 This->allocator = NULL;
1644 This->presenter = NULL;
1645
1646 switch (mode)
1647 {
1648 case VMR9Mode_Windowed:
1650 This->allocator_is_ex = 0;
1651 This->cookie = ~0;
1652
1654 if (SUCCEEDED(hr))
1655 hr = IVMRImagePresenter9_QueryInterface(This->presenter, &IID_IVMRSurfaceAllocatorEx9, (LPVOID*)&This->allocator);
1656 if (FAILED(hr))
1657 {
1658 ERR("Unable to find Presenter interface\n");
1659 IVMRImagePresenter9_Release(This->presenter);
1660 This->allocator = NULL;
1661 This->presenter = NULL;
1662 }
1663 else
1664 hr = IVMRSurfaceAllocatorEx9_AdviseNotify(This->allocator, &This->IVMRSurfaceAllocatorNotify9_iface);
1665 break;
1667 break;
1668 default:
1669 LeaveCriticalSection(&This->renderer.filter.csFilter);
1670 return E_INVALIDARG;
1671 }
1672
1673 This->mode = mode;
1674 LeaveCriticalSection(&This->renderer.filter.csFilter);
1675 return hr;
1676}
1677
1679{
1681
1682 TRACE("(%p/%p)->(%p)\n", iface, This, mode);
1683 if (!mode)
1684 return E_POINTER;
1685
1686 if (This->mode)
1687 *mode = This->mode;
1688 else
1690
1691 return S_OK;
1692}
1693
1694static const IVMRFilterConfig9Vtbl VMR9_FilterConfig_Vtbl =
1695{
1706};
1707
1709 LPVOID * ppv)
1710{
1712 return VMR9_QueryInterface(&This->renderer.filter.IBaseFilter_iface, riid, ppv);
1713}
1714
1716{
1718 return VMR9_AddRef(&This->renderer.filter.IBaseFilter_iface);
1719}
1720
1722{
1724 return VMR9_Release(&This->renderer.filter.IBaseFilter_iface);
1725}
1726
1728 LONG *width, LONG *height,
1729 LONG *arwidth, LONG *arheight)
1730{
1732 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", iface, This, width, height, arwidth, arheight);
1733
1734 if (!width || !height || !arwidth || !arheight)
1735 {
1736 ERR("Got no pointer\n");
1737 return E_POINTER;
1738 }
1739
1740 *width = This->bmiheader.biWidth;
1741 *height = This->bmiheader.biHeight;
1742 *arwidth = This->bmiheader.biWidth;
1743 *arheight = This->bmiheader.biHeight;
1744
1745 return S_OK;
1746}
1747
1749 LONG *width, LONG *height)
1750{
1752
1753 FIXME("(%p/%p)->(...) stub\n", iface, This);
1754 return E_NOTIMPL;
1755}
1756
1758 LONG *width, LONG *height)
1759{
1761
1762 FIXME("(%p/%p)->(...) stub\n", iface, This);
1763 return E_NOTIMPL;
1764}
1765
1767 const RECT *source, const RECT *dest)
1768{
1770
1771 TRACE("(%p/%p)->(%p, %p)\n", iface, This, source, dest);
1772
1773 EnterCriticalSection(&This->renderer.filter.csFilter);
1774
1775 if (source)
1776 This->source_rect = *source;
1777 if (dest)
1778 {
1779 This->target_rect = *dest;
1780 if (This->baseControlWindow.baseWindow.hWnd)
1781 {
1782 FIXME("Output rectangle: %s\n", wine_dbgstr_rect(dest));
1783 SetWindowPos(This->baseControlWindow.baseWindow.hWnd, NULL,
1784 dest->left, dest->top, dest->right - dest->left, dest->bottom-dest->top,
1786 }
1787 }
1788
1789 LeaveCriticalSection(&This->renderer.filter.csFilter);
1790
1791 return S_OK;
1792}
1793
1795 RECT *source, RECT *dest)
1796{
1798
1799 if (source)
1800 *source = This->source_rect;
1801
1802 if (dest)
1803 *dest = This->target_rect;
1804
1805 FIXME("(%p/%p)->(%p/%p) stub\n", iface, This, source, dest);
1806 return S_OK;
1807}
1808
1810 DWORD *mode)
1811{
1813
1814 FIXME("(%p/%p)->(...) stub\n", iface, This);
1815 return E_NOTIMPL;
1816}
1817
1819 DWORD mode)
1820{
1822
1823 FIXME("(%p/%p)->(...) stub\n", iface, This);
1824 return E_NOTIMPL;
1825}
1826
1828 HWND hwnd)
1829{
1831
1832 FIXME("(%p/%p)->(...) stub\n", iface, This);
1833 return E_NOTIMPL;
1834}
1835
1837 HWND hwnd, HDC hdc)
1838{
1840
1841 FIXME("(%p/%p)->(...) stub\n", iface, This);
1842 return E_NOTIMPL;
1843}
1844
1846{
1848
1849 FIXME("(%p/%p)->(...) stub\n", iface, This);
1850 return E_NOTIMPL;
1851}
1852
1854 BYTE **dib)
1855{
1857
1858 FIXME("(%p/%p)->(...) stub\n", iface, This);
1859 return E_NOTIMPL;
1860}
1861
1864{
1866
1867 FIXME("(%p/%p)->(...) stub\n", iface, This);
1868 return E_NOTIMPL;
1869}
1870
1872 COLORREF *color)
1873{
1875
1876 FIXME("(%p/%p)->(...) stub\n", iface, This);
1877 return E_NOTIMPL;
1878}
1879
1881{
1883
1884 FIXME("(%p/%p)->(...) stub\n", iface, This);
1885 return E_NOTIMPL;
1886}
1887
1889{
1891
1892 FIXME("(%p/%p)->(...) stub\n", iface, This);
1893 return E_NOTIMPL;
1894}
1895
1896static const IVMRWindowlessControlVtbl VMR7_WindowlessControl_Vtbl =
1897{
1916};
1917
1919{
1921 return VMR9_QueryInterface(&This->renderer.filter.IBaseFilter_iface, riid, ppv);
1922}
1923
1925{
1927 return VMR9_AddRef(&This->renderer.filter.IBaseFilter_iface);
1928}
1929
1931{
1933 return VMR9_Release(&This->renderer.filter.IBaseFilter_iface);
1934}
1935
1937{
1939 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", iface, This, width, height, arwidth, arheight);
1940
1941 if (!width || !height || !arwidth || !arheight)
1942 {
1943 ERR("Got no pointer\n");
1944 return E_POINTER;
1945 }
1946
1947 *width = This->bmiheader.biWidth;
1948 *height = This->bmiheader.biHeight;
1949 *arwidth = This->bmiheader.biWidth;
1950 *arheight = This->bmiheader.biHeight;
1951
1952 return S_OK;
1953}
1954
1956{
1958
1959 FIXME("(%p/%p)->(...) stub\n", iface, This);
1960 return E_NOTIMPL;
1961}
1962
1964{
1966
1967 FIXME("(%p/%p)->(...) stub\n", iface, This);
1968 return E_NOTIMPL;
1969}
1970
1972{
1974
1975 TRACE("(%p/%p)->(%p, %p)\n", iface, This, source, dest);
1976
1977 EnterCriticalSection(&This->renderer.filter.csFilter);
1978
1979 if (source)
1980 This->source_rect = *source;
1981 if (dest)
1982 {
1983 This->target_rect = *dest;
1984 if (This->baseControlWindow.baseWindow.hWnd)
1985 {
1986 FIXME("Output rectangle: %s\n", wine_dbgstr_rect(dest));
1987 SetWindowPos(This->baseControlWindow.baseWindow.hWnd, NULL, dest->left, dest->top, dest->right - dest->left,
1989 }
1990 }
1991
1992 LeaveCriticalSection(&This->renderer.filter.csFilter);
1993
1994 return S_OK;
1995}
1996
1998{
2000
2001 if (source)
2002 *source = This->source_rect;
2003
2004 if (dest)
2005 *dest = This->target_rect;
2006
2007 FIXME("(%p/%p)->(%p/%p) stub\n", iface, This, source, dest);
2008 return S_OK;
2009}
2010
2012{
2014
2015 FIXME("(%p/%p)->(...) stub\n", iface, This);
2016 return E_NOTIMPL;
2017}
2018
2020{
2022
2023 FIXME("(%p/%p)->(...) stub\n", iface, This);
2024 return E_NOTIMPL;
2025}
2026
2028{
2030
2031 TRACE("(%p/%p)->(%p)\n", iface, This, hwnd);
2032
2033 EnterCriticalSection(&This->renderer.filter.csFilter);
2034 This->hWndClippingWindow = hwnd;
2036 if (!hwnd)
2037 IVMRSurfaceAllocatorEx9_TerminateDevice(This->allocator, This->cookie);
2038 LeaveCriticalSection(&This->renderer.filter.csFilter);
2039 return S_OK;
2040}
2041
2043{
2045 HRESULT hr;
2046
2047 FIXME("(%p/%p)->(...) semi-stub\n", iface, This);
2048
2049 EnterCriticalSection(&This->renderer.filter.csFilter);
2050 if (hwnd != This->hWndClippingWindow && hwnd != This->baseControlWindow.baseWindow.hWnd)
2051 {
2052 ERR("Not handling changing windows yet!!!\n");
2053 LeaveCriticalSection(&This->renderer.filter.csFilter);
2054 return S_OK;
2055 }
2056
2057 if (!This->allocator_d3d9_dev)
2058 {
2059 ERR("No d3d9 device!\n");
2060 LeaveCriticalSection(&This->renderer.filter.csFilter);
2061 return VFW_E_WRONG_STATE;
2062 }
2063
2064 /* Windowless extension */
2065 hr = IDirect3DDevice9_Present(This->allocator_d3d9_dev, NULL, NULL, This->baseControlWindow.baseWindow.hWnd, NULL);
2066 LeaveCriticalSection(&This->renderer.filter.csFilter);
2067
2068 return hr;
2069}
2070
2072{
2074
2075 FIXME("(%p/%p)->(...) stub\n", iface, This);
2076 return E_NOTIMPL;
2077}
2078
2080{
2082
2083 FIXME("(%p/%p)->(...) stub\n", iface, This);
2084 return E_NOTIMPL;
2085}
2086
2088{
2090
2091 FIXME("(%p/%p)->(...) stub\n", iface, This);
2092 return E_NOTIMPL;
2093}
2094
2096{
2098
2099 FIXME("(%p/%p)->(...) stub\n", iface, This);
2100 return E_NOTIMPL;
2101}
2102
2103static const IVMRWindowlessControl9Vtbl VMR9_WindowlessControl_Vtbl =
2104{
2121};
2122
2124 REFIID riid, LPVOID * ppv)
2125{
2127 return VMR9_QueryInterface(&This->renderer.filter.IBaseFilter_iface, riid, ppv);
2128}
2129
2131{
2133 return VMR9_AddRef(&This->renderer.filter.IBaseFilter_iface);
2134}
2135
2137{
2139 return VMR9_Release(&This->renderer.filter.IBaseFilter_iface);
2140}
2141
2143 DWORD_PTR id,
2145{
2147
2148 FIXME("(%p/%p)->(...) stub\n", iface, This);
2149 return E_NOTIMPL;
2150}
2151
2153 IDirectDraw7 *device, HMONITOR monitor)
2154{
2156
2157 FIXME("(%p/%p)->(...) stub\n", iface, This);
2158 return E_NOTIMPL;
2159}
2160
2162 IDirectDraw7 *device, HMONITOR monitor)
2163{
2165
2166 FIXME("(%p/%p)->(...) stub\n", iface, This);
2167 return E_NOTIMPL;
2168}
2169
2171{
2173
2174 FIXME("(%p/%p)->(...) stub\n", iface, This);
2175 return E_NOTIMPL;
2176}
2177
2179 LONG_PTR param1, LONG_PTR param2)
2180{
2182
2183 FIXME("(%p/%p)->(...) stub\n", iface, This);
2184 return E_NOTIMPL;
2185}
2186
2188 COLORREF clrBorder)
2189{
2191
2192 FIXME("(%p/%p)->(...) stub\n", iface, This);
2193 return E_NOTIMPL;
2194}
2195
2196static const IVMRSurfaceAllocatorNotifyVtbl VMR7_SurfaceAllocatorNotify_Vtbl =
2197{
2207};
2208
2210{
2212 return VMR9_QueryInterface(&This->renderer.filter.IBaseFilter_iface, riid, ppv);
2213}
2214
2216{
2218 return VMR9_AddRef(&This->renderer.filter.IBaseFilter_iface);
2219}
2220
2222{
2224 return VMR9_Release(&This->renderer.filter.IBaseFilter_iface);
2225}
2226
2228{
2230
2231 /* FIXME: This code is not tested!!! */
2232 FIXME("(%p/%p)->(...) stub\n", iface, This);
2233 This->cookie = id;
2234
2235 if (This->presenter)
2236 return VFW_E_WRONG_STATE;
2237
2238 if (FAILED(IVMRSurfaceAllocator9_QueryInterface(alloc, &IID_IVMRImagePresenter9, (void **)&This->presenter)))
2239 return E_NOINTERFACE;
2240
2241 if (SUCCEEDED(IVMRSurfaceAllocator9_QueryInterface(alloc, &IID_IVMRSurfaceAllocatorEx9, (void **)&This->allocator)))
2242 This->allocator_is_ex = 1;
2243 else
2244 {
2245 This->allocator = (IVMRSurfaceAllocatorEx9 *)alloc;
2246 IVMRSurfaceAllocator9_AddRef(alloc);
2247 This->allocator_is_ex = 0;
2248 }
2249
2250 return S_OK;
2251}
2252
2254{
2256
2257 FIXME("(%p/%p)->(...) semi-stub\n", iface, This);
2258 if (This->allocator_d3d9_dev)
2259 IDirect3DDevice9_Release(This->allocator_d3d9_dev);
2260 This->allocator_d3d9_dev = device;
2261 IDirect3DDevice9_AddRef(This->allocator_d3d9_dev);
2262 This->allocator_mon = monitor;
2263
2264 return S_OK;
2265}
2266
2268{
2270
2271 FIXME("(%p/%p)->(...) semi-stub\n", iface, This);
2272 if (This->allocator_d3d9_dev)
2273 IDirect3DDevice9_Release(This->allocator_d3d9_dev);
2274 This->allocator_d3d9_dev = device;
2275 IDirect3DDevice9_AddRef(This->allocator_d3d9_dev);
2276 This->allocator_mon = monitor;
2277
2278 return S_OK;
2279}
2280
2282{
2284 DWORD i;
2285 HRESULT hr = S_OK;
2286
2287 FIXME("(%p/%p)->(%p, %p => %u, %p) semi-stub\n", iface, This, allocinfo, numbuffers, (numbuffers ? *numbuffers : 0), surface);
2288
2289 if (!allocinfo || !numbuffers || !surface)
2290 return E_POINTER;
2291
2292 if (!*numbuffers || *numbuffers < allocinfo->MinBuffers)
2293 {
2294 ERR("Invalid number of buffers?\n");
2295 return E_INVALIDARG;
2296 }
2297
2298 if (!This->allocator_d3d9_dev)
2299 {
2300 ERR("No direct3d device when requested to allocate a surface!\n");
2301 return VFW_E_WRONG_STATE;
2302 }
2303
2304 if (allocinfo->dwFlags & VMR9AllocFlag_OffscreenSurface)
2305 {
2306 ERR("Creating offscreen surface\n");
2307 for (i = 0; i < *numbuffers; ++i)
2308 {
2309 hr = IDirect3DDevice9_CreateOffscreenPlainSurface(This->allocator_d3d9_dev, allocinfo->dwWidth, allocinfo->dwHeight,
2310 allocinfo->Format, allocinfo->Pool, &surface[i], NULL);
2311 if (FAILED(hr))
2312 break;
2313 }
2314 }
2315 else if (allocinfo->dwFlags & VMR9AllocFlag_TextureSurface)
2316 {
2317 TRACE("Creating texture surface\n");
2318 for (i = 0; i < *numbuffers; ++i)
2319 {
2320 IDirect3DTexture9 *texture;
2321
2322 hr = IDirect3DDevice9_CreateTexture(This->allocator_d3d9_dev, allocinfo->dwWidth, allocinfo->dwHeight, 1, 0,
2323 allocinfo->Format, allocinfo->Pool, &texture, NULL);
2324 if (FAILED(hr))
2325 break;
2328 }
2329 }
2330 else
2331 {
2332 FIXME("Could not allocate for type %08x\n", allocinfo->dwFlags);
2333 return E_NOTIMPL;
2334 }
2335
2336 if (i >= allocinfo->MinBuffers)
2337 {
2338 hr = S_OK;
2339 *numbuffers = i;
2340 }
2341 else
2342 {
2343 for ( ; i > 0; --i) IDirect3DSurface9_Release(surface[i - 1]);
2344 *numbuffers = 0;
2345 }
2346 return hr;
2347}
2348
2350{
2352
2353 FIXME("(%p/%p)->(...) stub\n", iface, This);
2354 return E_NOTIMPL;
2355}
2356
2357static const IVMRSurfaceAllocatorNotify9Vtbl VMR9_SurfaceAllocatorNotify_Vtbl =
2358{
2367};
2368
2370{
2371 HRESULT hr;
2372 struct quartz_vmr* pVMR;
2373
2374 TRACE("(%p, %p)\n", outer_unk, ppv);
2375
2376 *ppv = NULL;
2377
2378 pVMR = CoTaskMemAlloc(sizeof(struct quartz_vmr));
2379
2380 pVMR->hD3d9 = LoadLibraryA("d3d9.dll");
2381 if (!pVMR->hD3d9 )
2382 {
2383 WARN("Could not load d3d9.dll\n");
2384 CoTaskMemFree(pVMR);
2386 }
2387
2388 pVMR->outer_unk = outer_unk;
2389 pVMR->bUnkOuterValid = FALSE;
2390 pVMR->bAggregatable = FALSE;
2391 pVMR->IUnknown_inner.lpVtbl = &IInner_VTable;
2394
2395 pVMR->mode = 0;
2396 pVMR->allocator_d3d9_dev = NULL;
2397 pVMR->allocator_mon= NULL;
2398 pVMR->num_surfaces = pVMR->cur_surface = 0;
2399 pVMR->allocator = NULL;
2400 pVMR->presenter = NULL;
2401 pVMR->hWndClippingWindow = NULL;
2410
2411 if (IsEqualGUID(clsid, &CLSID_VideoMixingRenderer))
2412 hr = BaseRenderer_Init(&pVMR->renderer, &VMR_Vtbl, outer_unk, &CLSID_VideoMixingRenderer,
2413 (DWORD_PTR)(__FILE__ ": VMR7Impl.csFilter"), &BaseFuncTable);
2414 else
2415 hr = BaseRenderer_Init(&pVMR->renderer, &VMR_Vtbl, outer_unk, &CLSID_VideoMixingRenderer9,
2416 (DWORD_PTR)(__FILE__ ": VMR9Impl.csFilter"), &BaseFuncTable);
2417
2418 if (FAILED(hr))
2419 goto fail;
2420
2422 &pVMR->renderer.filter.csFilter, &pVMR->renderer.pInputPin->pin,
2424 if (FAILED(hr))
2425 goto fail;
2426
2428 &pVMR->renderer.filter.csFilter, &pVMR->renderer.pInputPin->pin,
2430 if (FAILED(hr))
2431 goto fail;
2432
2433 *ppv = (LPVOID)pVMR;
2434 ZeroMemory(&pVMR->source_rect, sizeof(RECT));
2435 ZeroMemory(&pVMR->target_rect, sizeof(RECT));
2436 TRACE("Created at %p\n", pVMR);
2437 return hr;
2438
2439fail:
2441 FreeLibrary(pVMR->hD3d9);
2442 CoTaskMemFree(pVMR);
2443 return hr;
2444}
2445
2447{
2448 return vmr_create(outer_unk, ppv, &CLSID_VideoMixingRenderer);
2449}
2450
2452{
2453 return vmr_create(outer_unk, ppv, &CLSID_VideoMixingRenderer9);
2454}
2455
2456
2458{
2460 TRACE("(%p/%p)->(%s, %p)\n", This, iface, qzdebugstr_guid(riid), ppv);
2461
2462 *ppv = NULL;
2463
2465 *ppv = (LPVOID)&(This->IVMRImagePresenter9_iface);
2466 else if (IsEqualIID(riid, &IID_IVMRImagePresenter9))
2467 *ppv = &This->IVMRImagePresenter9_iface;
2468 else if (IsEqualIID(riid, &IID_IVMRSurfaceAllocatorEx9))
2469 *ppv = &This->IVMRSurfaceAllocatorEx9_iface;
2470
2471 if (*ppv)
2472 {
2473 IUnknown_AddRef((IUnknown *)(*ppv));
2474 return S_OK;
2475 }
2476
2477 FIXME("No interface for %s\n", debugstr_guid(riid));
2478
2479 return E_NOINTERFACE;
2480}
2481
2483{
2485 ULONG refCount = InterlockedIncrement(&This->refCount);
2486
2487 TRACE("(%p)->() AddRef from %d\n", iface, refCount - 1);
2488
2489 return refCount;
2490}
2491
2493{
2495 ULONG refCount = InterlockedDecrement(&This->refCount);
2496
2497 TRACE("(%p)->() Release from %d\n", iface, refCount + 1);
2498
2499 if (!refCount)
2500 {
2501 DWORD i;
2502 TRACE("Destroying\n");
2503 CloseHandle(This->ack);
2504 IDirect3D9_Release(This->d3d9_ptr);
2505
2506 TRACE("Number of surfaces: %u\n", This->num_surfaces);
2507 for (i = 0; i < This->num_surfaces; ++i)
2508 {
2509 IDirect3DSurface9 *surface = This->d3d9_surfaces[i];
2510 TRACE("Releasing surface %p\n", surface);
2511 if (surface)
2513 }
2514
2515 CoTaskMemFree(This->d3d9_surfaces);
2516 This->d3d9_surfaces = NULL;
2517 This->num_surfaces = 0;
2518 if (This->d3d9_vertex)
2519 {
2521 This->d3d9_vertex = NULL;
2522 }
2524 return 0;
2525 }
2526 return refCount;
2527}
2528
2530{
2532
2533 TRACE("(%p/%p/%p)->(...) stub\n", iface, This,This->pVMR9);
2534 return S_OK;
2535}
2536
2538{
2540
2541 TRACE("(%p/%p/%p)->(...) stub\n", iface, This,This->pVMR9);
2542 return S_OK;
2543}
2544
2545#define USED_FVF (D3DFVF_XYZRHW | D3DFVF_TEX1)
2546struct VERTEX { float x, y, z, rhw, u, v; };
2547
2549{
2550 IDirect3DTexture9 *texture = NULL;
2551 HRESULT hr;
2552
2554 if (FAILED(hr))
2555 {
2556 FIXME("SetFVF: %08x\n", hr);
2557 return hr;
2558 }
2559
2560 hr = IDirect3DDevice9_SetStreamSource(This->d3d9_dev, 0, This->d3d9_vertex, 0, sizeof(struct VERTEX));
2561 if (FAILED(hr))
2562 {
2563 FIXME("SetStreamSource: %08x\n", hr);
2564 return hr;
2565 }
2566
2567 hr = IDirect3DSurface9_GetContainer(surface, &IID_IDirect3DTexture9, (void **) &texture);
2568 if (FAILED(hr))
2569 {
2570 FIXME("IDirect3DSurface9_GetContainer failed\n");
2571 return hr;
2572 }
2573 hr = IDirect3DDevice9_SetTexture(This->d3d9_dev, 0, (IDirect3DBaseTexture9 *)texture);
2575 if (FAILED(hr))
2576 {
2577 FIXME("SetTexture: %08x\n", hr);
2578 return hr;
2579 }
2580
2582 if (FAILED(hr))
2583 {
2584 FIXME("DrawPrimitive: %08x\n", hr);
2585 return hr;
2586 }
2587
2588 return S_OK;
2589}
2590
2592{
2593 HRESULT hr;
2594 IDirect3DSurface9 *target = NULL;
2595 RECT target_rect;
2596
2598 if (FAILED(hr))
2599 {
2600 ERR("IDirect3DDevice9_GetBackBuffer -- %08x\n", hr);
2601 return hr;
2602 }
2603
2604 /* Move rect to origin and flip it */
2605 SetRect(&target_rect, 0, This->pVMR9->target_rect.bottom - This->pVMR9->target_rect.top,
2606 This->pVMR9->target_rect.right - This->pVMR9->target_rect.left, 0);
2607
2608 hr = IDirect3DDevice9_StretchRect(This->d3d9_dev, surface, &This->pVMR9->source_rect, target, &target_rect, D3DTEXF_LINEAR);
2609 if (FAILED(hr))
2610 ERR("IDirect3DDevice9_StretchRect -- %08x\n", hr);
2612
2613 return hr;
2614}
2615
2617{
2619 HRESULT hr;
2620 RECT output;
2621 BOOL render = FALSE;
2622
2623 TRACE("(%p/%p/%p)->(...) stub\n", iface, This, This->pVMR9);
2624 GetWindowRect(This->pVMR9->baseControlWindow.baseWindow.hWnd, &output);
2625 TRACE("Output rectangle: %s\n", wine_dbgstr_rect(&output));
2626
2627 /* This might happen if we don't have active focus (eg on a different virtual desktop) */
2628 if (!This->d3d9_dev)
2629 return S_OK;
2630
2631 /* Display image here */
2632 hr = IDirect3DDevice9_Clear(This->d3d9_dev, 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, 0, 0), 1.0f, 0);
2633 if (FAILED(hr))
2634 FIXME("hr: %08x\n", hr);
2635 hr = IDirect3DDevice9_BeginScene(This->d3d9_dev);
2636 if (SUCCEEDED(hr))
2637 {
2638 if (This->d3d9_vertex)
2640 else
2642 render = SUCCEEDED(hr);
2643 }
2644 else
2645 FIXME("BeginScene: %08x\n", hr);
2646 hr = IDirect3DDevice9_EndScene(This->d3d9_dev);
2647 if (render && SUCCEEDED(hr))
2648 {
2649 hr = IDirect3DDevice9_Present(This->d3d9_dev, NULL, NULL, This->pVMR9->baseControlWindow.baseWindow.hWnd, NULL);
2650 if (FAILED(hr))
2651 FIXME("Presenting image: %08x\n", hr);
2652 }
2653
2654 return S_OK;
2655}
2656
2657static const IVMRImagePresenter9Vtbl VMR9_ImagePresenter =
2658{
2665};
2666
2668{
2670
2671 return VMR9_ImagePresenter_QueryInterface(&This->IVMRImagePresenter9_iface, riid, ppv);
2672}
2673
2675{
2677
2678 return VMR9_ImagePresenter_AddRef(&This->IVMRImagePresenter9_iface);
2679}
2680
2682{
2684
2685 return VMR9_ImagePresenter_Release(&This->IVMRImagePresenter9_iface);
2686}
2687
2689{
2690 D3DCAPS9 caps;
2691 UINT width, height;
2692 HRESULT hr;
2693
2694 if (!(allocinfo->dwFlags & VMR9AllocFlag_TextureSurface))
2695 /* Only needed for texture surfaces */
2696 return S_OK;
2697
2698 hr = IDirect3DDevice9_GetDeviceCaps(This->d3d9_dev, &caps);
2699 if (FAILED(hr))
2700 return hr;
2701
2703 {
2704 width = allocinfo->dwWidth;
2705 height = allocinfo->dwHeight;
2706 }
2707 else
2708 {
2709 width = height = 1;
2710 while (width < allocinfo->dwWidth)
2711 width *= 2;
2712
2713 while (height < allocinfo->dwHeight)
2714 height *= 2;
2715 FIXME("NPOW2 support missing, not using proper surfaces!\n");
2716 }
2717
2719 {
2720 if (height > width)
2721 width = height;
2722 else
2723 height = width;
2724 FIXME("Square texture support required..\n");
2725 }
2726
2727 hr = IDirect3DDevice9_CreateVertexBuffer(This->d3d9_dev, 4 * sizeof(struct VERTEX), D3DUSAGE_WRITEONLY, USED_FVF, allocinfo->Pool, &This->d3d9_vertex, NULL);
2728 if (FAILED(hr))
2729 {
2730 ERR("Couldn't create vertex buffer: %08x\n", hr);
2731 return hr;
2732 }
2733
2734 This->reset = TRUE;
2735 allocinfo->dwHeight = height;
2736 allocinfo->dwWidth = width;
2737
2738 return hr;
2739}
2740
2741static DWORD WINAPI MessageLoop(LPVOID lpParameter)
2742{
2743 MSG msg;
2744 BOOL fGotMessage;
2746
2747 TRACE("Starting message loop\n");
2748
2749 if (FAILED(BaseWindowImpl_PrepareWindow(&This->pVMR9->baseControlWindow.baseWindow)))
2750 {
2751 FIXME("Failed to prepare window\n");
2752 return FALSE;
2753 }
2754
2755 SetEvent(This->ack);
2756 while ((fGotMessage = GetMessageW(&msg, NULL, 0, 0)) != 0 && fGotMessage != -1)
2757 {
2760 }
2761
2762 TRACE("End of message loop\n");
2763
2764 return 0;
2765}
2766
2767static UINT d3d9_adapter_from_hwnd(IDirect3D9 *d3d9, HWND hwnd, HMONITOR *mon_out)
2768{
2769 UINT d3d9_adapter;
2770 HMONITOR mon;
2771
2772 mon = MonitorFromWindow(hwnd, MONITOR_DEFAULTTONULL);
2773 if (!mon)
2774 d3d9_adapter = 0;
2775 else
2776 {
2777 for (d3d9_adapter = 0; d3d9_adapter < IDirect3D9_GetAdapterCount(d3d9); ++d3d9_adapter)
2778 {
2779 if (mon == IDirect3D9_GetAdapterMonitor(d3d9, d3d9_adapter))
2780 break;
2781 }
2782 if (d3d9_adapter >= IDirect3D9_GetAdapterCount(d3d9))
2783 d3d9_adapter = 0;
2784 }
2785 if (mon_out)
2786 *mon_out = mon;
2787 return d3d9_adapter;
2788}
2789
2791{
2793 DWORD d3d9_adapter;
2794 HRESULT hr;
2795
2796 TRACE("(%p)->()\n", This);
2797
2798 This->hWndThread = CreateThread(NULL, 0, MessageLoop, This, 0, &This->tid);
2799 if (!This->hWndThread)
2800 return FALSE;
2801
2803
2804 if (!This->pVMR9->baseControlWindow.baseWindow.hWnd) return FALSE;
2805
2806 /* Obtain a monitor and d3d9 device */
2807 d3d9_adapter = d3d9_adapter_from_hwnd(This->d3d9_ptr, This->pVMR9->baseControlWindow.baseWindow.hWnd, &This->hMon);
2808
2809 /* Now try to create the d3d9 device */
2810 ZeroMemory(&d3dpp, sizeof(d3dpp));
2811 d3dpp.Windowed = TRUE;
2812 d3dpp.hDeviceWindow = This->pVMR9->baseControlWindow.baseWindow.hWnd;
2814 d3dpp.BackBufferHeight = This->pVMR9->target_rect.bottom - This->pVMR9->target_rect.top;
2815 d3dpp.BackBufferWidth = This->pVMR9->target_rect.right - This->pVMR9->target_rect.left;
2816
2817 hr = IDirect3D9_CreateDevice(This->d3d9_ptr, d3d9_adapter, D3DDEVTYPE_HAL, NULL, D3DCREATE_MIXED_VERTEXPROCESSING, &d3dpp, &This->d3d9_dev);
2818 if (FAILED(hr))
2819 {
2820 ERR("Could not create device: %08x\n", hr);
2821 BaseWindowImpl_DoneWithWindow(&This->pVMR9->baseControlWindow.baseWindow);
2822 return FALSE;
2823 }
2824 IVMRSurfaceAllocatorNotify9_SetD3DDevice(This->SurfaceAllocatorNotify, This->d3d9_dev, This->hMon);
2825
2826 This->d3d9_surfaces = CoTaskMemAlloc(*numbuffers * sizeof(IDirect3DSurface9 *));
2827 ZeroMemory(This->d3d9_surfaces, *numbuffers * sizeof(IDirect3DSurface9 *));
2828
2830 if (FAILED(hr))
2831 ERR("Setting allocation settings failed: %08x\n", hr);
2832
2833 if (SUCCEEDED(hr))
2834 {
2835 hr = IVMRSurfaceAllocatorNotify9_AllocateSurfaceHelper(This->SurfaceAllocatorNotify, info, numbuffers, This->d3d9_surfaces);
2836 if (FAILED(hr))
2837 ERR("Allocating surfaces failed: %08x\n", hr);
2838 }
2839
2840 if (FAILED(hr))
2841 {
2842 IVMRSurfaceAllocatorEx9_TerminateDevice(This->pVMR9->allocator, This->pVMR9->cookie);
2843 BaseWindowImpl_DoneWithWindow(&This->pVMR9->baseControlWindow.baseWindow);
2844 return FALSE;
2845 }
2846
2847 This->num_surfaces = *numbuffers;
2848
2849 return TRUE;
2850}
2851
2853{
2855
2856 if (This->pVMR9->mode != VMR9Mode_Windowed && !This->pVMR9->hWndClippingWindow)
2857 {
2858 ERR("No window set\n");
2859 return VFW_E_WRONG_STATE;
2860 }
2861
2862 This->info = *allocinfo;
2863
2864 if (!CreateRenderingWindow(This, allocinfo, numbuffers))
2865 {
2866 ERR("Failed to create rendering window, expect no output!\n");
2867 return VFW_E_WRONG_STATE;
2868 }
2869
2870 return S_OK;
2871}
2872
2874{
2876
2877 if (!This->pVMR9->baseControlWindow.baseWindow.hWnd)
2878 {
2879 return S_OK;
2880 }
2881
2882 SendMessageW(This->pVMR9->baseControlWindow.baseWindow.hWnd, WM_CLOSE, 0, 0);
2883 PostThreadMessageW(This->tid, WM_QUIT, 0, 0);
2884 WaitForSingleObject(This->hWndThread, INFINITE);
2885 This->hWndThread = NULL;
2886 BaseWindowImpl_DoneWithWindow(&This->pVMR9->baseControlWindow.baseWindow);
2887
2888 return S_OK;
2889}
2890
2891/* Recreate all surfaces (If allocated as D3DPOOL_DEFAULT) and survive! */
2893{
2894 struct VERTEX t_vert[4];
2895 UINT width, height;
2896 unsigned int i;
2897 void *bits = NULL;
2899 HRESULT hr;
2900
2901 if (!This->pVMR9->baseControlWindow.baseWindow.hWnd)
2902 {
2903 ERR("No window\n");
2904 return E_FAIL;
2905 }
2906
2907 if (!This->d3d9_surfaces || !This->reset)
2908 return S_OK;
2909
2910 This->reset = FALSE;
2911 TRACE("RESETTING\n");
2912 if (This->d3d9_vertex)
2913 {
2915 This->d3d9_vertex = NULL;
2916 }
2917
2918 for (i = 0; i < This->num_surfaces; ++i)
2919 {
2920 IDirect3DSurface9 *surface = This->d3d9_surfaces[i];
2921 TRACE("Releasing surface %p\n", surface);
2922 if (surface)
2924 }
2925 ZeroMemory(This->d3d9_surfaces, sizeof(IDirect3DSurface9 *) * This->num_surfaces);
2926
2927 /* Now try to create the d3d9 device */
2928 ZeroMemory(&d3dpp, sizeof(d3dpp));
2929 d3dpp.Windowed = TRUE;
2930 d3dpp.hDeviceWindow = This->pVMR9->baseControlWindow.baseWindow.hWnd;
2932
2933 if (This->d3d9_dev)
2934 IDirect3DDevice9_Release(This->d3d9_dev);
2935 This->d3d9_dev = NULL;
2936 hr = IDirect3D9_CreateDevice(This->d3d9_ptr, d3d9_adapter_from_hwnd(This->d3d9_ptr, This->pVMR9->baseControlWindow.baseWindow.hWnd, &This->hMon), D3DDEVTYPE_HAL, NULL, D3DCREATE_HARDWARE_VERTEXPROCESSING, &d3dpp, &This->d3d9_dev);
2937 if (FAILED(hr))
2938 {
2939 hr = IDirect3D9_CreateDevice(This->d3d9_ptr, d3d9_adapter_from_hwnd(This->d3d9_ptr, This->pVMR9->baseControlWindow.baseWindow.hWnd, &This->hMon), D3DDEVTYPE_HAL, NULL, D3DCREATE_MIXED_VERTEXPROCESSING, &d3dpp, &This->d3d9_dev);
2940 if (FAILED(hr))
2941 {
2942 ERR("--> Creating device: %08x\n", hr);
2943 return S_OK;
2944 }
2945 }
2946 IVMRSurfaceAllocatorNotify9_ChangeD3DDevice(This->SurfaceAllocatorNotify, This->d3d9_dev, This->hMon);
2947
2948 IVMRSurfaceAllocatorNotify9_AllocateSurfaceHelper(This->SurfaceAllocatorNotify, &This->info, &This->num_surfaces, This->d3d9_surfaces);
2949
2950 This->reset = FALSE;
2951
2952 if (!(This->info.dwFlags & VMR9AllocFlag_TextureSurface))
2953 return S_OK;
2954
2956 This->info.Pool, &This->d3d9_vertex, NULL);
2957
2958 width = This->info.dwWidth;
2959 height = This->info.dwHeight;
2960
2961 for (i = 0; i < sizeof(t_vert) / sizeof(t_vert[0]); ++i)
2962 {
2963 if (i % 2)
2964 {
2965 t_vert[i].x = (float)This->pVMR9->target_rect.right - (float)This->pVMR9->target_rect.left - 0.5f;
2966 t_vert[i].u = (float)This->pVMR9->source_rect.right / (float)width;
2967 }
2968 else
2969 {
2970 t_vert[i].x = -0.5f;
2971 t_vert[i].u = (float)This->pVMR9->source_rect.left / (float)width;
2972 }
2973
2974 if (i % 4 < 2)
2975 {
2976 t_vert[i].y = -0.5f;
2977 t_vert[i].v = (float)This->pVMR9->source_rect.bottom / (float)height;
2978 }
2979 else
2980 {
2981 t_vert[i].y = (float)This->pVMR9->target_rect.bottom - (float)This->pVMR9->target_rect.top - 0.5f;
2982 t_vert[i].v = (float)This->pVMR9->source_rect.top / (float)height;
2983 }
2984 t_vert[i].z = 0.0f;
2985 t_vert[i].rhw = 1.0f;
2986 }
2987
2988 FIXME("Vertex rectangle:\n");
2989 FIXME("X, Y: %f, %f\n", t_vert[0].x, t_vert[0].y);
2990 FIXME("X, Y: %f, %f\n", t_vert[3].x, t_vert[3].y);
2991 FIXME("TOP, LEFT: %f, %f\n", t_vert[0].u, t_vert[0].v);
2992 FIXME("DOWN, BOTTOM: %f, %f\n", t_vert[3].u, t_vert[3].v);
2993
2994 IDirect3DVertexBuffer9_Lock(This->d3d9_vertex, 0, sizeof(t_vert), &bits, 0);
2995 memcpy(bits, t_vert, sizeof(t_vert));
2996 IDirect3DVertexBuffer9_Unlock(This->d3d9_vertex);
2997
2998 return S_OK;
2999}
3000
3001static HRESULT WINAPI VMR9_SurfaceAllocator_GetSurface(IVMRSurfaceAllocatorEx9 *iface, DWORD_PTR id, DWORD surfaceindex, DWORD flags, IDirect3DSurface9 **surface)
3002{
3004
3005 /* Update everything first, this is needed because the surface might be destroyed in the reset */
3006 if (!This->d3d9_dev)
3007 {
3008 TRACE("Device has left me!\n");
3009 return E_FAIL;
3010 }
3011
3013
3014 if (surfaceindex >= This->num_surfaces)
3015 {
3016 ERR("surfaceindex is greater than num_surfaces\n");
3017 return E_FAIL;
3018 }
3019 *surface = This->d3d9_surfaces[surfaceindex];
3020 IDirect3DSurface9_AddRef(*surface);
3021
3022 return S_OK;
3023}
3024
3026{
3028
3029 TRACE("(%p/%p)->(...)\n", iface, This);
3030
3031 /* No AddRef taken here or the base VMR9 filter would never be destroyed */
3032 This->SurfaceAllocatorNotify = allocnotify;
3033 return S_OK;
3034}
3035
3036static const IVMRSurfaceAllocatorEx9Vtbl VMR9_SurfaceAllocator =
3037{
3045 NULL /* This isn't the SurfaceAllocatorEx type yet, working on it */
3046};
3047
3048static IDirect3D9 *init_d3d9(HMODULE d3d9_handle)
3049{
3050 IDirect3D9 * (__stdcall * d3d9_create)(UINT SDKVersion);
3051
3052 d3d9_create = (void *)GetProcAddress(d3d9_handle, "Direct3DCreate9");
3053 if (!d3d9_create) return NULL;
3054
3055 return d3d9_create(D3D_SDK_VERSION);
3056}
3057
3059{
3060 HRESULT hr = S_OK;
3061 int i;
3063
3065 if (!This)
3066 return E_OUTOFMEMORY;
3067
3068 This->d3d9_ptr = init_d3d9(parent->hD3d9);
3069 if (!This->d3d9_ptr)
3070 {
3071 WARN("Could not initialize d3d9.dll\n");
3074 }
3075
3076 i = 0;
3077 do
3078 {
3080
3082 if (hr == D3DERR_INVALIDCALL) break; /* out of adapters */
3083 } while (FAILED(hr));
3084 if (FAILED(hr))
3085 ERR("HR: %08x\n", hr);
3086 if (hr == D3DERR_NOTAVAILABLE)
3087 {
3088 ERR("Format not supported\n");
3089 IDirect3D9_Release(This->d3d9_ptr);
3092 }
3093
3094 This->IVMRImagePresenter9_iface.lpVtbl = &VMR9_ImagePresenter;
3095 This->IVMRSurfaceAllocatorEx9_iface.lpVtbl = &VMR9_SurfaceAllocator;
3096
3097 This->refCount = 1;
3098 This->pVMR9 = parent;
3099 This->d3d9_surfaces = NULL;
3100 This->d3d9_dev = NULL;
3101 This->hMon = 0;
3102 This->d3d9_vertex = NULL;
3103 This->num_surfaces = 0;
3104 This->hWndThread = NULL;
3105 This->ack = CreateEventW(NULL, 0, 0, NULL);
3106 This->SurfaceAllocatorNotify = NULL;
3107 This->reset = FALSE;
3108
3109 *ppv = &This->IVMRImagePresenter9_iface;
3110 return S_OK;
3111}
@ lparam
Definition: SystemMenu.c:31
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
static const char * wine_dbgstr_rect(const RECT *prc)
Definition: atltest.h:160
#define msg(x)
Definition: auth_time.c:54
AMCOPPSignature
Definition: axextend.idl:835
@ AM_FILTER_MISC_FLAGS_IS_RENDERER
Definition: axextend.idl:1239
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
const GUID IID_IUnknown
#define FIXME(fmt,...)
Definition: debug.h:114
#define WARN(fmt,...)
Definition: debug.h:115
#define ERR(fmt,...)
Definition: debug.h:113
#define D3DPTEXTURECAPS_SQUAREONLY
Definition: d3d8caps.h:116
#define D3DPTEXTURECAPS_POW2
Definition: d3d8caps.h:114
@ D3DTEXF_LINEAR
Definition: d3d8types.h:872
#define D3DLOCK_DISCARD
Definition: d3d8types.h:72
@ D3DBACKBUFFER_TYPE_MONO
Definition: d3d8types.h:493
@ D3DFMT_X1R5G5B5
Definition: d3d8types.h:607
@ D3DFMT_R8G8B8
Definition: d3d8types.h:603
@ D3DFMT_R3G3B2
Definition: d3d8types.h:610
@ D3DFMT_R5G6B5
Definition: d3d8types.h:606
@ D3DFMT_X8R8G8B8
Definition: d3d8types.h:605
#define D3DUSAGE_WRITEONLY
Definition: d3d8types.h:93
@ D3DSWAPEFFECT_DISCARD
Definition: d3d8types.h:851
@ D3DPT_TRIANGLESTRIP
Definition: d3d8types.h:722
@ D3DDEVTYPE_HAL
Definition: d3d8types.h:576
@ D3DPOOL_DEFAULT
Definition: d3d8types.h:709
#define D3DCOLOR_XRGB(r, g, b)
Definition: d3d8types.h:44
#define D3DCLEAR_TARGET
Definition: d3d8types.h:30
#define IDirect3DDevice9_EndScene(p)
Definition: d3d9.h:1549
#define IDirect3DDevice9_BeginScene(p)
Definition: d3d9.h:1548
#define IDirect3DDevice9_SetFVF(p, a)
Definition: d3d9.h:1596
#define IDirect3DVertexBuffer9_Unlock(p)
Definition: d3d9.h:708
#define IDirect3DDevice9_GetBackBuffer(p, a, b, c, d)
Definition: d3d9.h:1525
#define IDirect3DTexture9_GetSurfaceLevel(p, a, b)
Definition: d3d9.h:1033
#define IDirect3DVertexBuffer9_Release(p)
Definition: d3d9.h:696
#define IDirect3DSurface9_LockRect(p, a, b, c)
Definition: d3d9.h:635
#define IDirect3D9_CreateDevice(p, a, b, c, d, e, f)
Definition: d3d9.h:235
#define IDirect3D9_GetAdapterMonitor(p, a)
Definition: d3d9.h:234
#define IDirect3DDevice9_StretchRect(p, a, b, c, d, e)
Definition: d3d9.h:1541
#define IDirect3DVertexBuffer9_Lock(p, a, b, c, d)
Definition: d3d9.h:707
#define IDirect3DDevice9_CreateTexture(p, a, b, c, d, e, f, g, h)
Definition: d3d9.h:1530
#define IDirect3DDevice9_Present(p, a, b, c, d)
Definition: d3d9.h:1524
#define IDirect3DDevice9_GetDeviceCaps(p, a)
Definition: d3d9.h:1514
#define IDirect3DDevice9_SetStreamSource(p, a, b, c, d)
Definition: d3d9.h:1607
#define IDirect3DSurface9_AddRef(p)
Definition: d3d9.h:621
#define IDirect3D9_Release(p)
Definition: d3d9.h:220
#define IDirect3DSurface9_GetContainer(p, a, b)
Definition: d3d9.h:633
#define IDirect3DDevice9_DrawPrimitive(p, a, b, c)
Definition: d3d9.h:1588
#define IDirect3DDevice9_Release(p)
Definition: d3d9.h:1508
#define IDirect3DDevice9_Clear(p, a, b, c, d, e, f)
Definition: d3d9.h:1550
#define IDirect3D9_GetAdapterCount(p)
Definition: d3d9.h:223
#define IDirect3DSurface9_UnlockRect(p)
Definition: d3d9.h:636
#define IDirect3DDevice9_CreateVertexBuffer(p, a, b, c, d, e, f)
Definition: d3d9.h:1533
#define IDirect3DSurface9_Release(p)
Definition: d3d9.h:622
#define IDirect3DDevice9_SetTexture(p, a, b)
Definition: d3d9.h:1572
#define IDirect3DTexture9_Release(p)
Definition: d3d9.h:1014
#define IDirect3DDevice9_AddRef(p)
Definition: d3d9.h:1507
#define IDirect3D9_EnumAdapterModes(p, a, b, c, d)
Definition: d3d9.h:226
#define IDirect3DDevice9_CreateOffscreenPlainSurface(p, a, b, c, d, e, f)
Definition: d3d9.h:1543
#define D3DERR_INVALIDCALL
#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 NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static const WCHAR dwWidth[]
Definition: provider.c:62
static const WCHAR dwHeight[]
Definition: provider.c:63
const char * qzdebugstr_guid(const GUID *id)
Definition: main.c:279
#define CloseHandle
Definition: compat.h:739
#define GetProcAddress(x, y)
Definition: compat.h:753
static __inline const char * debugstr_an(const char *s, int n)
Definition: compat.h:55
#define FreeLibrary(x)
Definition: compat.h:748
#define CALLBACK
Definition: compat.h:35
#define lstrcpynW
Definition: compat.h:738
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:137
LONGLONG REFERENCE_TIME
Definition: dmusicks.h:9
#define BI_RGB
Definition: precomp.h:56
r parent
Definition: btrfs.c:3010
#define INFINITE
Definition: serial.h:102
@ VMRMode_Renderless
Definition: vmrender.idl:107
@ VMRMode_Windowless
Definition: vmrender.idl:106
@ VMRMode_Windowed
Definition: vmrender.idl:105
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
_Must_inspect_result_ _In_ ULONG _Out_writes_bytes_ pBufferSize PVOID _Inout_ PULONG pBufferSize
Definition: fsrtlfuncs.h:1165
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
const GLdouble * v
Definition: gl.h:2040
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546
GLsizeiptr size
Definition: glext.h:5919
GLenum GLuint texture
Definition: glext.h:6295
GLuint color
Definition: glext.h:6243
GLenum mode
Definition: glext.h:6217
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
Definition: glext.h:10929
GLbitfield flags
Definition: glext.h:7161
const GLuint * buffers
Definition: glext.h:5916
GLuint id
Definition: glext.h:5910
GLdouble GLdouble z
Definition: glext.h:5874
GLenum target
Definition: glext.h:7315
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 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 * u
Definition: glfuncs.h:240
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
Definition: axcore.idl:92
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
#define debugstr_guid
Definition: kernel32.h:35
if(dx< 0)
Definition: linetemp.h:194
static HANDLE hmon
Definition: localmon.c:41
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static PVOID ptr
Definition: dispmode.c:27
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:92
static char * dest
Definition: rtl.c:135
static const BYTE dib[]
Definition: ole2.c:201
static float(__cdecl *square_half_float)(float x
REFCLSID clsid
Definition: msctf.c:82
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
HMONITOR WINAPI MonitorFromWindow(HWND, DWORD)
unsigned int UINT
Definition: ndis.h:50
#define LPVOID
Definition: nt_native.h:45
#define WS_SIZEBOX
Definition: pedump.c:642
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
DWORD IDirectDraw7
Definition: vmrender.idl:21
#define alloc
Definition: rosglue.h:13
#define D3DCREATE_HARDWARE_VERTEXPROCESSING
Definition: d3d8.h:45
#define D3D_SDK_VERSION
Definition: d3d8.h:56
#define D3DERR_NOTAVAILABLE
Definition: d3d8.h:84
#define D3DCREATE_MIXED_VERTEXPROCESSING
Definition: d3d8.h:46
HRESULT WINAPI BaseControlVideoImpl_GetTypeInfoCount(IBasicVideo *iface, UINT *pctinfo)
Definition: video.c:83
HRESULT WINAPI BaseControlVideoImpl_GetCurrentImage(IBasicVideo *iface, LONG *pBufferSize, LONG *pDIBImage)
Definition: video.c:576
HRESULT WINAPI BaseControlVideoImpl_get_SourceLeft(IBasicVideo *iface, LONG *pSourceLeft)
Definition: video.c:221
HRESULT WINAPI BaseControlVideoImpl_GetVideoSize(IBasicVideo *iface, LONG *pWidth, LONG *pHeight)
Definition: video.c:548
HRESULT WINAPI BaseControlVideoImpl_SetDefaultDestinationPosition(IBasicVideo *iface)
Definition: video.c:540
HRESULT WINAPI BaseControlVideoImpl_GetDestinationPosition(IBasicVideo *iface, LONG *pLeft, LONG *pTop, LONG *pWidth, LONG *pHeight)
Definition: video.c:522
HRESULT WINAPI BaseControlVideoImpl_put_SourceTop(IBasicVideo *iface, LONG SourceTop)
Definition: video.c:268
HRESULT WINAPI BaseControlVideoImpl_get_SourceWidth(IBasicVideo *iface, LONG *pSourceWidth)
Definition: video.c:254
HRESULT WINAPI BaseControlVideoImpl_put_SourceHeight(IBasicVideo *iface, LONG SourceHeight)
Definition: video.c:302
HRESULT WINAPI BaseControlVideoImpl_get_DestinationWidth(IBasicVideo *iface, LONG *pDestinationWidth)
Definition: video.c:389
HRESULT WINAPI BaseControlVideoImpl_SetSourcePosition(IBasicVideo *iface, LONG Left, LONG Top, LONG Width, LONG Height)
Definition: video.c:470
HRESULT WINAPI BaseControlVideoImpl_get_SourceTop(IBasicVideo *iface, LONG *pSourceTop)
Definition: video.c:288
HRESULT WINAPI BaseControlVideoImpl_put_DestinationWidth(IBasicVideo *iface, LONG DestinationWidth)
Definition: video.c:370
HRESULT WINAPI BaseControlVideoImpl_IsUsingDefaultDestination(IBasicVideo *iface)
Definition: video.c:592
HRESULT WINAPI BaseControlVideoImpl_put_SourceLeft(IBasicVideo *iface, LONG SourceLeft)
Definition: video.c:201
HRESULT WINAPI BaseControlVideoImpl_GetTypeInfo(IBasicVideo *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: video.c:90
HRESULT WINAPI BaseControlVideoImpl_GetSourcePosition(IBasicVideo *iface, LONG *pLeft, LONG *pTop, LONG *pWidth, LONG *pHeight)
Definition: video.c:483
HRESULT WINAPI BaseControlVideoImpl_get_DestinationLeft(IBasicVideo *iface, LONG *pDestinationLeft)
Definition: video.c:356
HRESULT WINAPI BaseControlVideoImpl_get_DestinationHeight(IBasicVideo *iface, LONG *pDestinationHeight)
Definition: video.c:456
HRESULT WINAPI BaseControlVideoImpl_IsUsingDefaultSource(IBasicVideo *iface)
Definition: video.c:585
HRESULT WINAPI BaseControlVideoImpl_get_BitRate(IBasicVideo *iface, LONG *pBitRate)
Definition: video.c:137
HRESULT WINAPI BaseControlVideoImpl_get_DestinationTop(IBasicVideo *iface, LONG *pDestinationTop)
Definition: video.c:423
HRESULT WINAPI BaseControlVideoImpl_Invoke(IBasicVideo *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExepInfo, UINT *puArgErr)
Definition: video.c:104
HRESULT WINAPI BaseControlVideoImpl_put_SourceWidth(IBasicVideo *iface, LONG SourceWidth)
Definition: video.c:235
HRESULT WINAPI BaseControlVideoImpl_GetIDsOfNames(IBasicVideo *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: video.c:97
HRESULT WINAPI BaseControlVideoImpl_get_VideoHeight(IBasicVideo *iface, LONG *pVideoHeight)
Definition: video.c:186
HRESULT WINAPI BaseControlVideoImpl_get_SourceHeight(IBasicVideo *iface, LONG *pSourceHeight)
Definition: video.c:321
HRESULT WINAPI BaseControlVideoImpl_get_AvgTimePerFrame(IBasicVideo *iface, REFTIME *pAvgTimePerFrame)
Definition: video.c:120
HRESULT WINAPI BaseControlVideo_Init(BaseControlVideo *pControlVideo, const IBasicVideoVtbl *lpVtbl, BaseFilter *owner, CRITICAL_SECTION *lock, BasePin *pPin, const BaseControlVideoFuncTable *pFuncsTable)
Definition: video.c:38
HRESULT WINAPI BaseControlVideoImpl_GetVideoPaletteEntries(IBasicVideo *iface, LONG StartIndex, LONG Entries, LONG *pRetrieved, LONG *pPalette)
Definition: video.c:564
HRESULT WINAPI BaseControlVideoImpl_get_BitErrorRate(IBasicVideo *iface, LONG *pBitErrorRate)
Definition: video.c:154
HRESULT WINAPI BaseControlVideoImpl_put_DestinationTop(IBasicVideo *iface, LONG DestinationTop)
Definition: video.c:403
HRESULT WINAPI BaseControlVideoImpl_put_DestinationHeight(IBasicVideo *iface, LONG DestinationHeight)
Definition: video.c:437
HRESULT WINAPI BaseControlVideoImpl_put_DestinationLeft(IBasicVideo *iface, LONG DestinationLeft)
Definition: video.c:336
HRESULT WINAPI BaseControlVideoImpl_SetDefaultSourcePosition(IBasicVideo *iface)
Definition: video.c:501
HRESULT WINAPI BaseControlVideoImpl_get_VideoWidth(IBasicVideo *iface, LONG *pVideoWidth)
Definition: video.c:171
HRESULT WINAPI BaseControlVideoImpl_SetDestinationPosition(IBasicVideo *iface, LONG Left, LONG Top, LONG Width, LONG Height)
Definition: video.c:509
HRESULT WINAPI BaseControlWindow_Destroy(BaseControlWindow *pControlWindow)
Definition: window.c:223
HRESULT WINAPI BaseControlWindowImpl_HideCursor(IVideoWindow *iface, LONG HideCursor)
Definition: window.c:722
HRESULT WINAPI BaseControlWindowImpl_put_Visible(IVideoWindow *iface, LONG Visible)
Definition: window.c:404
HRESULT WINAPI BaseControlWindowImpl_GetTypeInfo(IVideoWindow *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: window.c:236
HRESULT WINAPI BaseControlWindowImpl_get_FullScreenMode(IVideoWindow *iface, LONG *FullScreenMode)
Definition: window.c:602
HRESULT WINAPI BaseControlWindowImpl_put_WindowState(IVideoWindow *iface, LONG WindowState)
Definition: window.c:364
HRESULT WINAPI BaseControlWindowImpl_get_Top(IVideoWindow *iface, LONG *pTop)
Definition: window.c:492
HRESULT WINAPI BaseControlWindowImpl_put_Height(IVideoWindow *iface, LONG Height)
Definition: window.c:505
HRESULT WINAPI BaseControlWindowImpl_get_Height(IVideoWindow *iface, LONG *pHeight)
Definition: window.c:519
HRESULT WINAPI BaseControlWindow_Init(BaseControlWindow *pControlWindow, const IVideoWindowVtbl *lpVtbl, BaseFilter *owner, CRITICAL_SECTION *lock, BasePin *pPin, const BaseWindowFuncTable *pFuncsTable)
Definition: window.c:204
HRESULT WINAPI BaseControlWindowImpl_get_Width(IVideoWindow *iface, LONG *pWidth)
Definition: window.c:467
HRESULT WINAPI BaseControlWindowImpl_put_AutoShow(IVideoWindow *iface, LONG AutoShow)
Definition: window.c:342
HRESULT WINAPI BaseControlWindowImpl_Invoke(IVideoWindow *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExepInfo, UINT *puArgErr)
Definition: window.c:250
HRESULT WINAPI BaseControlWindowImpl_get_Caption(IVideoWindow *iface, BSTR *strCaption)
Definition: window.c:278
HRESULT WINAPI BaseControlWindowImpl_put_Top(IVideoWindow *iface, LONG Top)
Definition: window.c:478
HRESULT WINAPI BaseControlWindowImpl_put_Owner(IVideoWindow *iface, OAHWND Owner)
Definition: window.c:530
HRESULT WINAPI BaseControlWindowImpl_get_WindowStyle(IVideoWindow *iface, LONG *WindowStyle)
Definition: window.c:308
HRESULT WINAPI BaseControlWindowImpl_GetWindowPosition(IVideoWindow *iface, LONG *pLeft, LONG *pTop, LONG *pWidth, LONG *pHeight)
Definition: window.c:657
HRESULT WINAPI BaseControlWindowImpl_get_WindowState(IVideoWindow *iface, LONG *WindowState)
Definition: window.c:373
HRESULT WINAPI BaseControlWindowImpl_GetMinIdealImageSize(IVideoWindow *iface, LONG *pWidth, LONG *pHeight)
Definition: window.c:685
HRESULT WINAPI BaseControlWindowImpl_put_Width(IVideoWindow *iface, LONG Width)
Definition: window.c:453
HRESULT WINAPI BaseControlWindowImpl_get_Left(IVideoWindow *iface, LONG *pLeft)
Definition: window.c:440
HRESULT WINAPI BaseControlWindowImpl_GetIDsOfNames(IVideoWindow *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: window.c:243
HRESULT WINAPI BaseControlWindowImpl_GetMaxIdealImageSize(IVideoWindow *iface, LONG *pWidth, LONG *pHeight)
Definition: window.c:699
HRESULT WINAPI BaseControlWindowImpl_get_WindowStyleEx(IVideoWindow *iface, LONG *WindowStyleEx)
Definition: window.c:331
HRESULT WINAPI BaseControlWindowImpl_put_Left(IVideoWindow *iface, LONG Left)
Definition: window.c:426
HRESULT WINAPI BaseControlWindowImpl_SetWindowPosition(IVideoWindow *iface, LONG Left, LONG Top, LONG Width, LONG Height)
Definition: window.c:642
HRESULT WINAPI BaseControlWindowImpl_put_FullScreenMode(IVideoWindow *iface, LONG FullScreenMode)
Definition: window.c:609
HRESULT WINAPI BaseControlWindowImpl_put_BorderColor(IVideoWindow *iface, LONG Color)
Definition: window.c:593
HRESULT WINAPI BaseControlWindowImpl_get_Visible(IVideoWindow *iface, LONG *pVisible)
Definition: window.c:415
HRESULT WINAPI BaseControlWindowImpl_get_BackgroundPalette(IVideoWindow *iface, LONG *pBackgroundPalette)
Definition: window.c:395
BOOL WINAPI BaseControlWindowImpl_PossiblyEatMessage(BaseWindow *This, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: window.c:164
HRESULT WINAPI BaseControlWindowImpl_get_MessageDrain(IVideoWindow *iface, OAHWND *Drain)
Definition: window.c:573
HRESULT WINAPI BaseControlWindowImpl_put_MessageDrain(IVideoWindow *iface, OAHWND Drain)
Definition: window.c:562
HRESULT WINAPI BaseControlWindowImpl_SetWindowForeground(IVideoWindow *iface, LONG Focus)
Definition: window.c:615
HRESULT WINAPI BaseControlWindowImpl_get_AutoShow(IVideoWindow *iface, LONG *AutoShow)
Definition: window.c:353
HRESULT WINAPI BaseControlWindowImpl_GetTypeInfoCount(IVideoWindow *iface, UINT *pctinfo)
Definition: window.c:229
HRESULT WINAPI BaseControlWindowImpl_put_WindowStyle(IVideoWindow *iface, LONG WindowStyle)
Definition: window.c:289
HRESULT WINAPI BaseControlWindowImpl_get_Owner(IVideoWindow *iface, OAHWND *Owner)
Definition: window.c:551
HRESULT WINAPI BaseControlWindowImpl_GetRestorePosition(IVideoWindow *iface, LONG *pLeft, LONG *pTop, LONG *pWidth, LONG *pHeight)
Definition: window.c:713
HRESULT WINAPI BaseControlWindowImpl_NotifyOwnerMessage(IVideoWindow *iface, OAHWND hwnd, LONG uMsg, LONG_PTR wParam, LONG_PTR lParam)
Definition: window.c:673
HRESULT WINAPI BaseControlWindowImpl_put_BackgroundPalette(IVideoWindow *iface, LONG BackgroundPalette)
Definition: window.c:386
HRESULT WINAPI BaseControlWindowImpl_IsCursorHidden(IVideoWindow *iface, LONG *CursorHidden)
Definition: window.c:731
HRESULT WINAPI BaseControlWindowImpl_get_BorderColor(IVideoWindow *iface, LONG *Color)
Definition: window.c:584
HRESULT WINAPI BaseControlWindowImpl_put_Caption(IVideoWindow *iface, BSTR strCaption)
Definition: window.c:266
HRESULT WINAPI BaseControlWindowImpl_put_WindowStyleEx(IVideoWindow *iface, LONG WindowStyleEx)
Definition: window.c:319
#define memset(x, y, z)
Definition: compat.h:39
HRESULT hr
Definition: shlfolder.c:183
#define TRACE(s)
Definition: solgame.cpp:4
static void render(void)
Definition: ssstars.c:272
& rect
Definition: startmenu.cpp:1413
BOOL WINAPI BaseWindowImpl_OnSize(BaseWindow *This, LONG Height, LONG Width)
Definition: window.c:73
HRESULT WINAPI BaseRendererImpl_SetSyncSource(IBaseFilter *iface, IReferenceClock *clock)
Definition: renderer.c:537
HRESULT WINAPI BaseFilterImpl_GetClassID(IBaseFilter *iface, CLSID *pClsid)
Definition: filter.c:77
ULONG WINAPI BaseRendererImpl_Release(IBaseFilter *iface)
Definition: renderer.c:296
HRESULT WINAPI BaseFilterImpl_QueryFilterInfo(IBaseFilter *iface, FILTER_INFO *pInfo)
Definition: filter.c:145
HRESULT WINAPI BaseRendererImpl_Stop(IBaseFilter *iface)
Definition: renderer.c:440
HRESULT WINAPI BaseWindowImpl_PrepareWindow(BaseWindow *This)
Definition: window.c:100
HRESULT WINAPI BaseRendererImpl_FindPin(IBaseFilter *iface, LPCWSTR Id, IPin **ppPin)
Definition: renderer.c:421
HRESULT WINAPI BaseRendererImpl_Run(IBaseFilter *iface, REFERENCE_TIME tStart)
Definition: renderer.c:461
ULONG WINAPI BaseFilterImpl_AddRef(IBaseFilter *iface)
Definition: filter.c:54
HRESULT WINAPI BaseFilterImpl_JoinFilterGraph(IBaseFilter *iface, IFilterGraph *pGraph, LPCWSTR pName)
Definition: filter.c:159
HRESULT WINAPI BaseRendererImpl_Pause(IBaseFilter *iface)
Definition: renderer.c:506
HRESULT WINAPI BaseWindowImpl_DoneWithWindow(BaseWindow *This)
Definition: window.c:143
HRESULT WINAPI BaseFilterImpl_QueryVendorInfo(IBaseFilter *iface, LPWSTR *pVendorInfo)
Definition: filter.c:178
HRESULT WINAPI BaseFilterImpl_GetSyncSource(IBaseFilter *iface, IReferenceClock **ppClock)
Definition: filter.c:119
HRESULT WINAPI BaseRendererImpl_GetState(IBaseFilter *iface, DWORD dwMilliSecsTimeout, FILTER_STATE *pState)
Definition: renderer.c:550
HRESULT WINAPI BaseRendererImpl_QueryInterface(IBaseFilter *iface, REFIID riid, LPVOID *ppv)
Definition: renderer.c:280
HRESULT WINAPI BaseFilterImpl_EnumPins(IBaseFilter *iface, IEnumPins **ppEnum)
Definition: filter.c:135
HRESULT WINAPI BaseRenderer_Init(BaseRenderer *This, const IBaseFilterVtbl *Vtbl, IUnknown *pUnkOuter, const CLSID *pClsid, DWORD_PTR DebugInfo, const BaseRendererFuncTable *pBaseFuncsTable)
Definition: renderer.c:241
DWORD biCompression
Definition: amvideo.idl:35
DWORD biSizeImage
Definition: amvideo.idl:36
IBaseFilter IBaseFilter_iface
Definition: strmbase.h:163
CRITICAL_SECTION csFilter
Definition: strmbase.h:165
FILTER_STATE state
Definition: strmbase.h:167
BasePin pin
Definition: strmbase.h:90
AM_MEDIA_TYPE mtCurrent
Definition: strmbase.h:40
BaseInputPin * pInputPin
Definition: strmbase.h:582
BaseFilter filter
Definition: strmbase.h:580
IMediaSample * pMediaSample
Definition: strmbase.h:588
Definition: vmr9.c:2546
float x
Definition: vmr9.c:2546
float v
Definition: vmr9.c:2546
float rhw
Definition: vmr9.c:2546
float y
Definition: vmr9.c:2546
float z
Definition: vmr9.c:2546
float u
Definition: vmr9.c:2546
VMR9AllocationInfo info
Definition: vmr9.c:191
IVMRSurfaceAllocatorNotify9 * SurfaceAllocatorNotify
Definition: vmr9.c:194
IDirect3DDevice9 * d3d9_dev
Definition: vmr9.c:183
IDirect3DSurface9 ** d3d9_surfaces
Definition: vmr9.c:185
IVMRImagePresenter9 IVMRImagePresenter9_iface
Definition: vmr9.c:174
struct quartz_vmr * pVMR9
Definition: vmr9.c:193
IVMRSurfaceAllocatorEx9 IVMRSurfaceAllocatorEx9_iface
Definition: vmr9.c:175
IDirect3DVertexBuffer9 * d3d9_vertex
Definition: vmr9.c:186
DWORD TextureCaps
Definition: d3d9caps.h:279
D3DSWAPEFFECT SwapEffect
Definition: d3d8types.h:1128
D3DFORMAT Format
Definition: vmr9.idl:99
Definition: match.c:390
Definition: ftp_var.h:139
Definition: inflate.c:139
Definition: devices.h:37
VMR9MonitorInfo * info9
Definition: vmr9.c:1287
VMRMONITORINFO * info7
Definition: vmr9.c:1286
IVMRWindowlessControl IVMRWindowlessControl_iface
Definition: vmr9.c:61
IVMRFilterConfig IVMRFilterConfig_iface
Definition: vmr9.c:55
IVMRImagePresenter9 * presenter
Definition: vmr9.c:65
BITMAPINFOHEADER bmiheader
Definition: vmr9.c:74
IDirect3DDevice9 * allocator_d3d9_dev
Definition: vmr9.c:82
IVMRSurfaceAllocatorEx9 * allocator
Definition: vmr9.c:64
LONG VideoHeight
Definition: vmr9.c:94
BOOL bAggregatable
Definition: vmr9.c:77
IAMCertifiedOutputProtection IAMCertifiedOutputProtection_iface
Definition: vmr9.c:53
DWORD cur_surface
Definition: vmr9.c:85
BaseControlWindow baseControlWindow
Definition: vmr9.c:49
BaseControlVideo baseControlVideo
Definition: vmr9.c:50
IVMRWindowlessControl9 IVMRWindowlessControl9_iface
Definition: vmr9.c:62
VMR9Mode mode
Definition: vmr9.c:73
BOOL allocator_is_ex
Definition: vmr9.c:66
IVMRSurfaceAllocatorNotify IVMRSurfaceAllocatorNotify_iface
Definition: vmr9.c:59
RECT target_rect
Definition: vmr9.c:92
IUnknown IUnknown_inner
Definition: vmr9.c:52
HMONITOR allocator_mon
Definition: vmr9.c:83
IVMRMonitorConfig IVMRMonitorConfig_iface
Definition: vmr9.c:57
IVMRFilterConfig9 IVMRFilterConfig9_iface
Definition: vmr9.c:56
HWND hWndClippingWindow
Definition: vmr9.c:89
HMODULE hD3d9
Definition: vmr9.c:79
BaseRenderer renderer
Definition: vmr9.c:48
RECT source_rect
Definition: vmr9.c:91
IVMRSurfaceAllocatorNotify9 IVMRSurfaceAllocatorNotify9_iface
Definition: vmr9.c:60
LONG VideoWidth
Definition: vmr9.c:93
IVMRMonitorConfig9 IVMRMonitorConfig9_iface
Definition: vmr9.c:58
IUnknown * outer_unk
Definition: vmr9.c:75
DWORD num_surfaces
Definition: vmr9.c:84
BOOL bUnkOuterValid
Definition: vmr9.c:76
DWORD_PTR cookie
Definition: vmr9.c:86
IAMFilterMiscFlags IAMFilterMiscFlags_iface
Definition: vmr9.c:54
RECT rcMonitor
Definition: winuser.h:3785
DWORD dwFlags
Definition: winuser.h:3787
DWORD cbSize
Definition: winuser.h:3784
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
BITMAPINFOHEADER bmiHeader
Definition: dvdmedia.h:41
BITMAPINFOHEADER bmiHeader
Definition: amvideo.idl:189
struct _GUID * pGUID
Definition: vmrender.idl:171
#define max(a, b)
Definition: svc.c:63
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:651
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
rwlock_t lock
Definition: tcpcore.h:0
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
uint32_t DWORD_PTR
Definition: typedefs.h:65
unsigned char * LPBYTE
Definition: typedefs.h:53
#define __stdcall
Definition: typedefs.h:25
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
Definition: font.h:89
_In_ HFONT _Out_ PUINT Height
Definition: font.h:88
#define VFW_E_DDRAW_CAPS_NOT_SUITABLE
Definition: vfwmsgs.h:124
#define VFW_E_NOT_PAUSED
Definition: vfwmsgs.h:76
#define VFW_E_WRONG_STATE
Definition: vfwmsgs.h:78
#define VFW_E_NO_COPP_HW
Definition: vfwmsgs.h:160
#define VFW_E_RUNTIME_ERROR
Definition: vfwmsgs.h:50
static HRESULT WINAPI VMR7FilterConfig_SetRenderingMode(IVMRFilterConfig *iface, DWORD mode)
Definition: vmr9.c:1247
static HRESULT WINAPI VMR7WindowlessControl_GetMaxIdealVideoSize(IVMRWindowlessControl *iface, LONG *width, LONG *height)
Definition: vmr9.c:1757
static HRESULT WINAPI VMR9MonitorConfig_GetAvailableMonitors(IVMRMonitorConfig9 *iface, VMR9MonitorInfo *info, DWORD arraysize, DWORD *numdev)
Definition: vmr9.c:1529
static ULONG WINAPI VMR7FilterConfig_AddRef(IVMRFilterConfig *iface)
Definition: vmr9.c:1194
static HRESULT WINAPI VMR7FilterConfig_GetRenderingMode(IVMRFilterConfig *iface, DWORD *mode)
Definition: vmr9.c:1255
static const BaseControlVideoFuncTable renderer_BaseControlVideoFuncTable
Definition: vmr9.c:729
static const BaseWindowFuncTable renderer_BaseWindowFuncTable
Definition: vmr9.c:574
static ULONG WINAPI AMCertifiedOutputProtection_AddRef(IAMCertifiedOutputProtection *iface)
Definition: vmr9.c:1100
static HRESULT WINAPI VMR9FilterConfig_SetImageCompositor(IVMRFilterConfig9 *iface, IVMRImageCompositor9 *compositor)
Definition: vmr9.c:1584
static HRESULT WINAPI VMR9WindowlessControl_GetBorderColor(IVMRWindowlessControl9 *iface, COLORREF *color)
Definition: vmr9.c:2095
static RECT WINAPI VMR9_GetDefaultRect(BaseWindow *This)
Definition: vmr9.c:550
static VMR9DefaultAllocatorPresenterImpl * impl_from_IVMRImagePresenter9(IVMRImagePresenter9 *iface)
Definition: vmr9.c:197
static HRESULT WINAPI VMR7WindowlessControl_GetVideoPosition(IVMRWindowlessControl *iface, RECT *source, RECT *dest)
Definition: vmr9.c:1794
static ULONG WINAPI VMR9_SurfaceAllocator_AddRef(IVMRSurfaceAllocatorEx9 *iface)
Definition: vmr9.c:2674
static struct quartz_vmr * impl_from_BaseWindow(BaseWindow *wnd)
Definition: vmr9.c:102
static HRESULT WINAPI VMR9FilterConfig_GetRenderingPrefs(IVMRFilterConfig9 *iface, DWORD *renderflags)
Definition: vmr9.c:1616
static HRESULT WINAPI VMR9MonitorConfig_SetDefaultMonitor(IVMRMonitorConfig9 *iface, UINT uDev)
Definition: vmr9.c:1507
static ULONG WINAPI VMR7WindowlessControl_Release(IVMRWindowlessControl *iface)
Definition: vmr9.c:1721
static const IAMCertifiedOutputProtectionVtbl IAMCertifiedOutputProtection_Vtbl
Definition: vmr9.c:1150
static HRESULT WINAPI VMR7SurfaceAllocatorNotify_RestoreDDrawSurfaces(IVMRSurfaceAllocatorNotify *iface)
Definition: vmr9.c:2170
static ULONG WINAPI Basicvideo_Release(IBasicVideo *iface)
Definition: vmr9.c:1041
static ULONG WINAPI Videowindow_Release(IVideoWindow *iface)
Definition: vmr9.c:963
static HRESULT WINAPI VMR9_ShouldDrawSampleNow(BaseRenderer *This, IMediaSample *pSample, REFERENCE_TIME *pStartTime, REFERENCE_TIME *pEndTime)
Definition: vmr9.c:474
static HRESULT WINAPI VMR9FilterConfig_SetRenderingPrefs(IVMRFilterConfig9 *iface, DWORD renderflags)
Definition: vmr9.c:1608
static ULONG WINAPI VMR7WindowlessControl_AddRef(IVMRWindowlessControl *iface)
Definition: vmr9.c:1715
static HRESULT WINAPI VMR9_SetDefaultTargetRect(BaseControlVideo *This)
Definition: vmr9.c:702
static HRESULT WINAPI VMR9MonitorConfig_QueryInterface(IVMRMonitorConfig9 *iface, REFIID riid, LPVOID *ppv)
Definition: vmr9.c:1466
static ULONG WINAPI VMR9FilterConfig_AddRef(IVMRFilterConfig9 *iface)
Definition: vmr9.c:1572
static HRESULT vmr_create(IUnknown *outer_unk, LPVOID *ppv, const CLSID *clsid)
Definition: vmr9.c:2369
static HRESULT WINAPI AMCertifiedOutputProtection_KeyExchange(IAMCertifiedOutputProtection *iface, GUID *pRandom, BYTE **VarLenCertGH, DWORD *pdwLengthCertGH)
Definition: vmr9.c:1112
static const IVMRFilterConfig9Vtbl VMR9_FilterConfig_Vtbl
Definition: vmr9.c:1694
static HRESULT WINAPI VMR9_SetDefaultSourceRect(BaseControlVideo *This)
Definition: vmr9.c:693
static HRESULT WINAPI VMR9_GetSourceRect(BaseControlVideo *This, RECT *pSourceRect)
Definition: vmr9.c:582
static HRESULT WINAPI VMR7FilterConfig_SetRenderingPrefs(IVMRFilterConfig *iface, DWORD renderflags)
Definition: vmr9.c:1231
static LPWSTR WINAPI VMR9_GetClassWindowStyles(BaseWindow *This, DWORD *pClassStyles, DWORD *pWindowStyles, DWORD *pWindowStylesEx)
Definition: vmr9.c:539
static HRESULT WINAPI VMR9MonitorConfig_SetMonitor(IVMRMonitorConfig9 *iface, UINT uDev)
Definition: vmr9.c:1485
static HRESULT WINAPI VMR9SurfaceAllocatorNotify_AllocateSurfaceHelper(IVMRSurfaceAllocatorNotify9 *iface, VMR9AllocationInfo *allocinfo, DWORD *numbuffers, IDirect3DSurface9 **surface)
Definition: vmr9.c:2281
static HRESULT VMR9DefaultAllocatorPresenterImpl_create(struct quartz_vmr *parent, LPVOID *ppv)
Definition: vmr9.c:3058
static struct quartz_vmr * impl_from_IVMRMonitorConfig(IVMRMonitorConfig *iface)
Definition: vmr9.c:142
static HRESULT WINAPI VMR9_SurfaceAllocator_QueryInterface(IVMRSurfaceAllocatorEx9 *iface, REFIID riid, LPVOID *ppv)
Definition: vmr9.c:2667
static HRESULT WINAPI VMR9SurfaceAllocatorNotify_SetD3DDevice(IVMRSurfaceAllocatorNotify9 *iface, IDirect3DDevice9 *device, HMONITOR monitor)
Definition: vmr9.c:2253
static HRESULT WINAPI VMR7SurfaceAllocatorNotify_SetDDrawDevice(IVMRSurfaceAllocatorNotify *iface, IDirectDraw7 *device, HMONITOR monit