Source code of Windows XP (NT5)
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.

116 lines
3.8 KiB

  1. #ifndef __OUTPIN_H__
  2. #define __OUTPIN_H__
  3. #include "filter.h"
  4. // Almost nothing to override
  5. class CWrapperOutputPin : public CBaseOutputPin,
  6. public IAMStreamConfig,
  7. public IAMVideoCompression
  8. {
  9. friend class CMediaWrapperFilter; // stuff at the bottom is owned by the filter
  10. public:
  11. DECLARE_IUNKNOWN
  12. CWrapperOutputPin(CMediaWrapperFilter *pFilter,
  13. ULONG Id,
  14. BOOL bOptional,
  15. HRESULT *phr);
  16. ~CWrapperOutputPin();
  17. STDMETHODIMP NonDelegatingQueryInterface(REFGUID riid, void **ppv);
  18. HRESULT DecideBufferSize(
  19. IMemAllocator * pAlloc,
  20. ALLOCATOR_PROPERTIES * ppropInputRequest
  21. );
  22. HRESULT CheckMediaType(const CMediaType *pmt);
  23. HRESULT SetMediaType(const CMediaType *pmt);
  24. HRESULT GetMediaType(int iPosition,CMediaType *pMediaType);
  25. // Override to unset media type
  26. HRESULT BreakConnect();
  27. // override to work around broken wm encoders which need a bitrate to connect, for
  28. // use when connecting directly to the ASF writer filter
  29. STDMETHODIMP Connect(IPin *pReceivePin, const AM_MEDIA_TYPE *pmt);
  30. STDMETHODIMP Notify(IBaseFilter * pSender, Quality q);
  31. // IAMStreamConfig methods
  32. STDMETHODIMP SetFormat(AM_MEDIA_TYPE *pmt);
  33. STDMETHODIMP GetFormat(AM_MEDIA_TYPE **ppmt);
  34. STDMETHODIMP GetNumberOfCapabilities(int *piCount, int *piSize);
  35. STDMETHODIMP GetStreamCaps(int i, AM_MEDIA_TYPE **ppmt, LPBYTE pSCC);
  36. // IAMVideoCompression methods
  37. STDMETHODIMP put_KeyFrameRate(long KeyFrameRate);
  38. STDMETHODIMP get_KeyFrameRate(long FAR* pKeyFrameRate);
  39. STDMETHODIMP put_PFramesPerKeyFrame(long PFramesPerKeyFrame)
  40. {return E_NOTIMPL;};
  41. STDMETHODIMP get_PFramesPerKeyFrame(long FAR* pPFramesPerKeyFrame)
  42. {return E_NOTIMPL;};
  43. STDMETHODIMP put_Quality(double Quality);
  44. STDMETHODIMP get_Quality(double FAR* pQuality);
  45. STDMETHODIMP put_WindowSize(DWORDLONG WindowSize);
  46. STDMETHODIMP get_WindowSize(DWORDLONG FAR* pWindowSize);
  47. STDMETHODIMP OverrideKeyFrame(long FrameNumber);
  48. STDMETHODIMP OverrideFrameSize(long FrameNumber, long Size);
  49. STDMETHODIMP GetInfo(LPWSTR pstrVersion,
  50. int *pcbVersion,
  51. LPWSTR pstrDescription,
  52. int *pcbDescription,
  53. long FAR* pDefaultKeyFrameRate,
  54. long FAR* pDefaultPFramesPerKey,
  55. double FAR* pDefaultQuality,
  56. long FAR* pCapabilities);
  57. protected:
  58. CMediaWrapperFilter *Filter() const
  59. {
  60. return static_cast<CMediaWrapperFilter *>(m_pFilter);
  61. }
  62. ULONG m_Id;
  63. CCritSec m_csStream;
  64. BOOL m_fNoPosPassThru;
  65. CPosPassThru* m_pPosPassThru;
  66. CCritSec m_csPassThru;
  67. // This stuff is owned by the filter and is declared here for allocation convenience
  68. IMediaSample* m_pMediaSample;
  69. CStaticMediaBuffer m_MediaBuffer;
  70. bool m_fStreamNeedsBuffer; // per-output-stream flag local to SuckOutOutput()
  71. bool m_fEOS; // indicates we have already delivered an EOS on this stream
  72. bool m_fNeedsPreviousSample;
  73. bool m_fAllocatorHasOneBuffer;
  74. // Only valid between GetDeliveryBuffer and Deliver for video
  75. bool m_fNeedToRelockSurface;
  76. // Set when OutputSetType is called
  77. bool m_fVideo;
  78. // IAMStreamConfig helpers
  79. bool IsAudioEncoder();
  80. bool IsVideoEncoder();
  81. bool IsInputConnected();
  82. // used for dmo encoders that natively support these interfaces
  83. bool m_bUseIAMStreamConfigOnDMO;
  84. bool m_bUseIAMVideoCompressionOnDMO;
  85. HRESULT SetCompressionParamUsingIPropBag(const WCHAR * wszParam, const LONG lValue);
  86. // compression params for IAMVideoCompression, move to struct eventually
  87. long m_lKeyFrameRate;
  88. long m_lQuality;
  89. AM_MEDIA_TYPE *m_pmtFromSetFormat;
  90. };
  91. #endif //__OUTPIN_H__