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.

328 lines
9.5 KiB

  1. // ImageSync.idl : IDL source for ImageSync.dll
  2. //
  3. // This file will be processed by the MIDL tool to
  4. // produce the type library (ImageSync.tlb) and marshalling code.
  5. //=====================================================================
  6. //=====================================================================
  7. // time information
  8. //
  9. // This represents a time (either reference or stream) in 100ns units
  10. // The class library contains a CRefTime helper class
  11. // that supports simple comparison and arithmetic operations
  12. //=====================================================================
  13. //=====================================================================
  14. cpp_quote("#ifdef DSHOW_INDEPENDENT")
  15. // Win32 HANDLEs have to be cast to these as the MIDL compiler doesn't
  16. // like the HANDLE type or in fact anything remotely associated with
  17. // them. If this ever gets ported to a MAC environment then these will
  18. // have to become an alertable synchronisation object that it supports
  19. //typedef DWORD_PTR HSEMAPHORE;
  20. //typedef DWORD_PTR HEVENT;
  21. typedef unsigned long HSEMAPHORE;
  22. typedef unsigned long HEVENT;
  23. typedef __int64 REFERENCE_TIME;
  24. typedef double REFTIME;
  25. cpp_quote("#endif")
  26. cpp_quote("#if 0")
  27. // This is temporary hack to get around the fact thatI don't know how to persuade
  28. // MIDL to allow forward declarations.
  29. typedef DWORD* LPDIRECTDRAW7;
  30. typedef DWORD* LPDIRECTDRAWSURFACE7;
  31. cpp_quote ("#endif")
  32. cpp_quote("#include <ddraw.h>")
  33. import "oaidl.idl";
  34. import "ocidl.idl";
  35. //=====================================================================
  36. //=====================================================================
  37. //
  38. // DDraw information
  39. //
  40. //=====================================================================
  41. //=====================================================================
  42. cpp_quote("//")
  43. cpp_quote("// The following declarations within the 'if 0' block are dummy")
  44. cpp_quote("// typedef's used to make the ImageSync.idl build under midl.")
  45. cpp_quote("// The actual definitions are contained in ddraw.h.")
  46. cpp_quote("//")
  47. cpp_quote("#if 0")
  48. typedef IUnknown* IReferenceClock;
  49. cpp_quote("#endif")
  50. cpp_quote("#include <ddraw.h>")
  51. cpp_quote("#ifdef DSHOW_INDEPENDENT")
  52. //=====================================================================
  53. //=====================================================================
  54. //
  55. // QualityControl information
  56. //
  57. //=====================================================================
  58. //=====================================================================
  59. typedef enum tagQualityMessageType {
  60. Famine,
  61. Flood
  62. } QualityMessageType;
  63. typedef struct tagQuality {
  64. QualityMessageType Type;
  65. // milli-units. 1000 = no change
  66. // for Flood:
  67. // What proportion of the media samples currently
  68. // coming through are required in the future.
  69. // 800 means please drop another 20%
  70. // For Famine:
  71. // How much to "keep in" e.g. 800 means send me
  72. // 20% less e.g. by dropping 20% of the samples.
  73. // 1100 would mean "I'm coping, send me more".
  74. long Proportion;
  75. // How much you need to catch up by
  76. REFERENCE_TIME Late;
  77. // The stream time when this was generated (probably
  78. // corresponds to the start time on some sample).
  79. REFERENCE_TIME TimeStamp;
  80. } Quality;
  81. //=====================================================================
  82. //=====================================================================
  83. //
  84. // IQualProp
  85. //
  86. //=====================================================================
  87. //=====================================================================
  88. [
  89. object,
  90. uuid(1bd0ecb0-f8e2-11ce-aac6-0020af0b99a3),
  91. helpstring("IQualProp Interface"),
  92. pointer_default(unique)
  93. ]
  94. interface IQualProp : IUnknown
  95. {
  96. HRESULT get_FramesDroppedInRenderer(
  97. [out] int *cFramesDropped
  98. );
  99. HRESULT get_FramesDrawn(
  100. [out] int *pcFramesDrawn
  101. );
  102. HRESULT get_AvgFrameRate(
  103. [out] int *piAvgFrameRate
  104. );
  105. HRESULT get_Jitter(
  106. [out] int *piJitter
  107. );
  108. HRESULT get_AvgSyncOffset(
  109. [out] int *piAvg
  110. );
  111. HRESULT get_DevSyncOffset(
  112. [out] int *piDev
  113. );
  114. };
  115. cpp_quote("#endif")
  116. //=====================================================================
  117. //=====================================================================
  118. //
  119. // IVMRImagePresenter
  120. //
  121. //=====================================================================
  122. //=====================================================================
  123. [
  124. object,
  125. uuid(CE704FE7-E71E-41fb-BAA2-C4403E1182F5),
  126. helpstring("IVMRImagePresenter Interface"),
  127. pointer_default(unique)
  128. ]
  129. interface IVMRImagePresenter : IUnknown
  130. {
  131. HRESULT StartPresenting();
  132. HRESULT StopPresenting();
  133. HRESULT PresentImage(
  134. [in] LPDIRECTDRAWSURFACE7 lpSurf,
  135. [in] DWORD dwFlags
  136. );
  137. };
  138. //=====================================================================
  139. //=====================================================================
  140. //
  141. // IImageSyncStepComplete
  142. //
  143. //=====================================================================
  144. //=====================================================================
  145. [
  146. object,
  147. uuid(1DBCA562-5C92-474a-A276-382079164970),
  148. helpstring("IImageSyncStepComplete Interface"),
  149. pointer_default(unique)
  150. ]
  151. interface IImageSyncStepComplete : IUnknown
  152. {
  153. HRESULT StepComplete(
  154. [in] BOOL fCancelled
  155. );
  156. };
  157. typedef enum {
  158. ImageSync_State_Stopped,
  159. ImageSync_State_Cued,
  160. ImageSync_State_Playing
  161. } ImageSequenceState;
  162. //=====================================================================
  163. //=====================================================================
  164. //
  165. // IImageSyncControl
  166. //
  167. //=====================================================================
  168. //=====================================================================
  169. [
  170. object,
  171. uuid(A67F6A0D-883B-44ce-AA93-87BA3017E19C),
  172. helpstring("IImageSyncControl Interface"),
  173. pointer_default(unique)
  174. ]
  175. interface IImageSyncControl : IUnknown
  176. {
  177. // ============================================================
  178. // Synchronisation control
  179. // ============================================================
  180. HRESULT SetImagePresenter(
  181. [in] IVMRImagePresenter* lpImagePresenter
  182. );
  183. HRESULT SetReferenceClock(
  184. [in] IReferenceClock* lpRefClock
  185. );
  186. // ============================================================
  187. // Image sequence control
  188. // ============================================================
  189. HRESULT CueImageSequence(
  190. );
  191. HRESULT BeginImageSequence(
  192. [in] REFERENCE_TIME* baseTime
  193. );
  194. HRESULT EndImageSequence(
  195. );
  196. HRESULT GetImageSequenceState(
  197. [in] DWORD dwMSecsTimeOut,
  198. [out] DWORD* lpdwState
  199. );
  200. // ============================================================
  201. // Frame stepping
  202. // ============================================================
  203. HRESULT FrameStep(
  204. [in] IImageSyncStepComplete* lpStepComplete,
  205. [in] DWORD nFramesToStep,
  206. [in] DWORD dwStepFlags
  207. );
  208. HRESULT CancelFrameStep(
  209. );
  210. };
  211. typedef enum {
  212. ImageSync_Sample_SyncPoint = 0x00000001,
  213. ImageSync_Sample_Preroll = 0x00000002,
  214. ImageSync_Sample_Discontinuity = 0x00000004,
  215. ImageSync_Sample_TimeValid = 0x00000008,
  216. ImageSync_Sample_DontPresent = 0x00000010
  217. } SampleFlags;
  218. //=====================================================================
  219. //=====================================================================
  220. //
  221. // IImageSync
  222. //
  223. //=====================================================================
  224. //=====================================================================
  225. [
  226. object,
  227. uuid(56a86897-0ad4-11ce-b03a-0020af0ba770),
  228. helpstring("IImageSync Interface"),
  229. pointer_default(unique)
  230. ]
  231. interface IImageSync : IUnknown
  232. {
  233. // return the buffer to the renderer along with time stamps relating to
  234. // when the buffer should be presented.
  235. HRESULT Receive(
  236. [in] REFERENCE_TIME startTime, // sample start time
  237. [in] REFERENCE_TIME endTime, // sample end time
  238. [in] DWORD_PTR lpSurf, // sample
  239. [in] DWORD dwSampleFlags // flags relating to the sample
  240. );
  241. // ask for quality control information from the renderer
  242. HRESULT GetQualityControlMessage(
  243. [out] Quality* pQualityMsg // where your cookie goes
  244. );
  245. };
  246. //=====================================================================
  247. //=====================================================================
  248. //
  249. // ImageSynchronization Class
  250. //
  251. //=====================================================================
  252. //=====================================================================
  253. [
  254. uuid(A4A309B1-F733-4646-A127-C95F98CB144B),
  255. version(1.0),
  256. helpstring("ImageSynchronization 1.0 Type Library")
  257. ]
  258. library IMAGESYNCHRONIZATIONlib
  259. {
  260. importlib("stdole2.tlb");
  261. [
  262. uuid(7D8AA343-6E63-4663-BE90-6B80F66540A3),
  263. helpstring("ImageSynchronization Class")
  264. ]
  265. coclass ImageSynchronization
  266. {
  267. [default] interface IImageSyncControl;
  268. };
  269. };