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.

130 lines
3.9 KiB

  1. // Copyright (c) 1997 - 1998 Microsoft Corporation. All Rights Reserved.
  2. // MSS.h : Declaration of the CAMMediaTypeStream
  3. #ifndef __MSS_H_
  4. #define __MSS_H_
  5. #include "resource.h" // main symbols
  6. class CAMMediaTypeSample;
  7. /////////////////////////////////////////////////////////////////////////////
  8. // CDDStream
  9. class ATL_NO_VTABLE CAMMediaTypeStream :
  10. public CComCoClass<CAMMediaTypeStream, &CLSID_AMMediaTypeStream>,
  11. public CStream,
  12. public IAMMediaTypeStream
  13. {
  14. friend CAMMediaTypeSample;
  15. public:
  16. //
  17. // METHODS
  18. //
  19. CAMMediaTypeStream();
  20. //
  21. // IMediaStream
  22. //
  23. // HACK HACK - the first 2 are duplicates but it won't link
  24. // without
  25. STDMETHODIMP GetMultiMediaStream(
  26. /* [out] */ IMultiMediaStream **ppMultiMediaStream)
  27. {
  28. return CStream::GetMultiMediaStream(ppMultiMediaStream);
  29. }
  30. STDMETHODIMP GetInformation(
  31. /* [optional][out] */ MSPID *pPurposeId,
  32. /* [optional][out] */ STREAM_TYPE *pType)
  33. {
  34. return CStream::GetInformation(pPurposeId, pType);
  35. }
  36. STDMETHODIMP SetSameFormat(IMediaStream *pStream, DWORD dwFlags);
  37. STDMETHODIMP AllocateSample(
  38. /* [in] */ DWORD dwFlags,
  39. /* [out] */ IStreamSample **ppSample);
  40. STDMETHODIMP CreateSharedSample(
  41. /* [in] */ IStreamSample *pExistingSample,
  42. /* [in] */ DWORD dwFlags,
  43. /* [out] */ IStreamSample **ppNewSample);
  44. STDMETHODIMP SendEndOfStream(DWORD dwFlags)
  45. {
  46. return CStream::SendEndOfStream(dwFlags);
  47. }
  48. //
  49. // IAMMediaTypeStream
  50. //
  51. STDMETHODIMP GetFormat(
  52. /* [out] */ AM_MEDIA_TYPE __RPC_FAR *pMediaType,
  53. /* [in] */ DWORD dwFlags);
  54. STDMETHODIMP SetFormat(
  55. /* [in] */ AM_MEDIA_TYPE __RPC_FAR *pMediaType,
  56. /* [in] */ DWORD dwFlags);
  57. STDMETHODIMP CreateSample(
  58. /* [in] */ long lSampleSize,
  59. /* [optional][in] */ BYTE __RPC_FAR *pbBuffer,
  60. /* [in] */ DWORD dwFlags,
  61. /* [optional][in] */ IUnknown *pUnkOuter,
  62. /* [out] */ IAMMediaTypeSample __RPC_FAR *__RPC_FAR *ppAMMediaTypeSample);
  63. STDMETHODIMP GetStreamAllocatorRequirements(
  64. /* [out] */ ALLOCATOR_PROPERTIES __RPC_FAR *pProps);
  65. STDMETHODIMP SetStreamAllocatorRequirements(
  66. /* [in] */ ALLOCATOR_PROPERTIES __RPC_FAR *pProps);
  67. //
  68. // IPin
  69. //
  70. STDMETHODIMP ReceiveConnection(IPin * pConnector, const AM_MEDIA_TYPE *pmt);
  71. STDMETHODIMP QueryAccept(const AM_MEDIA_TYPE *pmt);
  72. //
  73. // IMemInputPin
  74. //
  75. STDMETHODIMP Receive(IMediaSample *pSample);
  76. //
  77. // IMemAllocator
  78. //
  79. STDMETHODIMP SetProperties(ALLOCATOR_PROPERTIES* pRequest, ALLOCATOR_PROPERTIES* pActual);
  80. STDMETHODIMP GetProperties(ALLOCATOR_PROPERTIES* pProps);
  81. STDMETHODIMP GetBuffer(IMediaSample **ppBuffer, REFERENCE_TIME * pStartTime,
  82. REFERENCE_TIME * pEndTime, DWORD dwFlags);
  83. //
  84. // Special CStream methods
  85. //
  86. HRESULT GetMediaType(ULONG Index, AM_MEDIA_TYPE **ppMediaType);
  87. protected:
  88. HRESULT inline AllocMTSampleFromPool(const REFERENCE_TIME *rtStart, CAMMediaTypeSample **ppMTSample)
  89. {
  90. CSample *pSample;
  91. HRESULT hr = AllocSampleFromPool(rtStart, &pSample);
  92. *ppMTSample = (CAMMediaTypeSample *)pSample;
  93. return hr;
  94. }
  95. public:
  96. DECLARE_REGISTRY_RESOURCEID(IDR_MTSTREAM)
  97. BEGIN_COM_MAP(CAMMediaTypeStream)
  98. COM_INTERFACE_ENTRY(IAMMediaTypeStream)
  99. COM_INTERFACE_ENTRY_CHAIN(CStream)
  100. END_COM_MAP()
  101. protected:
  102. AM_MEDIA_TYPE m_MediaType;
  103. ALLOCATOR_PROPERTIES m_AllocatorProperties;
  104. };
  105. #endif // __MSS_H_