Counter Strike : Global Offensive Source Code
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.

428 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 - 2001, 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. #define EC_PREPROCESS_COMPLETE 0x56
  286. // Sent by the WM ASF writer filter (WMSDK V9 version) to signal the completion
  287. // of a pre-process run when running in multipass encode mode.
  288. // Param1 = 0, Param2 = IBaseFilter ptr of sending filter
  289. #define EC_CODECAPI_EVENT 0x57
  290. // Sent by the Codec API when an event is encountered. Both the Data
  291. // must be freed by the recipient using CoTaskMemFree
  292. // Param1 = UserDataPointer, Param2 = VOID* Data
  293. //------------------------------------------
  294. //
  295. // BDA events:
  296. //
  297. // Event code 0x80 through 0x8f are reserved for BDA
  298. //
  299. //------------------------------------------
  300. //
  301. // WindowsMedia SDK filter-specific events:
  302. //
  303. //
  304. // Note that for EC_WMT_EVENT events the wmsdk-based filters use the following structure for
  305. // passing event parameters to the app:
  306. #ifndef AM_WMT_EVENT_DATA_DEFINED
  307. #define AM_WMT_EVENT_DATA_DEFINED
  308. typedef struct {
  309. HRESULT hrStatus; // status code
  310. void * pData; // event data
  311. } AM_WMT_EVENT_DATA;
  312. #endif
  313. //
  314. #define EC_WMT_EVENT_BASE 0x0251
  315. //
  316. #define EC_WMT_INDEX_EVENT EC_WMT_EVENT_BASE
  317. // WindowsMedia SDK-originated file indexing status, sent by WMSDK-based filters
  318. //
  319. // lParam1 is one of the enum WMT_STATUS messages listed below, sent by the WindowsMedia SDK
  320. // lParam2 is specific to the lParam event
  321. //
  322. // the following WMT_STATUS messages are sent for this event:
  323. // WMT_STARTED - lParam2 is 0
  324. // WMT_CLOSED - lParam2 is 0
  325. // WMT_INDEX_PROGRESS - lParam2 is a DWORD containing the progress percent complete
  326. //
  327. #define EC_WMT_EVENT EC_WMT_EVENT_BASE+1
  328. // WindowsMedia SDK-originated event, sent by WMSDK-based filters
  329. //
  330. // lParam1 is one of the enum WMT_STATUS messages listed below, sent by the WindowsMedia SDK
  331. // lParam2 is a pointer an AM_WMT_EVENT_DATA structure where,
  332. // hrStatus is the status code sent by the wmsdk
  333. // pData is specific to the lParam1 event
  334. //
  335. // the following WMT_STATUS messages are sent by the WMSDK Reader filter for this event:
  336. // WMT_NO_RIGHTS - pData is a pointer to a WCHAR string containing a challenge URL
  337. // WMT_ACQUIRE_LICENSE - lParam2 is a pointer to a WM_GET_LICENSE_DATA struct
  338. // WMT_NO_RIGHTS_EX - lParam2 is a pointer to a WM_GET_LICENSE_DATA struct
  339. // WMT_NEEDS_INDIVIDUALIZATION - lParam2 is NULL
  340. // WMT_INDIVIDUALIZE - lParam2 is a pointer to a WM_INDIVIDUALIZE_STATUS struct
  341. // the WMSDK (V9) ASF Writer filter will send this event in response to a wmsdk-signaled error during file
  342. // writing, along with the wmsdk WMT_STATUS error as the lParam1 and hrStatus embedded in the
  343. // AM_WMT_EVENT_DATA struct pointed to by the lParam2 pointer.
  344. //
  345. // end WMSDK-originated events
  346. //-----------------------------------------
  347. #define EC_BUILT 0x300
  348. // Sent to notify transition from unbuilt to built state
  349. #define EC_UNBUILT 0x301
  350. // Sent to notify transtion from built to unbuilt state