home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional Developers Kit 1992 November / Disc01 / Disc01.mdf / runnable / mmos2 / mmtoolkt / h / shdd.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-05-06  |  9.6 KB  |  199 lines

  1. /***************************************************************************\
  2. *
  3. * Module Name: SHDD.H
  4. *
  5. * OS/2 2.0 Multimedia Extensions Stream Handler Device Driver Interfaces
  6. * Block defintions.
  7. *
  8. * Copyright (c) International Business Machines Corporation 1990,1991
  9. *                         All Rights Reserved
  10. *
  11. \***************************************************************************/
  12.  
  13. /****************************************************************************/
  14. /*                         D E F I N E S                                    */
  15. /****************************************************************************/
  16.  
  17. /* XLATOFF */
  18. typedef RC (FAR *PSHDFN)        (PVOID pParmIn);
  19. typedef RC (FAR *PDDCMDFN)      (PVOID pParmIn);
  20. /* XLATON */
  21. #ifdef XXXXX                                 /* Picked up by H2INC only    */
  22. typedef PVOID PSHDFN;                        /* Because previous function  */
  23. typedef PVOID PDDCMDFN;                      /* prototypes generate errors */
  24.                                              /* when parsed by H2INC.      */
  25. #endif                                       /*                            */
  26.  
  27.  
  28.  
  29. /* DDCMD's:                                                                */
  30.  
  31. #define     DDCMD_SETUP         0L
  32. #define     DDCMD_READ          1L
  33. #define     DDCMD_WRITE         2L
  34. #define     DDCMD_STATUS        3L
  35. #define     DDCMD_CONTROL       4L
  36. #define     DDCMD_REG_STREAM    5L
  37. #define     DDCMD_DEREG_STREAM  6L
  38.  
  39.  
  40. /* SHD's:                                                                   */
  41. #define     SHD_REPORT_INT      0L      /* PDD reports interrupt has arrived*/
  42. #define     SHD_REPORT_EVENT    1L      /* PDD reports cuetime has arrived  */
  43.  
  44.  
  45.  
  46. /****************************************************************************/
  47. /*                       S T R U C T U R E S                                */
  48. /****************************************************************************/
  49.  
  50. /* XLATOFF */
  51. #pragma pack(4)
  52. /* XLATON */
  53.  
  54. /**************************************/
  55. /****   DDCMD's                      **/
  56. /**************************************/
  57. typedef struct  _ddcmd_common_parm {            /* comm  - common to all DD cmds */
  58.                         ULONG   ulFunction;     /* Function requested by SH */
  59.                         HSTREAM hStream;        /* data stream instance     */
  60.                       } DDCMDCOMMON;
  61.  
  62. typedef struct  _ddcmd_setup_parm {             /* setu */
  63.                         ULONG   ulFunction;     /* Function requested by SH */
  64.                         HSTREAM hStream;
  65.                         PVOID   pSetupParm;     /* pass stream time to PDD  */
  66.                         ULONG   ulSetupParmSize;
  67.                       } DDCMDSETUP;
  68.  
  69. typedef struct  _ddcmd_readwrite_parm {         /* read */
  70.                         ULONG   ulFunction;     /* Function requested by SH */
  71.                         HSTREAM hStream;
  72.                         PVOID   pBuffer;
  73.                         ULONG   ulBufferSize;
  74.                       } DDCMDREADWRITE;
  75.  
  76. typedef struct  _ddcmd_status_parm {            /* stat */
  77.                         ULONG   ulFunction;     /* Function requested by SH */
  78.                         HSTREAM hStream;
  79.                         PVOID   pStatus;        /* (output)ptr to current position time */
  80.                         ULONG   ulStatusSize;   /* (output)size of position time        */
  81.                       } DDCMDSTATUS;
  82.  
  83. typedef struct  _ddcmd_control_parm {           /* cont */
  84.                         ULONG   ulFunction;     /* Function requested by SH */
  85.                         HSTREAM hStream;
  86.                         HEVENT  hEvent;         /* used for EVENTS only                 */
  87.                         ULONG   ulCmd;
  88.                         PVOID   pParm;          /* (input/output) ptr to (ulong)cuetime when ulCmd is ENABLE_EVENT */
  89.                         ULONG   ulParmSize;     /* (input/output) size of cuetime or returning current time        */
  90.                       } DDCMDCONTROL;
  91.  
  92. /**********************************************/
  93. /* ulCmd defines                              */
  94. /**********************************************/
  95.                                           /* CHANGE and WAIT not implemented                   */
  96. #define DDCMD_START       1               /* start device                                      */
  97. #define DDCMD_STOP        2               /* stop device and return current position in pParm  */
  98. #define DDCMD_PAUSE       3               /* pause device and return current position in pParm */
  99. #define DDCMD_RESUME      4               /* resume device                                     */
  100. #define DDCMD_ENABLE_EVENT  5             /* ask PDD to create this event                      */
  101. #define DDCMD_DISABLE_EVENT 6             /* ask PDD to purge this event                       */
  102.  
  103. typedef struct  _ddcmd_register_parm {          /* regi */
  104.                         ULONG   ulFunction;     /* Function requested by SH                    */
  105.                         HSTREAM hStream;        /* Stream handle needed @ interrupt time       */
  106.                         ULONG   ulSysFileNum;   /* Device Handle so pdd can map device instance to hstream */
  107.                         PSHDFN  pSHDEntryPoint; /* Stream handler entry point                  */
  108.                         ULONG   ulStreamOperation; /* SH input Record or play                  */
  109.                         SPCBKEY spcbkey;
  110.                         ULONG   ulBufSize;      /* PDD output (optional) buffer size in bytes for SPCB */
  111.                         ULONG   ulNumBufs;      /* PDD output (optional) # of buffers for SPCB         */
  112.                         ULONG   ulAddressType;  /* PDD output (required) addr ptr type to data buffer  */
  113.                         ULONG   ulBytesPerUnit; /*PDD output (required)                                */
  114.                         MMTIME  mmtimePerUnit;  /*PDD output (required)                                */
  115.                       } DDCMDREGISTER;
  116.  
  117. /*****************************/
  118. /* ulStreamOperation  defines*/
  119. /*****************************/
  120. #define STREAM_OPERATION_MASK     0xC000
  121. #define STREAM_OPERATION_CONSUME  0x8000
  122. #define STREAM_OPERATION_PRODUCE  0xC000
  123.  
  124. /*******************************************************************************/
  125. /* ulAddressType  defines                                                      */
  126. /* The PDD will tell the SH what type of address ptr it expects the data buffer*/
  127. /* to be.  The SH will then request this address type to the SSM, so that the  */
  128. /* SSM will send the correct type of each buffer request.                      */
  129. /*******************************************************************************/
  130. #define ADDRESS_TYPE_VIRTUAL    0L
  131. #define ADDRESS_TYPE_PHYSICAL   1L              /*default                  */
  132. #define ADDRESS_TYPE_LINEAR     2L
  133.  
  134.  
  135. typedef struct  _ddcmd_deregister_parm {        /* dere */
  136.                         ULONG   ulFunction;     /* Function requested by SH */
  137.                         HSTREAM hStream;        /* Stream handle needed @ interrupt time */
  138.                       } DDCMDDEREGISTER;
  139.  
  140.  
  141.  
  142. typedef DDCMDCOMMON    FAR     *PDDCMDCOMMON;
  143. typedef DDCMDSETUP     FAR     *PDDCMDSETUP;
  144. typedef DDCMDREADWRITE FAR     *PDDCMDREADWRITE;
  145. typedef DDCMDSTATUS    FAR     *PDDCMDSTATUS;
  146. typedef DDCMDCONTROL   FAR     *PDDCMDCONTROL;
  147. typedef DDCMDREGISTER  FAR     *PDDCMDREGISTER;
  148. typedef DDCMDDEREGISTER FAR    *PDDCMDDEREGISTER;
  149.  
  150.  
  151. /**************************************/
  152. /****   SHD's                        **/
  153. /**************************************/
  154. typedef struct  _shd_common_parm {              /* shdc */
  155.                         ULONG   ulFunction;     /* Function requested by PDD               */
  156.                         HSTREAM hStream;        /* Stream handle needed @ interrupt time   */
  157.                         }SHD_COMMON;
  158.  
  159. typedef struct  _shd_reportint_parm {           /* repi */
  160.                         ULONG   ulFunction;     /* Function requested by PDD*/
  161.                         HSTREAM hStream;        /* so SH knows which stream to process     */
  162.                         PVOID   pBuffer;        /* return ptr to last used buffer          */
  163.                         ULONG   ulFlag;         /* reason for interrupt     */
  164.                         ULONG   ulStatus;       /* rc or bytes read/written */
  165.                         ULONG   ulStreamTime;   /* time in milliseconds of stream position  */
  166.                       } SHD_REPORTINT;
  167. /* ulFlag settings */
  168. #define ERROR               0x80L
  169. #define SHD_READ_COMPLETE   1L
  170. #define SHD_WRITE_COMPLETE  2L
  171.  
  172. typedef struct  _shd_reportevent_parm {         /* repe */
  173.                         ULONG   ulFunction;     /* Function requested by PDD*/
  174.                         HSTREAM hStream;        /* so SH knows which stream to process     */
  175.                         HEVENT  hEvent;         /* event handle pass back to stream handler*/
  176.                         ULONG   ulStreamTime;   /* time in milliseconds of stream position  */
  177.                       } SHD_REPORTEVENT;
  178.  
  179. typedef SHD_COMMON      FAR  *PSHD_COMMON;
  180. typedef SHD_REPORTINT   FAR  *PSHD_REPORTINT;
  181. typedef SHD_REPORTEVENT FAR  *PSHD_REPORTEVENT;
  182.  
  183.  
  184. /* XLATOFF */
  185. #pragma pack()
  186. /* XLATON */
  187.  
  188. /****************************************************************************/
  189. /*              F U N C T I O N   P R O T O T Y P E S                       */
  190. /****************************************************************************/
  191.  
  192. /* XLATOFF */
  193. RC  FAR         SHDEntryPoint(PSHD_COMMON pCommon);
  194. RC  FAR         DDCMDEntryPoint(PDDCMDCOMMON pCommon);
  195. /* XLATON  */
  196.  
  197.  
  198.  
  199.