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.

217 lines
4.1 KiB

  1. /**************************************************************************
  2. BDA/AVStream Simulated Hardware Sample
  3. Copyright (c) 2001, Microsoft Corporation.
  4. File:
  5. BdaCap.h
  6. Abstract:
  7. BDA/AVStream Simulated Hardware Sample header file. This is the
  8. main header.
  9. History:
  10. created 3/12/2001
  11. **************************************************************************/
  12. /*************************************************
  13. Standard Includes
  14. *************************************************/
  15. extern "C" {
  16. #include <wdm.h>
  17. }
  18. #include <windef.h>
  19. #include <stdio.h>
  20. #include <stdlib.h>
  21. #include <windef.h>
  22. #define NOBITMAP
  23. #include <mmreg.h>
  24. #undef NOBITMAP
  25. #include <unknown.h>
  26. #include <ks.h>
  27. #include <ksmedia.h>
  28. #include <bdatypes.h>
  29. #include <bdamedia.h>
  30. #include <kcom.h>
  31. /*************************************************
  32. Misc Definitions
  33. *************************************************/
  34. #define ABS(x) ((x) < 0 ? (-(x)) : (x))
  35. #define MS_SAMPLE_CAPTURE_POOL_TAG 'CadB'
  36. #ifndef mmioFOURCC
  37. #define mmioFOURCC( ch0, ch1, ch2, ch3 ) \
  38. ( (DWORD)(BYTE)(ch0) | ( (DWORD)(BYTE)(ch1) << 8 ) | \
  39. ( (DWORD)(BYTE)(ch2) << 16 ) | ( (DWORD)(BYTE)(ch3) << 24 ) )
  40. #endif
  41. #define FOURCC_YUV422 mmioFOURCC('U', 'Y', 'V', 'Y')
  42. //
  43. // CAPTURE_OUT_PIN_DATA_RANGE_COUNT:
  44. //
  45. // The number of ranges supported on the capture output pin.
  46. //
  47. #define CAPTURE_OUT_PIN_DATA_RANGE_COUNT 1
  48. //
  49. // CAPTURE_IN_PIN_DATA_RANGE_COUNT:
  50. //
  51. // The number of ranges supported on the capture input pin.
  52. //
  53. #define CAPTURE_IN_PIN_DATA_RANGE_COUNT 1
  54. //
  55. // CAPTURE_FILTER_PIN_COUNT:
  56. //
  57. // The number of pins on the capture filter.
  58. //
  59. #define CAPTURE_FILTER_PIN_COUNT 2
  60. //
  61. // CAPTURE_FILTER_CATEGORIES_COUNT:
  62. //
  63. // The number of categories for the capture filter.
  64. //
  65. #define CAPTURE_FILTER_CATEGORIES_COUNT 1
  66. /*************************************************
  67. Externed information
  68. *************************************************/
  69. //
  70. // filter.cpp externs:
  71. //
  72. extern
  73. const
  74. KSFILTER_DISPATCH
  75. CaptureFilterDispatch;
  76. extern
  77. const
  78. KSFILTER_DESCRIPTOR
  79. CaptureFilterDescriptor;
  80. extern
  81. const
  82. KSPIN_DESCRIPTOR_EX
  83. CaptureFilterPinDescriptors [CAPTURE_FILTER_PIN_COUNT];
  84. extern
  85. const
  86. GUID
  87. CaptureFilterCategories [CAPTURE_FILTER_CATEGORIES_COUNT];
  88. //
  89. // capture.cpp externs:
  90. //
  91. extern
  92. const
  93. KSALLOCATOR_FRAMING_EX
  94. CapturePinAllocatorFraming;
  95. extern
  96. const
  97. KSPIN_DISPATCH
  98. CapturePinDispatch;
  99. extern
  100. const
  101. KSPIN_DISPATCH
  102. InputPinDispatch;
  103. extern
  104. const
  105. PKSDATARANGE
  106. CaptureOutPinDataRanges [CAPTURE_OUT_PIN_DATA_RANGE_COUNT];
  107. extern
  108. const
  109. PKSDATARANGE
  110. CaptureInPinDataRanges [CAPTURE_IN_PIN_DATA_RANGE_COUNT];
  111. /*************************************************
  112. Enums / Typedefs
  113. *************************************************/
  114. typedef enum _HARDWARE_STATE {
  115. HardwareStopped = 0,
  116. HardwarePaused,
  117. HardwareRunning
  118. } HARDWARE_STATE, *PHARDWARE_STATE;
  119. /*************************************************
  120. Class Definitions
  121. *************************************************/
  122. //
  123. // IHardwareSink:
  124. //
  125. // This interface is used by the hardware simulation to fake interrupt
  126. // service routines. The Interrupt method is called at DPC as a fake
  127. // interrupt.
  128. //
  129. class IHardwareSink {
  130. public:
  131. virtual
  132. void
  133. Interrupt (
  134. ) = 0;
  135. };
  136. //
  137. // ICaptureSink:
  138. //
  139. // This is a capture sink interface. The device level calls back the
  140. // CompleteMappings method passing the number of completed mappings for
  141. // the capture pin. This method is called during the device DPC.
  142. //
  143. class ICaptureSink {
  144. public:
  145. virtual
  146. void
  147. CompleteMappings (
  148. IN ULONG NumMappings
  149. ) = 0;
  150. };
  151. /*************************************************
  152. Internal Includes
  153. *************************************************/
  154. #include "TStream.h"
  155. #include "hwsim.h"
  156. #include "device.h"
  157. #include "filter.h"
  158. #include "capture.h"