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.

327 lines
14 KiB

  1. /****************************************************************************
  2. * @doc INTERNAL TAPIH26X
  3. *
  4. * @module TAPIH26X.h | Header file for the supported compressed input formats.
  5. ***************************************************************************/
  6. #ifndef _TAPIH26X_H_
  7. #define _TAPIH26X_H_
  8. //#define USE_OLD_FORMAT_DEFINITION 1
  9. // RTP-packetized video subtypes
  10. #define STATIC_MEDIASUBTYPE_R263_V1 0x33363252L, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71
  11. #define STATIC_MEDIASUBTYPE_R261 0x31363252L, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71
  12. // H.26x specific structures
  13. /*****************************************************************************
  14. * @doc INTERNAL TAPIH26XSTRUCTENUM
  15. *
  16. * @struct BITMAPINFOHEADER_H263 | The <t BITMAPINFOHEADER_H263> structure
  17. * is used to specify the details of the H.263 video format.
  18. *
  19. * @field BITMAPINFOHEADER | bmi | Specifies a well-known GDI bitmap info
  20. * header structure.
  21. *
  22. * @field DWORD | dwMaxBitrate | Specifies the maximum bit rate in units of
  23. * 100 bits/s at which the receiver can receive video. This value is valid
  24. * between 1 and 192400.
  25. *
  26. * @field DWORD | dwBppMaxKb | Specifies the maximum number of bits for one
  27. * coded picture that the receiver can receive and decode correctly, and is
  28. * measured in units of 1024 bits. This value is valid between 0 and 65535.
  29. *
  30. * @field DWORD | dwHRD_B | Specifies the Hypothetical Reference Decoder
  31. * parameter B as described in Annex B of H.263. This value is valid
  32. * between 0 and 524287.
  33. *
  34. * @field DWORD | fUnrestrictedVector:1 | Specifies that the receiver can
  35. * receive video data using the unrestricted motion vectors mode as defined
  36. * in Annex D of H.263.
  37. *
  38. * @field DWORD | fArithmeticCoding:1| Specifies that the receiver can receive
  39. * video data using the syntax based arithmetic coding mode as defined in
  40. * Annex E of H.263.
  41. *
  42. * @field DWORD | fAdvancedPrediction:1 | Specifies that the receiver can
  43. * receive video data using the advanced prediction mode as defined in Annex
  44. * F of H.263.
  45. *
  46. * @field DWORD | fPBFrames:1 | Specifies that the receiver can receive video
  47. * data using the PB-frames mode as defined in Annex G of H.263.
  48. *
  49. * @field DWORD | fErrorCompensation:1 | Specifies that the receiver can
  50. * identify MBs received with transmission errors, treat them as not coded,
  51. * and send appropriate videoNotDecodedMBs indications.
  52. *
  53. * @field DWORD | fAdvancedIntraCodingMode:1 | Specifies that the receiver can
  54. * receive video data using the advanced INTRA coding mode as defined in
  55. * Annex I of H.263.
  56. *
  57. * @field DWORD | fDeblockingFilterMode:1 | Specifies that the receiver can
  58. * receive video data using the deblocking filter mode as defined in Annex J
  59. * of H.263.
  60. *
  61. * @field DWORD | fImprovedPBFrameMode:1 | Specifies that the receiver can
  62. * receive video data using the improved PB-frames mode as defined in Annex
  63. * M of H.263.
  64. *
  65. * @field DWORD | fUnlimitedMotionVectors:1 | Specifies that the receiver can
  66. * receive video data using the unrestricted motion vector range when
  67. * unrestricted motion vector mode as defined in Annex D of H.263 is also
  68. * indicated.
  69. *
  70. * @field DWORD | fFullPictureFreeze:1 | Specifies that the receiver can receive
  71. * Full Picture Freeze commands as described in Annex L of H.263.
  72. *
  73. * @field DWORD | fPartialPictureFreezeAndRelease:1 | Specifies that the
  74. * receiver can receive the Resizing Partial Picture Freeze and Release
  75. * commands as described in Annex L of H.263.
  76. *
  77. * @field DWORD | fResizingPartPicFreezeAndRelease:1 | Specifies that the
  78. * receiver can receive the Resizing Partial Picture Freeze and Release
  79. * commands as described in Annex L of H.263.
  80. *
  81. * @field DWORD | fFullPictureSnapshot:1 | Specifies that the receiver can
  82. * receive Full Picture snapshots of the video content as described in Annex L
  83. * of H.263.
  84. *
  85. * @field DWORD | fPartialPictureSnapshot:1 | Specifies that the receiver can
  86. * receive Partial Picture Snapshots of the video content as described in
  87. * Annex L of H.263.
  88. *
  89. * @field DWORD | fVideoSegmentTagging:1 | Specifies that the receiver can
  90. * receive Video Segment tagging for the video content as described in Annex L
  91. * of H.263.
  92. *
  93. * @field DWORD | fProgressiveRefinement:1 | Specifies that the receiver can
  94. * receive Progressive Refinement tagging as described in Annex L of H.263. In
  95. * addition, when true, the encoder shall respond to the progressive refinement
  96. * miscellaneous commands doOneProgression, doContinuousProgressions,
  97. * doOneIndependentProgression, doContinuousIndependentProgressions,
  98. * progressiveRefinementAbortOne, and progressiveRefinementAbortContinuous. In
  99. * addition, the encoder shall insert the Progressive Refinement Segment Start
  100. * Tags and the Progressive Refinement Segment End Tags as defined in the
  101. * Supplemental Enhancement Information Specification (Annex L) of
  102. * Recommendation H.263. Note, Progressive Refinement tagging can be sent by an
  103. * encoder and received by a decoder even when not commanded in a miscellaneous
  104. * command.
  105. *
  106. * @field DWORD | fDynamicPictureResizingByFour:1 | Specifies that the receiver
  107. * supports the picture resizing-by-four (with clipping) submode of the
  108. * implicit Reference Picture Resampling Mode (Annex P) of H.263.
  109. *
  110. * @field DWORD | fDynamicPictureResizingSixteenthPel:1 | Specifies that the
  111. * receiver supports resizing a reference picture to any width and height using
  112. * the implicit Reference Picture Resampling mode (Annex P) of H.263 (with
  113. * clipping). If DynamicPictureResizingSixteenthPel is true then
  114. * DynamicPictureResizingByFour shall be true.
  115. *
  116. * @field DWORD | fDynamicWarpingHalfPel:1 | Specifies that the receiver supports
  117. * the arbitrary picture warping operation within the Reference Picture
  118. * Resampling mode (Annex P) of H.263 (with any fill mode) using half-pixel
  119. * accuracy warping.
  120. *
  121. * @field DWORD | fDynamicWarpingSixteenthPel:1 | Specifies that the receiver
  122. * supports the arbitrary picture warping operation within the Reference Picture
  123. * Resampling mode (Annex P) of H.263 (with any fill mode) using either
  124. * half-pixel or sixteenth pixel accuracy warping.
  125. *
  126. * @field DWORD | fIndependentSegmentDecoding:1 | Specifies that the receiver
  127. * supports the Independent Segment Decoding Mode (H.263 Annex R) of H.263.
  128. *
  129. * @field DWORD | fSlicesInOrder_NonRect:1 | Specifies that the receiver supports
  130. * the submode of Slice Structured Mode (H.263 Annex K) where slices are
  131. * transmitted in order and contain macroblocks in scanning order of the
  132. * picture.
  133. *
  134. * @field DWORD | fSlicesInOrder_Rect:1 | Specifies that the receiver supports
  135. * the submode of Slice Structured Mode (H.263 Annex K) where slices are
  136. * transmitted in order and the slice occupies a rectangular region of the
  137. * picture.
  138. *
  139. * @field DWORD | fSlicesNoOrder_NonRect:1 | Specifies that the receiver
  140. * supports the submode of Slice Structured Mode (H.263 Annex K) where
  141. * slices contain macroblocks in scanning order of the picture and need
  142. * not be transmitted in order.
  143. *
  144. * @field DWORD | fSlicesNoOrder_Rect:1 | Specifies that the receiver
  145. * supports the submode of Slice Structured Mode (H.263 Annex K) where
  146. * slices occupy a rectangular region of the picture and need not be
  147. * transmitted in order.
  148. *
  149. * @field DWORD | fAlternateInterVLCMode:1 | Specifies that the receiver
  150. * can receive video data using the alternate inter VLC mode as defined
  151. * in Annex S of H.263.
  152. *
  153. * @field DWORD | fModifiedQuantizationMode:1 | Specifies that the receiver
  154. * can receive video data using the modified quantization mode as defined
  155. * in Annex T of H.263.
  156. *
  157. * @field DWORD | fReducedResolutionUpdate:1 | Specifies that the receiver
  158. * can receive video data using the reduced resolution update mode as
  159. * defined in Annex Q of H.263.
  160. *
  161. * @field DWORD | fReserved:4 | Reserved. Shall be set to 0.
  162. *
  163. * @field DWORD | dwReserved[4] | Reserved. Shall all be set to 0.
  164. ***************************************************************************/
  165. #define MAX_BITRATE_H263 (192400)
  166. typedef struct tagBITMAPINFOHEADER_H263
  167. {
  168. // Generic bitmap info header fields
  169. BITMAPINFOHEADER bmi;
  170. #ifndef USE_OLD_FORMAT_DEFINITION
  171. // H.263 specific fields
  172. DWORD dwMaxBitrate;
  173. DWORD dwBppMaxKb;
  174. DWORD dwHRD_B;
  175. // Options
  176. DWORD fUnrestrictedVector:1;
  177. DWORD fArithmeticCoding:1;
  178. DWORD fAdvancedPrediction:1;
  179. DWORD fPBFrames:1;
  180. DWORD fErrorCompensation:1;
  181. DWORD fAdvancedIntraCodingMode:1;
  182. DWORD fDeblockingFilterMode:1;
  183. DWORD fImprovedPBFrameMode:1;
  184. DWORD fUnlimitedMotionVectors:1;
  185. DWORD fFullPictureFreeze:1;
  186. DWORD fPartialPictureFreezeAndRelease:1;
  187. DWORD fResizingPartPicFreezeAndRelease:1;
  188. DWORD fFullPictureSnapshot:1;
  189. DWORD fPartialPictureSnapshot:1;
  190. DWORD fVideoSegmentTagging:1;
  191. DWORD fProgressiveRefinement:1;
  192. DWORD fDynamicPictureResizingByFour:1;
  193. DWORD fDynamicPictureResizingSixteenthPel:1;
  194. DWORD fDynamicWarpingHalfPel:1;
  195. DWORD fDynamicWarpingSixteenthPel:1;
  196. DWORD fIndependentSegmentDecoding:1;
  197. DWORD fSlicesInOrder_NonRect:1;
  198. DWORD fSlicesInOrder_Rect:1;
  199. DWORD fSlicesNoOrder_NonRect:1;
  200. DWORD fSlicesNoOrder_Rect:1;
  201. DWORD fAlternateInterVLCMode:1;
  202. DWORD fModifiedQuantizationMode:1;
  203. DWORD fReducedResolutionUpdate:1;
  204. DWORD fReserved:4;
  205. // Reserved
  206. DWORD dwReserved[4];
  207. #endif
  208. } BITMAPINFOHEADER_H263, *PBITMAPINFOHEADER_H263;
  209. /*****************************************************************************
  210. * @doc INTERNAL TAPIH26XSTRUCTENUM
  211. *
  212. * @struct VIDEOINFOHEADER_H263 | The <t VIDEOINFOHEADER_H263> structure
  213. * is used to specify the details of the H.263 video format.
  214. *
  215. * @field RECT | rcSource | Specifies a <t RECT> structure that defines the
  216. * source video window.
  217. *
  218. * @field RECT | rcTarget | Specifies a <t RECT> structure that defines the
  219. * destination video window.
  220. *
  221. * @field DWORD | dwBitRate | Specifies a <t DWORD> value that indicates
  222. * the video stream's approximate data rate, in bits per second.
  223. *
  224. * @field DWORD | dwBitErrorRate | Specifies a <t DWORD> value that
  225. * indicates the video stream's data error rate, in bit errors per second.
  226. *
  227. * @field REFERENCE_TIME | AvgTimePerFrame | Specifies a <t REFERENCE_TIME>
  228. * value that indicates the video frame's average display time, in
  229. * 100-nanosecond units.
  230. *
  231. * @field BITMAPINFOHEADER_H263 | bmiHeader | Specifies a
  232. * <t BITMAPINFOHEADER_H263> structure that contains detailed format
  233. * information for the H.263 video data.
  234. ***************************************************************************/
  235. typedef struct tagVIDEOINFOHEADER_H263
  236. {
  237. RECT rcSource; // The bit we really want to use
  238. RECT rcTarget; // Where the video should go
  239. DWORD dwBitRate; // Approximate bit data rate
  240. DWORD dwBitErrorRate; // Bit error rate for this stream
  241. REFERENCE_TIME AvgTimePerFrame; // Average time per frame (100ns units)
  242. BITMAPINFOHEADER_H263 bmiHeader;
  243. } VIDEOINFOHEADER_H263, *PVIDEOINFOHEADER_H263;
  244. /*****************************************************************************
  245. * @doc INTERNAL TAPIH26XSTRUCTENUM
  246. *
  247. * @struct BITMAPINFOHEADER_H261 | The <t BITMAPINFOHEADER_H261> structure
  248. * is used to specify the details of the H.261 video format.
  249. *
  250. * @field BITMAPINFOHEADER | bmi | Specifies a well-known GDI bitmap info
  251. * header structure.
  252. *
  253. * @field DWORD | dwMaxBitrate | Specifies the maximum bit rate in units
  254. * of 100 bits/s at which the receiver can receive video. This value is
  255. * only valid between 1 and 19200.
  256. *
  257. * @field BOOL | fStillImageTransmission | Specifies that the receiver can
  258. * receive still images as defined in Annex D of H.261.
  259. *
  260. * @field DWORD | dwReserved[4] | Reserved. Shall all be set to 0.
  261. ***************************************************************************/
  262. #define MAX_BITRATE_H261 (19200)
  263. typedef struct tagBITMAPINFOHEADER_H261
  264. {
  265. // Generic bitmap info header fields
  266. BITMAPINFOHEADER bmi;
  267. #ifndef USE_OLD_FORMAT_DEFINITION
  268. // H.261 specific fields
  269. DWORD dwMaxBitrate;
  270. BOOL fStillImageTransmission;
  271. // Reserved
  272. DWORD dwReserved[4];
  273. #endif
  274. } BITMAPINFOHEADER_H261, *PBITMAPINFOHEADER_H261;
  275. /*****************************************************************************
  276. * @doc INTERNAL TAPIH26XSTRUCTENUM
  277. *
  278. * @struct VIDEOINFOHEADER_H261 | The <t VIDEOINFOHEADER_H261> structure
  279. * is used to specify the details of the H.261 video format.
  280. *
  281. * @field RECT | rcSource | Specifies a <t RECT> structure that defines the
  282. * source video window.
  283. *
  284. * @field RECT | rcTarget | Specifies a <t RECT> structure that defines the
  285. * destination video window.
  286. *
  287. * @field DWORD | dwBitRate | Specifies a <t DWORD> value that indicates
  288. * the video stream's approximate data rate, in bits per second.
  289. *
  290. * @field DWORD | dwBitErrorRate | Specifies a <t DWORD> value that
  291. * indicates the video stream's data error rate, in bit errors per second.
  292. *
  293. * @field REFERENCE_TIME | AvgTimePerFrame | Specifies a <t REFERENCE_TIME>
  294. * value that indicates the video frame's average display time, in
  295. * 100-nanosecond units.
  296. *
  297. * @field BITMAPINFOHEADER_H261 | bmiHeader | Specifies a
  298. * <t BITMAPINFOHEADER_H261> structure that contains detailed format
  299. * information for the H.261 video data.
  300. ***************************************************************************/
  301. typedef struct tagVIDEOINFOHEADER_H261
  302. {
  303. RECT rcSource; // The bit we really want to use
  304. RECT rcTarget; // Where the video should go
  305. DWORD dwBitRate; // Approximate bit data rate
  306. DWORD dwBitErrorRate; // Bit error rate for this stream
  307. REFERENCE_TIME AvgTimePerFrame; // Average time per frame (100ns units)
  308. BITMAPINFOHEADER_H261 bmiHeader;
  309. } VIDEOINFOHEADER_H261, *PVIDEOINFOHEADER_H261;
  310. #endif // _TAPIH26X_H_