ReactOS  0.4.14-dev-614-gbfd8a84
videorenderer.c
Go to the documentation of this file.
1 /*
2  * Video Renderer (Fullscreen and Windowed using Direct Draw)
3  *
4  * Copyright 2004 Christian Costa
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20 
21 #include "config.h"
22 
23 #include "quartz_private.h"
24 #include "pin.h"
25 
26 #include "uuids.h"
27 #include "vfwmsgs.h"
28 #include "amvideo.h"
29 #include "windef.h"
30 #include "winbase.h"
31 #include "dshow.h"
32 #include "evcode.h"
33 #include "strmif.h"
34 #include "ddraw.h"
35 #include "dvdmedia.h"
36 
37 #include <assert.h>
38 #include "wine/unicode.h"
39 #include "wine/debug.h"
40 
42 
43 typedef struct VideoRendererImpl
44 {
46  BaseControlWindow baseControlWindow;
47  BaseControlVideo baseControlVideo;
48 
52 
55 
58 /* hEvent == evComplete? */
67 
69 {
70  return CONTAINING_RECORD(iface, VideoRendererImpl, baseControlWindow.baseWindow);
71 }
72 
74 {
75  return CONTAINING_RECORD(iface, VideoRendererImpl, renderer);
76 }
77 
79 {
80  return CONTAINING_RECORD(iface, VideoRendererImpl, renderer.filter.IBaseFilter_iface);
81 }
82 
83 static inline VideoRendererImpl *impl_from_IVideoWindow(IVideoWindow *iface)
84 {
85  return CONTAINING_RECORD(iface, VideoRendererImpl, baseControlWindow.IVideoWindow_iface);
86 }
87 
88 static inline VideoRendererImpl *impl_from_BaseControlVideo(BaseControlVideo *iface)
89 {
90  return CONTAINING_RECORD(iface, VideoRendererImpl, baseControlVideo);
91 }
92 
93 static inline VideoRendererImpl *impl_from_IBasicVideo(IBasicVideo *iface)
94 {
95  return CONTAINING_RECORD(iface, VideoRendererImpl, baseControlVideo.IBasicVideo_iface);
96 }
97 
99 {
101  MSG msg;
102  BOOL fGotMessage;
103 
104  TRACE("Starting message loop\n");
105 
106  if (FAILED(BaseWindowImpl_PrepareWindow(&This->baseControlWindow.baseWindow)))
107  {
108  This->ThreadResult = FALSE;
109  SetEvent(This->hEvent);
110  return 0;
111  }
112 
113  This->ThreadResult = TRUE;
114  SetEvent(This->hEvent);
115 
116  while ((fGotMessage = GetMessageW(&msg, NULL, 0, 0)) != 0 && fGotMessage != -1)
117  {
120  }
121 
122  TRACE("End of message loop\n");
123 
124  return msg.wParam;
125 }
126 
128 {
129  This->hEvent = CreateEventW(NULL, TRUE, FALSE, NULL);
130  if (!This->hEvent)
131  return FALSE;
132 
133  This->hThread = CreateThread(NULL, 0, MessageLoop, This, 0, &This->ThreadID);
134  if (!This->hThread)
135  {
136  CloseHandle(This->hEvent);
137  return FALSE;
138  }
139 
141 
142  if (!This->ThreadResult)
143  {
144  CloseHandle(This->hEvent);
145  CloseHandle(This->hThread);
146  return FALSE;
147  }
148 
149  return TRUE;
150 }
151 
153 {
154  if (!This->init && (!This->WindowPos.right || !This->WindowPos.top))
155  {
156  DWORD style = GetWindowLongW(This->baseControlWindow.baseWindow.hWnd, GWL_STYLE);
157  DWORD style_ex = GetWindowLongW(This->baseControlWindow.baseWindow.hWnd, GWL_EXSTYLE);
158 
159  if (!This->WindowPos.right)
160  {
161  if (This->DestRect.right)
162  {
163  This->WindowPos.left = This->DestRect.left;
164  This->WindowPos.right = This->DestRect.right;
165  }
166  else
167  {
168  This->WindowPos.left = This->SourceRect.left;
169  This->WindowPos.right = This->SourceRect.right;
170  }
171  }
172  if (!This->WindowPos.bottom)
173  {
174  if (This->DestRect.bottom)
175  {
176  This->WindowPos.top = This->DestRect.top;
177  This->WindowPos.bottom = This->DestRect.bottom;
178  }
179  else
180  {
181  This->WindowPos.top = This->SourceRect.top;
182  This->WindowPos.bottom = This->SourceRect.bottom;
183  }
184  }
185 
186  AdjustWindowRectEx(&This->WindowPos, style, FALSE, style_ex);
187 
188  TRACE("WindowPos: %s\n", wine_dbgstr_rect(&This->WindowPos));
189  SetWindowPos(This->baseControlWindow.baseWindow.hWnd, NULL,
190  This->WindowPos.left,
191  This->WindowPos.top,
192  This->WindowPos.right - This->WindowPos.left,
193  This->WindowPos.bottom - This->WindowPos.top,
195 
196  GetClientRect(This->baseControlWindow.baseWindow.hWnd, &This->DestRect);
197  }
198  else if (!This->init)
199  This->DestRect = This->WindowPos;
200  This->init = TRUE;
201  if (This->baseControlWindow.AutoShow)
202  ShowWindow(This->baseControlWindow.baseWindow.hWnd, SW_SHOW);
203 }
204 
206 {
207  AM_MEDIA_TYPE amt;
208  HRESULT hr = S_OK;
209  BITMAPINFOHEADER *bmiHeader;
210 
211  TRACE("(%p)->(%p, %d)\n", This, data, size);
212 
213  hr = IPin_ConnectionMediaType(&This->renderer.pInputPin->pin.IPin_iface, &amt);
214  if (FAILED(hr)) {
215  ERR("Unable to retrieve media type\n");
216  return hr;
217  }
218 
219  if (IsEqualIID(&amt.formattype, &FORMAT_VideoInfo))
220  {
221  bmiHeader = &((VIDEOINFOHEADER *)amt.pbFormat)->bmiHeader;
222  }
223  else if (IsEqualIID(&amt.formattype, &FORMAT_VideoInfo2))
224  {
225  bmiHeader = &((VIDEOINFOHEADER2 *)amt.pbFormat)->bmiHeader;
226  }
227  else
228  {
229  FIXME("Unknown type %s\n", debugstr_guid(&amt.subtype));
230  return VFW_E_RUNTIME_ERROR;
231  }
232 
233  TRACE("biSize = %d\n", bmiHeader->biSize);
234  TRACE("biWidth = %d\n", bmiHeader->biWidth);
235  TRACE("biHeight = %d\n", bmiHeader->biHeight);
236  TRACE("biPlanes = %d\n", bmiHeader->biPlanes);
237  TRACE("biBitCount = %d\n", bmiHeader->biBitCount);
238  TRACE("biCompression = %s\n", debugstr_an((LPSTR)&(bmiHeader->biCompression), 4));
239  TRACE("biSizeImage = %d\n", bmiHeader->biSizeImage);
240 
241  if (!This->baseControlWindow.baseWindow.hDC) {
242  ERR("Cannot get DC from window!\n");
243  return E_FAIL;
244  }
245 
246  TRACE("Src Rect: %s\n", wine_dbgstr_rect(&This->SourceRect));
247  TRACE("Dst Rect: %s\n", wine_dbgstr_rect(&This->DestRect));
248 
249  StretchDIBits(This->baseControlWindow.baseWindow.hDC, This->DestRect.left, This->DestRect.top, This->DestRect.right -This->DestRect.left,
250  This->DestRect.bottom - This->DestRect.top, This->SourceRect.left, This->SourceRect.top,
251  This->SourceRect.right - This->SourceRect.left, This->SourceRect.bottom - This->SourceRect.top,
252  data, (BITMAPINFO *)bmiHeader, DIB_RGB_COLORS, SRCCOPY);
253 
254  return S_OK;
255 }
256 
258 {
259  /* Preroll means the sample isn't shown, this is used for key frames and things like that */
260  if (IMediaSample_IsPreroll(pSample) == S_OK)
261  return E_FAIL;
262  return S_FALSE;
263 }
264 
266 {
268  LPBYTE pbSrcStream = NULL;
269  LONG cbSrcStream = 0;
270  HRESULT hr;
271 
272  TRACE("(%p)->(%p)\n", This, pSample);
273 
274  hr = IMediaSample_GetPointer(pSample, &pbSrcStream);
275  if (FAILED(hr))
276  {
277  ERR("Cannot get pointer to sample data (%x)\n", hr);
278  return hr;
279  }
280 
281  cbSrcStream = IMediaSample_GetActualDataLength(pSample);
282 
283  TRACE("val %p %d\n", pbSrcStream, cbSrcStream);
284 
285 #if 0 /* For debugging purpose */
286  {
287  int i;
288  for(i = 0; i < cbSrcStream; i++)
289  {
290  if ((i!=0) && !(i%16))
291  TRACE("\n");
292  TRACE("%02x ", pbSrcStream[i]);
293  }
294  TRACE("\n");
295  }
296 #endif
297 
298  SetEvent(This->hEvent);
299  if (This->renderer.filter.state == State_Paused)
300  {
301  VideoRenderer_SendSampleData(This, pbSrcStream, cbSrcStream);
302  SetEvent(This->hEvent);
303  if (This->renderer.filter.state == State_Paused)
304  {
305  /* Flushing */
306  return S_OK;
307  }
308  if (This->renderer.filter.state == State_Stopped)
309  {
310  return VFW_E_WRONG_STATE;
311  }
312  } else {
313  VideoRenderer_SendSampleData(This, pbSrcStream, cbSrcStream);
314  }
315  return S_OK;
316 }
317 
319 {
321 
322  if (!IsEqualIID(&pmt->majortype, &MEDIATYPE_Video))
323  return S_FALSE;
324 
325  if (IsEqualIID(&pmt->subtype, &MEDIASUBTYPE_RGB32) ||
326  IsEqualIID(&pmt->subtype, &MEDIASUBTYPE_RGB24) ||
327  IsEqualIID(&pmt->subtype, &MEDIASUBTYPE_RGB565) ||
328  IsEqualIID(&pmt->subtype, &MEDIASUBTYPE_RGB8))
329  {
330  LONG height;
331 
332  if (IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo))
333  {
334  VIDEOINFOHEADER *format = (VIDEOINFOHEADER *)pmt->pbFormat;
335  This->SourceRect.left = 0;
336  This->SourceRect.top = 0;
337  This->SourceRect.right = This->VideoWidth = format->bmiHeader.biWidth;
338  height = format->bmiHeader.biHeight;
339  if (height < 0)
340  This->SourceRect.bottom = This->VideoHeight = -height;
341  else
342  This->SourceRect.bottom = This->VideoHeight = height;
343  }
344  else if (IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo2))
345  {
346  VIDEOINFOHEADER2 *format2 = (VIDEOINFOHEADER2 *)pmt->pbFormat;
347 
348  This->SourceRect.left = 0;
349  This->SourceRect.top = 0;
350  This->SourceRect.right = This->VideoWidth = format2->bmiHeader.biWidth;
351  height = format2->bmiHeader.biHeight;
352  if (height < 0)
353  This->SourceRect.bottom = This->VideoHeight = -height;
354  else
355  This->SourceRect.bottom = This->VideoHeight = height;
356  }
357  else
358  {
359  WARN("Format type %s not supported\n", debugstr_guid(&pmt->formattype));
360  return S_FALSE;
361  }
362  return S_OK;
363  }
364  return S_FALSE;
365 }
366 
368 {
370 
371  TRACE("(%p)->()\n", iface);
372 
373  if (This->renderer.pMediaSample) {
374  ResetEvent(This->hEvent);
382  }
383  if (This->renderer.filter.state == State_Paused) {
384  ResetEvent(This->hEvent);
385  }
386 
387  return BaseRendererImpl_EndFlush(iface);
388 }
389 
391 {
393 
394  TRACE("(%p)->()\n", This);
395 
396  SetEvent(This->hEvent);
397  if (This->baseControlWindow.AutoShow)
398  /* Black it out */
399  RedrawWindow(This->baseControlWindow.baseWindow.hWnd, NULL, NULL, RDW_INVALIDATE|RDW_ERASE);
400 }
401 
403 {
405 
406  TRACE("(%p)\n", This);
407 
408  if (This->renderer.pInputPin->pin.pConnectedTo && (This->renderer.filter.state == State_Stopped || !This->renderer.pInputPin->end_of_stream))
409  {
410  if (This->renderer.filter.state == State_Stopped)
411  {
412  ResetEvent(This->hEvent);
414  }
415  }
416 }
417 
418 static LPWSTR WINAPI VideoRenderer_GetClassWindowStyles(BaseWindow *This, DWORD *pClassStyles, DWORD *pWindowStyles, DWORD *pWindowStylesEx)
419 {
420  static const WCHAR classnameW[] = { 'W','i','n','e',' ','A','c','t','i','v','e','M','o','v','i','e',' ','C','l','a','s','s',0 };
421 
422  *pClassStyles = 0;
423  *pWindowStyles = WS_SIZEBOX;
424  *pWindowStylesEx = 0;
425 
426  return (LPWSTR)classnameW;
427 }
428 
430 {
432  static RECT defRect;
433 
434  SetRect(&defRect, 0, 0, This->VideoWidth, This->VideoHeight);
435 
436  return defRect;
437 }
438 
439 static BOOL WINAPI VideoRenderer_OnSize(BaseWindow *iface, LONG Width, LONG Height)
440 {
442 
443  TRACE("WM_SIZE %d %d\n", Width, Height);
444  GetClientRect(iface->hWnd, &This->DestRect);
445  TRACE("WM_SIZING: DestRect=(%d,%d),(%d,%d)\n",
446  This->DestRect.left,
447  This->DestRect.top,
448  This->DestRect.right - This->DestRect.left,
449  This->DestRect.bottom - This->DestRect.top);
450  return BaseWindowImpl_OnSize(iface, Width, Height);
451 }
452 
456 
457  NULL,
458  NULL,
459  NULL,
462  NULL,
463  NULL,
464  NULL,
466  NULL,
467 
468  NULL,
469  NULL,
470  NULL,
471  NULL,
473 };
474 
478  NULL,
481 };
482 
483 static HRESULT WINAPI VideoRenderer_GetSourceRect(BaseControlVideo* iface, RECT *pSourceRect)
484 {
486  CopyRect(pSourceRect,&This->SourceRect);
487  return S_OK;
488 }
489 
490 static HRESULT WINAPI VideoRenderer_GetStaticImage(BaseControlVideo* iface, LONG *pBufferSize, LONG *pDIBImage)
491 {
493  BITMAPINFOHEADER *bmiHeader;
494  LONG needed_size;
495  AM_MEDIA_TYPE *amt = &This->renderer.pInputPin->pin.mtCurrent;
496  char *ptr;
497 
498  FIXME("(%p/%p)->(%p, %p): partial stub\n", This, iface, pBufferSize, pDIBImage);
499 
500  EnterCriticalSection(&This->renderer.filter.csFilter);
501 
502  if (!This->renderer.pMediaSample)
503  {
504  LeaveCriticalSection(&This->renderer.filter.csFilter);
505  return (This->renderer.filter.state == State_Paused ? E_UNEXPECTED : VFW_E_NOT_PAUSED);
506  }
507 
508  if (IsEqualIID(&amt->formattype, &FORMAT_VideoInfo))
509  {
510  bmiHeader = &((VIDEOINFOHEADER *)amt->pbFormat)->bmiHeader;
511  }
512  else if (IsEqualIID(&amt->formattype, &FORMAT_VideoInfo2))
513  {
514  bmiHeader = &((VIDEOINFOHEADER2 *)amt->pbFormat)->bmiHeader;
515  }
516  else
517  {
518  FIXME("Unknown type %s\n", debugstr_guid(&amt->subtype));
519  LeaveCriticalSection(&This->renderer.filter.csFilter);
520  return VFW_E_RUNTIME_ERROR;
521  }
522 
523  needed_size = bmiHeader->biSize;
524  needed_size += IMediaSample_GetActualDataLength(This->renderer.pMediaSample);
525 
526  if (!pDIBImage)
527  {
528  *pBufferSize = needed_size;
529  LeaveCriticalSection(&This->renderer.filter.csFilter);
530  return S_OK;
531  }
532 
533  if (needed_size < *pBufferSize)
534  {
535  ERR("Buffer too small %u/%u\n", needed_size, *pBufferSize);
536  LeaveCriticalSection(&This->renderer.filter.csFilter);
537  return E_FAIL;
538  }
539  *pBufferSize = needed_size;
540 
541  memcpy(pDIBImage, bmiHeader, bmiHeader->biSize);
542  IMediaSample_GetPointer(This->renderer.pMediaSample, (BYTE **)&ptr);
543  memcpy((char *)pDIBImage + bmiHeader->biSize, ptr, IMediaSample_GetActualDataLength(This->renderer.pMediaSample));
544 
545  LeaveCriticalSection(&This->renderer.filter.csFilter);
546  return S_OK;
547 }
548 
549 static HRESULT WINAPI VideoRenderer_GetTargetRect(BaseControlVideo* iface, RECT *pTargetRect)
550 {
552  CopyRect(pTargetRect,&This->DestRect);
553  return S_OK;
554 }
555 
556 static VIDEOINFOHEADER* WINAPI VideoRenderer_GetVideoFormat(BaseControlVideo* iface)
557 {
559  AM_MEDIA_TYPE *pmt;
560 
561  TRACE("(%p/%p)\n", This, iface);
562 
563  pmt = &This->renderer.pInputPin->pin.mtCurrent;
564  if (IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo)) {
565  return (VIDEOINFOHEADER*)pmt->pbFormat;
566  } else if (IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo2)) {
567  static VIDEOINFOHEADER vih;
568  VIDEOINFOHEADER2 *vih2 = (VIDEOINFOHEADER2*)pmt->pbFormat;
569  memcpy(&vih,vih2,sizeof(VIDEOINFOHEADER));
570  memcpy(&vih.bmiHeader, &vih2->bmiHeader, sizeof(BITMAPINFOHEADER));
571  return &vih;
572  } else {
573  ERR("Unknown format type %s\n", qzdebugstr_guid(&pmt->formattype));
574  return NULL;
575  }
576 }
577 
578 static HRESULT WINAPI VideoRenderer_IsDefaultSourceRect(BaseControlVideo* iface)
579 {
581  FIXME("(%p/%p)->(): stub !!!\n", This, iface);
582 
583  return S_OK;
584 }
585 
586 static HRESULT WINAPI VideoRenderer_IsDefaultTargetRect(BaseControlVideo* iface)
587 {
589  FIXME("(%p/%p)->(): stub !!!\n", This, iface);
590 
591  return S_OK;
592 }
593 
594 static HRESULT WINAPI VideoRenderer_SetDefaultSourceRect(BaseControlVideo* iface)
595 {
597 
598  SetRect(&This->SourceRect, 0, 0, This->VideoWidth, This->VideoHeight);
599 
600  return S_OK;
601 }
602 
603 static HRESULT WINAPI VideoRenderer_SetDefaultTargetRect(BaseControlVideo* iface)
604 {
606  RECT rect;
607 
608  if (!GetClientRect(This->baseControlWindow.baseWindow.hWnd, &rect))
609  return E_FAIL;
610 
611  SetRect(&This->DestRect, 0, 0, rect.right, rect.bottom);
612 
613  return S_OK;
614 }
615 
616 static HRESULT WINAPI VideoRenderer_SetSourceRect(BaseControlVideo* iface, RECT *pSourceRect)
617 {
619  CopyRect(&This->SourceRect,pSourceRect);
620  return S_OK;
621 }
622 
623 static HRESULT WINAPI VideoRenderer_SetTargetRect(BaseControlVideo* iface, RECT *pTargetRect)
624 {
626  CopyRect(&This->DestRect,pTargetRect);
627  return S_OK;
628 }
629 
630 static const BaseControlVideoFuncTable renderer_BaseControlVideoFuncTable = {
641 };
642 
644 {
645  return CONTAINING_RECORD(iface, VideoRendererImpl, IUnknown_inner);
646 }
647 
649 {
651 
652  TRACE("(%p/%p)->(%s, %p)\n", This, iface, qzdebugstr_guid(riid), ppv);
653 
654  *ppv = NULL;
655 
657  *ppv = &This->IUnknown_inner;
658  else if (IsEqualIID(riid, &IID_IBasicVideo))
659  *ppv = &This->baseControlVideo.IBasicVideo_iface;
660  else if (IsEqualIID(riid, &IID_IVideoWindow))
661  *ppv = &This->baseControlWindow.IVideoWindow_iface;
662  else if (IsEqualIID(riid, &IID_IAMFilterMiscFlags))
663  *ppv = &This->IAMFilterMiscFlags_iface;
664  else
665  {
666  HRESULT hr;
667  hr = BaseRendererImpl_QueryInterface(&This->renderer.filter.IBaseFilter_iface, riid, ppv);
668  if (SUCCEEDED(hr))
669  return hr;
670  }
671 
672  if (*ppv)
673  {
674  IUnknown_AddRef((IUnknown *)*ppv);
675  return S_OK;
676  }
677 
678  if (!IsEqualIID(riid, &IID_IPin))
679  FIXME("No interface for %s!\n", qzdebugstr_guid(riid));
680 
681  return E_NOINTERFACE;
682 }
683 
685 {
687  ULONG refCount = BaseFilterImpl_AddRef(&This->renderer.filter.IBaseFilter_iface);
688 
689  TRACE("(%p)->(): new ref = %d\n", This, refCount);
690 
691  return refCount;
692 }
693 
695 {
697  ULONG refCount = BaseRendererImpl_Release(&This->renderer.filter.IBaseFilter_iface);
698 
699  TRACE("(%p)->(): new ref = %d\n", This, refCount);
700 
701  if (!refCount)
702  {
703  BaseControlWindow_Destroy(&This->baseControlWindow);
704  BaseControlVideo_Destroy(&This->baseControlVideo);
705  PostThreadMessageW(This->ThreadID, WM_QUIT, 0, 0);
706  WaitForSingleObject(This->hThread, INFINITE);
707  CloseHandle(This->hThread);
708  CloseHandle(This->hEvent);
709 
710  TRACE("Destroying Video Renderer\n");
712 
713  return 0;
714  }
715  else
716  return refCount;
717 }
718 
719 static const IUnknownVtbl IInner_VTable =
720 {
724 };
725 
727 {
729  return IUnknown_QueryInterface(This->outer_unk, riid, ppv);
730 }
731 
733 {
735  return IUnknown_AddRef(This->outer_unk);
736 }
737 
739 {
741  return IUnknown_Release(This->outer_unk);
742 }
743 
747 {
749 
750  TRACE("(%p/%p)->()\n", This, iface);
751 
752  EnterCriticalSection(&This->renderer.csRenderLock);
753  if (This->renderer.filter.state != State_Paused)
754  {
755  if (This->renderer.filter.state == State_Stopped)
756  {
757  This->renderer.pInputPin->end_of_stream = 0;
758  ResetEvent(This->hEvent);
760  }
761 
762  ResetEvent(This->renderer.RenderEvent);
763  This->renderer.filter.state = State_Paused;
764  }
765  LeaveCriticalSection(&This->renderer.csRenderLock);
766 
767  return S_OK;
768 }
769 
770 static const IBaseFilterVtbl VideoRenderer_Vtbl =
771 {
787 };
788 
789 /*** IUnknown methods ***/
790 static HRESULT WINAPI BasicVideo_QueryInterface(IBasicVideo *iface, REFIID riid, LPVOID *ppvObj)
791 {
793 
794  TRACE("(%p/%p)->(%s, %p)\n", This, iface, debugstr_guid(riid), ppvObj);
795 
796  return IUnknown_QueryInterface(This->outer_unk, riid, ppvObj);
797 }
798 
799 static ULONG WINAPI BasicVideo_AddRef(IBasicVideo *iface)
800 {
802 
803  TRACE("(%p/%p)->()\n", This, iface);
804 
805  return IUnknown_AddRef(This->outer_unk);
806 }
807 
808 static ULONG WINAPI BasicVideo_Release(IBasicVideo *iface)
809 {
811 
812  TRACE("(%p/%p)->()\n", This, iface);
813 
814  return IUnknown_Release(This->outer_unk);
815 }
816 
817 static const IBasicVideoVtbl IBasicVideo_VTable =
818 {
858 };
859 
860 
861 /*** IUnknown methods ***/
862 static HRESULT WINAPI VideoWindow_QueryInterface(IVideoWindow *iface, REFIID riid, LPVOID *ppvObj)
863 {
865 
866  TRACE("(%p/%p)->(%s, %p)\n", This, iface, debugstr_guid(riid), ppvObj);
867 
868  return IUnknown_QueryInterface(This->outer_unk, riid, ppvObj);
869 }
870 
871 static ULONG WINAPI VideoWindow_AddRef(IVideoWindow *iface)
872 {
874 
875  TRACE("(%p/%p)->()\n", This, iface);
876 
877  return IUnknown_AddRef(This->outer_unk);
878 }
879 
880 static ULONG WINAPI VideoWindow_Release(IVideoWindow *iface)
881 {
883 
884  TRACE("(%p/%p)->()\n", This, iface);
885 
886  return IUnknown_Release(This->outer_unk);
887 }
888 
889 static HRESULT WINAPI VideoWindow_get_FullScreenMode(IVideoWindow *iface,
890  LONG *FullScreenMode)
891 {
893 
894  TRACE("(%p/%p)->(%p): %d\n", This, iface, FullScreenMode, This->FullScreenMode);
895 
896  if (!FullScreenMode)
897  return E_POINTER;
898 
899  *FullScreenMode = This->FullScreenMode;
900 
901  return S_OK;
902 }
903 
904 static HRESULT WINAPI VideoWindow_put_FullScreenMode(IVideoWindow *iface,
905  LONG FullScreenMode)
906 {
908 
909  FIXME("(%p/%p)->(%d): stub !!!\n", This, iface, FullScreenMode);
910 
911  if (FullScreenMode) {
912  This->baseControlWindow.baseWindow.WindowStyles = GetWindowLongW(This->baseControlWindow.baseWindow.hWnd, GWL_STYLE);
913  ShowWindow(This->baseControlWindow.baseWindow.hWnd, SW_HIDE);
914  SetParent(This->baseControlWindow.baseWindow.hWnd, 0);
915  SetWindowLongW(This->baseControlWindow.baseWindow.hWnd, GWL_STYLE, WS_POPUP);
917  GetWindowRect(This->baseControlWindow.baseWindow.hWnd, &This->DestRect);
918  This->WindowPos = This->DestRect;
919  } else {
920  ShowWindow(This->baseControlWindow.baseWindow.hWnd, SW_HIDE);
921  SetParent(This->baseControlWindow.baseWindow.hWnd, This->baseControlWindow.hwndOwner);
922  SetWindowLongW(This->baseControlWindow.baseWindow.hWnd, GWL_STYLE, This->baseControlWindow.baseWindow.WindowStyles);
923  GetClientRect(This->baseControlWindow.baseWindow.hWnd, &This->DestRect);
924  SetWindowPos(This->baseControlWindow.baseWindow.hWnd,0,This->DestRect.left,This->DestRect.top,This->DestRect.right,This->DestRect.bottom,SWP_NOZORDER|SWP_SHOWWINDOW);
925  This->WindowPos = This->DestRect;
926  }
927  This->FullScreenMode = FullScreenMode;
928 
929  return S_OK;
930 }
931 
932 static const IVideoWindowVtbl IVideoWindow_VTable =
933 {
980 };
981 
983 {
984  return CONTAINING_RECORD(iface, VideoRendererImpl, IAMFilterMiscFlags_iface);
985 }
986 
988  void **ppv)
989 {
991  return IUnknown_QueryInterface(This->outer_unk, riid, ppv);
992 }
993 
995 {
997  return IUnknown_AddRef(This->outer_unk);
998 }
999 
1001 {
1003  return IUnknown_Release(This->outer_unk);
1004 }
1005 
1007 {
1009 }
1010 
1011 static const IAMFilterMiscFlagsVtbl IAMFilterMiscFlags_Vtbl = {
1016 };
1017 
1019 {
1020  HRESULT hr;
1022 
1023  TRACE("(%p, %p)\n", pUnkOuter, ppv);
1024 
1025  *ppv = NULL;
1026 
1028  pVideoRenderer->IUnknown_inner.lpVtbl = &IInner_VTable;
1029  pVideoRenderer->IAMFilterMiscFlags_iface.lpVtbl = &IAMFilterMiscFlags_Vtbl;
1030 
1031  pVideoRenderer->init = FALSE;
1032  ZeroMemory(&pVideoRenderer->SourceRect, sizeof(RECT));
1033  ZeroMemory(&pVideoRenderer->DestRect, sizeof(RECT));
1034  ZeroMemory(&pVideoRenderer->WindowPos, sizeof(RECT));
1035  pVideoRenderer->FullScreenMode = OAFALSE;
1036 
1037  if (pUnkOuter)
1038  pVideoRenderer->outer_unk = pUnkOuter;
1039  else
1040  pVideoRenderer->outer_unk = &pVideoRenderer->IUnknown_inner;
1041 
1042  hr = BaseRenderer_Init(&pVideoRenderer->renderer, &VideoRenderer_Vtbl, pUnkOuter,
1043  &CLSID_VideoRenderer, (DWORD_PTR)(__FILE__ ": VideoRendererImpl.csFilter"),
1044  &BaseFuncTable);
1045 
1046  if (FAILED(hr))
1047  goto fail;
1048 
1050  &pVideoRenderer->renderer.filter, &pVideoRenderer->renderer.filter.csFilter,
1051  &pVideoRenderer->renderer.pInputPin->pin, &renderer_BaseWindowFuncTable);
1052  if (FAILED(hr))
1053  goto fail;
1054 
1056  &pVideoRenderer->renderer.filter, &pVideoRenderer->renderer.filter.csFilter,
1057  &pVideoRenderer->renderer.pInputPin->pin, &renderer_BaseControlVideoFuncTable);
1058  if (FAILED(hr))
1059  goto fail;
1060 
1062  hr = E_FAIL;
1063  goto fail;
1064  }
1065 
1066  *ppv = &pVideoRenderer->IUnknown_inner;
1067  return S_OK;
1068 
1069 fail:
1070  BaseRendererImpl_Release(&pVideoRenderer->renderer.filter.IBaseFilter_iface);
1072  return hr;
1073 }
1074 
1076 {
1077  /* TODO: Attempt to use the VMR-7 renderer instead when possible */
1078  return VideoRenderer_create(pUnkOuter, ppv);
1079 }
HRESULT WINAPI BaseControlVideoImpl_get_BitErrorRate(IBasicVideo *iface, LONG *pBitErrorRate)
Definition: video.c:154
static HRESULT WINAPI VideoWindow_get_FullScreenMode(IVideoWindow *iface, LONG *FullScreenMode)
HRESULT WINAPI BaseControlVideoImpl_put_SourceHeight(IBasicVideo *iface, LONG SourceHeight)
Definition: video.c:302
HRESULT WINAPI BaseControlWindowImpl_NotifyOwnerMessage(IVideoWindow *iface, OAHWND hwnd, LONG uMsg, LONG_PTR wParam, LONG_PTR lParam)
Definition: window.c:673
HRESULT WINAPI BaseControlVideoImpl_get_DestinationTop(IBasicVideo *iface, LONG *pDestinationTop)
Definition: video.c:423
static ULONG WINAPI VideoWindow_AddRef(IVideoWindow *iface)
HRESULT WINAPI BaseRendererImpl_SetSyncSource(IBaseFilter *iface, IReferenceClock *clock)
Definition: renderer.c:537
HRESULT WINAPI BaseControlVideoImpl_GetTypeInfo(IBasicVideo *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: video.c:90
static HRESULT WINAPI VideoRenderer_QueryInterface(IBaseFilter *iface, REFIID riid, LPVOID *ppv)
int WINAPI StretchDIBits(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_opt_ const VOID *, _In_ const BITMAPINFO *, _In_ UINT, _In_ DWORD)
HRESULT WINAPI BaseControlVideoImpl_get_SourceLeft(IBasicVideo *iface, LONG *pSourceLeft)
Definition: video.c:221
HRESULT WINAPI BaseControlVideo_Init(BaseControlVideo *pControlVideo, const IBasicVideoVtbl *lpVtbl, BaseFilter *owner, CRITICAL_SECTION *lock, BasePin *pPin, const BaseControlVideoFuncTable *pFuncsTable)
Definition: video.c:38
BOOL WINAPI RedrawWindow(_In_opt_ HWND, _In_opt_ LPCRECT, _In_opt_ HRGN, _In_ UINT)
HRESULT WINAPI BaseControlVideoImpl_get_AvgTimePerFrame(IBasicVideo *iface, REFTIME *pAvgTimePerFrame)
Definition: video.c:120
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define REFIID
Definition: guiddef.h:118
#define TRUE
Definition: types.h:120
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
#define CloseHandle
Definition: compat.h:406
#define E_NOINTERFACE
Definition: winerror.h:2364
HRESULT WINAPI BaseControlVideoImpl_get_DestinationHeight(IBasicVideo *iface, LONG *pDestinationHeight)
Definition: video.c:456
LPCRITICAL_SECTION pCritSec
Definition: strmbase.h:37
static ULONG WINAPI AMFilterMiscFlags_Release(IAMFilterMiscFlags *iface)
static ULONG WINAPI AMFilterMiscFlags_GetMiscFlags(IAMFilterMiscFlags *iface)
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:420
HRESULT WINAPI BaseControlWindowImpl_HideCursor(IVideoWindow *iface, LONG HideCursor)
Definition: window.c:722
static VideoRendererImpl * impl_from_IUnknown(IUnknown *iface)
HRESULT hr
Definition: shlfolder.c:183
static ULONG WINAPI VideoRendererInner_AddRef(IUnknown *iface)
HRESULT WINAPI BaseControlWindowImpl_get_Left(IVideoWindow *iface, LONG *pLeft)
Definition: window.c:440
HRESULT WINAPI BaseControlWindowImpl_get_Caption(IVideoWindow *iface, BSTR *strCaption)
Definition: window.c:278
static ULONG WINAPI BasicVideo_AddRef(IBasicVideo *iface)
#define SW_HIDE
Definition: winuser.h:762
REFIID riid
Definition: precomp.h:44
HWND WINAPI SetParent(_In_ HWND, _In_opt_ HWND)
const char * qzdebugstr_guid(const GUID *id)
Definition: main.c:279
static const IUnknownVtbl IInner_VTable
HRESULT WINAPI BaseRendererImpl_GetState(IBaseFilter *iface, DWORD dwMilliSecsTimeout, FILTER_STATE *pState)
Definition: renderer.c:550
static const BaseWindowFuncTable renderer_BaseWindowFuncTable
HRESULT WINAPI BaseControlWindowImpl_put_AutoShow(IVideoWindow *iface, LONG AutoShow)
Definition: window.c:342
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
HRESULT WINAPI BaseControlVideoImpl_put_SourceWidth(IBasicVideo *iface, LONG SourceWidth)
Definition: video.c:235
#define WARN(fmt,...)
Definition: debug.h:111
BOOL WINAPI BaseWindowImpl_OnSize(BaseWindow *This, LONG Height, LONG Width)
Definition: window.c:73
static HRESULT WINAPI VideoRenderer_SetTargetRect(BaseControlVideo *iface, RECT *pTargetRect)
static const IBaseFilterVtbl VideoRenderer_Vtbl
HRESULT WINAPI BaseControlVideoImpl_get_DestinationLeft(IBasicVideo *iface, LONG *pDestinationLeft)
Definition: video.c:356
static HRESULT WINAPI VideoRendererInner_QueryInterface(IUnknown *iface, REFIID riid, void **ppv)
HRESULT WINAPI BaseControlVideoImpl_GetIDsOfNames(IBasicVideo *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: video.c:97
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define WM_QUIT
Definition: winuser.h:1605
_Must_inspect_result_ _In_ ULONG _Out_writes_bytes_ pBufferSize PVOID _Inout_ PULONG pBufferSize
Definition: fsrtlfuncs.h:1164
HRESULT WINAPI BaseControlWindowImpl_get_BackgroundPalette(IVideoWindow *iface, LONG *pBackgroundPalette)
Definition: window.c:395
HRESULT WINAPI BaseControlVideoImpl_get_DestinationWidth(IBasicVideo *iface, LONG *pDestinationWidth)
Definition: video.c:389
BOOL WINAPI AdjustWindowRectEx(_Inout_ LPRECT, _In_ DWORD, _In_ BOOL, _In_ DWORD)
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
#define ZeroMemory
Definition: winbase.h:1642
#define WS_SIZEBOX
Definition: pedump.c:642
#define GWL_EXSTYLE
Definition: winuser.h:845
#define HWND_TOP
Definition: winuser.h:1193
HRESULT WINAPI BaseControlWindowImpl_GetMinIdealImageSize(IVideoWindow *iface, LONG *pWidth, LONG *pHeight)
Definition: window.c:685
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
BasePin pin
Definition: strmbase.h:90
HRESULT WINAPI BaseControlWindowImpl_put_WindowState(IVideoWindow *iface, LONG WindowState)
Definition: window.c:364
static const IAMFilterMiscFlagsVtbl IAMFilterMiscFlags_Vtbl
#define SWP_NOZORDER
Definition: winuser.h:1232
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
HRESULT WINAPI BaseControlWindowImpl_GetTypeInfoCount(IVideoWindow *iface, UINT *pctinfo)
Definition: window.c:229
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
HRESULT WINAPI BaseControlWindowImpl_GetIDsOfNames(IVideoWindow *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: window.c:243
static const IVideoWindowVtbl IVideoWindow_VTable
char * LPSTR
Definition: xmlstorage.h:182
static ULONG WINAPI AMFilterMiscFlags_AddRef(IAMFilterMiscFlags *iface)
HRESULT WINAPI BaseControlVideoImpl_put_DestinationHeight(IBasicVideo *iface, LONG DestinationHeight)
Definition: video.c:437
static DWORD WINAPI MessageLoop(LPVOID lpParameter)
Definition: videorenderer.c:98
#define E_FAIL
Definition: ddrawi.h:102
static IUnknown * pVideoRenderer
Definition: videorenderer.c:35
IUnknown IUnknown_inner
Definition: videorenderer.c:49
& rect
Definition: startmenu.cpp:1413
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
static HRESULT WINAPI VideoWindow_put_FullScreenMode(IVideoWindow *iface, LONG FullScreenMode)
HRESULT WINAPI BaseControlVideoImpl_GetCurrentImage(IBasicVideo *iface, LONG *pBufferSize, LONG *pDIBImage)
Definition: video.c:576
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:651
#define OAFALSE
Definition: dshow.h:53
static VideoRendererImpl * impl_from_IAMFilterMiscFlags(IAMFilterMiscFlags *iface)
HRESULT WINAPI BaseControlVideoImpl_GetTypeInfoCount(IBasicVideo *iface, UINT *pctinfo)
Definition: video.c:83
IUnknown * outer_unk
Definition: videorenderer.c:51
WINE_DEFAULT_DEBUG_CHANNEL(quartz)
HRESULT WINAPI BaseControlVideoImpl_GetSourcePosition(IBasicVideo *iface, LONG *pLeft, LONG *pTop, LONG *pWidth, LONG *pHeight)
Definition: video.c:483
ULONG WINAPI BaseRendererImpl_Release(IBaseFilter *iface)
Definition: renderer.c:296
#define VFW_E_NOT_PAUSED
Definition: vfwmsgs.h:76
HRESULT WINAPI BaseControlWindowImpl_put_Width(IVideoWindow *iface, LONG Width)
Definition: window.c:453
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
HRESULT WINAPI BaseControlWindowImpl_get_WindowStyle(IVideoWindow *iface, LONG *WindowStyle)
Definition: window.c:308
static HRESULT WINAPI VideoRenderer_GetTargetRect(BaseControlVideo *iface, RECT *pTargetRect)
#define SM_CXSCREEN
Definition: winuser.h:949
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
static const BaseControlVideoFuncTable renderer_BaseControlVideoFuncTable
unsigned char * LPBYTE
Definition: typedefs.h:52
HRESULT WINAPI BaseControlVideoImpl_GetDestinationPosition(IBasicVideo *iface, LONG *pLeft, LONG *pTop, LONG *pWidth, LONG *pHeight)
Definition: video.c:522
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
HRESULT WINAPI BaseRendererImpl_EndFlush(BaseRenderer *iface)
Definition: renderer.c:599
HRESULT WINAPI BaseControlVideoImpl_SetDestinationPosition(IBasicVideo *iface, LONG Left, LONG Top, LONG Width, LONG Height)
Definition: video.c:509
HRESULT WINAPI BaseRendererImpl_FindPin(IBaseFilter *iface, LPCWSTR Id, IPin **ppPin)
Definition: renderer.c:421
HRESULT WINAPI BaseFilterImpl_GetClassID(IBaseFilter *iface, CLSID *pClsid)
Definition: filter.c:77
LONG WINAPI SetWindowLongW(_In_ HWND, _In_ int, _In_ LONG)
HRESULT WINAPI BaseRendererImpl_QueryInterface(IBaseFilter *iface, REFIID riid, LPVOID *ppv)
Definition: renderer.c:280
#define FIXME(fmt,...)
Definition: debug.h:110
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
static PVOID ptr
Definition: dispmode.c:27
static HRESULT WINAPI BasicVideo_QueryInterface(IBasicVideo *iface, REFIID riid, LPVOID *ppvObj)
HRESULT WINAPI BaseControlWindow_Destroy(BaseControlWindow *pControlWindow)
Definition: window.c:223
BaseControlVideo baseControlVideo
Definition: videorenderer.c:47
#define S_FALSE
Definition: winerror.h:2357
HRESULT WINAPI BaseControlWindowImpl_get_AutoShow(IVideoWindow *iface, LONG *AutoShow)
Definition: window.c:353
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
HRESULT WINAPI BaseControlWindowImpl_GetRestorePosition(IVideoWindow *iface, LONG *pLeft, LONG *pTop, LONG *pWidth, LONG *pHeight)
Definition: window.c:713
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:136
static HRESULT WINAPI VideoRenderer_ShouldDrawSampleNow(BaseRenderer *This, IMediaSample *pSample, REFERENCE_TIME *pStartTime, REFERENCE_TIME *pEndTime)
smooth NULL
Definition: ftsmooth.c:416
BITMAPINFOHEADER bmiHeader
Definition: amvideo.idl:189
HRESULT WINAPI BaseControlVideoImpl_SetSourcePosition(IBasicVideo *iface, LONG Left, LONG Top, LONG Width, LONG Height)
Definition: video.c:470
static RECT WINAPI VideoRenderer_GetDefaultRect(BaseWindow *iface)
HRESULT WINAPI BaseControlWindowImpl_get_Visible(IVideoWindow *iface, LONG *pVisible)
Definition: window.c:415
#define SW_SHOW
Definition: winuser.h:769
#define debugstr_guid
Definition: kernel32.h:35
HRESULT WINAPI BaseControlVideoImpl_SetDefaultSourcePosition(IBasicVideo *iface)
Definition: video.c:501
HRESULT WINAPI BaseControlVideoImpl_IsUsingDefaultSource(IBasicVideo *iface)
Definition: video.c:585
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
HRESULT WINAPI BaseControlVideo_Destroy(BaseControlVideo *pControlVideo)
Definition: video.c:51
HRESULT WINAPI BaseControlWindowImpl_put_WindowStyleEx(IVideoWindow *iface, LONG WindowStyleEx)
Definition: window.c:319
static HRESULT WINAPI VideoRenderer_GetSourceRect(BaseControlVideo *iface, RECT *pSourceRect)
HRESULT WINAPI BaseControlWindowImpl_put_Caption(IVideoWindow *iface, BSTR strCaption)
Definition: window.c:266
#define SM_CYSCREEN
Definition: winuser.h:950
static VideoRendererImpl * impl_from_BaseRenderer(BaseRenderer *iface)
Definition: videorenderer.c:73
HRESULT WINAPI BaseFilterImpl_QueryVendorInfo(IBaseFilter *iface, LPWSTR *pVendorInfo)
Definition: filter.c:178
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
static void VideoRenderer_AutoShowWindow(VideoRendererImpl *This)
if(!(yy_init))
Definition: macro.lex.yy.c:714
LONGLONG REFERENCE_TIME
Definition: dmusicks.h:9
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define VFW_E_RUNTIME_ERROR
Definition: vfwmsgs.h:50
HRESULT WINAPI BaseControlWindowImpl_put_BackgroundPalette(IVideoWindow *iface, LONG BackgroundPalette)
Definition: window.c:386
static VideoRendererImpl * impl_from_BaseWindow(BaseWindow *iface)
Definition: videorenderer.c:68
BaseInputPin * pInputPin
Definition: strmbase.h:582
LONG HRESULT
Definition: typedefs.h:77
#define RDW_ERASE
Definition: winuser.h:1197
const GUID IID_IUnknown
static BOOL CreateRenderingSubsystem(VideoRendererImpl *This)
#define WINAPI
Definition: msvc.h:6
const char * wine_dbgstr_rect(const RECT *rect)
int WINAPI GetSystemMetrics(_In_ int)
unsigned long DWORD
Definition: ntddk_ex.h:95
static HRESULT WINAPI VideoRenderer_IsDefaultSourceRect(BaseControlVideo *iface)
HRESULT WINAPI BaseWindowImpl_PrepareWindow(BaseWindow *This)
Definition: window.c:100
DWORD biSizeImage
Definition: amvideo.idl:36
HRESULT WINAPI BaseControlWindowImpl_GetMaxIdealImageSize(IVideoWindow *iface, LONG *pWidth, LONG *pHeight)
Definition: window.c:699
HRESULT WINAPI BaseControlWindowImpl_get_Width(IVideoWindow *iface, LONG *pWidth)
Definition: window.c:467
static HRESULT WINAPI VideoRenderer_IsDefaultTargetRect(BaseControlVideo *iface)
HRESULT WINAPI BaseControlWindowImpl_GetTypeInfo(IVideoWindow *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: window.c:236
static VideoRendererImpl * impl_from_IBasicVideo(IBasicVideo *iface)
Definition: videorenderer.c:93
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
HRESULT WINAPI BaseControlVideoImpl_SetDefaultDestinationPosition(IBasicVideo *iface)
Definition: video.c:540
HRESULT WINAPI BaseControlWindowImpl_put_Owner(IVideoWindow *iface, OAHWND Owner)
Definition: window.c:530
HRESULT WINAPI BaseControlWindowImpl_get_BorderColor(IVideoWindow *iface, LONG *Color)
Definition: window.c:584
static ULONG WINAPI VideoWindow_Release(IVideoWindow *iface)
HRESULT WINAPI BaseControlWindowImpl_SetWindowForeground(IVideoWindow *iface, LONG Focus)
Definition: window.c:615
static VideoRendererImpl * impl_from_BaseControlVideo(BaseControlVideo *iface)
Definition: videorenderer.c:88
HRESULT WINAPI BaseControlWindowImpl_get_WindowState(IVideoWindow *iface, LONG *WindowState)
Definition: window.c:373
static __inline const char * debugstr_an(const char *s, int n)
Definition: compat.h:47
LPVOID lpParameter
Definition: kernel32.h:241
BITMAPINFOHEADER bmiHeader
Definition: dvdmedia.h:41
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
HRESULT WINAPI BaseControlVideoImpl_GetVideoSize(IBasicVideo *iface, LONG *pWidth, LONG *pHeight)
Definition: video.c:548
HRESULT WINAPI BaseControlWindow_Init(BaseControlWindow *pControlWindow, const IVideoWindowVtbl *lpVtbl, BaseFilter *owner, CRITICAL_SECTION *lock, BasePin *pPin, const BaseWindowFuncTable *pFuncsTable)
Definition: window.c:204
CRITICAL_SECTION csFilter
Definition: strmbase.h:165
unsigned char BYTE
Definition: mem.h:68
static HRESULT WINAPI VideoRenderer_DoRenderSample(BaseRenderer *iface, IMediaSample *pSample)
HRESULT WINAPI BaseRendererImpl_Run(IBaseFilter *iface, REFERENCE_TIME tStart)
Definition: renderer.c:461
CRITICAL_SECTION csRenderLock
Definition: strmbase.h:584
HRESULT WINAPI BaseFilterImpl_EnumPins(IBaseFilter *iface, IEnumPins **ppEnum)
Definition: filter.c:135
static HRESULT WINAPI VideoRenderer_Pause(IBaseFilter *iface)
BaseFilter filter
Definition: strmbase.h:580
uint32_t DWORD_PTR
Definition: typedefs.h:63
struct VideoRendererImpl VideoRendererImpl
HRESULT WINAPI BaseControlWindowImpl_get_Owner(IVideoWindow *iface, OAHWND *Owner)
Definition: window.c:551
HRESULT WINAPI BaseControlVideoImpl_get_VideoWidth(IBasicVideo *iface, LONG *pVideoWidth)
Definition: video.c:171
static DWORD VideoRenderer_SendSampleData(VideoRendererImpl *This, LPBYTE data, DWORD size)
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
static HRESULT WINAPI VideoRenderer_GetStaticImage(BaseControlVideo *iface, LONG *pBufferSize, LONG *pDIBImage)
HRESULT WINAPI BaseControlWindowImpl_get_Height(IVideoWindow *iface, LONG *pHeight)
Definition: window.c:519
static ULONG WINAPI VideoRenderer_Release(IBaseFilter *iface)
HRESULT WINAPI BaseControlVideoImpl_get_VideoHeight(IBasicVideo *iface, LONG *pVideoHeight)
Definition: video.c:186
#define ERR(fmt,...)
Definition: debug.h:109
#define GWL_STYLE
Definition: winuser.h:846
HRESULT WINAPI BaseRendererImpl_Stop(IBaseFilter *iface)
Definition: renderer.c:440
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HRESULT WINAPI BaseControlWindowImpl_get_WindowStyleEx(IVideoWindow *iface, LONG *WindowStyleEx)
Definition: window.c:331
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
#define S_OK
Definition: intsafe.h:59
HRESULT WINAPI BaseControlWindowImpl_get_MessageDrain(IVideoWindow *iface, OAHWND *Drain)
Definition: window.c:573
HRESULT WINAPI BaseControlVideoImpl_put_SourceLeft(IBasicVideo *iface, LONG SourceLeft)
Definition: video.c:201
static HRESULT WINAPI VideoRenderer_SetSourceRect(BaseControlVideo *iface, RECT *pSourceRect)
HRESULT WINAPI BaseControlWindowImpl_get_Top(IVideoWindow *iface, LONG *pTop)
Definition: window.c:492
static ULONG WINAPI VideoRenderer_AddRef(IBaseFilter *iface)
static BOOL WINAPI VideoRenderer_OnSize(BaseWindow *iface, LONG Width, LONG Height)
static ULONG WINAPI VideoRendererInner_Release(IUnknown *iface)
BaseRenderer renderer
Definition: videorenderer.c:45
BaseControlWindow baseControlWindow
Definition: videorenderer.c:46
HRESULT WINAPI BaseFilterImpl_QueryFilterInfo(IBaseFilter *iface, FILTER_INFO *pInfo)
Definition: filter.c:145
#define WS_POPUP
Definition: pedump.c:616
static VideoRendererImpl * impl_from_IBaseFilter(IBaseFilter *iface)
Definition: videorenderer.c:78
static HRESULT WINAPI VideoRenderer_SetDefaultSourceRect(BaseControlVideo *iface)
#define SWP_SHOWWINDOW
Definition: winuser.h:1233
#define SWP_DEFERERASE
Definition: winuser.h:1237
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
ULONG WINAPI BaseFilterImpl_AddRef(IBaseFilter *iface)
Definition: filter.c:54
HRESULT WINAPI BaseControlVideoImpl_get_SourceTop(IBasicVideo *iface, LONG *pSourceTop)
Definition: video.c:288
BOOL WINAPI DECLSPEC_HOTPATCH ResetEvent(IN HANDLE hEvent)
Definition: synch.c:714
HRESULT WINAPI BaseControlWindowImpl_put_Visible(IVideoWindow *iface, LONG Visible)
Definition: window.c:404
HRESULT WINAPI BaseFilterImpl_GetSyncSource(IBaseFilter *iface, IReferenceClock **ppClock)
Definition: filter.c:119
HRESULT WINAPI BaseControlVideoImpl_get_SourceWidth(IBasicVideo *iface, LONG *pSourceWidth)
Definition: video.c:254
HRESULT VideoRenderer_create(IUnknown *pUnkOuter, void **ppv)
static HRESULT WINAPI AMFilterMiscFlags_QueryInterface(IAMFilterMiscFlags *iface, REFIID riid, void **ppv)
static HRESULT WINAPI VideoWindow_QueryInterface(IVideoWindow *iface, REFIID riid, LPVOID *ppvObj)
#define E_UNEXPECTED
Definition: winerror.h:2456
static LPWSTR WINAPI VideoRenderer_GetClassWindowStyles(BaseWindow *This, DWORD *pClassStyles, DWORD *pWindowStyles, DWORD *pWindowStylesEx)
#define msg(x)
Definition: auth_time.c:54
HRESULT WINAPI BaseControlWindowImpl_put_Height(IVideoWindow *iface, LONG Height)
Definition: window.c:505
HRESULT WINAPI BaseControlWindowImpl_put_WindowStyle(IVideoWindow *iface, LONG WindowStyle)
Definition: window.c:289
BOOL WINAPI CopyRect(_Out_ LPRECT, _In_ LPCRECT)
static VOID WINAPI VideoRenderer_OnStopStreaming(BaseRenderer *iface)
HRESULT WINAPI BaseFilterImpl_JoinFilterGraph(IBaseFilter *iface, IFilterGraph *pGraph, LPCWSTR pName)
Definition: filter.c:159
unsigned int ULONG
Definition: retypes.h:1
HRESULT WINAPI BaseControlVideoImpl_put_DestinationLeft(IBasicVideo *iface, LONG DestinationLeft)
Definition: video.c:336
#define SWP_NOMOVE
Definition: winuser.h:1229
HRESULT WINAPI BaseControlVideoImpl_IsUsingDefaultDestination(IBasicVideo *iface)
Definition: video.c:592
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
HRESULT WINAPI BaseControlVideoImpl_put_DestinationWidth(IBasicVideo *iface, LONG DestinationWidth)
Definition: video.c:370
HRESULT WINAPI BaseControlWindowImpl_put_BorderColor(IVideoWindow *iface, LONG Color)
Definition: window.c:593
static HRESULT WINAPI VideoRenderer_CheckMediaType(BaseRenderer *iface, const AM_MEDIA_TYPE *pmt)
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define VFW_E_WRONG_STATE
Definition: vfwmsgs.h:78
static VOID WINAPI VideoRenderer_OnStartStreaming(BaseRenderer *iface)
HRESULT WINAPI BaseControlWindowImpl_SetWindowPosition(IVideoWindow *iface, LONG Left, LONG Top, LONG Width, LONG Height)
Definition: window.c:642
static const IBasicVideoVtbl IBasicVideo_VTable
WCHAR * LPWSTR
Definition: xmlstorage.h:184
BOOL WINAPI BaseControlWindowImpl_PossiblyEatMessage(BaseWindow *This, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: window.c:164
static HRESULT WINAPI VideoRenderer_SetDefaultTargetRect(BaseControlVideo *iface)
#define DIB_RGB_COLORS
Definition: wingdi.h:366
#define E_POINTER
Definition: winerror.h:2365
#define INFINITE
Definition: serial.h:102
Arabic default style
Definition: afstyles.h:93
HRESULT WINAPI BaseControlWindowImpl_put_MessageDrain(IVideoWindow *iface, OAHWND Drain)
Definition: window.c:562
HRESULT WINAPI BaseControlWindowImpl_GetWindowPosition(IVideoWindow *iface, LONG *pLeft, LONG *pTop, LONG *pWidth, LONG *pHeight)
Definition: window.c:657
HRESULT WINAPI BaseControlWindowImpl_put_Left(IVideoWindow *iface, LONG Left)
Definition: window.c:426
HRESULT WINAPI BaseControlVideoImpl_put_SourceTop(IBasicVideo *iface, LONG SourceTop)
Definition: video.c:268
BOOL WINAPI PostThreadMessageW(_In_ DWORD, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static const BaseRendererFuncTable BaseFuncTable
HRESULT VideoRendererDefault_create(IUnknown *pUnkOuter, LPVOID *ppv)
static VideoRendererImpl * impl_from_IVideoWindow(IVideoWindow *iface)
Definition: videorenderer.c:83
const GUID IID_IPin
Definition: pincontrol.cpp:15
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:404
HRESULT WINAPI BaseControlVideoImpl_put_DestinationTop(IBasicVideo *iface, LONG DestinationTop)
Definition: video.c:403
HRESULT WINAPI BaseControlWindowImpl_put_Top(IVideoWindow *iface, LONG Top)
Definition: window.c:478
#define SRCCOPY
Definition: wingdi.h:332
static HRESULT WINAPI VideoRenderer_EndFlush(BaseRenderer *iface)
HRESULT WINAPI BaseControlVideoImpl_GetVideoPaletteEntries(IBasicVideo *iface, LONG StartIndex, LONG Entries, LONG *pRetrieved, LONG *pPalette)
Definition: video.c:564
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
IAMFilterMiscFlags IAMFilterMiscFlags_iface
Definition: videorenderer.c:50
HRESULT WINAPI BaseControlVideoImpl_get_BitRate(IBasicVideo *iface, LONG *pBitRate)
Definition: video.c:137
#define SUCCEEDED(hr)
Definition: intsafe.h:57
#define RDW_INVALIDATE
Definition: winuser.h:1200
HRESULT WINAPI BaseControlVideoImpl_get_SourceHeight(IBasicVideo *iface, LONG *pSourceHeight)
Definition: video.c:321
static VIDEOINFOHEADER *WINAPI VideoRenderer_GetVideoFormat(BaseControlVideo *iface)
HRESULT WINAPI BaseControlWindowImpl_IsCursorHidden(IVideoWindow *iface, LONG *CursorHidden)
Definition: window.c:731
static ULONG WINAPI BasicVideo_Release(IBasicVideo *iface)