home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the 3D Game Programming Gurus / gurus.iso / DirectX / dx9sdkcp.exe / SDK (C++) / Include / evcode.h < prev    next >
Encoding:
C/C++ Source or Header  |  2002-11-12  |  17.5 KB  |  429 lines

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