Leaked source code of windows server 2003
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.

416 lines
17 KiB

  1. //------------------------------------------------------------------------------
  2. // File: EvCode.h
  3. //
  4. // Desc: List of standard Quartz event codes and the expected params.
  5. //
  6. // Copyright (c) 1992 - 2000, Microsoft Corporation. All rights reserved.
  7. //------------------------------------------------------------------------------
  8. // Event codes are broken into two groups
  9. // -- system event codes
  10. // -- extension event codes
  11. // All system event codes are below EC_USER
  12. #define EC_SYSTEMBASE 0x00
  13. #define EC_USER 0x8000
  14. // System-defined event codes
  15. // ==========================
  16. //
  17. // There are three types of system-defined event codes:
  18. //
  19. // 1. Those which are always passed through to the application
  20. // (To be collected by calls to GetEvent or within WaitForCompletion.)
  21. // (e.g. EC_ERRORABORT, EC_USERABORT.)
  22. //
  23. // 2. Those which are pure internal and will never be passed to
  24. // the application. (e.g. EC_SHUTDOWN)
  25. //
  26. // 3. Those which have default handling. Default handing implies that
  27. // the event is not passed to the application. However, default
  28. // handling may be canceled by calling
  29. // IMediaEvent::CancelDefaultHandling. If the default handling is
  30. // cancelled in this way, then the message will be delivered to the
  31. // application and the application must action it appropriately.
  32. // Default handling can be restored by calling RestoreDefaultHandling.
  33. //
  34. // We will refer to these events as application, internal and defaulted
  35. // events respectively.
  36. //
  37. // System-defined events may have interface pointers, BSTR's, etc passed
  38. // as parameters. It is therefore essential that, for any message
  39. // retrieved using GetEvent, a matching call to FreeEventParams is made
  40. // to ensure that relevant interfaces are released and storage freed.
  41. // Failure to call FreeEventParams will result in memory leaks, if not
  42. // worse.
  43. //
  44. // Filters sending these messages to the filter graph should not AddRef()
  45. // any interfaces that they may pass as parameters. The filter graph
  46. // manager will AddRef them if required. E.g. if the event is to be queued
  47. // for the application or queued to a worker thread.
  48. // Each event listed below is immediately followed by a parameter list
  49. // detailing the types of the parameters associated with the message,
  50. // and an indication of whether the message is an application, internal
  51. // or defaulted message. This is then followed by a short description.
  52. // The use of "void" in the parameter list implies that the parameter is not
  53. // used. Such parameters should be zero.
  54. // Other defined EC_ regions:
  55. // DVD event codes 0x0100 - 0x0150 (dvdevcod.h)
  56. // audio device event codes 0x0200 - 0x0250 (audevcod.h)
  57. // WindowsMedia SDK-originated events 0x0251 - 0x0300 (see below)
  58. // MSVIDCTL 0x0301 - 0x0325 (msvidctl.idl)
  59. // stream buffer engine (PVR) 0x0326 - 0x0350 (sbe.idl)
  60. #define EC_COMPLETE 0x01
  61. // ( HRESULT, void ) : defaulted (special)
  62. // Signals the completed playback of a stream within the graph. This message
  63. // is sent by renderers when they receive end-of-stream. The default handling
  64. // of this message results in a _SINGLE_ EC_COMPLETE being sent to the
  65. // application when ALL of the individual renderers have signaled EC_COMPLETE
  66. // to the filter graph. If the default handing is canceled, the application
  67. // will see all of the individual EC_COMPLETEs.
  68. #define EC_USERABORT 0x02
  69. // ( void, void ) : application
  70. // In some sense, the user has requested that playback be terminated.
  71. // This message is typically sent by renderers that render into a
  72. // window if the user closes the window into which it was rendering.
  73. // It is up to the application to decide if playback should actually
  74. // be stopped.
  75. #define EC_ERRORABORT 0x03
  76. // ( HRESULT, void ) : application
  77. // Operation aborted because of error
  78. #define EC_TIME 0x04
  79. // ( DWORD, DWORD ) : application
  80. // The requested reference time occurred. (This event is currently not used).
  81. // lParam1 is low dword of ref time, lParam2 is high dword of reftime.
  82. #define EC_REPAINT 0x05
  83. // ( IPin * (could be NULL), void ) : defaulted
  84. // A repaint is required - lParam1 contains the (IPin *) that needs the data
  85. // to be sent again. Default handling is: if the output pin which the IPin is
  86. // attached to supports the IMediaEventSink interface then it will be called
  87. // with the EC_REPAINT first. If that fails then normal repaint processing is
  88. // done by the filter graph.
  89. // Stream error notifications
  90. #define EC_STREAM_ERROR_STOPPED 0x06
  91. #define EC_STREAM_ERROR_STILLPLAYING 0x07
  92. // ( HRESULT, DWORD ) : application
  93. // lParam 1 is major code, lParam2 is minor code, either may be zero.
  94. #define EC_ERROR_STILLPLAYING 0x08
  95. // ( HRESULT, void ) : application
  96. // The filter graph manager may issue Run's to the graph asynchronously.
  97. // If such a Run fails, EC_ERROR_STILLPLAYING is issued to notify the
  98. // application of the failure. The state of the underlying filters
  99. // at such a time will be indeterminate - they will all have been asked
  100. // to run, but some are almost certainly not.
  101. #define EC_PALETTE_CHANGED 0x09
  102. // ( void, void ) : application
  103. // notify application that the video palette has changed
  104. #define EC_VIDEO_SIZE_CHANGED 0x0A
  105. // ( DWORD, void ) : application
  106. // Sent by video renderers.
  107. // Notifies the application that the native video size has changed.
  108. // LOWORD of the DWORD is the new width, HIWORD is the new height.
  109. #define EC_QUALITY_CHANGE 0x0B
  110. // ( void, void ) : application
  111. // Notify application that playback degradation has occurred
  112. #define EC_SHUTTING_DOWN 0x0C
  113. // ( void, void ) : internal
  114. // This message is sent by the filter graph manager to any plug-in
  115. // distributors which support IMediaEventSink to notify them that
  116. // the filter graph is starting to shutdown.
  117. #define EC_CLOCK_CHANGED 0x0D
  118. // ( void, void ) : application
  119. // Notify application that the clock has changed.
  120. // (i.e. SetSyncSource has been called on the filter graph and has been
  121. // distributed successfully to the filters in the graph.)
  122. #define EC_PAUSED 0x0E
  123. // ( HRESULT, void ) : application
  124. // Notify application the previous pause request has completed
  125. #define EC_OPENING_FILE 0x10
  126. #define EC_BUFFERING_DATA 0x11
  127. // ( BOOL, void ) : application
  128. // lParam1 == 1 --> starting to open file or buffer data
  129. // lParam1 == 0 --> not opening or buffering any more
  130. // (This event does not appear to be used by ActiveMovie.)
  131. #define EC_FULLSCREEN_LOST 0x12
  132. // ( void, IBaseFilter * ) : application
  133. // Sent by full screen renderers when switched away from full screen.
  134. // IBaseFilter may be NULL.
  135. #define EC_ACTIVATE 0x13
  136. // ( BOOL, IBaseFilter * ) : internal
  137. // Sent by video renderers when they lose or gain activation.
  138. // lParam1 is set to 1 if gained or 0 if lost
  139. // lParam2 is the IBaseFilter* for the filter that is sending the message
  140. // Used for sound follows focus and full-screen switching
  141. #define EC_NEED_RESTART 0x14
  142. // ( void, void ) : defaulted
  143. // Sent by renderers when they regain a resource (e.g. audio renderer).
  144. // Causes a restart by Pause/put_Current/Run (if running).
  145. #define EC_WINDOW_DESTROYED 0x15
  146. // ( IBaseFilter *, void ) : internal
  147. // Sent by video renderers when the window has been destroyed. Handled
  148. // by the filter graph / distributor telling the resource manager.
  149. // lParam1 is the IBaseFilter* of the filter whose window is being destroyed
  150. #define EC_DISPLAY_CHANGED 0x16
  151. // ( IPin *, void ) : internal
  152. // Sent by renderers when they detect a display change. the filter graph
  153. // will arrange for the graph to be stopped and the pin send in lParam1
  154. // to be reconnected. by being reconnected it allows a renderer to reset
  155. // and connect with a more appropriate format for the new display mode
  156. // lParam1 contains an (IPin *) that should be reconnected by the graph
  157. #define EC_STARVATION 0x17
  158. // ( void, void ) : defaulted
  159. // Sent by a filter when it detects starvation. Default handling (only when
  160. // running) is for the graph to be paused until all filters enter the
  161. // paused state and then run. Normally this would be sent by a parser or source
  162. // filter when too little data is arriving.
  163. #define EC_OLE_EVENT 0x18
  164. // ( BSTR, BSTR ) : application
  165. // Sent by a filter to pass a text string to the application.
  166. // Conventionally, the first string is a type, and the second a parameter.
  167. #define EC_NOTIFY_WINDOW 0x19
  168. // ( HWND, void ) : internal
  169. // Pass the window handle around during pin connection.
  170. #define EC_STREAM_CONTROL_STOPPED 0x1A
  171. // ( IPin * pSender, DWORD dwCookie )
  172. // Notification that an earlier call to IAMStreamControl::StopAt
  173. // has now take effect. Calls to the method can be marked
  174. // with a cookie which is passed back in the second parameter,
  175. // allowing applications to easily tie together request
  176. // and completion notifications.
  177. //
  178. // NB: IPin will point to the pin that actioned the Stop. This
  179. // may not be the pin that the StopAt was sent to.
  180. #define EC_STREAM_CONTROL_STARTED 0x1B
  181. // ( IPin * pSender, DWORD dwCookie )
  182. // Notification that an earlier call to IAMStreamControl::StartAt
  183. // has now take effect. Calls to the method can be marked
  184. // with a cookie which is passed back in the second parameter,
  185. // allowing applications to easily tie together request
  186. // and completion notifications.
  187. //
  188. // NB: IPin will point to the pin that actioned the Start. This
  189. // may not be the pin that the StartAt was sent to.
  190. #define EC_END_OF_SEGMENT 0x1C
  191. //
  192. // ( const REFERENCE_TIME *pStreamTimeAtEndOfSegment, DWORD dwSegmentNumber )
  193. //
  194. // pStreamTimeAtEndOfSegment
  195. // pointer to the accumulated stream clock
  196. // time since the start of the segment - this is directly computable
  197. // as the sum of the previous and current segment durations (Stop - Start)
  198. // and the rate applied to each segment
  199. // The source add this time to the time within each segment to get
  200. // a total elapsed time
  201. //
  202. // dwSegmentNumber
  203. // Segment number - starts at 0
  204. //
  205. // Notifies that a segment end has been reached when the
  206. // AM_SEEKING_Segment flags was set for IMediaSeeking::SetPositions
  207. // Passes in an IMediaSeeking interface to allow the next segment
  208. // to be defined by the application
  209. #define EC_SEGMENT_STARTED 0x1D
  210. //
  211. // ( const REFERENCE_TIME *pStreamTimeAtStartOfSegment, DWORD dwSegmentNumber)
  212. //
  213. // pStreamTimeAtStartOfSegment
  214. // pointer to the accumulated stream clock
  215. // time since the start of the segment - this is directly computable
  216. // as the sum of the previous segment durations (Stop - Start)
  217. // and the rate applied to each segment
  218. //
  219. // dwSegmentNumber
  220. // Segment number - starts at 0
  221. //
  222. // Notifies that a new segment has been started.
  223. // This is sent synchronously by any entity that will issue
  224. // EC_END_OF_SEGMENT when a new segment is started
  225. // (See IMediaSeeking::SetPositions - AM_SEEKING_Segment flag)
  226. // It is used to compute how many EC_END_OF_SEGMENT notifications
  227. // to expect at the end of a segment and as a consitency check
  228. #define EC_LENGTH_CHANGED 0x1E
  229. // (void, void)
  230. // sent to indicate that the length of the "file" has changed
  231. #define EC_DEVICE_LOST 0x1f
  232. // (IUnknown, 0)
  233. //
  234. // request window notification when the device is available again
  235. // (through WM_DEVICECHANGED messages registered with
  236. // RegisterDeviceNotification; see IAMDeviceRemoval interface)
  237. #define EC_STEP_COMPLETE 0x24
  238. // (BOOL bCacelled, void)
  239. // Step request complete
  240. // if bCancelled is TRUE the step was cancelled. This can happen
  241. // if the application issued some control request or because there
  242. // was a mode change etc etc
  243. // Event code 25 is reserved for future use.
  244. #define EC_TIMECODE_AVAILABLE 0x30
  245. // Sent by filter supporting timecode
  246. // Param1 has a pointer to the sending object
  247. // Param2 has the device ID of the sending object
  248. #define EC_EXTDEVICE_MODE_CHANGE 0x31
  249. // Sent by filter supporting IAMExtDevice
  250. // Param1 has the new mode
  251. // Param2 has the device ID of the sending object
  252. #define EC_STATE_CHANGE 0x32
  253. // ( FILTER_STATE, BOOL bInternal)
  254. // Used to notify the application of any state changes in the filter graph.
  255. // lParam1 is of type enum FILTER_STATE (defined in strmif.h) and indicates
  256. // the state of the filter graph.
  257. //
  258. // lParam2 == 0 indicates that the previous state change request has completed
  259. // & a change in application state.
  260. // lParam2 == 1 reserved for future use to indicate internal state changes.
  261. #define EC_GRAPH_CHANGED 0x50
  262. // Sent by filter to notify interesting graph changes
  263. #define EC_CLOCK_UNSET 0x51
  264. // ( void, void ) : application
  265. // Used to notify the filter graph to unset the current graph clock.
  266. // Has the affect of forcing the filter graph to reestablish the graph clock
  267. // on the next Pause/Run (note that this is only used by ksproxy, when the pin
  268. // of a clock providing filter is disconnected)
  269. #define EC_VMR_RENDERDEVICE_SET 0x53
  270. // (Render_Device type, void)
  271. // Identifies the type of rendering mechanism the VMR
  272. // is using to display video. Types used include:
  273. #define VMR_RENDER_DEVICE_OVERLAY 0x01
  274. #define VMR_RENDER_DEVICE_VIDMEM 0x02
  275. #define VMR_RENDER_DEVICE_SYSMEM 0x04
  276. #define EC_VMR_SURFACE_FLIPPED 0x54
  277. // (hr - Flip return code, void)
  278. // Identifies the VMR's allocator-presenter has called the DDraw flip api on
  279. // the surface being presented. This allows the VMR to keep its DX-VA table
  280. // of DDraw surfaces in sync with DDraws flipping chain.
  281. #define EC_VMR_RECONNECTION_FAILED 0x55
  282. // (hr - ReceiveConnection return code, void)
  283. // Identifies that an upstream decoder tried to perform a dynamic format
  284. // change and the VMR was unable to accept the new format.
  285. //------------------------------------------
  286. //
  287. // BDA events:
  288. //
  289. // Event code 0x80 through 0x8f are reserved for BDA
  290. //
  291. //------------------------------------------
  292. //
  293. // WindowsMedia SDK filter-specific events:
  294. //
  295. //
  296. // Note that for EC_WMT_EVENT events the wmsdk-based filters use the following structure for
  297. // passing event parameters to the app:
  298. #ifndef AM_WMT_EVENT_DATA_DEFINED
  299. #define AM_WMT_EVENT_DATA_DEFINED
  300. typedef struct {
  301. HRESULT hrStatus; // status code
  302. void * pData; // event data
  303. } AM_WMT_EVENT_DATA;
  304. #endif
  305. //
  306. #define EC_WMT_EVENT_BASE 0x0251
  307. //
  308. #define EC_WMT_INDEX_EVENT EC_WMT_EVENT_BASE
  309. // WindowsMedia SDK-originated file indexing status, sent by WMSDK-based filters
  310. //
  311. // lParam1 is one of the enum WMT_STATUS messages listed below, sent by the WindowsMedia SDK
  312. // lParam2 is specific to the lParam event
  313. //
  314. // the following WMT_STATUS messages are sent for this event:
  315. // WMT_STARTED - lParam2 is 0
  316. // WMT_CLOSED - lParam2 is 0
  317. // WMT_INDEX_PROGRESS - lParam2 is a DWORD containing the progress percent complete
  318. //
  319. #define EC_WMT_EVENT EC_WMT_EVENT_BASE+1
  320. // WindowsMedia SDK-originated event, sent by WMSDK-based filters
  321. //
  322. // lParam1 is one of the enum WMT_STATUS messages listed below, sent by the WindowsMedia SDK
  323. // lParam2 is a pointer an AM_WMT_EVENT_DATA structure where,
  324. // hrStatus is the status code sent by the wmsdk
  325. // pData is specific to the lParam1 event
  326. //
  327. // the following WMT_STATUS messages are sent by the WMSDK Reader filter for this event:
  328. // WMT_NO_RIGHTS - pData is a pointer to a WCHAR string containing a challenge URL
  329. // WMT_ACQUIRE_LICENSE - lParam2 is a pointer to a WM_GET_LICENSE_DATA struct
  330. // WMT_NO_RIGHTS_EX - lParam2 is a pointer to a WM_GET_LICENSE_DATA struct
  331. // WMT_NEEDS_INDIVIDUALIZATION - lParam2 is NULL
  332. // WMT_INDIVIDUALIZE - lParam2 is a pointer to a WM_INDIVIDUALIZE_STATUS struct
  333. //
  334. // end WMSDK-originated events
  335. //-----------------------------------------
  336. #define EC_BUILT 0x300
  337. // Sent to notify transition from unbuilt to built state
  338. #define EC_UNBUILT 0x301
  339. // Sent to notify transtion from built to unbuilt state