streams.h 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. //------------------------------------------------------------------------------
  2. // File: Streams.h
  3. //
  4. // Desc: DirectShow base classes - defines overall streams architecture.
  5. //
  6. // Copyright (c) 1992-2001 Microsoft Corporation. All rights reserved.
  7. //------------------------------------------------------------------------------
  8. #ifndef __STREAMS__
  9. #define __STREAMS__
  10. #ifdef _MSC_VER
  11. // disable some level-4 warnings, use #pragma warning(enable:###) to re-enable
  12. #pragma warning(disable:4100) // warning C4100: unreferenced formal parameter
  13. #pragma warning(disable:4201) // warning C4201: nonstandard extension used : nameless struct/union
  14. #pragma warning(disable:4511) // warning C4511: copy constructor could not be generated
  15. #pragma warning(disable:4512) // warning C4512: assignment operator could not be generated
  16. #pragma warning(disable:4514) // warning C4514: "unreferenced inline function has been removed"
  17. #if _MSC_VER>=1100
  18. #define AM_NOVTABLE __declspec(novtable)
  19. #else
  20. #define AM_NOVTABLE
  21. #endif
  22. #endif // MSC_VER
  23. // Because of differences between Visual C++ and older Microsoft SDKs,
  24. // you may have defined _DEBUG without defining DEBUG. This logic
  25. // ensures that both will be set if Visual C++ sets _DEBUG.
  26. #ifdef _DEBUG
  27. #ifndef DEBUG
  28. #define DEBUG
  29. #endif
  30. #endif
  31. #include <windows.h>
  32. #include <windowsx.h>
  33. #include <olectl.h>
  34. #include <ddraw.h>
  35. #include <mmsystem.h>
  36. #ifndef NUMELMS
  37. #if _WIN32_WINNT < 0x0600
  38. #define NUMELMS(aa) (sizeof(aa)/sizeof((aa)[0]))
  39. #else
  40. #define NUMELMS(aa) ARRAYSIZE(aa)
  41. #endif
  42. #endif
  43. ///////////////////////////////////////////////////////////////////////////
  44. // The following definitions come from the Platform SDK and are required if
  45. // the applicaiton is being compiled with the headers from Visual C++ 6.0.
  46. /////////////////////////////////////////////////// ////////////////////////
  47. #ifndef InterlockedExchangePointer
  48. #define InterlockedExchangePointer(Target, Value) \
  49. (PVOID)InterlockedExchange((PLONG)(Target), (LONG)(Value))
  50. #endif
  51. #ifndef _WAVEFORMATEXTENSIBLE_
  52. #define _WAVEFORMATEXTENSIBLE_
  53. typedef struct {
  54. WAVEFORMATEX Format;
  55. union {
  56. WORD wValidBitsPerSample; /* bits of precision */
  57. WORD wSamplesPerBlock; /* valid if wBitsPerSample==0 */
  58. WORD wReserved; /* If neither applies, set to zero. */
  59. } Samples;
  60. DWORD dwChannelMask; /* which channels are */
  61. /* present in stream */
  62. GUID SubFormat;
  63. } WAVEFORMATEXTENSIBLE, *PWAVEFORMATEXTENSIBLE;
  64. #endif // !_WAVEFORMATEXTENSIBLE_
  65. #if !defined(WAVE_FORMAT_EXTENSIBLE)
  66. #define WAVE_FORMAT_EXTENSIBLE 0xFFFE
  67. #endif // !defined(WAVE_FORMAT_EXTENSIBLE)
  68. #ifndef GetWindowLongPtr
  69. #define GetWindowLongPtrA GetWindowLongA
  70. #define GetWindowLongPtrW GetWindowLongW
  71. #ifdef UNICODE
  72. #define GetWindowLongPtr GetWindowLongPtrW
  73. #else
  74. #define GetWindowLongPtr GetWindowLongPtrA
  75. #endif // !UNICODE
  76. #endif // !GetWindowLongPtr
  77. #ifndef SetWindowLongPtr
  78. #define SetWindowLongPtrA SetWindowLongA
  79. #define SetWindowLongPtrW SetWindowLongW
  80. #ifdef UNICODE
  81. #define SetWindowLongPtr SetWindowLongPtrW
  82. #else
  83. #define SetWindowLongPtr SetWindowLongPtrA
  84. #endif // !UNICODE
  85. #endif // !SetWindowLongPtr
  86. #ifndef GWLP_WNDPROC
  87. #define GWLP_WNDPROC (-4)
  88. #endif
  89. #ifndef GWLP_HINSTANCE
  90. #define GWLP_HINSTANCE (-6)
  91. #endif
  92. #ifndef GWLP_HWNDPARENT
  93. #define GWLP_HWNDPARENT (-8)
  94. #endif
  95. #ifndef GWLP_USERDATA
  96. #define GWLP_USERDATA (-21)
  97. #endif
  98. #ifndef GWLP_ID
  99. #define GWLP_ID (-12)
  100. #endif
  101. #ifndef DWLP_MSGRESULT
  102. #define DWLP_MSGRESULT 0
  103. #endif
  104. #ifndef DWLP_DLGPROC
  105. #define DWLP_DLGPROC DWLP_MSGRESULT + sizeof(LRESULT)
  106. #endif
  107. #ifndef DWLP_USER
  108. #define DWLP_USER DWLP_DLGPROC + sizeof(DLGPROC)
  109. #endif
  110. #pragma warning(push)
  111. #pragma warning(disable: 4312 4244)
  112. // _GetWindowLongPtr
  113. // Templated version of GetWindowLongPtr, to suppress spurious compiler warning.
  114. template <class T>
  115. T _GetWindowLongPtr(HWND hwnd, int nIndex)
  116. {
  117. return (T)GetWindowLongPtr(hwnd, nIndex);
  118. }
  119. // _SetWindowLongPtr
  120. // Templated version of SetWindowLongPtr, to suppress spurious compiler warning.
  121. template <class T>
  122. LONG_PTR _SetWindowLongPtr(HWND hwnd, int nIndex, T p)
  123. {
  124. return SetWindowLongPtr(hwnd, nIndex, (LONG_PTR)p);
  125. }
  126. #pragma warning(pop)
  127. ///////////////////////////////////////////////////////////////////////////
  128. // End Platform SDK definitions
  129. ///////////////////////////////////////////////////////////////////////////
  130. #include <strmif.h> // Generated IDL header file for streams interfaces
  131. #include <intsafe.h> // required by amvideo.h
  132. #include <reftime.h> // Helper class for REFERENCE_TIME management
  133. #include <wxdebug.h> // Debug support for logging and ASSERTs
  134. #include <amvideo.h> // ActiveMovie video interfaces and definitions
  135. //include amaudio.h explicitly if you need it. it requires the DX SDK.
  136. //#include <amaudio.h> // ActiveMovie audio interfaces and definitions
  137. #include <wxutil.h> // General helper classes for threads etc
  138. #include <combase.h> // Base COM classes to support IUnknown
  139. #include <dllsetup.h> // Filter registration support functions
  140. #include <measure.h> // Performance measurement
  141. #include <comlite.h> // Light weight com function prototypes
  142. #include <cache.h> // Simple cache container class
  143. #include <wxlist.h> // Non MFC generic list class
  144. #include <msgthrd.h> // CMsgThread
  145. #include <mtype.h> // Helper class for managing media types
  146. #include <fourcc.h> // conversions between FOURCCs and GUIDs
  147. #include <control.h> // generated from control.odl
  148. #include <ctlutil.h> // control interface utility classes
  149. #include <evcode.h> // event code definitions
  150. #include <amfilter.h> // Main streams architecture class hierachy
  151. #include <transfrm.h> // Generic transform filter
  152. #include <transip.h> // Generic transform-in-place filter
  153. #include <uuids.h> // declaration of type GUIDs and well-known clsids
  154. #include <source.h> // Generic source filter
  155. #include <outputq.h> // Output pin queueing
  156. #include <errors.h> // HRESULT status and error definitions
  157. #include <renbase.h> // Base class for writing ActiveX renderers
  158. #include <winutil.h> // Helps with filters that manage windows
  159. #include <winctrl.h> // Implements the IVideoWindow interface
  160. #include <videoctl.h> // Specifically video related classes
  161. #include <refclock.h> // Base clock class
  162. #include <sysclock.h> // System clock
  163. #include <pstream.h> // IPersistStream helper class
  164. #include <vtrans.h> // Video Transform Filter base class
  165. #include <amextra.h>
  166. #include <cprop.h> // Base property page class
  167. #include <strmctl.h> // IAMStreamControl support
  168. #include <edevdefs.h> // External device control interface defines
  169. #include <audevcod.h> // audio filter device error event codes
  170. #else
  171. #ifdef DEBUG
  172. #pragma message("STREAMS.H included TWICE")
  173. #endif
  174. #endif // __STREAMS__