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.

194 lines
5.1 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. bgbase.h
  5. Abstract:
  6. Definitions of the base classes of the bridge filters.
  7. Author:
  8. Mu Han (muhan) 11/12/1998
  9. --*/
  10. #ifndef _BGBASE_H_
  11. #define _BGBASE_H_
  12. class CTAPIBridgeSinkInputPin;
  13. class CTAPIBridgeSourceOutputPin;
  14. class CTAPIBridgeSinkFilter;
  15. class CTAPIBridgeSourceFilter;
  16. class CTAPIBridgeSinkInputPin :
  17. public CBaseInputPin
  18. {
  19. public:
  20. DECLARE_IUNKNOWN
  21. CTAPIBridgeSinkInputPin(
  22. IN CTAPIBridgeSinkFilter *pFilter,
  23. IN CCritSec *pLock,
  24. OUT HRESULT *phr
  25. );
  26. // override CBaseInputPin methods.
  27. STDMETHOD (GetAllocatorRequirements)(OUT ALLOCATOR_PROPERTIES *pProperties);
  28. STDMETHOD (ReceiveCanBlock) () { return S_FALSE; }
  29. STDMETHOD (Receive) (IN IMediaSample *pSample);
  30. // CBasePin stuff
  31. HRESULT GetMediaType(IN int iPosition, IN CMediaType *pMediaType);
  32. HRESULT CheckMediaType(IN const CMediaType *pMediatype);
  33. };
  34. // the interface to pass dat from the sink filter to the source filter.
  35. interface DECLSPEC_UUID("afb2050e-1ecf-4a97-8753-54e78b6c7bc4") DECLSPEC_NOVTABLE
  36. IDataBridge : public IUnknown
  37. {
  38. STDMETHOD (SendSample) (
  39. IN IMediaSample *pSample
  40. ) PURE;
  41. };
  42. struct DECLSPEC_UUID("8cdf1491-b5ab-49fb-b51f-eda6043d11be") TAPIBridgeSinkFilter;
  43. class DECLSPEC_NOVTABLE CTAPIBridgeSinkFilter :
  44. public CBaseFilter
  45. {
  46. public:
  47. DECLARE_IUNKNOWN
  48. CTAPIBridgeSinkFilter(
  49. IN LPUNKNOWN pUnk,
  50. IN IDataBridge * pIDataBridge,
  51. OUT HRESULT * phr
  52. );
  53. ~CTAPIBridgeSinkFilter();
  54. // Pin enumeration functions.
  55. CBasePin * GetPin(int n);
  56. int GetPinCount();
  57. // methods called by the input pin.
  58. virtual HRESULT GetMediaType(IN int iPosition, IN CMediaType *pMediaType) PURE;
  59. virtual HRESULT CheckMediaType(IN const CMediaType *pMediatype) PURE;
  60. virtual HRESULT ProcessSample(IN IMediaSample *pSample);
  61. protected:
  62. // The lock for the filter and the pin.
  63. CCritSec m_Lock;
  64. // The filter's input pin.
  65. CTAPIBridgeSinkInputPin * m_pInputPin;
  66. IDataBridge * m_pIDataBridge;
  67. };
  68. class CTAPIBridgeSourceOutputPin :
  69. public CBaseOutputPin,
  70. public IAMBufferNegotiation,
  71. public IAMStreamConfig
  72. {
  73. public:
  74. DECLARE_IUNKNOWN
  75. CTAPIBridgeSourceOutputPin(
  76. IN CTAPIBridgeSourceFilter *pFilter,
  77. IN CCritSec *pLock,
  78. OUT HRESULT *phr
  79. );
  80. ~CTAPIBridgeSourceOutputPin ();
  81. STDMETHOD (NonDelegatingQueryInterface) (
  82. IN REFIID riid,
  83. OUT PVOID* ppv
  84. );
  85. // CBasePin stuff
  86. HRESULT GetMediaType(IN int iPosition, IN CMediaType *pMediaType);
  87. HRESULT CheckMediaType(IN const CMediaType *pMediaType);
  88. // CBaseOutputPin stuff
  89. HRESULT DecideBufferSize(
  90. IMemAllocator * pAlloc,
  91. ALLOCATOR_PROPERTIES * ppropInputRequest
  92. );
  93. // IAMBufferNegotiation stuff
  94. STDMETHOD (SuggestAllocatorProperties) (IN const ALLOCATOR_PROPERTIES *pprop);
  95. STDMETHOD (GetAllocatorProperties) (OUT ALLOCATOR_PROPERTIES *pprop);
  96. // IAMStreamConfig stuff
  97. STDMETHOD (SetFormat) (IN AM_MEDIA_TYPE *pmt);
  98. STDMETHOD (GetFormat) (OUT AM_MEDIA_TYPE **ppmt);
  99. STDMETHOD (GetNumberOfCapabilities) (OUT int *piCount, OUT int *piSize);
  100. STDMETHOD (GetStreamCaps) (IN int iIndex, OUT AM_MEDIA_TYPE **ppmt, BYTE *pSCC);
  101. };
  102. struct DECLSPEC_UUID("9a712df9-50d0-4ca3-842e-6dc3d3b4b5a8") TAPIBridgeSourceFilter;
  103. class DECLSPEC_NOVTABLE CTAPIBridgeSourceFilter :
  104. public CBaseFilter,
  105. public IDataBridge
  106. {
  107. public:
  108. DECLARE_IUNKNOWN
  109. CTAPIBridgeSourceFilter(
  110. IN LPUNKNOWN pUnk,
  111. OUT HRESULT *phr
  112. );
  113. ~CTAPIBridgeSourceFilter();
  114. STDMETHOD (NonDelegatingQueryInterface) (
  115. IN REFIID riid,
  116. OUT PVOID* ppv
  117. );
  118. // Pin enumeration functions.
  119. CBasePin * GetPin(int n);
  120. int GetPinCount();
  121. // Overrides CBaseFilter methods.
  122. STDMETHOD (GetState) (DWORD dwMSecs, FILTER_STATE *State);
  123. // methods called by the output pins.
  124. virtual HRESULT GetMediaType(IN int iPosition, IN CMediaType *pMediaType);
  125. virtual HRESULT CheckMediaType(IN const CMediaType *pMediatype);
  126. // method for IDataBridge
  127. STDMETHOD (SendSample) (
  128. IN IMediaSample *pSample
  129. );
  130. // audio related methods are moved into CTAPIAudioBridgeSourceFilter
  131. // IAMBufferNegotiation stuff
  132. STDMETHOD (SuggestAllocatorProperties) (IN const ALLOCATOR_PROPERTIES *pprop) {return E_NOTIMPL;};
  133. STDMETHOD (GetAllocatorProperties) (OUT ALLOCATOR_PROPERTIES *pprop) {return E_NOTIMPL;};
  134. // IAMStreamConfig stuff
  135. STDMETHOD (SetFormat) (IN AM_MEDIA_TYPE *pmt) {return E_NOTIMPL;};
  136. STDMETHOD (GetFormat) (OUT AM_MEDIA_TYPE **ppmt) {return E_NOTIMPL;};
  137. protected:
  138. // The lock for the filter and the pin.
  139. CCritSec m_Lock;
  140. // The filter's output pin.
  141. CTAPIBridgeSourceOutputPin * m_pOutputPin;
  142. };
  143. #endif