home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / evcode.h < prev    next >
Text File  |  1998-04-25  |  12KB  |  282 lines

  1. //==========================================================================;
  2. //
  3. //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  4. //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  5. //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  6. //  PURPOSE.
  7. //
  8. //  Copyright (c) 1992 - 1997  Microsoft Corporation.  All Rights Reserved.
  9. //
  10. //--------------------------------------------------------------------------;
  11.  
  12. //
  13. // list of standard Quartz event codes and the expected params
  14. //
  15.  
  16. // Event codes are broken into two groups
  17. //   -- system event codes
  18. //   -- extension event codes
  19. // All system event codes are below EC_USER
  20.  
  21. #define EC_SYSTEMBASE                       0x00
  22. #define EC_USER                             0x8000
  23.  
  24.  
  25. // System-defined event codes
  26. // ==========================
  27. //
  28. // There are three types of system-defined event codes:
  29. //
  30. // 1.  Those which are always passed through to the application
  31. //     (To be collected by calls to GetEvent or within WaitForCompletion.)
  32. //     (e.g. EC_ERRORABORT, EC_USERABORT.)
  33. //
  34. // 2.  Those which are pure internal and will never be passed to
  35. //     the application.  (e.g. EC_SHUTDOWN)
  36. //
  37. // 3.  Those which have default handling.  Default handing implies that
  38. //     the event is not passed to the application.  However, default
  39. //     handling may be canceled by calling
  40. //     IMediaEvent::CancelDefaultHandling.  If the default handling is
  41. //     cancelled in this way, then the message will be delivered to the
  42. //     application and the application must action it appropriately.
  43. //     Default handling can be restored by calling RestoreDefaultHandling.
  44. //
  45. // We will refer to these events as application, internal and defaulted
  46. // events respectively.
  47. //
  48. // System-defined events may have interface pointers, BSTR's, etc passed
  49. // as parameters.  It is therefore essential that, for any message
  50. // retrieved using GetEvent, a matching call to FreeEventParams is made
  51. // to ensure that relevant interfaces are released and storage freed.
  52. // Failure to call FreeEventParams will result in memory leaks, if not
  53. // worse.
  54. //
  55. // Filters sending these messages to the filter graph should not AddRef()
  56. // any interfaces that they may pass as parameters.  The filter graph
  57. // manager will AddRef them if required.  E.g. if the event is to be queued
  58. // for the application or queued to a worker thread.
  59.  
  60. // Each event listed below is immediately followed by a parameter list
  61. // detailing the types of the parameters associated with the message,
  62. // and an indication of whether the message is an application, internal
  63. // or defaulted message.  This is then followed by a short description.
  64. // The use of "void" in the parameter list implies that the parameter is not
  65. // used.  Such parameters should be zero.
  66.  
  67.  
  68.  
  69. #define EC_COMPLETE                         0x01
  70. // ( HRESULT, void ) : defaulted (special)
  71. // Signals the completed playback of a stream within the graph.  This message
  72. // is sent by renderers when they receive end-of-stream.  The default handling
  73. // of this message results in a _SINGLE_ EC_COMPLETE being sent to the
  74. // application when ALL of the individual renderers have signaled EC_COMPLETE
  75. // to the filter graph.  If the default handing is canceled, the application
  76. // will see all of the individual EC_COMPLETEs.
  77.  
  78.  
  79. #define EC_USERABORT                        0x02
  80. // ( void, void ) : application
  81. // In some sense, the user has requested that playback be terminated.
  82. // This message is typically sent by renderers that render into a
  83. // window if the user closes the window into which it was rendering.
  84. // It is up to the application to decide if playback should actually
  85. // be stopped.
  86.  
  87.  
  88. #define EC_ERRORABORT                       0x03
  89. // ( HRESULT, void ) : application
  90. // Operation aborted because of error
  91.  
  92.  
  93. #define EC_TIME                             0x04
  94. // ( DWORD, DWORD ) : application
  95. // The requested reference time occurred.  (This event is currently not used).
  96. // lParam1 is low dword of ref time, lParam2 is high dword of reftime.
  97.  
  98.  
  99. #define EC_REPAINT                          0x05
  100. // ( IPin * (could be NULL), void ) : defaulted
  101. // A repaint is required - lParam1 contains the (IPin *) that needs the data
  102. // to be sent again. Default handling is: if the output pin which the IPin is
  103. // attached  to supports the IMediaEventSink interface then it will be called
  104. // with the EC_REPAINT first.  If that fails then normal repaint processing is
  105. // done by the filter graph.
  106.  
  107.  
  108. // Stream error notifications
  109. #define EC_STREAM_ERROR_STOPPED             0x06
  110. #define EC_STREAM_ERROR_STILLPLAYING        0x07
  111. // ( HRESULT, DWORD ) : application
  112. // lParam 1 is major code, lParam2 is minor code, either may be zero.
  113.  
  114.  
  115. #define EC_ERROR_STILLPLAYING               0x08
  116. // ( HRESULT, void ) : application
  117. // The filter graph manager may issue Run's to the graph asynchronously.
  118. // If such a Run fails, EC_ERROR_STILLPLAYING is issued to notify the
  119. // application of the failure.  The state of the underlying filters
  120. // at such a time will be indeterminate - they will all have been asked
  121. // to run, but some are almost certainly not.
  122.  
  123.  
  124. #define EC_PALETTE_CHANGED                  0x09
  125. // ( void, void ) : application
  126. // notify application that the video palette has changed
  127.  
  128.  
  129. #define EC_VIDEO_SIZE_CHANGED               0x0A
  130. // ( DWORD, void ) : application
  131. // Sent by video renderers.
  132. // Notifies the application that the native video size has changed.
  133. // LOWORD of the DWORD is the new width, HIWORD is the new height.
  134.  
  135.  
  136. #define EC_QUALITY_CHANGE                   0x0B
  137. // ( void, void ) : application
  138. // Notify application that playback degradation has occurred
  139.  
  140.  
  141. #define EC_SHUTTING_DOWN                    0x0C
  142. // ( void, void ) : internal
  143. // This message is sent by the filter graph manager to any plug-in
  144. // distributors which support IMediaEventSink to notify them that
  145. // the filter graph is starting to shutdown.
  146.  
  147.  
  148. #define EC_CLOCK_CHANGED                    0x0D
  149. // ( void, void ) : application
  150. // Notify application that the clock has changed.
  151. // (i.e. SetSyncSource has been called on the filter graph and has been
  152. // distributed successfully to the filters in the graph.)
  153.  
  154.  
  155. #define EC_OPENING_FILE                        0x10
  156. #define EC_BUFFERING_DATA                   0x11
  157. // ( BOOL, void ) : application
  158. // lParam1 == 1   --> starting to open file or buffer data
  159. // lParam1 == 0   --> not opening or buffering any more
  160. // (This event does not appear to be used by ActiveMovie.)
  161.  
  162.  
  163. #define EC_FULLSCREEN_LOST                  0x12
  164. // ( void, IBaseFilter * ) : application
  165. // Sent by full screen renderers when switched away from full screen.
  166. // IBaseFilter may be NULL.
  167.  
  168.  
  169. #define EC_ACTIVATE                         0x13
  170. // ( BOOL, IBaseFilter * ) : internal
  171. // Sent by video renderers when they lose or gain activation.
  172. // lParam1 is set to 1 if gained or 0 if lost
  173. // lParam2 is the IBaseFilter* for the filter that is sending the message
  174. // Used for sound follows focus and full-screen switching
  175.  
  176.  
  177. #define EC_NEED_RESTART                     0x14
  178. // ( void, void ) : defaulted
  179. // Sent by renderers when they regain a resource (e.g. audio renderer).
  180. // Causes a restart by Pause/put_Current/Run (if running).
  181.  
  182.  
  183. #define EC_WINDOW_DESTROYED                 0x15
  184. // ( IBaseFilter *, void ) : internal
  185. // Sent by video renderers when the window has been destroyed. Handled
  186. // by the filter graph / distributor telling the resource manager.
  187. // lParam1 is the IBaseFilter* of the filter whose window is being destroyed
  188.  
  189.  
  190. #define EC_DISPLAY_CHANGED                  0x16
  191. // ( IPin *, void ) : internal
  192. // Sent by renderers when they detect a display change. the filter graph
  193. // will arrange for the graph to be stopped and the pin send in lParam1
  194. // to be reconnected. by being reconnected it allows a renderer to reset
  195. // and connect with a more appropriate format for the new display mode
  196. // lParam1 contains an (IPin *) that should be reconnected by the graph
  197.  
  198.  
  199. #define EC_STARVATION                       0x17
  200. // ( void, void ) : defaulted
  201. // Sent by a filter when it detects starvation. Default handling (only when
  202. // running) is for the graph to be paused until all filters enter the
  203. // paused state and then run. Normally this would be sent by a parser or source
  204. // filter when too little data is arriving.
  205.  
  206.  
  207. #define EC_OLE_EVENT                0x18
  208. // ( BSTR, BSTR ) : application
  209. // Sent by a filter to pass a text string to the application.
  210. // Conventionally, the first string is a type, and the second a parameter.
  211.  
  212.  
  213. #define EC_NOTIFY_WINDOW                    0x19
  214. // ( HWND, void ) : internal
  215. // Pass the window handle around during pin connection.
  216.  
  217. #define EC_STREAM_CONTROL_STOPPED        0x1A
  218. // ( IPin * pSender, DWORD dwCookie )
  219. // Notification that an earlier call to IAMStreamControl::StopAt
  220. // has now take effect.  Calls to the method can be marked
  221. // with a cookie which is passed back in the second parameter,
  222. // allowing applications to easily tie together request
  223. // and completion notifications.
  224. //
  225. // NB: IPin will point to the pin that actioned the Stop.  This
  226. // may not be the pin that the StopAt was sent to.
  227.  
  228. #define EC_STREAM_CONTROL_STARTED        0x1B
  229. // ( IPin * pSender, DWORD dwCookie )
  230. // Notification that an earlier call to IAMStreamControl::StartAt
  231. // has now take effect.  Calls to the method can be marked
  232. // with a cookie which is passed back in the second parameter,
  233. // allowing applications to easily tie together request
  234. // and completion notifications.
  235. //
  236. // NB: IPin will point to the pin that actioned the Start.  This
  237. // may not be the pin that the StartAt was sent to.
  238.  
  239. #define EC_END_OF_SEGMENT                   0x1C
  240. //
  241. // ( const REFERENCE_TIME *pStreamTimeAtEndOfSegment, DWORD dwSegmentNumber )
  242. //
  243. // pStreamTimeAtEndOfSegment
  244. //     pointer to the accumulated stream clock
  245. //     time since the start of the segment - this is directly computable
  246. //     as the sum of the previous and current segment durations (Stop - Start)
  247. //     and the rate applied to each segment
  248. //     The source add this time to the time within each segment to get
  249. //     a total elapsed time
  250. //
  251. // dwSegmentNumber
  252. //     Segment number - starts at 0
  253. //
  254. // Notifies that a segment end has been reached when the
  255. // AM_SEEKING_Segment flags was set for IMediaSeeking::SetPositions
  256. // Passes in an IMediaSeeking interface to allow the next segment
  257. // to be defined by the application
  258.  
  259. #define EC_SEGMENT_STARTED                  0x1D
  260. //
  261. // ( const REFERENCE_TIME *pStreamTimeAtStartOfSegment, DWORD dwSegmentNumber)
  262. //
  263. // pStreamTimeAtStartOfSegment
  264. //     pointer to the accumulated stream clock
  265. //     time since the start of the segment - this is directly computable
  266. //     as the sum of the previous segment durations (Stop - Start)
  267. //     and the rate applied to each segment
  268. //
  269. // dwSegmentNumber
  270. //     Segment number - starts at 0
  271. //
  272. // Notifies that a new segment has been started.
  273. // This is sent synchronously by any entity that will issue
  274. // EC_END_OF_SEGMENT when a new segment is started
  275. // (See IMediaSeeking::SetPositions - AM_SEEKING_Segment flag)
  276. // It is used to compute how many EC_END_OF_SEGMENT notifications
  277. // to expect at the end of a segment and as a consitency check
  278.  
  279. #define EC_LENGTH_CHANGED                  0x1E
  280. // (void, void)
  281. // sent to indicate that the length of the "file" has changed
  282.