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.

189 lines
4.8 KiB

  1. //------------------------------------------------------------------------------
  2. // File: MMStream.idl
  3. //
  4. // Desc: MultiMedia streaming interface IDL file.
  5. //
  6. // Copyright (c) 1998 - 2000, Microsoft Corporation. All rights reserved.
  7. //------------------------------------------------------------------------------
  8. import "unknwn.idl";
  9. cpp_quote("#define MS_ERROR_CODE(x) MAKE_HRESULT(1, FACILITY_ITF, (x) + 0x400)")
  10. cpp_quote("#define MS_SUCCESS_CODE(x) MAKE_HRESULT(0, FACILITY_ITF, x)")
  11. cpp_quote("#define MS_S_PENDING MS_SUCCESS_CODE(1)")
  12. cpp_quote("#define MS_S_NOUPDATE MS_SUCCESS_CODE(2)")
  13. cpp_quote("#define MS_S_ENDOFSTREAM MS_SUCCESS_CODE(3)")
  14. cpp_quote("#define MS_E_SAMPLEALLOC MS_ERROR_CODE(1)")
  15. cpp_quote("#define MS_E_PURPOSEID MS_ERROR_CODE(2)")
  16. cpp_quote("#define MS_E_NOSTREAM MS_ERROR_CODE(3)")
  17. cpp_quote("#define MS_E_NOSEEKING MS_ERROR_CODE(4)")
  18. cpp_quote("#define MS_E_INCOMPATIBLE MS_ERROR_CODE(5)")
  19. cpp_quote("#define MS_E_BUSY MS_ERROR_CODE(6)")
  20. cpp_quote("#define MS_E_NOTINIT MS_ERROR_CODE(7)")
  21. cpp_quote("#define MS_E_SOURCEALREADYDEFINED MS_ERROR_CODE(8)")
  22. cpp_quote("#define MS_E_INVALIDSTREAMTYPE MS_ERROR_CODE(9)")
  23. cpp_quote("#define MS_E_NOTRUNNING MS_ERROR_CODE(10)")
  24. cpp_quote("// {A35FF56A-9FDA-11d0-8FDF-00C04FD9189D}")
  25. cpp_quote("DEFINE_GUID(MSPID_PrimaryVideo, ")
  26. cpp_quote("0xa35ff56a, 0x9fda, 0x11d0, 0x8f, 0xdf, 0x0, 0xc0, 0x4f, 0xd9, 0x18, 0x9d);")
  27. cpp_quote("// {A35FF56B-9FDA-11d0-8FDF-00C04FD9189D}")
  28. cpp_quote("DEFINE_GUID(MSPID_PrimaryAudio,")
  29. cpp_quote("0xa35ff56b, 0x9fda, 0x11d0, 0x8f, 0xdf, 0x0, 0xc0, 0x4f, 0xd9, 0x18, 0x9d);")
  30. cpp_quote("#if(_WIN32_WINNT < 0x0400)")
  31. typedef void (__stdcall * PAPCFUNC)(DWORD_PTR dwParam);
  32. cpp_quote("#endif")
  33. typedef LONGLONG STREAM_TIME;
  34. typedef GUID MSPID;
  35. typedef REFGUID REFMSPID;
  36. typedef enum {
  37. STREAMTYPE_READ = 0,
  38. STREAMTYPE_WRITE = 1,
  39. STREAMTYPE_TRANSFORM= 2
  40. } STREAM_TYPE;
  41. typedef enum {
  42. STREAMSTATE_STOP = 0,
  43. STREAMSTATE_RUN = 1
  44. } STREAM_STATE;
  45. typedef enum {
  46. COMPSTAT_NOUPDATEOK = 0x00000001,
  47. COMPSTAT_WAIT = 0x00000002,
  48. COMPSTAT_ABORT = 0x00000004
  49. } COMPLETION_STATUS_FLAGS;
  50. // Flags for GetInformation
  51. enum {
  52. MMSSF_HASCLOCK = 0x00000001,
  53. MMSSF_SUPPORTSEEK = 0x00000002,
  54. MMSSF_ASYNCHRONOUS = 0x00000004
  55. };
  56. // Flags for StreamSample::Update
  57. enum {
  58. SSUPDATE_ASYNC = 0x00000001,
  59. SSUPDATE_CONTINUOUS = 0x00000002
  60. };
  61. interface IMultiMediaStream;
  62. interface IMediaStream;
  63. interface IStreamSample;
  64. // IMultiMediaStream interface
  65. [
  66. object,
  67. local,
  68. uuid(B502D1BC-9A57-11d0-8FDE-00C04FD9189D),
  69. pointer_default(unique)
  70. ]
  71. interface IMultiMediaStream : IUnknown {
  72. HRESULT GetInformation(
  73. [out] DWORD *pdwFlags,
  74. [out] STREAM_TYPE *pStreamType);
  75. HRESULT GetMediaStream(
  76. [in] REFMSPID idPurpose,
  77. [out] IMediaStream **ppMediaStream);
  78. HRESULT EnumMediaStreams(
  79. [in] long Index,
  80. [out] IMediaStream **ppMediaStream);
  81. HRESULT GetState(
  82. [out] STREAM_STATE *pCurrentState);
  83. HRESULT SetState(
  84. [in] STREAM_STATE NewState);
  85. HRESULT GetTime(
  86. [out] STREAM_TIME *pCurrentTime);
  87. HRESULT GetDuration(
  88. [out] STREAM_TIME *pDuration);
  89. HRESULT Seek(
  90. [in] STREAM_TIME SeekTime);
  91. HRESULT GetEndOfStreamEventHandle(
  92. [out] HANDLE *phEOS);
  93. };
  94. // IMediaStream interface
  95. [
  96. object,
  97. uuid(B502D1BD-9A57-11d0-8FDE-00C04FD9189D),
  98. pointer_default(unique)
  99. ]
  100. interface IMediaStream : IUnknown {
  101. HRESULT GetMultiMediaStream(
  102. [out] IMultiMediaStream **ppMultiMediaStream);
  103. HRESULT GetInformation(
  104. [out] MSPID *pPurposeId,
  105. [out] STREAM_TYPE *pType);
  106. HRESULT SetSameFormat(
  107. [in] IMediaStream *pStreamThatHasDesiredFormat,
  108. [in] DWORD dwFlags);
  109. HRESULT AllocateSample(
  110. [in] DWORD dwFlags,
  111. [out] IStreamSample **ppSample);
  112. HRESULT CreateSharedSample(
  113. [in] IStreamSample *pExistingSample,
  114. [in] DWORD dwFlags,
  115. [out] IStreamSample **ppNewSample);
  116. HRESULT SendEndOfStream(DWORD dwFlags);
  117. };
  118. // IStreamSample interface
  119. [
  120. object,
  121. local,
  122. uuid(B502D1BE-9A57-11d0-8FDE-00C04FD9189D),
  123. pointer_default(unique)
  124. ]
  125. interface IStreamSample : IUnknown {
  126. HRESULT GetMediaStream(
  127. [in] IMediaStream **ppMediaStream);
  128. HRESULT GetSampleTimes(
  129. [out] STREAM_TIME * pStartTime,
  130. [out] STREAM_TIME * pEndTime,
  131. [out] STREAM_TIME * pCurrentTime);
  132. HRESULT SetSampleTimes(
  133. [in] const STREAM_TIME *pStartTime,
  134. [in] const STREAM_TIME *pEndTime);
  135. HRESULT Update(
  136. [in] DWORD dwFlags,
  137. [in] HANDLE hEvent,
  138. [in] PAPCFUNC pfnAPC,
  139. [in] DWORD_PTR dwAPCData);
  140. HRESULT CompletionStatus(
  141. [in] DWORD dwFlags,
  142. [in] DWORD dwMilliseconds);
  143. };