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