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.

82 lines
2.8 KiB

  1. // File: ichnlvid.h
  2. #ifndef _ICHNLVID_H_
  3. #define _ICHNLVID_H_
  4. // we have no notification on the channel "callback" that the state changed
  5. // to determine if a/v is active we need to get both the video and the audio channel
  6. class CNmChannelVideo : public INmChannelVideo,
  7. public DllRefCount, public CConnectionPointContainer
  8. {
  9. private:
  10. int m_cMembers;
  11. BOOL m_fIncoming;
  12. static CNmChannelVideo * m_pPreviewChannel;
  13. FRAMECONTEXT m_FrameContext;
  14. IMediaChannel *m_pMediaChannel;
  15. ICommChannel* m_pCommChannel;
  16. CVideoPump m_VideoPump;
  17. MEDIA_FORMAT_ID m_MediaFormat;
  18. BOOL IsCaptureAvailable() { return m_VideoPump.IsCaptureAvailable(); }
  19. public:
  20. CNmChannelVideo(BOOL fIncoming);
  21. ~CNmChannelVideo();
  22. static CNmChannelVideo * CreatePreviewChannel();
  23. static CNmChannelVideo * CreateChannel(BOOL fIncoming);
  24. VOID OnConnected(IH323Endpoint * pConnection, ICommChannel *pIChannel)
  25. { m_VideoPump.OnConnected(pConnection, pIChannel); }
  26. VOID OnDisconnected() { m_VideoPump.OnDisconnected(); }
  27. VOID CommChannelOpened(ICommChannel *pCommChannel);
  28. VOID CommChannelActive(ICommChannel *pCommChannel);
  29. VOID CommChannelError(DWORD dwStatus) { m_VideoPump.OnChannelError(); }
  30. VOID CommChannelRemotePaused(BOOL fPause) { OnStateChange(); }
  31. VOID CommChannelClosed();
  32. ICommChannel * GetCommChannel() { return m_pCommChannel; }
  33. ICommChannel * GetPreviewCommChannel() { return m_VideoPump.GetCommChannel();}
  34. VOID SetFormat(MEDIA_FORMAT_ID id) { m_MediaFormat = id;}
  35. BOOL IsSendEnabled() { return m_VideoPump.IsSendEnabled(); }
  36. BOOL IsPreviewEnabled() { return m_VideoPump.IsPreviewEnabled(); }
  37. VOID OnMemberAdded(CNmMember *pMember);
  38. VOID OnMemberRemoved(CNmMember *pMember);
  39. VOID OnMemberUpdated(CNmMember *pMember);
  40. IMediaChannel *GetMediaChannelInterface(void)
  41. { if (m_pMediaChannel) m_pMediaChannel->AddRef(); return m_pMediaChannel;}
  42. VOID OnStateChange();
  43. VOID OnFrameAvailable();
  44. VOID Open();
  45. VOID Close();
  46. // IUnknown
  47. STDMETHODIMP_(ULONG) AddRef(void);
  48. STDMETHODIMP_(ULONG) Release(void);
  49. STDMETHODIMP QueryInterface(REFIID riid, PVOID *ppvObj);
  50. // INmChannel
  51. STDMETHODIMP IsSameAs(INmChannel *pChannel);
  52. STDMETHODIMP IsActive();
  53. STDMETHODIMP SetActive(BOOL fActive);
  54. STDMETHODIMP GetConference(INmConference **ppConference);
  55. STDMETHODIMP GetInterface(IID *piid);
  56. STDMETHODIMP GetNmch(ULONG *puCh);
  57. STDMETHODIMP EnumMember(IEnumNmMember **ppEnum);
  58. STDMETHODIMP GetMemberCount(ULONG * puCount);
  59. // INmChannelVideo
  60. STDMETHODIMP IsIncoming(void);
  61. STDMETHODIMP GetState(NM_VIDEO_STATE *puState);
  62. STDMETHODIMP GetProperty(NM_VIDPROP uID, ULONG_PTR *puValue);
  63. STDMETHODIMP SetProperty(NM_VIDPROP uID, ULONG_PTR uValue);
  64. static VOID __stdcall FrameReadyCallback(DWORD_PTR dwMyThis);
  65. };
  66. #endif // _ICHNLVID_H_
  67.