home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / amiiprog.zip / AVKAPI.H < prev    next >
Text File  |  1994-10-27  |  29KB  |  710 lines

  1. //
  2. // Module Name: AVKAPI.H
  3. //
  4. // Description: The primary AVK application header file
  5. //
  6. // Status: Version 1 Release 2
  7. //
  8. //
  9. // Copyright Intel Corp. 1990, 1993
  10. //
  11. // Copyright IBM Corp. 1990, 1993
  12. // All Rights Reserved
  13. //
  14. // Description
  15. // This file contains the API calls, the data definitions,
  16. // notifications, error messages, and everything else interesting to apps,
  17. // except for algorithm data, which is in AVKALG.H
  18.  
  19.  
  20.  
  21. // _OS2 is defined (e.g. in the makefile) if this is an OS2 compilation
  22.  
  23. #ifndef AVKAPI_DEFINED // avoid nesting this file
  24. #define AVKAPI_DEFINED
  25. //avk 1.2...
  26. #define AVKAPI_VERSION 921023000L //actually, a date, a Vxx number , a digit
  27.  
  28. //AVKCOM.H defines many symbols that will commonly be used...
  29. // to call AVK functions...
  30. // to store, retrieve and interpret data about A/V motion/still files
  31. // to call higher-level libraries that themselves call AVK.
  32. // If you decide to study the AVKAPI.H file, it is recommended that
  33. // you study AVKCOM.H and AVKALG.H as well.
  34. // If you are searching for the actual definitions of symbols used in the
  35. // AVK calls, you will find some of them defined in AVKCOM.H.
  36. #include "AVKCOM.H"             //common symbols...
  37. // See AVKCOM.H for the following definitions...
  38. // AVK_CALL definition
  39. // PLANE definitions
  40. // External Video keying types
  41. // Audio impedance definitions
  42. // Portable data types for AVK functions and data definitions
  43. // Device Open Flags
  44. // for video sync capture types returned by AvkDeviceVideoIn
  45. // AVK_NTSC_ and AVK_PAL_ rate symbol definitions
  46. // audchannel values -- how to record or playback audio
  47.  
  48. // audio algorithm definitions are in AVKCOM.H and AVKALG.H
  49.  
  50.  
  51. #define AVK_MSG_MAX_NUM          128
  52. #define AVK_MSG_BASE             WM_USER        //AVK messages start here
  53. #define AVK_USER                 (AVK_MSG_BASE + AVK_MSG_MAX_NUM)
  54.  
  55. #define AVK_NOCHANGE 0x80000000L
  56.  
  57. // AVK FRAME special defines...
  58. #define AVK_NO_FRAME 0xFFFFFFFFL        //absence of a frame
  59. #define AVK_NOTHING  (~0)                //absence of (de)compress, status info
  60.  
  61. // special pre-defined HANDLES...
  62. #define  AVK_TIME_IMMEDIATE  0xFFFA
  63. #define  AVK_VIEW_BLANK        0xFFF9    //blank view for any board
  64.  
  65. #define  AVK_CONN_DIGITIZER  0xFFF5     //digitizer as connector source HANDLE
  66. #define  AVK_SPECIAL_HANDLES 0xFFE0     //reserve up to 16 special handles
  67.  
  68. //the two types of frame number for AvkStrmSetFrameNum
  69. #define  AVK_SHOW_FRAME_NUM     0        //the SHOWING frame number
  70. #define  AVK_PROC_FRAME_NUM     1        //the PROCESSED frame number (ready to show, etc)
  71.  
  72. //These symbols are defined for compatibility with release 1.0, but are
  73. //no longer used. In effect, the new value of these two symbols is: 1
  74. #define AVK_XRES_MULTIPLES 4            //image planar bitmaps xres is multiple of this
  75. #define AVK_YRES_MULTIPLES 4            //image planar bitmaps yres is multiple of this
  76.  
  77. // status grabbing defines
  78. #define AVK_STATUS_ALL          ((U16) (~0))      //grab ALL possible status data
  79. #define AVK_STATUS_DEFAULT      ((U16) (~0))      //use with AvkGetStatus call
  80.  
  81. //MAXIMA for AVK... How many of each kind of object you may have...
  82. #define AVK_MAX_SESSIONS 1
  83. #define AVK_MAX_MATCH_FRAMES 4
  84. #define AVK_MAX_BOARDS 1
  85. #define AVK_MAX_IMAGES  30
  86. #define AVK_MAX_IMGBUFS 8
  87. #define AVK_ALLOWED_VIEWS 4     //2 by spec, but allow more
  88. #define AVK_MAX_VIEWS (AVK_ALLOWED_VIEWS+AVK_MAX_IMAGES)
  89. #define AVK_MAX_GROUPS 4
  90. #define AVK_MAX_BUFFERS 4
  91. #define AVK_MAX_STREAMS_AUD 4    //audio play or capture, less for some audio rates
  92.  
  93. #ifdef _MULTISTREAM
  94. #define AVK_MAX_STREAMS_VIDP 4  //video play streams
  95. #define AVK_MAX_STREAMS 8        //total max in any case
  96. #else
  97. #define AVK_MAX_STREAMS_VIDP 1  //video play streams
  98. #define AVK_MAX_STREAMS 4        //total max in any case
  99. #endif
  100.  
  101. #define AVK_MAX_STREAMS_VIDC 1  //video capture streams
  102. #define AVK_MAX_PHYSICAL_BUF_STRMS 32
  103. #define AVK_MAX_DECODE_BITMAPS 8
  104. #define AVK_MIN_DECODE_BITMAPS 4
  105. #define AVK_MIN_ENCODE_BITMAPS 6
  106. #define AVK_MAX_OBJCONS 32              //this is: AVK_MAX_CONNECTORS
  107.  
  108. #define AVK_MAX_TIMES 8
  109.  
  110. //This XRES maximum defines the largest resolution allowed for either
  111. //premonitoring or capture.
  112. #define AVK_MAX_STREAM_XRES 306         //maxima for streams (YUV9)
  113. #define AVK_MAX_STREAM_YRES 288         //288 for PAL (allow worst case always)
  114. // The maximum xres for capture is actually smaller:
  115. #define AVK_MAX_CAPSTREAM_XRES 256
  116. // BUT the maximum xres for capture, for which the data can actually be
  117. // PLAYED BACK is...
  118. #define AVK_MAX_AVSTREAM_XRES (AVK_MAX_STREAM_XRES/2) //currently 153 for PAL
  119.  
  120. // group buffer directions....
  121. #define AVK_BUF_PLAYBACK 1
  122. #define AVK_BUF_CAPTURE 2
  123.  
  124.  
  125.  
  126. // group buffer sizes
  127. #define AVK_GRP_BUF_MIN 65536L
  128. #define AVK_GRP_BUF_MAX (512L*1024L)
  129.  
  130.  
  131. //The two capture sources on the digitizer board...
  132. #define AVK_DIGITIZER    AVK_CONN_DIGITIZER
  133. #define AVK_DIGITIZER_1 AVK_CONN_DIGITIZER
  134. // The following symbol is obsolete. Recompile with AVK_DIGITIZER_1 only!
  135. //#define AVK_DIGITIZER_2 2
  136.  
  137. // capture connector option settings; the acceptable default value is zero.
  138. #define AVK_PRE_MONITOR  1    //connector will only be used to pre-monitor.
  139.  
  140. //settings to turn monitoring off and on, in AvkDeviceAudioIn...
  141. #define AVK_MONITOR_ON  1
  142. #define AVK_MONITOR_OFF 0
  143.  
  144.  
  145. ////////////////// typedefs....
  146.  
  147.  
  148. typedef I16  HAVK;              // all handles
  149.  
  150. //To use the 32bit compiler, define the following symbol
  151. //before including AVKAPI.H...
  152. #ifdef _32BIT                    //typedefs for IBM C SET 2 32-bit compiler...
  153.  
  154. typedef I16  * _Seg16 PHAVK;    // all handles, pointer to receive
  155. #define AVKPTR * _Seg16         // A 'thunkable' ptr
  156.  
  157. #else                            //alternate typedefs for MSC6 and IBMC (16bit)
  158.  
  159. typedef I16  far *PHAVK;        // all handles, pointer to receive
  160. #define AVKPTR far *            // All AVK pointers are far pointers
  161.  
  162. #endif
  163.  
  164.  
  165. //
  166. //  This macro fills
  167. //  reasonable default values for an rtv20args structure...
  168. //  Use this macro as a tutorial... Be very careful to check its
  169. // relevance to your specific situation, if you decide to invoke it.
  170. //
  171.  
  172. /*
  173. When capturing video data, attention must be paid to the xo, yo, xs, ys
  174. values in the AVK_RTV_20_DEFAULT_ARGS algdata structure. The
  175. xo and yo values should be multiples of 8; xs,ys should be multiples
  176. of 16. The values that do not conform to these requirements
  177. will be rounded down to the nearest multiple.
  178. */
  179. #define AVK_RTV_20_DEFAULT_ARGS  {                                       \
  180.         12,                                          /* arg count */     \
  181.         AVK_RTV_2_0,                                 /* alg size */      \
  182.         0,0,128,240,                                 /* xo,yo, xs, ys */ \
  183.         3,                                           /* still period */  \
  184.         0, 0,                                         /* Bytes,lines */  \
  185.         AVK_RTV_20_PREFILTER | AVK_RTV_20_ASPECT_25, /* flags */         \
  186.         2, 0                                         /* quant values */  \
  187. }
  188.  
  189.  
  190.  
  191. ///////////// enumerating typedefs...
  192.  
  193. //use these as hunger enables with AvkGrpBufWrite/Read...
  194.  
  195. #define   AVK_NO_CHANGE         0
  196. #define   AVK_ENABLE            1
  197. #define   AVK_QUALIFIED_ENABLE  2        //for grpbuf: after incomplete write...
  198. #define   AVK_DISABLE            3        //last item in list
  199.  
  200. // Connector effects...
  201. #define  AVK_EFFECT_MIN 1
  202. #define  AVK_EFFECT_TINT        AVK_EFFECT_MIN
  203. #define  AVK_EFFECT_SATURATION  2
  204. #define  AVK_EFFECT_BRIGHTNESS  3
  205. #define  AVK_EFFECT_CONTRAST    4
  206. #define  AVK_EFFECT_MAX AVK_EFFECT_CONTRAST
  207.  
  208.  
  209.  
  210. // bitmap format types
  211. #define   AVK_YUV9              AVK_BM_9        //see AVKCOM.H
  212. #define   AVK_YUV16             AVK_BM_16
  213. #define   AVK_YUV24             AVK_BM_24
  214. #define   AVK_YUV12             AVK_BM_12
  215. //note, for compatibility with some existing applications,
  216. //the old values 1,2,3,4 (respectively) for the above symbols will also be
  217. //supported.
  218. //The following symbol has been retained for compilation compatibility,
  219. //but it has little semantic value and its use is now discouraged:
  220. #define AVK_BITMAP_FORMAT_MAX ((U16) AVK_BM_9)
  221.  
  222.  
  223. // output view-display types 
  224. // ONLY AVK_VIEW_DISPLAY_DEFAULT is supported! These AVK_VIEW_DISPLAY
  225. // symbols should not be used: _YC, _SYS, and _BOTH
  226. #define   AVK_VIEW_DISPLAY_DEFAULT      0
  227.                             //output to each of sys and Y-C if (in each case)
  228.                             //they can handle it.
  229. #define   AVK_VIEW_DISPLAY_YC            1
  230.                             //view to Y-C connector; no change to XGA/VGA
  231.                             //unless analog keying AND view is VID/PAL
  232.                             //in which case switch xga/vga to blank view.
  233. #define   AVK_VIEW_DISPLAY_SYS          2
  234.                             //view to keyed monitor (normal case) AND
  235.                             // BLANK the Y-C connector output.
  236. #define   AVK_VIEW_DISPLAY_BOTH         3
  237.                             //output to both. not allowed if this view is keyed.
  238.  
  239. //The following flags can be Or'd into the OutputDev argument to
  240. //force VGA and XGA displays to change between Keyed and unkeyed...
  241. #define AVK_VIEW_DISPLAY_KEYED        0x4000
  242. #define AVK_VIEW_DISPLAY_UNKEYED    0x2000
  243.  
  244.  
  245. //use this to open your AVK session (begin or callback)
  246. #define AVK_SESSION_DEFAULT (U32) (AVK_BUFFER_HUNGRY_O \
  247.                         | AVK_IDENTIFY_O \
  248.                         | AVK_BUFFER_STARVED_O \
  249.                         | AVK_GROUP_READY_O \
  250.                         | AVK_MATCH_FRAME_O \
  251.                         | AVK_GROUP_PAUSED_O \
  252.                         | AVK_GROUP_OUT_OF_SYNC_O \
  253.                         | AVK_PRESSING_DONE_O \
  254.                         | AVK_GROUP_FLUSHED_O \
  255.                         | AVK_NOTIFICATIONS_LOST_O \
  256.                         | AVK_CAPTURE_DATA_AVAILABLE_O \
  257.                         | AVK_UCODE_STALL_O \
  258.                         | AVK_CHECKSUM_FRAMES_O \
  259.                         | AVK_SCSI_EVENT_O \
  260.                         | AVK_CAUTION_O \
  261. )
  262.  
  263.  
  264. // MESSAGES SENT TO THE APPLICATION \\ option bits for each message...
  265. #define  AVK_IDENTIFY              (AVK_MSG_BASE +  0)
  266. #define  AVK_IDENTIFY_O              (2L     )
  267. #define  AVK_BUFFER_HUNGRY        (AVK_MSG_BASE + 1)
  268. #define  AVK_BUFFER_HUNGRY_O                  (2L<<1)  //AVK_SESSION bits...
  269. #define  AVK_BUFFER_STARVED       (AVK_MSG_BASE + 2)
  270. #define  AVK_BUFFER_STARVED_O                  (2L<<2)
  271. #define  AVK_GROUP_READY          (AVK_MSG_BASE + 3)
  272. #define  AVK_GROUP_READY_O                    (2L<<3)
  273.  
  274. #define  AVK_MATCH_FRAME          (AVK_MSG_BASE + 5)
  275. #define  AVK_MATCH_FRAME_O                   (2L<< 5)
  276. #define  AVK_UCODE_STALL          (AVK_MSG_BASE + 6)
  277. #define  AVK_UCODE_STALL_O                   (2L<< 6)
  278. #define  AVK_GROUP_PAUSED          (AVK_MSG_BASE + 7)
  279. #define  AVK_GROUP_PAUSED_O                  (2L<< 7)
  280. #define  AVK_GROUP_OUT_OF_SYNC    (AVK_MSG_BASE + 8)
  281. #define  AVK_GROUP_OUT_OF_SYNC_O             (2L<< 8)
  282. #define  AVK_PRESSING_DONE        (AVK_MSG_BASE + 9) //(de)compress complete
  283. #define  AVK_PRESSING_DONE_O                 (2L<< 9) //(de)compress complete
  284. #define  AVK_GROUP_FLUSHED        (AVK_MSG_BASE + 10)
  285. #define  AVK_GROUP_FLUSHED_O                 (2L<< 10)
  286. #define  AVK_NOTIFICATIONS_LOST   (AVK_MSG_BASE + 11)
  287. #define  AVK_NOTIFICATIONS_LOST_O             (2L<< 11)
  288. #define  AVK_GROUP_COMMITTED      (AVK_MSG_BASE + 13)
  289. #define  AVK_GROUP_COMMITTED_O               (2L<< 13)
  290. #define  AVK_CAPTURE_DATA_AVAILABLE (AVK_MSG_BASE + 14)
  291. #define  AVK_CAPTURE_DATA_AVAILABLE_O        (2L << 14)
  292. #define  AVK_SCSI_EVENT            (AVK_MSG_BASE + 15)
  293. #define  AVK_SCSI_EVENT_O                    (2L << 15)
  294. // The AVK_CAUTION notification can be sent to Windows programs,
  295. // but not to OS/2 programs:
  296. #define  AVK_CAUTION                  (AVK_MSG_BASE + 16)
  297. #define  AVK_CAUTION_O                (2L << 16)
  298.  
  299. //The following option bits are reserved and shall not be defined in this file:
  300. // (2L << 25) ... (2L << 28)
  301.  
  302. //the next option requests checksumming of write frame headers
  303. //and rejection if checksum fails... THIS DOES NOT GENERATE A NOTIFICATION.
  304. //NOTE: AVK does not commit to check every frame for proper checksumming,
  305. //because AVK does not (in the long run) commit to parsing frame data at all
  306. // for efficiency reasons. The following option tells AVK that whenever
  307. //it happens to KNOW it has a frame header, it should checksum...
  308. #define AVK_CHECKSUM_FRAMES_O                 (2L << 29)
  309.  
  310. //these option bits are reserved:
  311. // (2L<<28)
  312. // (2L<<27)
  313.  
  314. //these are not a default options...
  315. //the next message (not standard) indicates
  316. //that HAVK PARAM1 has been implicitly destroyed.
  317. #define  AVK_OBJECT_SWAT          (AVK_MSG_BASE + 12)
  318. #define  AVK_OBJECT_SWAT_O                   (2L<< 12)
  319.  
  320. #define AVK_MSG_HIGH (AVK_MSG_BASE + 15)
  321. #define AVK_MSG_LOW  (AVK_MSG_BASE + 0)
  322.  
  323. // video display sync types
  324. #define   AVK_VID_XGA            0x0100  //xga, no keying
  325. #define   AVK_VID_XGA_KEYED     0x8100  //xga plus keying
  326. #define   AVK_VID_VGA            0x0010  //vga, no keying
  327. #define   AVK_VID_VGA_KEYED     0x8010  //vga plus keying
  328. #define   AVK_VID_NTSC          0x0001  //ntsc, no keying, dual screen
  329. #define   AVK_VID_PAL            0x0002  // pal, no keying, dual screen
  330.  
  331.  
  332. // ERROR CODES
  333. //warnings...
  334. #define AVK_ERR_WARNINGS 9 //0 to 9 are warnings. Above this, errors.
  335.  
  336. #define AVK_ERR_OK        0
  337. #define AVK_WARN_NOHANDLE 1             //handle table full, no more
  338. #define AVK_WARN_HOSTMEM  2             //can't allocate near or far host mem
  339.  
  340.                                         //the next symbol has two spellings
  341.                                         //for compatibility with existing
  342.                                         //programs...
  343. #define AVK_WARN_TRUNCATION 4            //image read/write length truncated
  344. #define AVK_ERR_WARN_TRUNCATION 4        //image read/write length truncated
  345.                                         //OR, clip list truncated!
  346.  
  347.  
  348.  
  349. //errors...
  350. #define AVK_ERR_HANDLE 10                //handle is invalid, or
  351.                                         //not the correct type for
  352.                                         //this operation
  353. #define AVK_ERR_SESS   11                //not a valid session handle
  354. #define AVK_ERR_DEVICE 12                //not a valid device handle
  355. #define AVK_ERR_DEVNUM 13                // device number was not zero
  356. #define AVK_ERR_VIEW   14                //not a valid view handle
  357. #define AVK_ERR_TIME   15                //ditto time
  358. #define AVK_ERR_GRP    16                //ditto group
  359. #define AVK_ERR_GRPBUF 17                //ditto grpbuf
  360. #define AVK_ERR_IMG    18                //ditto image
  361. #define AVK_ERR_IMGBUF 19                //ditto imgbuf
  362. #define AVK_ERR_STRM   20                //ditto stream
  363. #define AVK_ERR_CONN   21                //ditto connector (objcon)
  364. #define AVK_ERR_LIM_TOOMANY 22          //cannot create any more of that object //ahs
  365. #define AVK_ERR_LIM_IMMED    23          //MUST use immediate time handle
  366. #define AVK_ERR_LIM_TIME    24          //MUST use REAL time handle
  367. #define AVK_ERR_LIM_VIEW    25          //unsuppt combo of view params
  368. #define AVK_ERR_LIM_RES     26          //unsuppt bitmap size
  369. #define AVK_ERR_BUSY_GRP    27          //group playing or capturing
  370. #define AVK_ERR_BUSY_VIEW    28          //view is showing motion  can't delete it
  371. #define AVK_ERR_BUSY_MON    29          //not used yet //device is busy monitoring
  372. #define AVK_ERR_BUSY_PRSG    30          //(de)compression blocks this
  373. #define AVK_ERR_UNSUP        31          //this call not implemented yet.
  374. #define AVK_ERR_WRONGAUD    32          //can't mix audio algs
  375. #define AVK_ERR_UNSUPAUD    33          //no ucode avail for this audio param combo
  376. #define AVK_ERR_CONDIG      34          //unsupp digitizer feature
  377.  
  378. #define AVK_ERR_NOTDIG      36          //digitizer required
  379. #define AVK_ERR_VERS        37          //unused
  380. #define AVK_ERR_BMFMT        38          //unknown or illegal (in this context) bitmap format.
  381. #define AVK_ERR_VIDTYPE     39          //unknown vid type
  382. #define AVK_ERR_ALG         40          //video algorithm not found
  383. #define AVK_ERR_ALGARG      41          //invalid algorithm arguments.
  384. #define AVK_ERR_ALGDATA     42          //invalid algorithm data
  385. #define AVK_ERR_SRCBOX      43          //src  box coords in error
  386. #define AVK_ERR_DSTBOX      44          //dest box coords in error
  387. #define AVK_ERR_FLAG        45          //unrecognzed flag setting
  388. #define AVK_ERR_ENUM        46          //unrecognzed enumerated const setting
  389. #define AVK_ERR_BOOL        47          //boolean arg  must be 0 or 1.
  390. #define AVK_ERR_PRCNT        48          //volume arg was over 200%
  391. #define AVK_ERR_RANGE        49          //value out of range
  392. #define AVK_ERR_CONFIG      50          //file missing, or DviMonitorSync line is silly
  393. #define AVK_ERR_OS          51          //function not available for this OS
  394. #define AVK_ERR_BUFTYPE     53          //read operation on write bfr or vv
  395. #define AVK_ERR_FAR         54          //probably not a good far pointer (or length>65535)
  396. #define AVK_ERR_COMMIT      56          //group has unformatted streams or is incomplete
  397. #define AVK_ERR_CONSRC      57          //connector mentions invalid src handle
  398. #define AVK_ERR_CONDST      58          //connector mentions invalid dst handle
  399.  
  400. #define AVK_ERR_WRONG_CLIP_RANGE        59 //copy list coordinate error
  401. #define AVK_ERR_NULL_POINTER_PASSED     60 //call required a far pointer param
  402. #define AVK_ERR_SYS_VIDEO_MODE          61 //incorrect video mode or session(MSG/CALLB) type
  403. #define AVK_ERR_INVALID_VALUE            62 //argument value unacceptable
  404. #define AVK_ERR_DEVIOCTL                63 //ERROR COMMUNICATING WITH avd.sys  IN os2
  405. #define AVK_ERR_INTERNAL                64 //A dll programming error has occurred.
  406. #define AVK_ERR_COMMITTED                65 //too late to define/create  resources committed
  407. #define AVK_ERR_COMMITTING              66 //error while committing board resources.
  408. #define AVK_ERR_UNCOMMITTING            67 //error while uncommitting board resources.
  409. #define AVK_ERR_PAUSE_ALREADY_SCHEDULED 68 //can't sched pause when pause already scheduled
  410. #define AVK_ERR_INVALID_PLAY_STATUS     69 //can't do this op at this time
  411. #define AVK_ERR_DEVDATA                 70 //failed to read or write device data
  412. #define AVK_ERR_FUNCTION                71 //rejecting concurrent call to KMVL (NB: OS/2 accepts concurrent calls)
  413. #define AVK_ERR_SYSCALL                 72 //native OS unexpectedly returned an error
  414. #define AVK_ERR_RESOURCES                73 //call failed due to insufficient resources (any dll)
  415. #define AVK_ERR_UCODE_MISSING            74 //missed ucode that's always required
  416. #define AVK_ERR_DEVOPEN                 75 //Device Open failed
  417. #define AVK_ERR_BOARD_IS_CLOSED         76 //op allowed only if device is open
  418. #define AVK_ERR_CHECKSUM                77 //checksum error in frame write data
  419. #define AVK_ERR_BUFFER_TOO_SMALL        78 //file requires larger grpbuf, e.g. 3*lgest frm
  420. #define AVK_ERR_DUPLICATE_CONNECTOR     79 //illegal attempt to enable duplicate connector
  421. #define AVK_ERR_UCODE_ERROR             80 //ucode issues "panic" interrupt
  422. #define AVK_ERR_UDATA_BAD                81 //ucode issues "bad data"  interrupt
  423. #define AVK_ERR_AP_STALLED              82 //audio micro processor not responding
  424. #define AVK_ERR_PP_STALLED              83 //pixel micro processor not responding
  425. #define AVK_ERR_UU_STALLED              84 //micro processors not responding
  426. #define AVK_ERR_INDEX                    85 //AVK structure[index] (indexing) INTERNAL error.
  427. #define AVK_ERR_GETSTATUS                86 //must get status before making status calls
  428. #define AVK_ERR_SUBSYSTEM                87 //AVK inadvertently failed to supply its own error code
  429.                                            //(should never happen, but might)
  430. #define AVK_ERR_BITMAP_TOO_SMALL        88 //(de)compression data too large to fit
  431.  
  432. #define AVK_ERR_DIG_IN_PROGRESS         89 //can't do this while digitizing
  433.  
  434. #define AVK_ERR_CANT_MIX_FRAME_RATES    90 //can't mix frame rates in a group buffer
  435.  
  436. #define AVK_ERR_MONITOR_WHILE_PLAY      91 // cant monitor and playback
  437.                                            // together (audio only)
  438.  
  439. #define AVK_ERR_DEVMEM                  92 //can't allocate device mem
  440.  
  441. #define AVK_ERR_DIGISTARTUP             93 //problem setting up digitizer
  442.  
  443. #define AVK_ERR_NODATA                  94 //no data available.
  444.  
  445. #define AVK_ERR_SEMA_STALLED            95 //gave up waiting for VRAM semaphore
  446. #define AVK_ERR_LIM_SYNC                96 //current display sync disallows
  447.                                            //stream or connector parameter
  448.  
  449.  
  450.  
  451.  
  452.  
  453. /////////// structures....
  454.  
  455. typedef struct
  456. {
  457.         U32  AvkVram;            //in bytes, such as 2*1024L*1024L...
  458.         U16 DisplayRevLevel; //note. these values are not available
  459.                                 //from actual hardware...
  460.         U16 DigitizerRevLevel;
  461.         U16 AvkRevLevel;        //these are available...
  462.         U16 AvkRevLevelTenths;
  463.         U16 AvkRevLevelHundredths;
  464. //the digitizer signals are not in this table becuase they take 1 to 2 secs
  465. //to calculate. There will be a notification message instead.
  466.  
  467. //for these fields, the values are as in AVK.INI...
  468.         U16 DviMonitorSync;
  469. // 0:none    1:NTSC   2:PAL   16:VGA mode 18   256:XGA 1024x768
  470.  
  471.         U16 SysMonitorSync;
  472. // 16: VGA mode 18  [640 x 480]         256: XGA mode [1024 x 768]
  473.  
  474.         U16 DviExtConn;
  475. // 0: no keying     1: analog keying (Y cable)  2: digital (windows only)
  476. } DVICAPS;
  477.  
  478. typedef struct
  479. {
  480.     I16 x1, y1, x2, y2;
  481. } BOX;
  482.  
  483. typedef BOX AVKPTR PBOX;
  484.  
  485. //These are the status data structures. Over time, they can change
  486. //by the addition of additional data fields. If a program is not recompiled
  487. //and requests less than the full structure, it will receive just
  488. //what it asked for. In the structure definitions below, the presence
  489. // of a cutoff line:  //------------------------------------
  490. // shows the optional substructure lengths that are supported.
  491.  
  492.  
  493. typedef struct  {        //volatile status data for a board..
  494.         U32 TotalFreeVram;
  495.         U32 DisplayVbiCount;
  496.         U32 Unused;
  497.         U32 AudVbiCount;
  498.         U16 VidEventFlag; //reason for last interrupt by PP
  499.         U16 AudEventFlag; //reason for last interrupt by AP
  500.         U16 UcodeError;   //TRUE if very serious errors have occurred, e.g.:
  501.                           //MVD_EVENT_... indicating serious error
  502.         U16 DataPresent;  //non-zero if grab really happened for this item
  503.         //-------------------------------------
  504.         U32 LargestFreeVram;
  505. } AVKSTATUSDEV;
  506.  
  507.  
  508. typedef struct { //current system time or "relative" current system time
  509.         I16 hour;        // 0-23
  510.         I16 minute;     // 0-59
  511.         I16 second;     // 0-59
  512.         I16 hsecond;    // 0-99  (hundredths of seconds)
  513.         U16 DataPresent; //non-zero if grab really happened for this item
  514. } AVKSTATUSTIME;
  515.  
  516.  
  517.  
  518. typedef struct {        //volatile status data for a group...
  519.         U16 playing;            //these are all boolean...
  520.         U16 Recording;
  521.         U16 Committed;
  522.         U16 InTransition;        //TRUE if group hasn't reached desired
  523.                                 //status yet (e.g. PLAYING, PAUSED)
  524.         U16 DataPresent; //non-zero if grab really happened for this item
  525. } AVKSTATUSGRP;
  526.  
  527.  
  528. typedef struct {        //volatile status data for a buffer...
  529.         U32 FreeBeginBufCt;     // 0 or more free bytes at beginning of buffer
  530.         U32 FreeEndBufCt;        // 0 or more free bytes at end of buffer
  531.         U32 InUseCt;    // 0 or more bytes containing data
  532.         U16 InError;    //TRUE if any A/V data errors have been detected
  533.         U16 DataPresent; //non-zero if grab really happened for this item
  534. } AVKSTATUSGRPBUF;
  535.  
  536.  
  537. typedef struct {        //volatile status data for a stream...
  538.         U32 ShowFrameNum; //current "on display" frame number, if ANY is current.
  539.         U32 ProcFrameNum; //current processed frame number
  540.         U16 StrmState; //This is StrmStat in the microcode, see below
  541.                           //the above field sets the CATCHUP STRATEGY IN UCODE.
  542.         U16 InSync;     //TRUE if stream is regarded as currently in synch
  543.                         // (play direction only)
  544.         I16 LoadedBitmaps; //The NUMBER of bitmaps with decompressed data,
  545.                         // if this is easy to determine.. (both cap and play)
  546.         U16 DataPresent; //non-zero if grab really happened for this item
  547. } AVKSTATUSSTRM;
  548. // bits of signifigance in the StrmState value...
  549. #define STRM_STAT_SLOW  0x10    //enable slowing down to frame rate
  550. #define STRM_STAT_FAST  0x20    //enable speeding up  to frame rate
  551.  
  552.  
  553. typedef struct {        //volatile status data for an image...
  554.         U32 CompressedLen; //amount of compressed data, or zero.
  555.                         //very interesting in the case of capture.
  556.                         //it's undefined while "Pressing" is true.
  557.         HAVK hImage;    //identify which image is being pressed, if any.
  558.         U16 Pressing; //TRUE if active compress or decompress is occurring
  559.         U16 DataPresent; //non-zero if grab really happened for this item
  560. } AVKSTATUSIMGBUF;
  561.  
  562.  
  563.  
  564.  
  565. ////////// calls.....
  566.  
  567. //RULES FOR Data-typing the parameters in the calls:
  568. // - anything that counts or numbers frame is U32
  569. // - BOX coords are int
  570. // - all other numeric data are I16.
  571. // - all boolean, symbol, enumerated or flag data is U16
  572. // - AVK_CALL definition, see avkcom.h
  573.  
  574. //BELOW: "undef" means call returns an error, it's not in release 1.
  575.  
  576. AVK_CALL AvkMatchFrame(HAVK hTime);
  577. AVK_CALL AvkMatchFrameCancel(HAVK hTime);
  578. AVK_CALL AvkDeviceVideoIn(HAVK hDev, U16 Digitizer);
  579. AVK_CALL AvkDeviceAudioIn(HAVK hDev, U16 Audtype, U16 AudMonitor);
  580.  
  581. AVK_CALL AvkBeginMsg(HWND hWnd,  PHAVK phSess, U32 options);
  582.  
  583. #ifdef _32BIT                    //see above...
  584. AVK_CALL AvkBeginCallback(
  585.     void ( * AVK_CALLBACK pcallback )(U32, HAVK, I16, U16, U32), 
  586.     U32 id, PHAVK phSess, U32 options); 
  587. #else
  588. AVK_CALL AvkBeginCallback(
  589.     void (AVK_CALLBACK *pcallback )(U32, HAVK, I16, U16, U32), 
  590.     U32 id, PHAVK phSess, U32 options); 
  591. #endif
  592.  
  593. // you should prototype your callback routine as follows....
  594. //  void  AVK_CALLBACK myroutine(U32 id, HAVK hsession, I16 msg,
  595. //                      U16 param1, U32 param2).
  596.  
  597.  
  598. AVK_CALL AvkEnd(HAVK hSess);
  599. AVK_CALL AvkGetDevCaps(I16 BoardNum, I16 Size, DVICAPS AVKPTR pCaps);
  600. AVK_CALL AvkGetSubSysErrCode(HAVK hSess, U16 AVKPTR  pErrCode);
  601. AVK_CALL AvkDeviceOpen(HAVK hSess, I16 DevNum, U16 Flags, PHAVK phDev);
  602. AVK_CALL AvkDeviceClose(HAVK hDev);
  603. AVK_CALL AvkTimeStrmFrameCreate(HAVK hstrm, U32 frame_no, PHAVK htime);
  604. AVK_CALL AvkTimeDelete(HAVK htime);
  605.  
  606. AVK_CALL AvkGetStatus(HAVK hSess, HAVK hTime, U16 Aspects);
  607. AVK_CALL AvkTimeStatus(HAVK hSess, I16 Len, AVKSTATUSTIME AVKPTR pStru);
  608. AVK_CALL AvkDeviceStatus(HAVK hDev, I16 Len, AVKSTATUSDEV AVKPTR pStru);
  609. AVK_CALL AvkGrpStatus(HAVK hGroup, I16 Len, AVKSTATUSGRP AVKPTR pStru);
  610. AVK_CALL AvkGrpBufStatus(HAVK hGrpBuf, I16 Len, AVKSTATUSGRPBUF AVKPTR pStru);
  611. AVK_CALL AvkStrmStatus(HAVK hStrm, I16 Len, AVKSTATUSSTRM AVKPTR pStru);
  612. AVK_CALL AvkImgBufStatus(HAVK hImgBuf, I16 Len, AVKSTATUSIMGBUF AVKPTR pStru);
  613.  
  614. AVK_CALL AvkViewCreate(HAVK hDev, I16 xres, I16 yres, U16 BitmapFmt,
  615.     U16 VidType, PHAVK phView);
  616. AVK_CALL AvkViewDelete(HAVK hView);
  617. AVK_CALL AvkViewDisplay(HAVK hDev, HAVK hView, HAVK hTime, U16 OutputDev);
  618. AVK_CALL AvkViewCleanRect(HAVK hView, BOX AVKPTR  Rect);
  619.  
  620. AVK_CALL AvkGrpCreate(HAVK hDev, PHAVK phGrp);
  621. AVK_CALL AvkGrpDelete(HAVK grp);
  622. AVK_CALL AvkGrpStart(HAVK hgrp, HAVK htime);
  623. AVK_CALL AvkGrpStep(HAVK hgrp, HAVK htime); //unsupported.
  624.  
  625. AVK_CALL AvkGrpPause(HAVK hGrp, HAVK hTime);
  626. AVK_CALL AvkGrpPauseCancel(HAVK hGrp, HAVK hTime);
  627. AVK_CALL AvkGrpFlush(HAVK hGrp);
  628. AVK_CALL AvkGrpTempo(HAVK hGrp, I16 Percent, HAVK hTime);
  629. AVK_CALL AvkGrpResync(HAVK hStrm);
  630.  
  631. AVK_CALL AvkGrpBufCreate(HAVK hgrp, U16 type, U32 bufsize, U32 hunger_gran,
  632.     U16 strm_ct, PHAVK phGrpBuf);
  633.  
  634. AVK_CALL AvkGrpBufDelete(HAVK hbuf);
  635. AVK_CALL AvkStrmSetFrameNum(HAVK hand,  U16 FrameType, U32 FrameNum);
  636.  
  637. AVK_CALL AvkGrpBufWrite(HAVK hbuf, U32 len,
  638.     void AVKPTR pData, U32 AVKPTR pbytes_written, U16 HungerEnable);
  639.  
  640. AVK_CALL AvkGrpBufGetSpec(HAVK hBuf, I16 Len, U32 AVKPTR pInfoBuffer); //do not use.
  641. AVK_CALL AvkGrpBufRead(HAVK hbuf, U32 Max,
  642.     void AVKPTR pDestin, U32 AVKPTR pBytesRead, U16 HungerEnable);
  643.  
  644. AVK_CALL AvkVidStrmCreate(HAVK hbuf, I16 strm_index, PHAVK newh);
  645.  
  646. AVK_CALL AvkStrmDelete(HAVK hstrm);
  647. AVK_CALL AvkVidStrmFormat(HAVK hstrm,
  648.     I16 nr_of_bitmaps,
  649.     I16 xres, I16 yres,
  650.     U16 bitmap_format,
  651.     U32 frame_rate,     // microseconds per frame
  652.     U16 decode_alg_name,
  653.     void AVKPTR alg_args,
  654.     I32 arg_len,
  655.     I32 arg_area_size,
  656.     void AVKPTR work_args,
  657.     I32 work_len,
  658.     I32 work_area_size);
  659.  
  660.  
  661. AVK_CALL AvkStrmThreshold(HAVK hstrm, U32 frames);
  662.  
  663. AVK_CALL AvkAudStrmCreate(HAVK hbuf, I16 strm_index, PHAVK newh);
  664. AVK_CALL AvkAudStrmFormat(HAVK hstrm,
  665.     U32 frame_rate,     // microseconds per frame
  666.     U32 SamplesPerSecond,
  667.     U16 decode_alg_name,
  668.     U16 AudChannel,     //for a good default value, use: AVK_AUD_MIX
  669.     void AVKPTR  pAlgData,
  670.     I32 AlgDataSize,
  671.     I32 AlgDataSpace);
  672.  
  673. AVK_CALL AvkAudStrmVolume(HAVK hStrm, I16 Left, I16 Right);
  674.  
  675. AVK_CALL AvkImgCreate(HAVK hDev, I16 xres, I16 yres, U16 BitmapFormat, PHAVK phImage);
  676. AVK_CALL AvkImgDelete(HAVK hImage);
  677. AVK_CALL AvkImgWrite(HAVK hImage, U16 Planes, U32 Len,
  678.         void AVKPTR pData, U32 Offset);
  679. AVK_CALL AvkImgRead(HAVK hImage, U16 Planes, U32 Len, U32 AVKPTR  pActuallen,
  680.         void AVKPTR pData, U32 Offset);
  681. AVK_CALL AvkImgBufCreate(HAVK hDev, U32 BufSize, PHAVK phImgBuf);
  682. AVK_CALL AvkImgBufDelete(HAVK hImgBuf);
  683. AVK_CALL AvkImgBufWrite(HAVK hImgBuf, U32 Len, void AVKPTR pData,
  684.          U32 Offset);
  685. AVK_CALL AvkImgBufRead(HAVK hImgBuf, U32 MaxLen, U32 AVKPTR pActuallen,
  686.         void AVKPTR pData, U32 Offset);
  687.  
  688. AVK_CALL AvkImgCompress(HAVK hImgBuf, U16 CompressionFormat, HAVK hImage,
  689.         void AVKPTR  pAlgData, I32 AlgDataSize, I32 AlgDataSpace,
  690.         void AVKPTR  pWorkData, I32 WorkDataSize, I32 WorkDataSpace );
  691. AVK_CALL AvkImgDecompress(HAVK hImgBuf, U16 CompressionFormat, HAVK hImage,
  692.         void AVKPTR  pAlgData, I32 AlgDataSize, I32 AlgDataSpace,
  693.         void AVKPTR  pWorkData, I32 WorkDataSize, I32 WorkDataSpace );
  694.  
  695. AVK_CALL AvkConnCreate( HAVK hSource, BOX AVKPTR pSrcBox, HAVK hDest,
  696.                    BOX AVKPTR pDstBox, U16 options,PHAVK phConn);
  697. AVK_CALL AvkConnDelete(HAVK hConn);
  698. AVK_CALL AvkConnModSrcDst(HAVK hConn, BOX AVKPTR psrcbox,
  699.         BOX AVKPTR pdstbox, HAVK hTime);
  700. AVK_CALL AvkConnCopyList(HAVK hConn, I16 nBoxes, BOX AVKPTR pBoxArrayz,
  701.         HAVK hTime);
  702. AVK_CALL AvkConnEnable(HAVK hConn, HAVK hTime);
  703. AVK_CALL AvkConnDisable(HAVK hConn, HAVK hTime);
  704. AVK_CALL AvkConnHide(HAVK hConn, HAVK hTime);
  705. AVK_CALL AvkConnModEffect(HAVK hConn, U16 WhichEffect, I16 Value, HAVK hTime);
  706.  
  707. #include "avkalg.h"  //include algorithm-related definitions...
  708. #endif //ifndef AVKAPI_DEFINED
  709. 
  710.