home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / header45.zip / spcb.h < prev    next >
C/C++ Source or Header  |  1999-03-15  |  11KB  |  182 lines

  1. /****************************************************************************/
  2. /*                                                                          */
  3. /* Module Name: SPCB.H                                                      */
  4. /*                                                                          */
  5. /* OS/2 2.0 Multimedia Extensions Sync/Stream Manager Stream Protocol       */
  6. /* Control Block Definitions.                                               */
  7. /*                                                                          */
  8. /* Copyright (c) International Business Machines Corporation 1991, 1992     */
  9. /*                        All Rights Reserved                               */
  10. /*                                                                          */
  11. /****************************************************************************/
  12. /* NOINC */
  13. #ifdef __cplusplus
  14.    extern "C" {
  15. #endif
  16. /* INC */
  17.  
  18.  
  19. /* XLATOFF */
  20. #pragma pack(4)
  21. /* XLATON */
  22.  
  23. #ifndef  _SPCBKEY_DEFINED
  24. #define  _SPCBKEY_DEFINED
  25. /**********************************************
  26.  *
  27.  * SPCBKEY - Stream Protocol Key
  28.  *
  29.  **********************************************/
  30. typedef struct _SPCBKEY { /* spcbkey SPCB key (Stream data type) */
  31.    ULONG    ulDataType;
  32.    ULONG    ulDataSubType;
  33.    ULONG    ulIntKey;                 /* generated internal key            */
  34.    } SPCBKEY;
  35. typedef SPCBKEY FAR *PSPCBKEY;
  36. #endif
  37.  
  38.  
  39. /**********************************************
  40.  *
  41.  * SPCB - Stream Protocol Control Block
  42.  *
  43.  **********************************************/
  44. typedef struct  _SPCB { /* spcb */
  45.    ULONG   ulSPCBLen;             /* SPCB struture length                   */
  46.    SPCBKEY spcbkey;
  47.    ULONG   ulDataFlags;           /* Data type flags                        */
  48.    ULONG   ulNumRec;              /* Max # records/buffer (Only used for Split streams) */
  49.    ULONG   ulBlockSize;           /* Block alignment in bytes.                   */
  50.    ULONG   ulBufSize;             /* Buffer size (SSM allocated buffers) must be */
  51.                                   /*  a multiple of Block size                   */
  52.    ULONG   ulMinBuf;              /* Minimum number of buffers needed to stream  */
  53.    ULONG   ulMaxBuf;              /* Maximum number of buffers needed to stream  */
  54.    ULONG   ulSrcStart;            /* # of EMPTY buffers required to start Source */
  55.    ULONG   ulTgtStart;            /* # of FULL buffers required to start Target  */
  56.    ULONG   ulBufFlags;            /* Handler Protocol negotiation flags          */
  57.    ULONG   ulHandFlags;           /* Handler Protocol flags                      */
  58.    MMTIME  mmtimeTolerance;       /* Sync tolerance value...Used as check by SSM */
  59.                                   /*  to determine whether to send a sync pulse  */
  60.                                   /*  to this specific slave Stream Handler.     */
  61.                                   /*  Algorithm:                                 */
  62.                                   /*   diff = abs(master time - slave time)      */
  63.                                   /*   if  diff >= tolerance                     */
  64.                                   /*     then send sync pulse                    */
  65.                                   /* (Valid only for Slave stream handlers)      */
  66.    MMTIME  mmtimeSync;            /* Used to save sync pulse generation granularity */
  67.                                   /*  if the master uses the Stream Manager Timer.  */
  68.                                   /*  if SpiSetSync passed NULL value for sync gran */
  69.                                   /*   then use this default value. (since hardware */
  70.                                   /*   must have it's own interrupt time interval.  */
  71.                                   /* (Valid only for Master stream handlers)        */
  72.    ULONG   ulBytesPerUnit;        /* Bytes/unit of time. This is used to do seeks   */
  73.                                   /* on linear data that is not compressed or       */
  74.                                   /* of variable length.                            */
  75.    MMTIME  mmtimePerUnit;         /* The amount of mmtime each unit represents.     */
  76.                                   /* A unit can be a second, minute or whatever.    */
  77.    } SPCB;
  78. typedef SPCB FAR *PSPCB;
  79.  
  80. #define SPCB_MAX_BUF_SIZE      (1024L*1024L)   /* Largest buffer size in bytes  */
  81.  
  82. /*******************
  83.  * SPCB_ulDataFlags:
  84.  *******************/
  85. /* XLATOFF */
  86. #define  VALIDDATAFLAGS        ( SPCBDATA_CUETIME |           \
  87.                                  SPCBDATA_CUEDATA |           \
  88.                                  SPCBDATA_YIELDTIME |         \
  89.                                  SPCBDATA_NOSEEK )
  90. /* XLATON */
  91. #define  SPCBDATA_CUETIME      0x0002L /* This data type can support time cue points*/
  92. #define  SPCBDATA_CUEDATA      0x0004L /* This data type can support data cue points*/
  93.  
  94. #define  SPCBDATA_SEEK         0x0000L /* Seeks can be performed on this data type. */
  95. #define  SPCBDATA_NOSEEK       0x0008L /* NO seeks can be performed on this data type.*/
  96. #define  SPCBDATA_YIELDTIME    0x0010L /* The ulBytes per unit field is used for a millisecond value    */
  97.                                        /* It represents the amount of yield time between reads of       */
  98.                                        /* each buffer. If this bit is set, the value of ulBytesPerUnit  */
  99.                                        /* is used as input to DosSleep to yield for that period of time */
  100.  
  101. /********************
  102.  * SPCB_ulBufFlags:
  103.  ********************/
  104. /* XLATOFF */
  105. #define  VALIDBUFFLAGS         ( SPCBBUF_USERPROVIDED |       \
  106.                                  SPCBBUF_FIXEDBUF |           \
  107.                                  SPCBBUF_NONCONTIGUOUS |      \
  108.                                  SPCBBUF_INTERLEAVED |        \
  109.                                  SPCBBUF_16MEG |              \
  110.                                  SPCBBUF_FIXEDBLOCK |         \
  111.                                  SPCBBUF_MAXSIZE )
  112. /* XLATON */
  113. #define  SPCBBUF_USERPROVIDED  0x0001L /* User provides buffers for stream        */
  114.                                        /* SSMgr will not allocate buffers,        */
  115.                                        /* but must lock down provided buffers,    */
  116.                                        /* so this will affect performance!!       */
  117.                                        /* (Source Handler only)                   */
  118. #define  SPCBBUF_FIXEDBUF      0x0002L /* Buffer size is fixed for this data type */
  119.                                        /*  in this handler. Can not be used       */
  120.                                        /*  with the SPCBBUF_USERPROVIDED flags.   */
  121. #define  SPCBBUF_NONCONTIGUOUS 0x0004L /* Buffer do not need to be contiguous     */
  122.                                        /*  in physical memory.                    */
  123. #define  SPCBBUF_INTERLEAVED   0x0008L /* Stream buffers can be interleaved.      */
  124.                                        /*  Can not be use with the                */
  125.                                        /*  SPCBBUF_USERPROVIDED flag.             */
  126.                                        /*  (Source Handler only)                  */
  127. #define  SPCBBUF_MAXSIZE       0x0010L /* ulBufSize is the maximum size that      */
  128.                                        /*  can be used by this stream handler     */
  129. #define  SPCBBUF_16MEG         0x0020L /* The Stream buffers may be allocated     */
  130.                                        /*  above the 16 Meg line. This is used    */
  131.                                        /*  by stream handlers that can support    */
  132.                                        /*  greater than 16 Megabyte addresses.    */
  133. #define  SPCBBUF_FIXEDBLOCK    0x0040L /* Use the ulBlockSize field to represent  */
  134.                                        /* the size of the IO reads that should    */
  135.                                        /* be performed (Interleaved streams)      */
  136.  
  137. /*******************
  138.  * SPCB_ulHandFlags:
  139.  *******************/
  140. /* XLATOFF */
  141. #define  VALIDHANDFLAGS        ( SPCBHAND_GENSYNC |           \
  142.                                  SPCBHAND_RCVSYNC |           \
  143.                                  SPCBHAND_TIMER |             \
  144.                                  SPCBHAND_NONSTREAM |         \
  145.                                  SPCBHAND_GENTIME |           \
  146.                                  SPCBHAND_NOPREROLL |         \
  147.                                  SPCBHAND_NOSYNC |            \
  148.                                  SPCBHAND_PHYS_SEEK )
  149. /* XLATON */
  150. #define  SPCBHAND_GENSYNC      0x0001L /* (INPUT FROM HANDLER ONLY)               */
  151.                                        /* This handler can generate sync pulses   */
  152.                                        /* if it is the master.                    */
  153. #define  SPCBHAND_RCVSYNC      0x0002L /* (INPUT FROM HANDLER ONLY)               */
  154.                                        /* This handler can receive sync pulses    */
  155.                                        /* if it is a slave                        */
  156. #define  SPCBHAND_TIMER        0x0004L /* Use Stream Manager Timer for Sync       */
  157. #define  SPCBHAND_NONSTREAM    0x0008L /* Stream Handler is non-streaming         */
  158. #define  SPCBHAND_GENTIME      0x0010L /* This handler contains real              */
  159.                                        /* stream time. The handler that           */
  160.                                        /* supports the SpiGetTime, data/time      */
  161.                                        /* cue point calls for this stream.        */
  162. #define  SPCBHAND_NOPREROLL    0x0020L /* This stream can not be prerolled.       */
  163.                                        /* (i.e. recording streams)                */
  164. #define  SPCBHAND_NOSYNC       0x0040L /* This stream can be group into a         */
  165.                                        /* sync group, but does not send or        */
  166.                                        /* receive sync pulses.                    */
  167. #define  SPCBHAND_PHYS_SEEK    0x0080L /* This handler does a seek to a physical  */
  168.                                        /* device or memory not just a time adjustment.*/
  169.                                        /* (ssm will always call this handler first on */
  170.                                        /*  an SpiSeekStream call).                    */
  171.  
  172. /* XLATOFF */
  173. #pragma pack()
  174. /* XLATON */
  175.  
  176. /* NOINC */
  177. #ifdef __cplusplus
  178. }
  179. #endif
  180. /* INC */
  181.  
  182.