Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

256 lines
10 KiB

  1. /*
  2. Copyright (c) 1998-1999 Microsoft Corporation
  3. */
  4. // tmvidrnd.h: Definition of the CVideoRenderTerminalE class
  5. //
  6. //////////////////////////////////////////////////////////////////////
  7. #if !defined(AFX_VIDEOOUTT_H__D1691429_B6CA_11D0_82A4_00AA00B5CA1B__INCLUDED_)
  8. #define AFX_VIDEOOUTT_H__D1691429_B6CA_11D0_82A4_00AA00B5CA1B__INCLUDED_
  9. #if _MSC_VER >= 1000
  10. #pragma once
  11. #endif // _MSC_VER >= 1000
  12. #include "resource.h" // main symbols
  13. //
  14. // The CLSID that's used to create us.
  15. //
  16. EXTERN_C const CLSID CLSID_VideoWindowTerminal_PRIVATE;
  17. #ifdef INSTANTIATE_GUIDS_NOW
  18. // {AED6483E-3304-11d2-86F1-006008B0E5D2}
  19. const CLSID CLSID_VideoWindowTerminal_PRIVATE =
  20. { 0xaed6483e, 0x3304, 0x11d2, { 0x86, 0xf1, 0x0, 0x60, 0x8, 0xb0, 0xe5, 0xd2 } };
  21. #endif // INSTANTIATE_GUIDS_NOW
  22. typedef struct
  23. {
  24. OUT IBaseFilter ** ppBaseFilter;
  25. OUT HRESULT hr;
  26. } CREATE_VIDEO_RENDER_FILTER_CONTEXT;
  27. DWORD WINAPI WorkItemProcCreateVideoRenderFilter(LPVOID pVoid);
  28. /////////////////////////////////////////////////////////////////////////////
  29. // CVideoRenderTerminal
  30. //
  31. class CVideoRenderTerminal :
  32. public CComCoClass<CVideoRenderTerminal, &CLSID_VideoWindowTerminal_PRIVATE>,
  33. public CComDualImpl<IBasicVideo, &IID_IBasicVideo, &LIBID_QuartzTypeLib>,
  34. public CComDualImpl<IVideoWindow, &IID_IVideoWindow, &LIBID_QuartzTypeLib>,
  35. public IDrawVideoImage,
  36. public ITPluggableTerminalInitialization,
  37. public CSingleFilterTerminal,
  38. public CMSPObjectSafetyImpl
  39. {
  40. public:
  41. CVideoRenderTerminal()
  42. :m_bThreadStarted(FALSE)
  43. {
  44. LOG((MSP_TRACE, "CVideoRenderTerminal::CVideoRenderTerminal - enter"));
  45. m_lAutoShowCache = 0; // window invisible by default
  46. m_TerminalType = TT_DYNAMIC; // this is a dynamic terminal
  47. LOG((MSP_TRACE, "CVideoRenderTerminal::CVideoRenderTerminal - finish"));
  48. }
  49. ~CVideoRenderTerminal();
  50. // ITPluggableTerminalInitialization
  51. STDMETHOD(InitializeDynamic) (
  52. IN IID iidTerminalClass,
  53. IN DWORD dwMediaType,
  54. IN TERMINAL_DIRECTION Direction,
  55. IN MSP_HANDLE htAddress
  56. );
  57. HRESULT FindTerminalPin(void);
  58. BEGIN_COM_MAP(CVideoRenderTerminal)
  59. COM_INTERFACE_ENTRY(ITPluggableTerminalInitialization)
  60. COM_INTERFACE_ENTRY(IBasicVideo)
  61. COM_INTERFACE_ENTRY(IVideoWindow)
  62. COM_INTERFACE_ENTRY(IObjectSafety)
  63. COM_INTERFACE_ENTRY(IDrawVideoImage)
  64. COM_INTERFACE_ENTRY_CHAIN(CSingleFilterTerminal)
  65. END_COM_MAP()
  66. DECLARE_DEBUG_ADDREF_RELEASE(CVideoRenderTerminal)
  67. DECLARE_REGISTRY_RESOURCEID(IDR_VideoRenderTerminal)
  68. // ITBasicVideo
  69. public:
  70. STDMETHOD(IsUsingDefaultDestination) (void);
  71. STDMETHOD(IsUsingDefaultSource) (void);
  72. STDMETHOD(GetCurrentImage) ( long *plBufferSize,
  73. long *pDIBImage);
  74. STDMETHOD(GetVideoPaletteEntries) ( long lStartIndex,
  75. long lcEntries,
  76. long *plcRetrieved,
  77. long *plPalette);
  78. STDMETHOD(GetVideoSize) ( long *plWidth,
  79. long *plHeight);
  80. STDMETHOD(SetDefaultDestinationPosition)(void);
  81. STDMETHOD(GetDestinationPosition) ( long *plLeft,
  82. long *plTop,
  83. long *plWidth,
  84. long *plHeight);
  85. STDMETHOD(SetDestinationPosition) ( long lLeft,
  86. long lTop,
  87. long lWidth,
  88. long lHeight);
  89. STDMETHOD(SetDefaultSourcePosition) (void);
  90. STDMETHOD(GetSourcePosition) ( long *plLeft,
  91. long *plTop,
  92. long *plWidth,
  93. long *plHeight);
  94. STDMETHOD(SetSourcePosition) ( long lLeft,
  95. long lTop,
  96. long lWidth,
  97. long lHeight);
  98. STDMETHOD(get_DestinationHeight) (OUT long *pVal);
  99. STDMETHOD(put_DestinationHeight) (IN long newVal);
  100. STDMETHOD(get_DestinationTop) (OUT long *pVal);
  101. STDMETHOD(put_DestinationTop) (IN long newVal);
  102. STDMETHOD(get_DestinationWidth) (OUT long *pVal);
  103. STDMETHOD(put_DestinationWidth) (IN long newVal);
  104. STDMETHOD(get_DestinationLeft) (OUT long *pVal);
  105. STDMETHOD(put_DestinationLeft) (IN long newVal);
  106. STDMETHOD(get_SourceHeight) (OUT long *pVal);
  107. STDMETHOD(put_SourceHeight) (IN long newVal);
  108. STDMETHOD(get_SourceTop) (OUT long *pVal);
  109. STDMETHOD(put_SourceTop) (IN long newVal);
  110. STDMETHOD(get_SourceWidth) (OUT long *pVal);
  111. STDMETHOD(put_SourceWidth) (IN long newVal);
  112. STDMETHOD(get_SourceLeft) (OUT long *pVal);
  113. STDMETHOD(put_SourceLeft) (IN long newVal);
  114. STDMETHOD(get_VideoHeight) (OUT long *pVal);
  115. STDMETHOD(get_VideoWidth) (OUT long *pVal);
  116. STDMETHOD(get_BitErrorRate) (OUT long *pVal);
  117. STDMETHOD(get_BitRate) (OUT long *pVal);
  118. STDMETHOD(get_AvgTimePerFrame) (OUT REFTIME *pVal);
  119. // IVideoWindow methods
  120. public:
  121. STDMETHOD(put_Caption) (THIS_ BSTR strCaption);
  122. STDMETHOD(get_Caption) (THIS_ BSTR FAR* strCaption);
  123. STDMETHOD(put_WindowStyle) (THIS_ long WindowStyle);
  124. STDMETHOD(get_WindowStyle) (THIS_ long FAR* WindowStyle);
  125. STDMETHOD(put_WindowStyleEx) (THIS_ long WindowStyleEx);
  126. STDMETHOD(get_WindowStyleEx) (THIS_ long FAR* WindowStyleEx);
  127. STDMETHOD(put_AutoShow) (THIS_ long AutoShow);
  128. STDMETHOD(get_AutoShow) (THIS_ long FAR* AutoShow);
  129. STDMETHOD(put_WindowState) (THIS_ long WindowState);
  130. STDMETHOD(get_WindowState) (THIS_ long FAR* WindowState);
  131. STDMETHOD(put_BackgroundPalette)(THIS_ long BackgroundPalette);
  132. STDMETHOD(get_BackgroundPalette)(THIS_ long FAR* pBackgroundPalette);
  133. STDMETHOD(put_Visible) (THIS_ long Visible);
  134. STDMETHOD(get_Visible) (THIS_ long FAR* pVisible);
  135. STDMETHOD(put_Left) (THIS_ long Left);
  136. STDMETHOD(get_Left) (THIS_ long FAR* pLeft);
  137. STDMETHOD(put_Width) (THIS_ long Width);
  138. STDMETHOD(get_Width) (THIS_ long FAR* pWidth);
  139. STDMETHOD(put_Top) (THIS_ long Top);
  140. STDMETHOD(get_Top) (THIS_ long FAR* pTop);
  141. STDMETHOD(put_Height) (THIS_ long Height);
  142. STDMETHOD(get_Height) (THIS_ long FAR* pHeight);
  143. STDMETHOD(put_Owner) (THIS_ OAHWND Owner);
  144. STDMETHOD(get_Owner) (THIS_ OAHWND FAR* Owner);
  145. STDMETHOD(put_MessageDrain) (THIS_ OAHWND Drain);
  146. STDMETHOD(get_MessageDrain) (THIS_ OAHWND FAR* Drain);
  147. STDMETHOD(get_BorderColor) (THIS_ long FAR* Color);
  148. STDMETHOD(put_BorderColor) (THIS_ long Color);
  149. STDMETHOD(get_FullScreenMode) (THIS_ long FAR* FullScreenMode);
  150. STDMETHOD(put_FullScreenMode) (THIS_ long FullScreenMode);
  151. STDMETHOD(SetWindowForeground) (THIS_ long Focus);
  152. STDMETHOD(NotifyOwnerMessage) (THIS_ OAHWND hwnd,
  153. long uMsg,
  154. LONG_PTR wParam,
  155. LONG_PTR lParam);
  156. STDMETHOD(SetWindowPosition) (THIS_ long Left,
  157. long Top,
  158. long Width,
  159. long Height);
  160. STDMETHOD(GetWindowPosition) (THIS_ long FAR* pLeft,
  161. long FAR* pTop,
  162. long FAR* pWidth,
  163. long FAR* pHeight);
  164. STDMETHOD(GetMinIdealImageSize) (THIS_ long FAR* pWidth,
  165. long FAR* pHeight);
  166. STDMETHOD(GetMaxIdealImageSize) (THIS_ long FAR* pWidth,
  167. long FAR* pHeight);
  168. STDMETHOD(GetRestorePosition) (THIS_ long FAR* pLeft,
  169. long FAR* pTop,
  170. long FAR* pWidth,
  171. long FAR* pHeight);
  172. STDMETHOD(HideCursor) (THIS_ long HideCursor);
  173. STDMETHOD(IsCursorHidden) (THIS_ long FAR* CursorHidden);
  174. // IDrawVideoImage
  175. public:
  176. STDMETHOD(DrawVideoImageBegin)(void);
  177. STDMETHOD(DrawVideoImageEnd) (void);
  178. STDMETHOD(DrawVideoImageDraw) (IN HDC hdc,
  179. IN LPRECT lprcSrc,
  180. IN LPRECT lprcDst);
  181. // Implementation
  182. private:
  183. //
  184. // Data members
  185. //
  186. CComPtr<IBasicVideo> m_pIBasicVideo;
  187. CComPtr<IVideoWindow> m_pIVideoWindow;
  188. CComPtr<IDrawVideoImage> m_pIDrawVideoImage;
  189. long m_lAutoShowCache;
  190. BOOL m_bThreadStarted;
  191. public:
  192. //
  193. // Methods
  194. //
  195. // CBaseTerminal required overrides
  196. STDMETHODIMP CompleteConnectTerminal(void);
  197. virtual HRESULT AddFiltersToGraph(void);
  198. virtual DWORD GetSupportedMediaTypes(void)
  199. {
  200. return (DWORD) TAPIMEDIATYPE_VIDEO;
  201. }
  202. };
  203. #endif // !defined(AFX_VIDEOOUTT_H__D1691429_B6CA_11D0_82A4_00AA00B5CA1B__INCLUDED_)