mmstream.idl 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. /*
  2. * Copyright 2004 Christian Costa
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2.1 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with this library; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  17. */
  18. import "unknwn.idl";
  19. cpp_quote("#define MS_ERROR_CODE(x) MAKE_HRESULT(1, FACILITY_ITF, (x) + 0x400)")
  20. cpp_quote("#define MS_SUCCESS_CODE(x) MAKE_HRESULT(0, FACILITY_ITF, x)")
  21. cpp_quote("#define MS_S_PENDING MS_SUCCESS_CODE(1)")
  22. cpp_quote("#define MS_S_NOUPDATE MS_SUCCESS_CODE(2)")
  23. cpp_quote("#define MS_S_ENDOFSTREAM MS_SUCCESS_CODE(3)")
  24. cpp_quote("#define MS_E_SAMPLEALLOC MS_ERROR_CODE(1)")
  25. cpp_quote("#define MS_E_PURPOSEID MS_ERROR_CODE(2)")
  26. cpp_quote("#define MS_E_NOSTREAM MS_ERROR_CODE(3)")
  27. cpp_quote("#define MS_E_NOSEEKING MS_ERROR_CODE(4)")
  28. cpp_quote("#define MS_E_INCOMPATIBLE MS_ERROR_CODE(5)")
  29. cpp_quote("#define MS_E_BUSY MS_ERROR_CODE(6)")
  30. cpp_quote("#define MS_E_NOTINIT MS_ERROR_CODE(7)")
  31. cpp_quote("#define MS_E_SOURCEALREADYDEFINED MS_ERROR_CODE(8)")
  32. cpp_quote("#define MS_E_INVALIDSTREAMTYPE MS_ERROR_CODE(9)")
  33. cpp_quote("#define MS_E_NOTRUNNING MS_ERROR_CODE(10)")
  34. cpp_quote("DEFINE_GUID(MSPID_PrimaryVideo, 0xa35ff56a, 0x9fda, 0x11d0, 0x8f, 0xdf, 0x0, 0xc0, 0x4f, 0xd9, 0x18, 0x9d);")
  35. cpp_quote("DEFINE_GUID(MSPID_PrimaryAudio, 0xa35ff56b, 0x9fda, 0x11d0, 0x8f, 0xdf, 0x0, 0xc0, 0x4f, 0xd9, 0x18, 0x9d);")
  36. cpp_quote("#if 0")
  37. typedef void* PAPCFUNC;
  38. cpp_quote("#endif")
  39. typedef LONGLONG STREAM_TIME;
  40. typedef GUID MSPID;
  41. typedef REFGUID REFMSPID;
  42. typedef enum {
  43. STREAMTYPE_READ = 0,
  44. STREAMTYPE_WRITE = 1,
  45. STREAMTYPE_TRANSFORM = 2
  46. } STREAM_TYPE;
  47. typedef enum {
  48. STREAMSTATE_STOP = 0,
  49. STREAMSTATE_RUN = 1
  50. } STREAM_STATE;
  51. typedef enum {
  52. COMPSTAT_NOUPDATEOK = 0x00000001,
  53. COMPSTAT_WAIT = 0x00000002,
  54. COMPSTAT_ABORT = 0x00000004
  55. } COMPLETION_STATUS_FLAGS;
  56. enum {
  57. MMSSF_HASCLOCK = 0x00000001,
  58. MMSSF_SUPPORTSEEK = 0x00000002,
  59. MMSSF_ASYNCHRONOUS = 0x00000004
  60. };
  61. enum {
  62. SSUPDATE_ASYNC = 0x00000001,
  63. SSUPDATE_CONTINUOUS = 0x00000002
  64. };
  65. interface IMultiMediaStream;
  66. interface IMediaStream;
  67. interface IStreamSample;
  68. [
  69. object,
  70. local,
  71. uuid(B502D1BC-9A57-11d0-8FDE-00C04FD9189D),
  72. pointer_default(unique)
  73. ]
  74. interface IMultiMediaStream : IUnknown {
  75. HRESULT GetInformation(
  76. [out, optional] DWORD *pdwFlags,
  77. [out, optional] STREAM_TYPE *pStreamType);
  78. HRESULT GetMediaStream(
  79. [in] REFMSPID idPurpose,
  80. [out] IMediaStream **ppMediaStream);
  81. HRESULT EnumMediaStreams(
  82. [in] long Index,
  83. [out] IMediaStream **ppMediaStream);
  84. HRESULT GetState(
  85. [out] STREAM_STATE *pCurrentState);
  86. HRESULT SetState(
  87. [in] STREAM_STATE NewState);
  88. HRESULT GetTime(
  89. [out] STREAM_TIME *pCurrentTime);
  90. HRESULT GetDuration(
  91. [out] STREAM_TIME *pDuration);
  92. HRESULT Seek(
  93. [in] STREAM_TIME SeekTime);
  94. HRESULT GetEndOfStreamEventHandle(
  95. [out] HANDLE *phEOS);
  96. }
  97. [
  98. object,
  99. uuid(B502D1BD-9A57-11d0-8FDE-00C04FD9189D),
  100. pointer_default(unique)
  101. ]
  102. interface IMediaStream : IUnknown {
  103. HRESULT GetMultiMediaStream(
  104. [out] IMultiMediaStream **ppMultiMediaStream);
  105. HRESULT GetInformation(
  106. [out, optional] MSPID *pPurposeId,
  107. [out, optional] STREAM_TYPE *pType);
  108. HRESULT SetSameFormat(
  109. [in] IMediaStream *pStreamThatHasDesiredFormat,
  110. [in] DWORD dwFlags);
  111. HRESULT AllocateSample(
  112. [in] DWORD dwFlags,
  113. [out] IStreamSample **ppSample);
  114. HRESULT CreateSharedSample(
  115. [in] IStreamSample *pExistingSample,
  116. [in] DWORD dwFlags,
  117. [out] IStreamSample **ppNewSample);
  118. HRESULT SendEndOfStream(DWORD dwFlags);
  119. }
  120. [
  121. object,
  122. local,
  123. uuid(B502D1BE-9A57-11d0-8FDE-00C04FD9189D),
  124. pointer_default(unique)
  125. ]
  126. interface IStreamSample : IUnknown {
  127. HRESULT GetMediaStream(
  128. [in] IMediaStream **ppMediaStream);
  129. HRESULT GetSampleTimes(
  130. [out, optional] STREAM_TIME * pStartTime,
  131. [out, optional] STREAM_TIME * pEndTime,
  132. [out, optional] STREAM_TIME * pCurrentTime);
  133. HRESULT SetSampleTimes(
  134. [in, optional] const STREAM_TIME *pStartTime,
  135. [in, optional] const STREAM_TIME *pEndTime);
  136. HRESULT Update(
  137. [in] DWORD dwFlags,
  138. [in, optional] HANDLE hEvent,
  139. [in, optional] PAPCFUNC pfnAPC,
  140. [in, optional] DWORD dwAPCData);
  141. HRESULT CompletionStatus(
  142. [in] DWORD dwFlags,
  143. [in, optional] DWORD dwMilliseconds);
  144. }