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.

100 lines
2.5 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. bgaudio.h
  5. Abstract:
  6. Definitions for the audio bridge filters
  7. Author:
  8. Mu Han (muhan) 11/12/1998
  9. --*/
  10. #ifndef _BGAUDIO_H_
  11. #define _BGAUDIO_H_
  12. class CTAPIAudioBridgeSinkFilter :
  13. public CTAPIBridgeSinkFilter
  14. {
  15. public:
  16. CTAPIAudioBridgeSinkFilter(
  17. IN LPUNKNOWN pUnk,
  18. IN IDataBridge * pIDataBridge,
  19. OUT HRESULT * phr
  20. );
  21. static HRESULT CreateInstance(
  22. IN IDataBridge * pIDataBridge,
  23. OUT IBaseFilter ** ppIBaseFilter
  24. );
  25. // methods called by the input pin.
  26. HRESULT GetMediaType(IN int iPosition, IN CMediaType *pMediaType);
  27. HRESULT CheckMediaType(IN const CMediaType *pMediatype);
  28. };
  29. class CTAPIAudioBridgeSourceFilter :
  30. public CTAPIBridgeSourceFilter
  31. {
  32. public:
  33. CTAPIAudioBridgeSourceFilter(
  34. IN LPUNKNOWN pUnk,
  35. OUT HRESULT *phr
  36. );
  37. ~CTAPIAudioBridgeSourceFilter ();
  38. static HRESULT CreateInstance(
  39. OUT IBaseFilter ** ppIBaseFilter
  40. );
  41. // override the IDataBridge methods.
  42. STDMETHOD (SendSample) (
  43. IN IMediaSample *pSample
  44. );
  45. // methods called by the output pin.
  46. HRESULT GetMediaType(IN int iPosition, IN CMediaType *pMediaType);
  47. HRESULT CheckMediaType(IN const CMediaType *pMediatype);
  48. // overrides the base filter
  49. // IAMBufferNegotiation stuff
  50. STDMETHOD (SuggestAllocatorProperties) (IN const ALLOCATOR_PROPERTIES *pprop);
  51. STDMETHOD (GetAllocatorProperties) (OUT ALLOCATOR_PROPERTIES *pprop);
  52. // IAMStreamConfig stuff
  53. STDMETHOD (SetFormat) (IN AM_MEDIA_TYPE *pmt);
  54. STDMETHOD (GetFormat) (OUT AM_MEDIA_TYPE **ppmt);
  55. protected:
  56. // following members were moved from CTAPIBridgeSourceOutputPin
  57. // because they are only need in audio part; we implement a derived filter class
  58. // for audio; same pin is shared by both audio and video
  59. ALLOCATOR_PROPERTIES m_prop;
  60. BOOL m_fPropSet;
  61. AM_MEDIA_TYPE m_mt;
  62. BOOL m_fMtSet;
  63. BOOL m_fClockStarted;
  64. BOOL m_fJustBurst;
  65. REFERENCE_TIME m_last_wall_time;
  66. REFERENCE_TIME m_last_stream_time;
  67. // assume output sample won't change size
  68. REFERENCE_TIME m_output_sample_time;
  69. // algorithm of SendSample can only deal with samples with fixed size
  70. LONG m_nInputSize, m_nOutputSize, m_nOutputFree;
  71. IMediaSample *m_pOutputSample;
  72. };
  73. #endif