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.

137 lines
3.4 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. wavestrm.h
  5. Abstract:
  6. Declaration of the CWaveMSPStream
  7. Author:
  8. Zoltan Szilagyi September 7th, 1998
  9. --*/
  10. #ifndef __WAVESTRM_H_
  11. #define __WAVESTRM_H_
  12. #if _MSC_VER >= 1000
  13. #pragma once
  14. #endif // _MSC_VER >= 1000
  15. /////////////////////////////////////////////////////////////////////////////
  16. // CWaveMSPStream
  17. /////////////////////////////////////////////////////////////////////////////
  18. class CWaveMSPStream : public CMSPStream, public CMSPObjectSafetyImpl
  19. {
  20. public:
  21. // DECLARE_POLY_AGGREGATABLE(CWaveMSP)
  22. // To add extra interfaces to this class, use the following:
  23. BEGIN_COM_MAP(CWaveMSPStream)
  24. COM_INTERFACE_ENTRY( IObjectSafety )
  25. COM_INTERFACE_ENTRY_CHAIN(CMSPStream)
  26. END_COM_MAP()
  27. public:
  28. //
  29. // Construction and destruction.
  30. //
  31. CWaveMSPStream();
  32. virtual ~CWaveMSPStream();
  33. virtual void FinalRelease();
  34. //
  35. // Required base class overrides.
  36. //
  37. STDMETHOD (get_Name) (
  38. OUT BSTR * ppName
  39. );
  40. //
  41. // We override these methods to implement our terminal handling.
  42. // This consists of only allowing one terminal on the stream at a time
  43. // and adding our filters and the terminal to the graph at the right
  44. // times.
  45. //
  46. STDMETHOD (SelectTerminal) (
  47. IN ITTerminal * pTerminal
  48. );
  49. STDMETHOD (UnselectTerminal) (
  50. IN ITTerminal * pTerminal
  51. );
  52. STDMETHOD (StartStream) ();
  53. STDMETHOD (PauseStream) ();
  54. STDMETHOD (StopStream) ();
  55. //
  56. // Overrides for event handling.
  57. //
  58. virtual HRESULT ProcessGraphEvent(
  59. IN long lEventCode,
  60. IN LONG_PTR lParam1,
  61. IN LONG_PTR lParam2
  62. );
  63. //
  64. // Public methods specific to our implementation.
  65. //
  66. virtual HRESULT SetWaveID(GUID *PermanentGuid);
  67. virtual HRESULT FireEvent(IN MSP_CALL_EVENT type,
  68. IN HRESULT hrError,
  69. IN MSP_CALL_EVENT_CAUSE cause);
  70. protected:
  71. //
  72. // Protected data members.
  73. //
  74. BOOL m_fHaveWaveID;
  75. BOOL m_fTerminalConnected;
  76. IBaseFilter * m_pFilter;
  77. IBaseFilter * m_pG711Filter;
  78. FILTER_STATE m_DesiredGraphState;
  79. private:
  80. //
  81. // Private helper methods.
  82. //
  83. HRESULT ConnectTerminal(ITTerminal * pTerminal);
  84. HRESULT ConnectToTerminalPin(IPin * pTerminalPin);
  85. HRESULT TryToConnect(IPin * pOutputPin, IPin * pInputPin);
  86. void CreateAndAddG711(void);
  87. HRESULT FindPinInFilter(
  88. BOOL bWantOutputPin, // IN: if false, we want the input pin
  89. IBaseFilter * pFilter, // IN: the filter to examine
  90. IPin ** ppPin // OUT: the pin we found
  91. );
  92. HRESULT FindPin(
  93. IPin ** ppPin
  94. );
  95. HRESULT DecideDesiredCaptureBufferSize(IUnknown * pUnknown,
  96. long * plDesiredSize);
  97. HRESULT SetupWaveIn( IPin * pOutputPin,
  98. IPin * pInputPin );
  99. HRESULT ExamineWaveInProperties(IPin *pPin);
  100. HRESULT ManipulateAllocatorProperties(IAMBufferNegotiation * pNegotiation,
  101. IMemInputPin * pMemInputPin);
  102. };
  103. #endif //__WAVEADDR_H_