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.

312 lines
14 KiB

  1. #ifndef __tapivid_h__
  2. #define __tapivid_h__
  3. #include "h245if.h"
  4. #include "tapiqc.h"
  5. /****************************************************************************
  6. * @doc INTERNAL TAPIVID
  7. *
  8. * @module TAPIVid.h | Header file for the new TAPI internal interfaces and
  9. * devine enumeration enums and struct, and our filter GUID.
  10. *
  11. * @comm Two interface declaration changes are due to a multiple inheritance
  12. * problem: <i IAMCameraControl> and <i IAMVideoProcAmp> interface methods
  13. * have identical prototypes. Our Video Capture filter implements both
  14. * interfaces.
  15. ***************************************************************************/
  16. DEFINE_GUID(CLSID_TAPIVideoCapture,
  17. 0x70616376L, 0x5245, 0x4945, 0x52, 0x52, 0x45, 0x46, 0x4C, 0x49, 0x48, 0x50);
  18. struct DECLSPEC_UUID("47a39f38-7f0f-4ce0-b788-d76b39fd6a4f") TAPIVideoCapture;
  19. struct DECLSPEC_UUID("145cb377-e7bb-4adf-bd42-a42304717ede") TAPIVideoDecoder;
  20. const WCHAR* const PNAME_PREVIEW = L"Preview";
  21. const WCHAR* const PNAME_CAPTURE = L"Capture";
  22. const WCHAR* const PNAME_RTPPD = L"RtpPd";
  23. /*****************************************************************************
  24. * @doc INTERNAL CDEVENUMSTRUCTENUM
  25. *
  26. * @enum DeviceType | The <t DeviceType> enum is used to identify VfW and WDM
  27. * device types.
  28. *
  29. * @emem DeviceType_VfW | Specifies a VfW device.
  30. *
  31. * @emem DeviceType_WDM | Specifies a WDM device.
  32. *
  33. * @emem DeviceType_DShow | Specifies unknown DirectShow device (e.g.,
  34. * DV camera)
  35. ****************************************************************************/
  36. typedef enum tagDeviceType
  37. {
  38. DeviceType_VfW,
  39. DeviceType_WDM,
  40. DeviceType_DShow
  41. } DeviceType;
  42. /*****************************************************************************
  43. * @doc INTERNAL CDEVENUMSTRUCTENUM
  44. *
  45. * @enum CaptureMode | The <t CaptureMode> enum is used to identify frame
  46. * grabbing or streaming mode.
  47. *
  48. * @emem CaptureMode_FrameGrabbing | Specifies frame grabbing mode.
  49. *
  50. * @emem CaptureMode_Streaming | Specifies streaming mode.
  51. ****************************************************************************/
  52. typedef enum tagCaptureMode
  53. {
  54. CaptureMode_FrameGrabbing,
  55. CaptureMode_Streaming
  56. } CaptureMode;
  57. /*****************************************************************************
  58. * @doc EXTERNAL CONSTANTS
  59. *
  60. * @const 4 | MAX_CAPTURE_DEVICES | Maximum number of capture devices.
  61. *
  62. * @const MAX_PATH | MAX_CAPDEV_DESCRIPTION | Maximum length of capture
  63. * device description string.
  64. *
  65. * @const 80 | MAX_CAPDEV_VERSION | Maximum length of capture device version
  66. * string.
  67. ****************************************************************************/
  68. #define MAX_CAPTURE_DEVICES 10
  69. #define MAX_CAPDEV_DESCRIPTION MAX_PATH
  70. #define MAX_CAPDEV_VERSION 80
  71. /*****************************************************************************
  72. * @doc INTERNAL CDEVENUMSTRUCTENUM
  73. *
  74. * @struct VIDEOCAPTUREDEVICEINFO | The <t VIDEOCAPTUREDEVICEINFO> structure is used to store capture
  75. * device information.
  76. *
  77. * @field char | szDeviceDescription[] | Specifies the description string of
  78. * the capture device.
  79. *
  80. * @field char | szDeviceVersion[] | Specifies the version string of
  81. * the capture device.
  82. *
  83. * @field BOOL | fHasOverlay | Specifies the overlay support of the capture
  84. * device.
  85. *
  86. * @field BOOL | fInUse | Set to TRUE when a device is being used by an
  87. * instance of the capture filter.
  88. *
  89. * @field DeviceType | nDeviceType | Specifies the type (VfW or WDM) of the
  90. * capture device.
  91. *
  92. * @field CaptureMode | nCaptureMode | Specifies the capture mode (frame grabbing
  93. * or streaming) of the capture device.
  94. *
  95. * @field DWORD | dwVfWIndex | Specifies the VfW index of the capture device.
  96. ***************************************************************************/
  97. typedef struct tagDEVICEINFO
  98. {
  99. char szDeviceDescription[MAX_CAPDEV_DESCRIPTION];
  100. char szDeviceVersion[MAX_CAPDEV_VERSION];
  101. char szDevicePath[MAX_PATH];
  102. BOOL fHasOverlay;
  103. BOOL fInUse;
  104. DeviceType nDeviceType;
  105. CaptureMode nCaptureMode;
  106. DWORD dwVfWIndex;
  107. } VIDEOCAPTUREDEVICEINFO, *PDEVICEINFO;
  108. typedef HRESULT (WINAPI *PFNGetCapDeviceInfo)(
  109. IN DWORD dwDeviceIndex,
  110. OUT PDEVICEINFO pDeviceInfo
  111. );
  112. typedef HRESULT (WINAPI *PFNGetNumCapDevices)(
  113. OUT PDWORD pdwNumDevices
  114. );
  115. // Video capture device selection/control interface (filter interface)
  116. interface DECLSPEC_UUID("bda95399-48da-4309-af1b-9b8f65f4f9be") IVideoDeviceControl : public IUnknown
  117. {
  118. public:
  119. virtual STDMETHODIMP GetNumDevices(OUT PDWORD pdwNumDevices) PURE;
  120. virtual STDMETHODIMP GetDeviceInfo(IN DWORD dwDeviceIndex, OUT VIDEOCAPTUREDEVICEINFO *pDeviceInfo) PURE;
  121. virtual STDMETHODIMP GetCurrentDevice(OUT DWORD *pdwDeviceIndex) PURE;
  122. virtual STDMETHODIMP SetCurrentDevice(IN DWORD dwDeviceIndex) PURE;
  123. };
  124. /*****************************************************************************
  125. * @doc INTERNAL CPROCAMPSTRUCTENUM
  126. *
  127. * @enum VideoProcAmpProperty | The <t VideoProcAmpProperty> enum is used to
  128. * identify specific video quality settings.
  129. *
  130. * @emem VideoProcAmp_Brightness | Specifies the brightness setting in IRE
  131. * units * 100. The range for Value is -10000 to 10000; the default value
  132. * is 750 (7.5 IRE).
  133. *
  134. * @emem VideoProcAmp_Contrast | Specifies the contrast or luma gain setting
  135. * in gain factor * 100. The Value range is from zero to 10000, and the
  136. * default is 100 (1x). Note that a particular video encoder filter may
  137. * only implement a subset of this range.
  138. *
  139. * @emem VideoProcAmp_Hue | Specifies the hue setting in degrees * 100. Value
  140. * range is from -18000 to 18000 ( -180 to +180 degrees), and the default
  141. * is zero. Note that a particular video encoder filter may only implement
  142. * a subset of this range.
  143. *
  144. * @emem VideoProcAmp_Saturation | Specifies the saturation or chroma gain
  145. * setting in gain * 100. Value ranges from zero to 10000, and the default
  146. * is 100 (1x). Note that a particular video encoder filter may only
  147. * implement a subset of this range.
  148. *
  149. * @emem VideoProcAmp_Sharpness | Specifies the sharpness setting in
  150. * arbitrary units. Value ranges from zero to 100, and the default is 50.
  151. * Note that a particular video encoder filter may only implement a subset
  152. * of this range.
  153. *
  154. * @emem VideoProcAmp_Gamma | Specifies the gamma setting in gamma * 100.
  155. * Value ranges from 1 to 500, and the default is 100 (gamma = 1). Note
  156. * that a particular video encoder filter may only implement a subset of
  157. * this range.
  158. *
  159. * @emem VideoProcAmp_ColorEnable | Specifies the color enable setting as a
  160. * Boolean value. Value ranges from zero to 1, and the default is 1.
  161. *
  162. * @emem VideoProcAmp_WhiteBalance | Specifies the white balance setting
  163. * expressed as a color temperature in degrees Kelvin. The range and
  164. * default values for this setting are video encoder filter dependent.
  165. *
  166. * @emem VideoProcAmp_BacklightCompensation | Specifies the backlight
  167. * compensation setting which is a Boolean. Zero indicates backlight
  168. * compensation is disabled, and 1 indicates backlight compensation is
  169. * enabled.
  170. ****************************************************************************/
  171. // IAMVideoProcAmp interface (filter interface)
  172. interface DECLSPEC_UUID("C6E13360-30AC-11d0-A18C-00A0C9118956") IVideoProcAmp : public IUnknown
  173. {
  174. public:
  175. virtual STDMETHODIMP GetRange(IN VideoProcAmpProperty Property, OUT long *pMin, OUT long *pMax, OUT long *pSteppingDelta, OUT long *pDefault, OUT TAPIControlFlags *pCapsFlags) PURE;
  176. virtual STDMETHODIMP Set(IN VideoProcAmpProperty Property, IN long lValue, IN TAPIControlFlags Flags) PURE;
  177. virtual STDMETHODIMP Get(IN VideoProcAmpProperty Property, OUT long *lValue, OUT TAPIControlFlags *Flags) PURE;
  178. };
  179. /*****************************************************************************
  180. * @doc INTERNAL CCAMERACSTRUCTENUM
  181. *
  182. * @enum TAPICameraControlProperty | The <t TAPICameraControlProperty> enum
  183. * is used to identify specific camera control settings.
  184. *
  185. * @emem TAPICameraControl_Pan | Specifies the camera pan setting in degrees.
  186. * Values range from -180 to +180, and the default is zero. Positive values
  187. * are clockwise from the origin (the camera rotates clockwise when viewed
  188. * from above), and negative values are counterclockwise from the origin.
  189. * Note that a particular video capture filter may only implement a subset
  190. * of this range.
  191. *
  192. * @emem TAPICameraControl_Tilt | Specifies the camera tilt setting in degrees.
  193. * Values range from -180 to +180, and the default is zero. Positive values
  194. * point the imaging plane up, and negative values point the imaging plane
  195. * down. Note that a particular video capture filter may only implement a
  196. * subset of this range.
  197. *
  198. * @emem TAPICameraControl_Roll | Specifies the roll setting in degrees. Values
  199. * range from -180 to +180, and the default is zero. Positive values cause
  200. * a clockwise rotation of the camera along the image viewing axis, and
  201. * negative values cause a counterclockwise rotation of the camera. Note
  202. * that a particular video capture filter may only implement a subset of
  203. * this range.
  204. *
  205. * @emem TAPICameraControl_Zoom | Specifies the zoom setting in millimeter units.
  206. * Values range from 10 to 600, and the default is video capture filter
  207. * specific.
  208. *
  209. * @emem TAPICameraControl_Exposure | Specifies the exposure setting in seconds
  210. * using the following formula. For values less than zero, the exposure
  211. * time is 1/2n seconds. For positive values and zero, the exposure time is
  212. * 2n seconds. Note that a particular video capture filter may only
  213. * implement a subset of this range.
  214. *
  215. * @emem TAPICameraControl_Iris | Specifies the iris setting expressed as the
  216. * fstop * 10.
  217. *
  218. * @emem TAPICameraControl_Focus | Specifies the camera focus setting as the
  219. * distance to the optimally focused target in millimeters. The range and
  220. * default values are video encoder filter specific. Note that a
  221. * particular video capture filter may only implement a subset of this
  222. * range.
  223. *
  224. * @emem TAPICameraControl_FlipVertical | Specifies that the picture is
  225. * flipped vertically.
  226. *
  227. * @emem TAPICameraControl_FlipHorizontal | Specifies that the picture is
  228. * flipped horizontally.
  229. *
  230. * @comm Our software-only implementation provides zoom, pan, tilt, vertical
  231. * flip and horizontal flip capabilities.
  232. ****************************************************************************/
  233. typedef enum tagTAPICameraControlProperty
  234. {
  235. TAPICameraControl_Pan = CameraControl_Pan,
  236. TAPICameraControl_Tilt = CameraControl_Tilt,
  237. TAPICameraControl_Roll = CameraControl_Roll,
  238. TAPICameraControl_Zoom = CameraControl_Zoom,
  239. TAPICameraControl_Exposure = CameraControl_Exposure,
  240. TAPICameraControl_Iris = CameraControl_Iris,
  241. TAPICameraControl_Focus = CameraControl_Focus,
  242. TAPICameraControl_FlipVertical = 0x100,
  243. TAPICameraControl_FlipHorizontal = 0x200
  244. } TAPICameraControlProperty;
  245. // ICameraControl interface (filter interface)
  246. interface DECLSPEC_UUID("4cda4f2d-969e-4223-801e-68267395fce4") ICameraControl : public IUnknown
  247. {
  248. public:
  249. virtual STDMETHODIMP GetRange(IN TAPICameraControlProperty Property, OUT long *plMin, OUT long *plMax, OUT long *plSteppingDelta, OUT long *plDefault, OUT TAPIControlFlags *plCapsFlags) PURE;
  250. virtual STDMETHODIMP Set(IN TAPICameraControlProperty Property, IN long lValue, IN TAPIControlFlags lFlags) PURE;
  251. virtual STDMETHODIMP Get(IN TAPICameraControlProperty Property, OUT long *plValue, OUT TAPIControlFlags *plFlags) PURE;
  252. };
  253. // IVideoControl interface (pin interface)
  254. interface DECLSPEC_UUID("12345678-30AC-11d0-A18C-00A0C9118956") IVideoControl : public IUnknown
  255. {
  256. public:
  257. virtual STDMETHODIMP GetCaps(OUT long *pCapsFlags) PURE;
  258. virtual STDMETHODIMP SetMode(IN long Mode) PURE;
  259. virtual STDMETHODIMP GetMode(OUT long *Mode) PURE;
  260. virtual STDMETHODIMP GetCurrentActualFrameRate(OUT LONGLONG *ActualFrameRate) PURE;
  261. virtual STDMETHODIMP GetMaxAvailableFrameRate(IN long iIndex, IN SIZE Dimensions, OUT LONGLONG *MaxAvailableFrameRate) PURE;
  262. virtual STDMETHODIMP GetFrameRateList(IN long iIndex, IN SIZE Dimensions, IN long *ListSize, OUT LONGLONG **FrameRates) PURE;
  263. };
  264. // RTP packetization descriptor control interface (pin interface)
  265. interface DECLSPEC_UUID("f454d51d-dfa4-4f88-ad4a-e64940eba1c0") IRTPPDControl : public IUnknown
  266. {
  267. public:
  268. virtual STDMETHODIMP SetMaxRTPPacketSize(IN DWORD dwMaxRTPPacketSize, IN DWORD dwLayerId) PURE;
  269. virtual STDMETHODIMP GetMaxRTPPacketSize(OUT LPDWORD pdwMaxRTPPacketSize, IN DWORD dwLayerId) PURE;
  270. virtual STDMETHODIMP GetMaxRTPPacketSizeRange(OUT LPDWORD pdwMin, OUT LPDWORD pdwMax, OUT LPDWORD pdwSteppingDelta, OUT LPDWORD pdwDefault, IN DWORD dwLayerId) PURE;
  271. };
  272. // Interface used to pass down an addrefed pointer to the IH245EncoderCommand interface (pin interface)
  273. interface DECLSPEC_UUID("dcbd33c7-dc65-48f1-8e83-22fdc954a8e7") IOutgoingInterface : public IUnknown
  274. {
  275. public:
  276. virtual STDMETHODIMP Set(IN IH245EncoderCommand *pIH245EncoderCommand) PURE;
  277. };
  278. typedef enum tagRTPPayloadHeaderMode
  279. {
  280. RTPPayloadHeaderMode_Draft = 0, // 0 = draft payload header (as for older compatibility, like Netmeeting)
  281. RTPPayloadHeaderMode_RFC2190 = 1 // 1 = standard payload header (as in RFC 2190)
  282. } RTPPayloadHeaderMode;
  283. // Interface used to switch the above mode in filters (TAPIVCap and TAPIVDec)
  284. interface DECLSPEC_UUID("d884c4e3-41d9-42a6-85c0-7d00658b4a26") IRTPPayloadHeaderMode : public IUnknown
  285. {
  286. public:
  287. virtual STDMETHODIMP SetMode(IN RTPPayloadHeaderMode rtpphmMode) PURE;
  288. };
  289. #endif