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.

112 lines
2.5 KiB

  1. //
  2. // FPPin.h
  3. //
  4. #include "FPFilter.h"
  5. typedef enum
  6. {
  7. PS_NOSTREAMING =0,
  8. PS_STREAMING
  9. } PIN_STREAMING_STATE;
  10. //
  11. // CFPPin implements the output pin
  12. //
  13. class CFPPin :
  14. public CSourceStream,
  15. public IAMStreamConfig,
  16. public IAMBufferNegotiation
  17. {
  18. public:
  19. // --- Constructor / Destructor ---
  20. CFPPin(
  21. CFPFilter* pFilter,
  22. HRESULT* phr,
  23. LPCWSTR pPinName
  24. );
  25. ~CFPPin();
  26. public:
  27. // --- IUnknown ---
  28. DECLARE_IUNKNOWN;
  29. STDMETHODIMP NonDelegatingQueryInterface(
  30. REFIID riid,
  31. void** ppv
  32. );
  33. public:
  34. // --- CSourceStream pure methods ---
  35. // initialize play timing data
  36. HRESULT OnThreadStartPlay();
  37. // stuff an audio buffer with the current format
  38. HRESULT FillBuffer(
  39. IN IMediaSample *pms
  40. );
  41. // ask for buffers of the size appropriate to the agreed media type.
  42. HRESULT DecideBufferSize(
  43. IN IMemAllocator *pIMemAlloc,
  44. OUT ALLOCATOR_PROPERTIES *pProperties
  45. );
  46. // --- CSourceStream virtual methods ---
  47. HRESULT GetMediaType(
  48. OUT CMediaType *pmt
  49. );
  50. // verify we can handle this format
  51. HRESULT CheckMediaType(
  52. IN const CMediaType *pMediaType
  53. );
  54. HRESULT SetMediaType(
  55. IN const CMediaType *pMediaType
  56. );
  57. // --- IAMStreamConfig ---
  58. STDMETHODIMP SetFormat(
  59. AM_MEDIA_TYPE* pmt
  60. );
  61. STDMETHODIMP GetFormat(
  62. AM_MEDIA_TYPE** ppmt
  63. );
  64. STDMETHODIMP GetNumberOfCapabilities(
  65. int* piCount,
  66. int* piSize
  67. );
  68. STDMETHODIMP GetStreamCaps(
  69. int i,
  70. AM_MEDIA_TYPE** ppmt,
  71. LPBYTE pSCC
  72. );
  73. // --- IAMBufferNegotiation methods ---
  74. STDMETHODIMP SuggestAllocatorProperties(
  75. const ALLOCATOR_PROPERTIES* pprop
  76. );
  77. STDMETHODIMP GetAllocatorProperties(
  78. ALLOCATOR_PROPERTIES* pprop
  79. );
  80. // CSourceStream methods
  81. virtual HRESULT Deliver(
  82. IN IMediaSample* pSample
  83. );
  84. private:
  85. // --- Members ---
  86. CFPFilter* m_pFPFilter; // back reference to the filter
  87. BOOL m_bFinished; // If we need to send finished message
  88. CMSPCritSection m_Lock; // Critical section
  89. };
  90. // eof