Source code of Windows XP (NT5)
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.

1273 lines
50 KiB

  1. #ifndef _INC_VCM
  2. #define _INC_VCM /* #defined if vcmStrm.h has been included */
  3. #if defined(UNICODE) && !defined(_UNICODE)
  4. #define _UNICODE
  5. #endif
  6. #pragma pack(1) /* Assume 1 byte packing throughout */
  7. #ifdef __cplusplus
  8. extern "C" { /* Assume C declarations for C++ */
  9. #endif /* __cplusplus */
  10. /****************************************************************************
  11. Table Of Contents
  12. ****************************************************************************/
  13. /****************************************************************************
  14. @doc EXTERNAL
  15. @contents1 Contents | To display a list of topics by category, click any
  16. of the contents entries below. To display an alphabetical list of
  17. topics, choose the Index button.
  18. @head3 Introduction |
  19. The vcmStreamXXX APIs are defined to simplify integration of video
  20. compression and decompression in NetMeeting's datapump. Currently, the datapump
  21. behavior relies a lot on the acmStreamXXX APIs. In order to limit the amount of modifications that need to be applied
  22. to the datapump, we define video compression APIs with a behavior similar to
  23. the audio compression APIs. Integration in the datapump will be achieved by defining
  24. a FilterVideoManager class identical to the FilterManager class, where calls to
  25. acmStreamXXX functions are simply replaced by calls to vcmStreamXXX functions.
  26. @head3 vcmStreamXXX Compression/Decompression API |
  27. @subindex Functions
  28. @subindex Structures and Enums
  29. @subindex Messages
  30. @head3 vcmDevCapsXXX Capture Device Capabilities API |
  31. @subindex Functions
  32. @subindex Structures and Enums
  33. @subindex Messages
  34. @head3 Other |
  35. @subindex Modules
  36. @subindex Constants
  37. ***********************************************************************
  38. @contents2 Compression/Decompression Functions |
  39. @index func | COMPFUNC
  40. ***********************************************************************
  41. @contents2 Compression/Decompression Structures and Enums |
  42. @index struct,enum | COMPSTRUCTENUM
  43. ***********************************************************************
  44. @contents2 Compression/Decompression Messages |
  45. @index msg | COMPMSG
  46. ***********************************************************************
  47. @contents2 Capture Device Capabilities Functions |
  48. @index func | DEVCAPSFUNC
  49. ***********************************************************************
  50. @contents2 Capture Device Capabilities Structures and Enums |
  51. @index struct,enum | DEVCAPSSTRUCTENUM
  52. ***********************************************************************
  53. @contents2 Modules |
  54. @index module |
  55. ***********************************************************************
  56. @contents2 Constants |
  57. @index const |
  58. ****************************************************************************/
  59. /*****************************************************************************
  60. * @doc EXTERNAL COMPSTRUCTENUM
  61. *
  62. * @struct VIDEOFORMATEX | The <t VIDEOFORMATEX> structure defines the format used to
  63. * capture video data and settings for the capture device.
  64. *
  65. * @field DWORD | dwFormatTag | Specifies the video format type (FOURCC code).
  66. *
  67. * @field DWORD | nSamplesPerSec | Specifies the sample rate, in frames per second.
  68. *
  69. * @field DWORD | nAvgBytesPerSec | Specifies the average data-transfer rate, in bytes per second.
  70. *
  71. * @field DWORD | nMinBytesPerSec | Specifies the minimum data-transfer rate, in bytes per second.
  72. *
  73. * @field DWORD | nMaxBytesPerSec | Specifies the maximum data-transfer rate, in bytes per second.
  74. *
  75. * @field DWORD | nBlockAlign | Specifies the block alignment, in bytes.
  76. *
  77. * @field DWORD | wBitsPerSample | Specifies the bits per sample for the wFormatTag format type.
  78. *
  79. * @field DWORD | dwRequestMicroSecPerFrame | Specifies the requested frame rate, in microseconds.
  80. *
  81. * @field DWORD | dwPercentDropForError | Specifies the maximum allowable percentage of dropped frames during capture.
  82. *
  83. * @field DWORD | dwNumVideoRequested | This specifies the maximum number of video buffers to allocate.
  84. *
  85. * @field DWORD | dwSupportTSTradeOff | Specifies the usage of temporal/spatial trade off.
  86. *
  87. * @field BOOL | bLive | Specifies if the preview is to be allowed.
  88. *
  89. * @field HWND | hWndParent | Specifies handle of the parent window.
  90. *
  91. * @field DWORD | dwFormatSize | Specifies the size of the actual video format.
  92. *
  93. * @field DWORD | biSize | Specifies the number of bytes required by the spatial information.
  94. *
  95. * @field LONG | biWidth | Specifies the width of the bitmap, in pixels.
  96. *
  97. * @field LONG | biHeight | Specifies the height of the bitmap, in pixels.
  98. *
  99. * @field WORD | biPlanes | Specifies the number of planes for the target device.
  100. *
  101. * @field WORD | biBitCount | Specifies the number of bits per pixel.
  102. *
  103. * @field DWORD | biCompression | Specifies the type of compression.
  104. *
  105. * @field DWORD | biSizeImage | Specifies the size, in bytes, of the image.
  106. *
  107. * @field LONG | biXPelsPerMeter | Specifies the horizontal resolution, in pixels per meter, of the target device for the bitmap.
  108. *
  109. * @field LONG | biYPelsPerMeter | Specifies the vertical resolution, in pixels per meter, of the target device for the bitmap.
  110. *
  111. * @field DWORD | biClrUsed | Specifies the number of color indices in the color table that are actually used by the bitmap.
  112. *
  113. * @field DWORD | biClrImportant | Specifies the number of color indices that are considered important for displaying the bitmap.
  114. *
  115. * @field DWORD | bmiColors[256] | Specifies an array of 256 RGBQUADs.
  116. *
  117. * @type PVIDEOFORMATEX | Pointer to a <t VIDEOFORMATEX> structure.
  118. *
  119. ****************************************************************************/
  120. #define VCMAPI WINAPI
  121. /****************************************************************************
  122. vcmStrm Constants
  123. ****************************************************************************/
  124. /*****************************************************************************
  125. * @doc EXTERNAL CONSTANTS
  126. *
  127. * @const WAVE_FORMAT_UNKNOWN | VIDEO_FORMAT_UNKNOWN | Constant for unknown video format.
  128. *
  129. * @const BI_RGB | VIDEO_FORMAT_BI_RGB | RGB video format.
  130. *
  131. * @const BI_RLE8 | VIDEO_FORMAT_BI_RLE8 | RLE 8 video format.
  132. *
  133. * @const BI_RLE4 | VIDEO_FORMAT_BI_RLE4 | RLE 4 video format.
  134. *
  135. * @const BI_BITFIELDS | VIDEO_FORMAT_BI_BITFIELDS | RGB Bit Fields video format.
  136. *
  137. * @const MAKEFOURCC('c','v','i','d') | VIDEO_FORMAT_CVID | Cinepack video format.
  138. *
  139. * @const MAKEFOURCC('I','V','3','2') | VIDEO_FORMAT_IV32 | Intel Indeo IV32 video format.
  140. *
  141. * @const MAKEFOURCC('Y','V','U','9') | VIDEO_FORMAT_YVU9 | Intel Indeo YVU9 video format.
  142. *
  143. * @const MAKEFOURCC('M','S','V','C') | VIDEO_FORMAT_MSVC | Microsoft CRAM video format.
  144. *
  145. * @const MAKEFOURCC('M','R','L','E') | VIDEO_FORMAT_MRLE | Microsoft RLE video format.
  146. *
  147. * @const MAKEFOURCC('h','2','6','3') | VIDEO_FORMAT_INTELH263 | Intel H.263 video format.
  148. *
  149. * @const MAKEFOURCC('h','2','6','1') | VIDEO_FORMAT_INTELH261 | Intel H.261 video format.
  150. *
  151. * @const MAKEFOURCC('M','2','6','3') | VIDEO_FORMAT_MSH263 | Microsoft H.263 video format.
  152. *
  153. * @const MAKEFOURCC('M','2','6','1') | VIDEO_FORMAT_MSH261 | Microsoft H.261 video format.
  154. *
  155. * @const MAKEFOURCC('V','D','E','C') | VIDEO_FORMAT_VDEC | Color QuickCam video format.
  156. *
  157. ****************************************************************************/
  158. #define VIDEO_FORMAT_UNKNOWN WAVE_FORMAT_UNKNOWN
  159. #define VIDEO_FORMAT_BI_RGB BI_RGB
  160. #define VIDEO_FORMAT_BI_RLE8 BI_RLE8
  161. #define VIDEO_FORMAT_BI_RLE4 BI_RLE4
  162. #define VIDEO_FORMAT_BI_BITFIELDS BI_BITFIELDS
  163. #define VIDEO_FORMAT_CVID MAKEFOURCC('C','V','I','D') // hex: 0x44495643
  164. #define VIDEO_FORMAT_IV31 MAKEFOURCC('I','V','3','1') // hex: 0x31335649
  165. #define VIDEO_FORMAT_IV32 MAKEFOURCC('I','V','3','2') // hex: 0x32335649
  166. #define VIDEO_FORMAT_YVU9 MAKEFOURCC('Y','V','U','9') // hex: 0x39555659
  167. #define VIDEO_FORMAT_I420 MAKEFOURCC('I','4','2','0')
  168. #define VIDEO_FORMAT_IYUV MAKEFOURCC('I','Y','U','V')
  169. #define VIDEO_FORMAT_MSVC MAKEFOURCC('M','S','V','C') // hex: 0x4356534d
  170. #define VIDEO_FORMAT_MRLE MAKEFOURCC('M','R','L','E') // hex: 0x454c524d
  171. #define VIDEO_FORMAT_INTELH263 MAKEFOURCC('H','2','6','3') // hex: 0x33363248
  172. #define VIDEO_FORMAT_INTELH261 MAKEFOURCC('H','2','6','1') // hex: 0x31363248
  173. #define VIDEO_FORMAT_INTELI420 MAKEFOURCC('I','4','2','0') // hex: 0x30323449
  174. #define VIDEO_FORMAT_INTELRT21 MAKEFOURCC('R','T','2','1') // hex: 0x31325452
  175. #define VIDEO_FORMAT_MSH263 MAKEFOURCC('M','2','6','3') // hex: 0x3336324d
  176. #define VIDEO_FORMAT_MSH261 MAKEFOURCC('M','2','6','1') // hex: 0x3136324d
  177. #if !defined(_ALPHA_) && defined(USE_BILINEAR_MSH26X)
  178. #define VIDEO_FORMAT_MSH26X MAKEFOURCC('M','2','6','X') // hex: 0x5836324d
  179. #endif
  180. #define VIDEO_FORMAT_Y411 MAKEFOURCC('Y','4','1','1') // hex:
  181. #define VIDEO_FORMAT_YUY2 MAKEFOURCC('Y','U','Y','2') // hex:
  182. #define VIDEO_FORMAT_YVYU MAKEFOURCC('Y','V','Y','U') // hex:
  183. #define VIDEO_FORMAT_UYVY MAKEFOURCC('U','Y','V','Y') // hex:
  184. #define VIDEO_FORMAT_Y211 MAKEFOURCC('Y','2','1','1') // hex:
  185. // VDOnet VDOWave codec
  186. #define VIDEO_FORMAT_VDOWAVE MAKEFOURCC('V','D','O','W') // hex:
  187. // Color QuickCam video codec
  188. #define VIDEO_FORMAT_VDEC MAKEFOURCC('V','D','E','C') // hex: 0x43454456
  189. // Dec Alpha
  190. #define VIDEO_FORMAT_DECH263 MAKEFOURCC('D','2','6','3') // hex: 0x33363248
  191. #define VIDEO_FORMAT_DECH261 MAKEFOURCC('D','2','6','1') // hex: 0x31363248
  192. // MPEG4 Scrunch codec
  193. #ifdef USE_MPEG4_SCRUNCH
  194. #define VIDEO_FORMAT_MPEG4_SCRUNCH MAKEFOURCC('M','P','G','4') // hex:
  195. #endif
  196. //--------------------------------------------------------------------------;
  197. //
  198. // VCM General API's and Defines
  199. //
  200. //
  201. //
  202. //
  203. //--------------------------------------------------------------------------;
  204. //
  205. // there are four types of 'handles' used by the VCM. the first three
  206. // are unique types that define specific objects:
  207. //
  208. // HVCMDRIVERID: used to _identify_ an VCM driver. this identifier can be
  209. // used to _open_ the driver for querying details, etc about the driver.
  210. //
  211. // HVCMDRIVER: used to manage a driver (codec, filter, etc). this handle
  212. // is much like a handle to other media drivers--you use it to send
  213. // messages to the converter, query for capabilities, etc.
  214. //
  215. // HVCMSTREAM: used to manage a 'stream' (conversion channel) with the
  216. // VCM. you use a stream handle to convert data from one format/type
  217. // to another--much like dealing with a file handle.
  218. //
  219. //
  220. // the fourth handle type is a generic type used on VCM functions that
  221. // can accept two or more of the above handle types (for example the
  222. // vcmMetrics and vcmDriverID functions).
  223. //
  224. // HVCMOBJ: used to identify VCM objects. this handle is used on functions
  225. // that can accept two or more VCM handle types.
  226. //
  227. DECLARE_HANDLE(HVCMDRIVERID);
  228. typedef HVCMDRIVERID *PHVCMDRIVERID;
  229. DECLARE_HANDLE(HVCMDRIVER);
  230. typedef HVCMDRIVER *PHVCMDRIVER;
  231. DECLARE_HANDLE(HVCMSTREAM);
  232. typedef HVCMSTREAM *PHVCMSTREAM;
  233. DECLARE_HANDLE(HVCMOBJ);
  234. typedef HVCMOBJ *PHVCMOBJ;
  235. /****************************************************************************
  236. callback function type
  237. ****************************************************************************/
  238. typedef void (CALLBACK* VCMSTREAMPROC) (HVCMSTREAM hvs, UINT uMsg, DWORD_PTR dwInstance, DWORD_PTR dwParam1, DWORD_PTR dwParam2);
  239. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  240. //
  241. // VCM Error Codes
  242. //
  243. // Note that these error codes are specific errors that apply to the VCM
  244. // directly--general errors are defined as MMSYSERR_*.
  245. //
  246. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  247. #ifndef _MMRESULT_
  248. #define _MMRESULT_
  249. typedef UINT MMRESULT;
  250. #endif
  251. /*****************************************************************************
  252. * @doc EXTERNAL CONSTANTS
  253. *
  254. * @const ACMERR_BASE | VCMERR_BASE | Base for video errors.
  255. *
  256. * @const (VCMERR_BASE + 0) | VCMERR_NOTPOSSIBLE | Unsupported video compression format.
  257. *
  258. * @const (VCMERR_BASE + 1) | VCMERR_BUSY | Compression header is already or still queued.
  259. *
  260. * @const (VCMERR_BASE + 2) | VCMERR_UNPREPARED | Compression header is not prepared.
  261. *
  262. * @const (VCMERR_BASE + 3) | VCMERR_CANCELED | User canceled operation.
  263. *
  264. * @const (VCMERR_BASE + 4) | VCMERR_FAILED | Compression operation failed.
  265. *
  266. * @const (VCMERR_BASE + 5) | VCMERR_NOREGENTRY | Failed to read/write registry entry.
  267. *
  268. * @const (VCMERR_BASE + 6) | VCMERR_NONSPECIFIC | Some error occured.
  269. *
  270. * @const (VCMERR_BASE + 7) | VCERR_NOMOREPACKETS | No more packets to receive a payload header.
  271. *
  272. ****************************************************************************/
  273. #define VCMERR_BASE ACMERR_BASE
  274. #define VCMERR_NOTPOSSIBLE (VCMERR_BASE + 0)
  275. #define VCMERR_BUSY (VCMERR_BASE + 1)
  276. #define VCMERR_UNPREPARED (VCMERR_BASE + 2)
  277. #define VCMERR_CANCELED (VCMERR_BASE + 3)
  278. #define VCMERR_FAILED (VCMERR_BASE + 4)
  279. #define VCMERR_NOREGENTRY (VCMERR_BASE + 5)
  280. #define VCMERR_NONSPECIFIC (VCMERR_BASE + 6)
  281. #define VCMERR_NOMOREPACKETS (VCMERR_BASE + 7)
  282. #define VCMERR_PSCMISSING (VCMERR_BASE + 8)
  283. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  284. //
  285. // VCM Window Messages
  286. //
  287. // These window messages are sent by the VCM or VCM drivers to notify
  288. // applications of events.
  289. //
  290. // Note that these window message numbers will also be defined in
  291. // mmsystem.
  292. //
  293. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  294. /*****************************************************************************
  295. * @doc EXTERNAL COMPMSG
  296. *
  297. * @msg VCM_OPEN | This message is sent to a video compression callback function when
  298. * a video compression stream is opened.
  299. *
  300. * @parm DWORD | dwParam1 | Currently unused.
  301. *
  302. * @parm DWORD | dwParam2 | Currently unused.
  303. *
  304. * @rdesc None
  305. *
  306. * @xref <m MM_VCM_OPEN>
  307. ****************************************************************************/
  308. /*****************************************************************************
  309. * @doc EXTERNAL COMPMSG
  310. *
  311. * @msg MM_VCM_OPEN | This message is sent to a window when a video compression
  312. * stream is opened.
  313. *
  314. * @parm WORD | wParam | Specifies a handle to the video compression stream
  315. * that was opened.
  316. *
  317. * @parm LONG | lParam | Currently unused.
  318. *
  319. * @rdesc None
  320. *
  321. * @xref <m VCM_OPEN>
  322. ****************************************************************************/
  323. /*****************************************************************************
  324. * @doc EXTERNAL COMPMSG
  325. *
  326. * @msg VCM_CLOSE | This message is sent to a video compression stream function when
  327. * a video ccompression stream is closed. The stream handle is no longer
  328. * valid once this message has been sent.
  329. *
  330. * @parm DWORD | dwParam1 | Currently unused.
  331. *
  332. * @parm DWORD | dwParam2 | Currently unused.
  333. *
  334. * @rdesc None
  335. *
  336. * @xref <m MM_VCM_CLOSE>
  337. ****************************************************************************/
  338. /*****************************************************************************
  339. * @doc EXTERNAL COMPMSG
  340. *
  341. * @msg MM_VCM_CLOSE | This message is sent to a window when a video compression
  342. * stream is closed. The stream handle is no longer valid once this message
  343. * has been sent.
  344. *
  345. * @parm WORD | wParam | Specifies a handle to the video compression stream
  346. * that was closed.
  347. *
  348. * @parm LONG | lParam | Currently unused.
  349. *
  350. * @rdesc None
  351. *
  352. * @xref <m VCM_CLOSE>
  353. ****************************************************************************/
  354. /*****************************************************************************
  355. * @doc EXTERNAL COMPMSG
  356. *
  357. * @msg VCM_DONE | This message is sent to a video compression stream callback function when
  358. * video data is present in the compression buffer and the buffer is being
  359. * returned to the application. The message can be sent either when the
  360. * buffer is full, or after the <f acmStreamReset> function is called.
  361. *
  362. * @parm DWORD | dwParam1 | Specifies a far pointer to a <t VCMSTREAMHDR> structure
  363. * identifying the buffer containing the compressed video data.
  364. *
  365. * @parm DWORD | dwParam2 | Currently unused.
  366. *
  367. * @rdesc None
  368. *
  369. * @comm The returned buffer may not be full. Use the <e VCMSTREAMHDR.dwDstBytesUsed>
  370. * field of the <t VCMSTREAMHDR> structure specified by <p dwParam1> to
  371. * determine the number of valid bytes into the returned buffer.
  372. *
  373. * @xref <m MM_VCM_DONE>
  374. ****************************************************************************/
  375. /*****************************************************************************
  376. * @doc EXTERNAL COMPMSG
  377. *
  378. * @msg MM_VCM_DONE | This message is sent to a window when video data is
  379. * present in the compression buffer and the buffer is being returned to the
  380. * application. The message can be sent either when the buffer is full, or
  381. * after the <f acmStreamReset> function is called.
  382. *
  383. * @parm WORD | wParam | Specifies a handle to the video compression stream
  384. * that received the compressed video data.
  385. *
  386. * @parm LONG | lParam | Specifies a far pointer to a <t VCMSTREAMHDR> structure
  387. * identifying the buffer containing the compressed video data.
  388. *
  389. * @rdesc None
  390. *
  391. * @comm The returned buffer may not be full. Use the <e VCMSTREAMHDR.dwDstBytesUsed>
  392. * field of the <t VCMSTREAMHDR> structure specified by <p lParam> to
  393. * determine the number of valid bytes into the returned buffer.
  394. *
  395. * @xref <m VCM_DONE>
  396. ****************************************************************************/
  397. #define MM_VCM_OPEN (MM_STREAM_OPEN) // conversion callback messages
  398. #define MM_VCM_CLOSE (MM_STREAM_CLOSE)
  399. #define MM_VCM_DONE (MM_STREAM_DONE)
  400. #define VCM_OPEN (MM_STREAM_OPEN) // conversion states
  401. #define VCM_CLOSE (MM_STREAM_CLOSE)
  402. #define VCM_DONE (MM_STREAM_DONE)
  403. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  404. //
  405. // vcmMetrics()
  406. //
  407. //
  408. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  409. MMRESULT VCMAPI vcmMetrics
  410. (
  411. HVCMOBJ hvo,
  412. UINT uMetric,
  413. LPVOID pMetric
  414. );
  415. #define VCM_METRIC_COUNT_DRIVERS 1
  416. #define VCM_METRIC_COUNT_CODECS 2
  417. #define VCM_METRIC_COUNT_CONVERTERS 3
  418. #define VCM_METRIC_COUNT_FILTERS 4
  419. #define VCM_METRIC_COUNT_DISABLED 5
  420. #define VCM_METRIC_COUNT_HARDWARE 6
  421. #define VCM_METRIC_COUNT_COMPRESSORS 7
  422. #define VCM_METRIC_COUNT_DECOMPRESSORS 8
  423. #define VCM_METRIC_COUNT_LOCAL_DRIVERS 20
  424. #define VCM_METRIC_COUNT_LOCAL_CODECS 21
  425. #define VCM_METRIC_COUNT_LOCAL_CONVERTERS 22
  426. #define VCM_METRIC_COUNT_LOCAL_FILTERS 23
  427. #define VCM_METRIC_COUNT_LOCAL_DISABLED 24
  428. #define VCM_METRIC_HARDWARE_VIDEO_INPUT 30
  429. #define VCM_METRIC_HARDWARE_VIDEO_OUTPUT 31
  430. #define VCM_METRIC_MAX_SIZE_FORMAT 50
  431. #define VCM_METRIC_MAX_SIZE_FILTER 51
  432. #define VCM_METRIC_MAX_SIZE_BITMAPINFOHEADER 52
  433. #define VCM_METRIC_DRIVER_SUPPORT 100
  434. #define VCM_METRIC_DRIVER_PRIORITY 101
  435. //--------------------------------------------------------------------------;
  436. //
  437. // VCM Drivers
  438. //
  439. //
  440. //
  441. //
  442. //--------------------------------------------------------------------------;
  443. #define VCMDM_USER (DRV_USER + 0x0000)
  444. #define VCMDM_RESERVED_LOW (DRV_USER + 0x2000)
  445. #define VCMDM_RESERVED_HIGH (DRV_USER + 0x2FFF)
  446. #define VCMDM_BASE VCMDM_RESERVED_LOW
  447. #define VCMDM_DRIVER_ABOUT (VCMDM_BASE + 11)
  448. //
  449. // VCMDRIVERDETAILS
  450. //
  451. // the VCMDRIVERDETAILS structure is used to get various capabilities from
  452. // an VCM driver (codec, converter, filter).
  453. //
  454. #define VCMDRIVERDETAILS_SHORTNAME_CHARS 16
  455. #define VCMDRIVERDETAILS_LONGNAME_CHARS 128
  456. #define VCMDRIVERDETAILS_MODULE_CHARS 128
  457. /*****************************************************************************
  458. * @doc EXTERNAL COMPSTRUCTENUM
  459. *
  460. * @struct VCMDRIVERDETAILS | The <t VCMDRIVERDETAILS> structure describes
  461. * various details of a Video Compression Manager (VCM) driver.
  462. *
  463. * @field DWORD | dwSize | Specifies the size, in bytes, of the valid
  464. * information contained in the <t VCMDRIVERDETAILS> structure.
  465. * An application should initialize this member to the size, in bytes, of
  466. * the desired information. The size specified in this member must be
  467. * large enough to contain the <e VCMDRIVERDETAILS.dwSize> member of
  468. * the <t VCMDRIVERDETAILS> structure. When the <f vcmDriverDetails>
  469. * function returns, this member contains the actual size of the
  470. * information returned. The returned information will never exceed
  471. * the requested size.
  472. *
  473. * @field FOURCC | fccType | Specifies the type of the driver. For VCM drivers, set
  474. * this member to <p vidc>, which represents VCMDRIVERDETAILS_FCCTYPE_VIDEOCODEC.
  475. *
  476. * @field FOURCC | fccHandler | Specifies a four-character code identifying a specific compressor.
  477. *
  478. * @field DWORD | dwFlags | Specifies applicable flags.
  479. *
  480. * @field DWORD | dwVersion | Specifies version number of the driver.
  481. *
  482. * @field DWORD | dwVersionICM | Specifies theersion of VCM supported by the driver.
  483. * This member should be set to ICVERSION.
  484. *
  485. * @field WCHAR | szName[VCMDRIVERDETAILS_SHORTNAME_CHARS] | Specifies
  486. * a NULL-terminated string that describes the short version of the compressor name.
  487. *
  488. * @field WCHAR | szDescription[VCMDRIVERDETAILS_LONGNAME_CHARS] | Specifies a
  489. * NULL-terminated string that describes the long version of the compressor name.
  490. *
  491. * @field WCHAR | szDriver[VCMDRIVERDETAILS_MODULE_CHARS] | Specifies
  492. * a NULL-terminated string that provides the name of the module containing the VCM compression driver.
  493. *
  494. * @xref <f vcmDriverDetails>
  495. ****************************************************************************/
  496. // This structure is equivalent to ICINFO
  497. typedef struct tVCMDRIVERDETAILS
  498. {
  499. DWORD dwSize; // Size, in bytes, of this structure
  500. DWORD fccType; // Four-character code indicating the type of stream being compressed or decompressed. Specify "VIDC" for video streams.
  501. DWORD fccHandler; // A four-character code identifying a specific compressor
  502. DWORD dwFlags; // Applicable flags
  503. DWORD dwVersion; // Version number of the driver
  504. DWORD dwVersionICM; // Version of VCM supported by the driver. This member should be set to ICVERSION
  505. WCHAR szName[VCMDRIVERDETAILS_SHORTNAME_CHARS]; // Short version of the compressor name
  506. WCHAR szDescription[VCMDRIVERDETAILS_LONGNAME_CHARS]; // Long version of the compressor name
  507. WCHAR szDriver[VCMDRIVERDETAILS_MODULE_CHARS]; // Name of the module containing VCM compression driver. Normally, a driver does not need to fill this out.
  508. } VCMDRIVERDETAILS, *PVCMDRIVERDETAILS;
  509. #define VCMDRIVERDETAILS_FCCTYPE_VIDEOCODEC mmioFOURCC('v', 'i', 'd', 'c')
  510. #define VCMDRIVERDETAILS_FCCCOMP_UNDEFINED mmioFOURCC('\0', '\0', '\0', '\0')
  511. MMRESULT VCMAPI vcmDriverDetails
  512. (
  513. PVCMDRIVERDETAILS pvdd
  514. );
  515. //--------------------------------------------------------------------------;
  516. //
  517. // VCM Format Tags
  518. //
  519. //
  520. //
  521. //
  522. //--------------------------------------------------------------------------;
  523. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  524. //
  525. // vcmFormatTagDetails()
  526. //
  527. //
  528. //
  529. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  530. #define VCMFORMATTAGDETAILS_FORMATTAG_CHARS 48
  531. typedef struct tVCMFORMATTAGDETAILSA
  532. {
  533. DWORD cbStruct;
  534. DWORD dwFormatTagIndex;
  535. DWORD dwFormatTag;
  536. DWORD cbFormatSize;
  537. DWORD fdwSupport;
  538. DWORD cStandardFormats;
  539. char szFormatTag[VCMFORMATTAGDETAILS_FORMATTAG_CHARS];
  540. } VCMFORMATTAGDETAILSA, *PVCMFORMATTAGDETAILSA;
  541. typedef struct tVCMFORMATTAGDETAILSW
  542. {
  543. DWORD cbStruct;
  544. DWORD dwFormatTagIndex;
  545. DWORD dwFormatTag;
  546. DWORD cbFormatSize;
  547. DWORD fdwSupport;
  548. DWORD cStandardFormats;
  549. WCHAR szFormatTag[VCMFORMATTAGDETAILS_FORMATTAG_CHARS];
  550. } VCMFORMATTAGDETAILSW, *PVCMFORMATTAGDETAILSW;
  551. #ifdef _UNICODE
  552. #define VCMFORMATTAGDETAILS VCMFORMATTAGDETAILSW
  553. #define PVCMFORMATTAGDETAILS PVCMFORMATTAGDETAILSW
  554. #else
  555. #define VCMFORMATTAGDETAILS VCMFORMATTAGDETAILSA
  556. #define PVCMFORMATTAGDETAILS PVCMFORMATTAGDETAILSA
  557. #endif
  558. #define VCM_FORMATTAGDETAILSF_INDEX 0x00000000L
  559. #define VCM_FORMATTAGDETAILSF_FORMATTAG 0x00000001L
  560. #define VCM_FORMATTAGDETAILSF_LARGESTSIZE 0x00000002L
  561. #define VCM_FORMATTAGDETAILSF_QUERYMASK 0x0000000FL
  562. //--------------------------------------------------------------------------;
  563. //
  564. // VCM Formats
  565. //
  566. //
  567. //
  568. //
  569. //--------------------------------------------------------------------------;
  570. #define VCMFORMATDETAILS_FORMAT_CHARS 128
  571. /*****************************************************************************
  572. * @doc EXTERNAL COMPSTRUCTENUM
  573. *
  574. * @struct VCMFORMATDETAILS | The <t VCMFORMATDETAILS> structure details a
  575. * video format.
  576. *
  577. * @field DWORD | cbStruct | Specifies the size, in bytes, of the
  578. * <t VCMFORMATDETAILS> structure. This member must be initialized
  579. * before calling the <f vcmFormatDetails> or <f vcmFormatEnum>
  580. * functions. The size specified in this member must be large enough to
  581. * contain the base <t VCMFORMATDETAILS> structure. When the
  582. * <f vcmFormatDetails> function returns, this member contains the
  583. * actual size of the information returned. The returned information
  584. * will never exceed the requested size.
  585. *
  586. * @field DWORD | dwFormatTag | Specifies the video format tag that the
  587. * <t VCMFORMATDETAILS> structure describes. This member is always
  588. * returned if the <f vcmFormatDetails> is successful. This member
  589. * should be set to VIDEO_FORMAT_UNKNOWN before calling <f vcmFormatDetails>.
  590. *
  591. * @field DWORD | dwFlags | Specifies if the format the <p pvfx> field points
  592. * to is a format that can be generated by the capture driver + codec, decompressed
  593. * by the codec, or both.
  594. *
  595. * @flag VCM_FORMATENUMF_INPUT | Specifies that the format enumerated can be transmitted.
  596. *
  597. * @flag VCM_FORMATENUMF_OUTPUT | Specifies that the format enumerated can be received.
  598. *
  599. * @flag VCM_FORMATENUMF_BOTH | Specifies that the format enumerated can be transmitted and received.
  600. *
  601. * @field PVIDEOFORMATEX | pvfx | Specifies a pointer to a <t VIDEOFORMATEX>
  602. * data structure that will receive the format details. This structure requires no initialization
  603. * by the application.
  604. *
  605. * @field DWORD | cbvfx | Specifies the size, in bytes, available for
  606. * the <e VCMFORMATDETAILS.pvfx> to receive the format details. The
  607. * <f vcmMetrics> function can be used to
  608. * determine the maximum size required for any format available for
  609. * all installed VCM drivers.
  610. *
  611. * @field char | szFormat[VCMFORMATDETAILS_FORMAT_CHARS] |
  612. * Specifies a string that describes the format for the
  613. * <e VCMFORMATDETAILS.dwFormatTag> type. This string is always returned
  614. * if the <f vcmFormatDetails> function is successful.
  615. *
  616. * @xref <f vcmFormatDetails> <f vcmFormatEnum>
  617. ****************************************************************************/
  618. typedef struct tVCMFORMATDETAILS
  619. {
  620. DWORD cbStruct;
  621. DWORD dwFormatTag;
  622. DWORD dwFlags;
  623. PVIDEOFORMATEX pvfx;
  624. DWORD cbvfx;
  625. WCHAR szFormat[VCMFORMATDETAILS_FORMAT_CHARS];
  626. } VCMFORMATDETAILS, *PVCMFORMATDETAILS;
  627. MMRESULT VCMAPI vcmFormatDetails
  628. (
  629. PVCMFORMATDETAILS pvfd
  630. );
  631. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  632. //
  633. // vcmFormatEnum()
  634. //
  635. //
  636. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  637. /****************************************************************************
  638. * @doc EXTERNAL COMPFUNC
  639. *
  640. * @func BOOL VCMFORMATENUMCB | vcmFormatEnumCallback |
  641. * The <f ccmFormatEnumCallback> function refers to the callback function used for
  642. * Video Compression Manager (VCM) video format detail enumeration. The
  643. * <f vcmFormatEnumCallback> is a placeholder for the application-supplied
  644. * function name.
  645. *
  646. * @parm HVCMDRIVERID | hvdid | Specifies a VCM driver identifier.
  647. *
  648. * @parm PVCMDRIVERDETAILS | pvfd | Specifies a pointer to a
  649. * <t VCMDRIVERDETAILS> structure that contains the enumerated
  650. * driver details.
  651. *
  652. * @parm PVCMFORMATDETAILS | pvfd | Specifies a pointer to a
  653. * <t VCMFORMATDETAILS> structure that contains the enumerated
  654. * format details.
  655. *
  656. * @parm DWORD | dwInstance | Specifies the application-defined value
  657. * specified in the <f vcmFormatEnum> function.
  658. *
  659. * @rdesc The callback function must return TRUE to continue enumeration;
  660. * to stop enumeration, it must return FALSE.
  661. *
  662. * @comm The <f vcmFormatEnum> function will return MMSYSERR_NOERROR
  663. * (zero) if no formats are to be enumerated. Moreover, the callback
  664. * function will not be called.
  665. *
  666. * @xref <f vcmFormatEnum> <f vcmFormatDetails>
  667. ***************************************************************************/
  668. typedef BOOL (CALLBACK *VCMFORMATENUMCB)
  669. (
  670. HVCMDRIVERID hvdid,
  671. PVCMDRIVERDETAILS pvdd,
  672. PVCMFORMATDETAILS pvfd,
  673. DWORD_PTR dwInstance
  674. );
  675. MMRESULT VCMAPI vcmFormatEnum
  676. (
  677. UINT uDevice,
  678. VCMFORMATENUMCB fnCallback,
  679. PVCMDRIVERDETAILS pvdd,
  680. PVCMFORMATDETAILS pvfd,
  681. DWORD_PTR dwInstance,
  682. DWORD fdwEnum
  683. );
  684. //#define VCM_FORMATENUMF_WFORMATTAG 0x00010000L
  685. //#define VCM_FORMATENUMF_NCHANNELS 0x00020000L
  686. //#define VCM_FORMATENUMF_NSAMPLESPERSEC 0x00040000L
  687. //#define VCM_FORMATENUMF_WBITSPERSAMPLE 0x00080000L
  688. //#define VCM_FORMATENUMF_CONVERT 0x00100000L
  689. //#define VCM_FORMATENUMF_SUGGEST 0x00200000L
  690. #define VCM_FORMATENUMF_INPUT 0x00400000L
  691. #define VCM_FORMATENUMF_OUTPUT 0x00800000L
  692. #define VCM_FORMATENUMF_BOTH 0x01000000L
  693. #define VCM_FORMATENUMF_TYPEMASK 0x01C00000L
  694. #define VCM_FORMATENUMF_APP 0x00000000L
  695. #define VCM_FORMATENUMF_ALL 0x02000000L
  696. #define VCM_FORMATENUMF_ALLMASK VCM_FORMATENUMF_ALL
  697. typedef struct
  698. {
  699. WORD biWidth;
  700. WORD biHeight;
  701. } MYFRAMESIZE;
  702. typedef struct
  703. {
  704. DWORD fccType;
  705. DWORD fccHandler;
  706. MYFRAMESIZE framesize[3];
  707. } VCM_APP_ICINFO, *PVCM_APP_ICINFO;
  708. typedef struct
  709. {
  710. DWORD dwRes;
  711. MYFRAMESIZE framesize;
  712. } NCAP_APP_INFO, *PNCAP_APP_INFO;
  713. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  714. //
  715. // vcmFormatSuggest()
  716. //
  717. //
  718. //
  719. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  720. MMRESULT VCMAPI vcmFormatSuggest
  721. (
  722. UINT uDevice,
  723. HVCMDRIVER hvd,
  724. PVIDEOFORMATEX pvfxSrc,
  725. PVIDEOFORMATEX pvfxDst,
  726. DWORD cbvfxDst,
  727. DWORD fdwSuggest
  728. );
  729. #define VCM_FORMATSUGGESTF_DST_WFORMATTAG 0x00010000L
  730. #define VCM_FORMATSUGGESTF_DST_NSAMPLESPERSEC 0x00020000L
  731. #define VCM_FORMATSUGGESTF_DST_WBITSPERSAMPLE 0x00040000L
  732. #define VCM_FORMATSUGGESTF_SRC_WFORMATTAG 0x00100000L
  733. #define VCM_FORMATSUGGESTF_SRC_NSAMPLESPERSEC 0x00200000L
  734. #define VCM_FORMATSUGGESTF_SRC_WBITSPERSAMPLE 0x00400000L
  735. #define VCM_FORMATSUGGESTF_TYPEMASK 0x00FF0000L
  736. //--------------------------------------------------------------------------;
  737. //
  738. // VCM Stream API's
  739. //
  740. //
  741. //
  742. //--------------------------------------------------------------------------;
  743. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  744. //
  745. // vcmStreamOpen()
  746. //
  747. //
  748. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  749. /*****************************************************************************
  750. * @doc EXTERNAL COMPSTRUCTENUM
  751. *
  752. * @struct VCMSTREAMHEADER | The <t VCMSTREAMHEADER> structure defines the
  753. * header used to identify an Video Compression Manager (VCM) conversion
  754. * source and destination buffer pair for a conversion stream.
  755. *
  756. * @field DWORD | cbStruct | Specifies the size, in bytes, of the
  757. * <t VCMSTREAMHEADER> structure. This member must be initialized
  758. * before calling any VCM stream functions using this structure.
  759. * The size specified in this member must be large enough to contain
  760. * the base <t VCMSTREAMHEADER> structure.
  761. *
  762. * @field DWORD | fdwStatus | Specifies flags giving information about
  763. * the conversion buffers. This member must be initialized to zero
  764. * before calling <f vcmStreamPrepareHeader> and should not be modified
  765. * by the application while the stream header remains prepared.
  766. *
  767. * @flag VCMSTREAMHEADER_STATUSF_DONE | Set by the VCM or driver to
  768. * indicate that it is finished with the conversion and is returning it
  769. * to the application.
  770. *
  771. * @flag VCMSTREAMHEADER_STATUSF_PREPARED | Set by the VCM to indicate
  772. * that the data buffers have been prepared with <f acmStreamPrepareHeader>.
  773. *
  774. * @flag VCMSTREAMHEADER_STATUSF_INQUEUE | Set by the VCM or driver to
  775. * indicate that the data buffers are queued for conversion.
  776. *
  777. * @field DWORD | dwUser | Specifies 32 bits of user data. This can be any
  778. * instance data specified by the application.
  779. *
  780. * @field PBYTE | pbSrc | Specifies a pointer to the source data buffer.
  781. * This pointer must always refer to the same location while the stream
  782. * header remains prepared. If an application needs to change the
  783. * source location, it must unprepare the header and re-prepare it
  784. * with the alternate location.
  785. *
  786. * @field DWORD | cbSrcLength | Specifies the length, in bytes, of the source
  787. * data buffer pointed to by <e VCMSTREAMHEADER.pbSrc>. When the
  788. * header is prepared, this member must specify the maximum size
  789. * that will be used in the source buffer. Conversions can be performed
  790. * on source lengths less than or equal to the original prepared size.
  791. * However, this member must be reset to the original size when
  792. * unpreparing the header.
  793. *
  794. * @field DWORD | cbSrcLengthUsed | Specifies the amount of data, in bytes,
  795. * used for the conversion. This member is not valid until the
  796. * conversion is complete. Note that this value can be less than or
  797. * equal to <e VCMSTREAMHEADER.cbSrcLength>. An application must use
  798. * the <e VCMSTREAMHEADER.cbSrcLengthUsed> member when advancing to
  799. * the next piece of source data for the conversion stream.
  800. *
  801. * @field DWORD | dwSrcUser | Specifies 32 bits of user data. This can be
  802. * any instance data specified by the application.
  803. *
  804. * @field PBYTE | pbDst | Specifies a pointer to the destination data
  805. * buffer. This pointer must always refer to the same location while
  806. * the stream header remains prepared. If an application needs to change
  807. * the destination location, it must unprepare the header and re-prepare
  808. * it with the alternate location.
  809. *
  810. * @field DWORD | cbDstLength | Specifies the length, in bytes, of the
  811. * destination data buffer pointed to by <e VCMSTREAMHEADER.pbDst>.
  812. * When the header is prepared, this member must specify the maximum
  813. * size that will be used in the destination buffer. Conversions can be
  814. * performed to destination lengths less than or equal to the original
  815. * prepared size. However, this member must be reset to the original
  816. * size when unpreparing the header.
  817. *
  818. * @field DWORD | cbDstLengthUsed | Specifies the amount of data, in bytes,
  819. * returned by a conversion. This member is not valid until the
  820. * conversion is complete. Note that this value may be less than or
  821. * equal to <e ACMSTREAMHEADER.cbDstLength>. An application must use
  822. * the <e ACMSTREAMHEADER.cbDstLengthUsed> member when advancing to
  823. * the next destination location for the conversion stream.
  824. *
  825. * @field DWORD | dwDstUser | Specifies 32 bits of user data. This can be
  826. * any instance data specified by the application.
  827. *
  828. * @field PBYTE | pbPrev | Specifies a pointer to the previous destination data
  829. * buffer. This pointer must always refer to the same location while
  830. * the stream header remains prepared. If an application needs to change
  831. * the destination location, it must unprepare the header and re-prepare
  832. * it with the alternate location.
  833. *
  834. * @field DWORD | cbPrevLength | Specifies the length, in bytes, of the previous
  835. * destination data buffer pointed to by <e VCMSTREAMHEADER.pbPrev>.
  836. * When the header is prepared, this member must specify the maximum
  837. * size that will be used in the destination buffer. Conversions can be
  838. * performed to destination lengths less than or equal to the original
  839. * prepared size. However, this member must be reset to the original
  840. * size when unpreparing the header.
  841. *
  842. * @field DWORD | cbPrevLengthUsed | Specifies the amount of data, in bytes,
  843. * returned by a conversion. This member is not valid until the
  844. * conversion is complete. Note that this value may be less than or
  845. * equal to <e VCMSTREAMHEADER.cbPrevLength>. An application must use
  846. * the <e VCMSTREAMHEADER.cbPrevLengthUsed> member when advancing to
  847. * the next destination location for the conversion stream.
  848. *
  849. * @field DWORD | dwDstUser | Specifies 32 bits of user data. This can be
  850. * any instance data specified by the application.
  851. *
  852. * @field struct tVCMSTREAMHEADER * | lpNext | Reserved for driver use and should not be
  853. * used. Typically, this maintains a linked list of buffers in the queue.
  854. *
  855. * @field DWORD | reserved | Reserved for driver use and should not be used.
  856. *
  857. * @type PVCMSTREAMHEADER | Pointer to a <t VCMSTREAMHEADER> structure.
  858. *
  859. * @comm Before an <t VCMSTREAMHEADER> structure can be used for a conversion, it must
  860. * be prepared with <f vcmStreamPrepareHeader>. When an application
  861. * is finished with an <t VCMSTREAMHEADER> structure, the <f vcmStreamUnprepareHeader>
  862. * function must be called before freeing the source and destination buffers.
  863. *
  864. * @xref <f vcmStreamPrepareHeader> <f vcmStreamUnprepareHeader>
  865. * <f vcmStreamConvert>
  866. ****************************************************************************/
  867. typedef struct tVCMSTREAMHEADER
  868. {
  869. DWORD cbStruct; // sizeof(VCMSTREAMHEADER)
  870. DWORD fdwStatus; // status flags
  871. DWORD dwUser; // user instance data for hdr
  872. PBYTE pbSrc;
  873. DWORD cbSrcLength;
  874. DWORD cbSrcLengthUsed;
  875. DWORD dwSrcUser; // user instance data for src
  876. PBYTE pbDst;
  877. DWORD cbDstLength;
  878. DWORD cbDstLengthUsed;
  879. DWORD dwDstUser; // user instance data for dst
  880. PBYTE pbPrev;
  881. DWORD cbPrevLength;
  882. DWORD cbPrevLengthUsed;
  883. DWORD dwPrevUser; // user instance data for prev
  884. struct tVCMSTREAMHEADER *pNext; // reserved for driver
  885. DWORD reserved; // reserved for driver
  886. } VCMSTREAMHEADER, *PVCMSTREAMHEADER;
  887. typedef struct tVCMSTREAM
  888. {
  889. HVCMDRIVER hIC; // Handle to driver (HIC)
  890. DWORD dwICInfoFlags; // Some properties of the compressor
  891. HWND hWndParent; // Handle to the parent window
  892. DWORD_PTR dwCallback; // Callback function, event, thread or window
  893. DWORD_PTR dwCallbackInstance; // User instance data
  894. DWORD fdwOpen; // Defines type of callback
  895. struct tVCMSTREAMHEADER *pvhLast; // Last of the list
  896. struct tVCMSTREAMHEADER *pvhFirst; // First of the list
  897. PVIDEOFORMATEX pvfxSrc; // Format of input buffers
  898. PVIDEOFORMATEX pvfxDst; // Format of output buffers
  899. BITMAPINFOHEADER *pbmiPrev; // Format of previous buffers
  900. UINT cSrcPrepared; // Number of input headers prepared
  901. UINT cDstPrepared; // Number of output headers prepared
  902. DWORD dwFrame; // Current frame number
  903. DWORD dwQuality; // Compression quality value
  904. DWORD dwMaxPacketSize; // Targeted max packet size for encode
  905. DWORD fdwStream; // Stream state flags, etc.
  906. CRITICAL_SECTION crsFrameNumber; // Used to allow the UI to request an I-Frame
  907. DWORD dwLastTimestamp; // Last known good timestamp
  908. DWORD dwTargetByterate; // Target bitrate
  909. DWORD dwTargetFrameRate; // Target frame rate
  910. BOOL fPeriodicIFrames; // Set to TRUE if we need to generate I-Frames periodically
  911. DWORD dwLastIFrameTime; // Holds the last time an I-Frame was generated
  912. } VCMSTREAM, *PVCMSTREAM;
  913. //
  914. // VCMSTREAMHEADER.fdwStatus
  915. //
  916. // VCMSTREAMHEADER_STATUSF_DONE: done bit for async conversions.
  917. //
  918. #define VCMSTREAMHEADER_STATUSF_DONE 0x00010000L
  919. #define VCMSTREAMHEADER_STATUSF_PREPARED 0x00020000L
  920. #define VCMSTREAMHEADER_STATUSF_INQUEUE 0x00100000L
  921. MMRESULT VCMAPI vcmStreamOpen
  922. (
  923. PHVCMSTREAM phas, // pointer to stream handle
  924. HVCMDRIVER had, // optional driver handle
  925. PVIDEOFORMATEX pvfxSrc, // source format to convert
  926. PVIDEOFORMATEX pvfxDst, // required destination format
  927. DWORD dwImageQuality, // image compression factor
  928. DWORD dwPacketSize, // target fragment size
  929. DWORD_PTR dwCallback, // callback
  930. DWORD_PTR dwInstance, // callback instance data
  931. DWORD fdwOpen // VCM_STREAMOPENF_* and CALLBACK_*
  932. );
  933. #define VCM_STREAMOPENF_QUERY 0x00000001
  934. #define VCM_STREAMOPENF_ASYNC 0x00000002
  935. #define VCM_STREAMOPENF_NONREALTIME 0x00000004
  936. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  937. //
  938. // vcmStreamClose()
  939. //
  940. //
  941. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  942. MMRESULT VCMAPI vcmStreamClose
  943. (
  944. HVCMSTREAM hvs
  945. );
  946. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  947. //
  948. // vcmStreamSize()
  949. //
  950. //
  951. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  952. MMRESULT VCMAPI vcmStreamSize
  953. (
  954. HVCMSTREAM has,
  955. DWORD cbInput,
  956. PDWORD pdwOutputBytes,
  957. DWORD fdwSize
  958. );
  959. #define VCM_STREAMSIZEF_SOURCE 0x00000000L
  960. #define VCM_STREAMSIZEF_DESTINATION 0x00000001L
  961. #define VCM_STREAMSIZEF_QUERYMASK 0x0000000FL
  962. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  963. //
  964. // vcmStreamReset()
  965. //
  966. //
  967. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  968. MMRESULT VCMAPI vcmStreamReset
  969. (
  970. HVCMSTREAM has
  971. );
  972. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  973. //
  974. // vcmStreamMessage()
  975. //
  976. //
  977. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  978. MMRESULT VCMAPI vcmStreamMessage
  979. (
  980. HVCMSTREAM has,
  981. UINT uMsg,
  982. LPARAM lParam1,
  983. LPARAM lParam2
  984. );
  985. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  986. //
  987. // vcmStreamConvert()
  988. //
  989. //
  990. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  991. MMRESULT VCMAPI vcmStreamConvert
  992. (
  993. HVCMSTREAM has,
  994. PVCMSTREAMHEADER pash,
  995. DWORD fdwConvert
  996. );
  997. #define VCM_STREAMCONVERTF_BLOCKALIGN 0x00000004
  998. #define VCM_STREAMCONVERTF_START 0x00000010
  999. #define VCM_STREAMCONVERTF_END 0x00000020
  1000. #define VCM_STREAMCONVERTF_FORCE_KEYFRAME 0x00000040
  1001. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  1002. //
  1003. // vcmStreamPrepareHeader()
  1004. //
  1005. //
  1006. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  1007. MMRESULT VCMAPI vcmStreamPrepareHeader
  1008. (
  1009. HVCMSTREAM has,
  1010. PVCMSTREAMHEADER pash,
  1011. DWORD fdwPrepare
  1012. );
  1013. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  1014. //
  1015. // vcmStreamUnprepareHeader()
  1016. //
  1017. //
  1018. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  1019. MMRESULT VCMAPI vcmStreamUnprepareHeader
  1020. (
  1021. HVCMSTREAM has,
  1022. PVCMSTREAMHEADER pash,
  1023. DWORD fdwUnprepare
  1024. );
  1025. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  1026. //
  1027. // Device Capabilities Functions
  1028. //
  1029. //
  1030. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  1031. MMRESULT VCMAPI vcmGetDevCaps(UINT uDevice, PVIDEOINCAPS pvc, UINT cbvc);
  1032. MMRESULT VCMAPI vcmDevCapsReadFromReg(LPSTR szDeviceName, LPSTR szDeviceVersion, PVIDEOINCAPS pvc, UINT cbvc);
  1033. MMRESULT VCMAPI vcmDevCapsProfile(UINT uDevice, PVIDEOINCAPS pvc, UINT cbvc);
  1034. MMRESULT VCMAPI vcmDevCapsWriteToReg(LPSTR szDeviceName, LPSTR szDeviceVersion, PVIDEOINCAPS pvc, UINT cbvc);
  1035. MMRESULT VCMAPI vcmGetDevCapsFrameSize(PVIDEOFORMATEX pvfx, PINT piWidth, PINT piHeight);
  1036. MMRESULT VCMAPI vcmGetDevCapsPreferredFormatTag(UINT uDevice, PDWORD pdwFormatTag);
  1037. MMRESULT VCMAPI vcmGetDevCapsStreamingMode(UINT uDevice, PDWORD pdwStreamingMode);
  1038. MMRESULT VCMAPI vcmGetDevCapsDialogs(UINT uDevice, PDWORD pdwDialogs);
  1039. MMRESULT VCMAPI vcmReleaseResources();
  1040. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  1041. //
  1042. // Post-processing Functions
  1043. //
  1044. //
  1045. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  1046. BOOL VCMAPI vcmStreamIsPostProcessingSupported(HVCMSTREAM hvs);
  1047. MMRESULT VCMAPI vcmStreamSetBrightness(HVCMSTREAM hvs, DWORD dwBrightness);
  1048. MMRESULT VCMAPI vcmStreamSetContrast(HVCMSTREAM hvs, DWORD dwContrast);
  1049. MMRESULT VCMAPI vcmStreamSetSaturation(HVCMSTREAM hvs, DWORD dwSaturation);
  1050. MMRESULT VCMAPI vcmStreamSetImageQuality(HVCMSTREAM hvs, DWORD dwImageQuality);
  1051. #define PLAYBACK_CUSTOM_START (ICM_RESERVED_HIGH + 1)
  1052. #define PLAYBACK_CUSTOM_CHANGE_BRIGHTNESS (PLAYBACK_CUSTOM_START + 0)
  1053. #define PLAYBACK_CUSTOM_CHANGE_CONTRAST (PLAYBACK_CUSTOM_START + 1)
  1054. #define PLAYBACK_CUSTOM_CHANGE_SATURATION (PLAYBACK_CUSTOM_START + 2)
  1055. #define G723MAGICWORD1 0xf7329ace
  1056. #define G723MAGICWORD2 0xacdeaea2
  1057. #define CUSTOM_ENABLE_CODEC (ICM_RESERVED_HIGH+201)
  1058. #define VCM_MAX_BRIGHTNESS 255UL
  1059. #define VCM_MIN_BRIGHTNESS 1UL
  1060. #define VCM_RESET_BRIGHTNESS 256UL
  1061. #define VCM_DEFAULT_BRIGHTNESS 128UL
  1062. #define VCM_MAX_CONTRAST 255UL
  1063. #define VCM_MIN_CONTRAST 1UL
  1064. #define VCM_RESET_CONTRAST 256UL
  1065. #define VCM_DEFAULT_CONTRAST 128UL
  1066. #define VCM_MAX_SATURATION 255UL
  1067. #define VCM_MIN_SATURATION 1UL
  1068. #define VCM_RESET_SATURATION 256UL
  1069. #define VCM_DEFAULT_SATURATION 128UL
  1070. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  1071. //
  1072. // Custom Encoder Control Functions
  1073. //
  1074. //
  1075. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  1076. MMRESULT VCMAPI vcmStreamSetMaxPacketSize(HVCMSTREAM hvs, DWORD dwMaxPacketSize);
  1077. #define CUSTOM_START (ICM_RESERVED_HIGH + 1)
  1078. #define CODEC_CUSTOM_ENCODER_CONTROL (CUSTOM_START + 9)
  1079. // CUSTOM_ENCODER_CONTROL: HIWORD(lParam1)
  1080. #define EC_SET_CURRENT 0
  1081. #define EC_GET_FACTORY_DEFAULT 1
  1082. #define EC_GET_FACTORY_LIMITS 2
  1083. #define EC_GET_CURRENT 3
  1084. #define EC_RESET_TO_FACTORY_DEFAULTS 4
  1085. // CUSTOM_ENCODER_CONTROL: LOWORD(lParam1)
  1086. #define EC_RTP_HEADER 0
  1087. #define EC_RESILIENCY 1
  1088. #define EC_PACKET_SIZE 2
  1089. #define EC_PACKET_LOSS 3
  1090. #define EC_BITRATE_CONTROL 4
  1091. #define EC_BITRATE 5
  1092. #define VCM_MAX_PACKET_SIZE 9600UL
  1093. #define VCM_MIN_PACKET_SIZE 64UL
  1094. #define VCM_RESET_PACKET_SIZE 512UL
  1095. #define VCM_DEFAULT_PACKET_SIZE 512UL
  1096. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  1097. //
  1098. // Compression Ratio and Compression Options Functions
  1099. //
  1100. //
  1101. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  1102. MMRESULT VCMAPI vcmStreamSetImageQuality(HVCMSTREAM hvs, DWORD dwImageQuality);
  1103. MMRESULT VCMAPI vcmStreamRequestIFrame(HVCMSTREAM hvs);
  1104. MMRESULT VCMAPI vcmStreamPeriodicIFrames(HVCMSTREAM hvs, BOOL fPeriodicIFrames);
  1105. MMRESULT VCMAPI vcmStreamSetTargetRates(HVCMSTREAM hvs, DWORD dwTargetFrameRate, DWORD dwTargetByterate);
  1106. #define MIN_IFRAME_REQUEST_INTERVAL 15000
  1107. #define VCM_MAX_IMAGE_QUALITY 0UL
  1108. #define VCM_MIN_IMAGE_QUALITY 31UL
  1109. #define VCM_RESET_IMAGE_QUALITY VCM_MAX_IMAGE_QUALITY
  1110. #define VCM_DEFAULT_IMAGE_QUALITY VCM_MAX_IMAGE_QUALITY
  1111. #define VCM_MAX_FRAME_RATE 2997UL
  1112. #define VCM_MIN_FRAME_RATE 20UL
  1113. #define VCM_RESET_FRAME_RATE 700UL
  1114. #define VCM_DEFAULT_FRAME_RATE 700UL
  1115. #define VCM_MAX_BYTE_RATE 187500UL
  1116. #define VCM_MIN_BYTE_RATE 1UL
  1117. #define VCM_RESET_BYTE_RATE 1664UL
  1118. #define VCM_DEFAULT_BYTE_RATE 1664UL
  1119. #define VCM_MAX_FRAME_SIZE 32768UL
  1120. #define VCM_MIN_FRAME_SIZE 1UL
  1121. #define VCM_RESET_FRAME_SIZE 235UL
  1122. #define VCM_DEFAULT_FRAME_SIZE 235UL
  1123. #define VCM_MAX_TRADE_OFF 31UL
  1124. #define VCM_MIN_TRADE_OFF 1UL
  1125. #define VCM_RESET_TRADE_OFF 31UL
  1126. #define VCM_DEFAULT_TRADE_OFF 31UL
  1127. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  1128. //
  1129. // RTP Payload Functions
  1130. //
  1131. //
  1132. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  1133. MMRESULT VCMAPI vcmStreamFormatPayload(HVCMSTREAM hvs, PBYTE pDataSrc, DWORD dwDataSize, PBYTE *ppDataPkt, PDWORD pdwPktSize,
  1134. PDWORD pdwPktCount, UINT *pfMark, PBYTE *pHdrInfo,PDWORD pdwHdrSize);
  1135. MMRESULT VCMAPI vcmStreamRestorePayload(HVCMSTREAM hvs, WSABUF *ppDataPkt, DWORD dwPktCount, PBYTE pbyFrame, PDWORD pdwFrameSize, BOOL *pfReceivedKeyframe);
  1136. MMRESULT VCMAPI vcmStreamGetPayloadHeaderSize(HVCMSTREAM hvs, PDWORD pdwPayloadHeaderSize);
  1137. #ifdef __cplusplus
  1138. } /* End of extern "C" { */
  1139. #endif /* __cplusplus */
  1140. #pragma pack() /* Revert to default packing */
  1141. #endif /* _INC_VCM */
  1142.