Source code of Windows XP (NT5)
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.

171 lines
4.5 KiB

  1. /****************************************************************************
  2. *
  3. * FILE: VidView.h
  4. *
  5. * CREATED: Chris Pirich (ChrisPi) 12-16-96
  6. *
  7. ****************************************************************************/
  8. #ifndef _VIDVIEW_H_
  9. #define _VIDVIEW_H_
  10. #include <ih323cc.h>
  11. #include "GenWindow.h"
  12. #include "SDKInternal.h"
  13. typedef HANDLE HDRAWDIB; /* hdd */
  14. class CVideoWindow;
  15. interface IVideoChange : public IUnknown
  16. {
  17. virtual void StateChange(CVideoWindow *pVideo, NM_VIDEO_STATE uState) = 0;
  18. } ;
  19. class CVideoWindow : public CGenWindow, public INmChannelVideoNotify
  20. {
  21. public:
  22. static VOID SetMirror(BOOL bMirror);
  23. static BOOL GetMirror() {return g_fMirror != FALSE;}
  24. enum VideoType
  25. {
  26. REMOTE,
  27. LOCAL
  28. } ;
  29. CVideoWindow(VideoType eType, BOOL bEmbedded);
  30. ~CVideoWindow();
  31. BOOL Create(HWND hwndOwner, HPALETTE hPal, IVideoChange *pNotify=NULL);
  32. BOOL IsXferAllowed();
  33. BOOL IsAutoXferEnabled();
  34. BOOL IsXferEnabled();
  35. BOOL IsPaused();
  36. BOOL IsConnected();
  37. HRESULT GetVideoState(NM_VIDEO_STATE* puState);
  38. BOOL CanCopy();
  39. BOOL HasDialog(DWORD dwDialog);
  40. DWORD GetFrameSize() { return(m_dwFrameSize); }
  41. DWORD GetFrameSizes();
  42. DWORD GetImageQuality() { return(m_dwImageQuality); }
  43. DWORD GetNumCapDev();
  44. DWORD GetMaxCapDevNameLen();
  45. DWORD GetCurrCapDevID();
  46. VOID SetCurrCapDevID(DWORD dwID);
  47. HRESULT SetImageQuality(DWORD dwQuality);
  48. HRESULT SetCameraDialog(ULONG ul);
  49. HRESULT GetCameraDialog(ULONG* pul);
  50. VOID SetFrameSize(DWORD dwSize);
  51. VOID SetZoom(UINT nZoom);
  52. VOID EnableAutoXfer(BOOL fEnable);
  53. VOID ShowDialog(DWORD dwDialog);
  54. VOID SaveSettings();
  55. VOID Pause(BOOL fPause);
  56. VOID RefreshWindow() { OnFrameAvailable(); }
  57. VOID ResizeWindowsToFrameSize();
  58. VOID EnumCapDev(DWORD *pdwCapDevIDs, LPTSTR pszCapDevNames, DWORD dwNumCapDev);
  59. VOID OnPaletteChanged(void);
  60. VOID OnMinimize(BOOL fMinimize) { /* Should this pause the video? */ }
  61. HRESULT OnChannelChanged(NM_CHANNEL_NOTIFY uNotify, INmChannel *pChannel);
  62. VOID ForwardSysChangeMsg(UINT uMsg, WPARAM wParam, LPARAM lParam);
  63. void UpdateVideoMenu(HMENU hMenu);
  64. void OnCommand(int idCmd);
  65. void SetZoomable(BOOL bZoomable) { m_fZoomable = (bZoomable!=FALSE); }
  66. BOOL IsZoomable() { return(m_fZoomable != FALSE); }
  67. // IUnknown
  68. STDMETHODIMP_(ULONG) AddRef(void) { return(CGenWindow::AddRef()); }
  69. STDMETHODIMP_(ULONG) Release(void) { return(CGenWindow::Release()); }
  70. STDMETHODIMP QueryInterface(REFIID riid, PVOID *ppvObj);
  71. // INmChannelVideoNotify
  72. STDMETHODIMP NmUI(CONFN uNotify);
  73. STDMETHODIMP MemberChanged(NM_MEMBER_NOTIFY uNotify, INmMember *pMember);
  74. STDMETHODIMP StateChanged(NM_VIDEO_STATE uState);
  75. STDMETHODIMP PropertyChanged(DWORD dwReserved);
  76. // IGenWindow
  77. virtual VOID GetDesiredSize(SIZE *ppt);
  78. static BOOL FDidNotDisplayIntelLogo();
  79. static VOID DisplayIntelLogo( BOOL bDisplay );
  80. protected:
  81. virtual LRESULT ProcessMessage(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
  82. private:
  83. // Array keeping track of all video windows, so they can be invalidated
  84. // when the state changes (like mirroring)
  85. static CSimpleArray<CVideoWindow *> *g_pVideos;
  86. // Specifies whether we are mirroring the local video.
  87. static BOOL g_fMirror;
  88. // Specifies whether we have done one-time local video init stuff
  89. static BOOL g_bLocalOneTimeInited;
  90. static VOID InvalidateAll();
  91. INmChannelVideo* m_pActiveChannel;
  92. DWORD m_dwCookie;
  93. DWORD m_dwImageQuality;
  94. UINT m_nXferOnConnect;
  95. DWORD m_dwFrameSize;
  96. SIZE m_sizeVideo;
  97. HDRAWDIB m_hdd;
  98. HPALETTE m_hPal;
  99. UINT m_zoom;
  100. IVideoChange *m_pNotify;
  101. BOOL m_fLocal : 1;
  102. // CMainUI uses this to disallow zoom on the PiP window
  103. BOOL m_fZoomable : 1;
  104. // Use this to make sure the embedded window does not display CIF
  105. BOOL m_bEmbedded : 1;
  106. VOID SetVideoSize(LPSIZE lpsize);
  107. UINT GetZoom() { return(m_zoom); }
  108. BOOL ShouldMirror() { return(IsLocal() && GetMirror()); }
  109. VOID OnFrameAvailable(void);
  110. VOID PaintDib(HDC hdc, FRAMECONTEXT *pFrame);
  111. VOID PaintLogo(HDC hdc, UINT idbLargeLogo, UINT idbSmallLogo);
  112. VOID OnPaint();
  113. VOID OnNCDestroy();
  114. void OnContextMenu(HWND hwnd, HWND hwndContext, UINT xPos, UINT yPos);
  115. BOOL CopyToClipboard();
  116. HRESULT GetFrame(FRAMECONTEXT *pFrameContext);
  117. HRESULT ReleaseFrame(FRAMECONTEXT *pFrameContext);
  118. BOOL InitMirroring(RECT &rcVideo);
  119. VOID UnInitMirroring();
  120. HBITMAP m_hBitmapMirror;
  121. SIZE m_sizeBitmapMirror;
  122. HDC m_hDCMirror;
  123. HGDIOBJ m_hGDIObj;
  124. BOOL IsLocal() { return m_fLocal; }
  125. };
  126. #endif // _VIDVIEW_H_