home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cset21v6.zip / MMPM2TK / TK / H / SPCB.H < prev    next >
C/C++ Source or Header  |  1992-11-12  |  10KB  |  161 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      (384L*1024L)   /* Largest buffer size in bytes  */
  75.  
  76. /*******************
  77.  * SPCB_ulDataFlags:
  78.  *******************/
  79. /* XLATOFF */
  80. #define  VALIDDATAFLAGS        ( SPCBDATA_CUETIME |           \
  81.                                  SPCBDATA_CUEDATA |           \
  82.                                  SPCBDATA_NOSEEK )
  83. /* XLATON */
  84. #define  SPCBDATA_CUETIME      0x0002L /* This data type can support time cue points*/
  85. #define  SPCBDATA_CUEDATA      0x0004L /* This data type can support data cue points*/
  86.  
  87. #define  SPCBDATA_SEEK         0x0000L /* Seeks can be performed on this data type. */
  88. #define  SPCBDATA_NOSEEK       0x0008L /* NO seeks can be performed on this data type.*/
  89.  
  90. /********************
  91.  * SPCB_ulBufFlags:
  92.  ********************/
  93. /* XLATOFF */
  94. #define  VALIDBUFFLAGS         ( SPCBBUF_USERPROVIDED |       \
  95.                                  SPCBBUF_FIXEDBUF |           \
  96.                                  SPCBBUF_NONCONTIGUOUS |      \
  97.                                  SPCBBUF_INTERLEAVED |        \
  98.                                  SPCBBUF_16MEG |              \
  99.                                  SPCBBUF_MAXSIZE )
  100. /* XLATON */
  101. #define  SPCBBUF_USERPROVIDED  0x0001L /* User provides buffers for stream        */
  102.                                        /* SSMgr will not allocate buffers,        */
  103.                                        /* but must lock down provided buffers,    */
  104.                                        /* so this will affect performance!!       */
  105.                                        /* (Source Handler only)                   */
  106. #define  SPCBBUF_FIXEDBUF      0x0002L /* Buffer size is fixed for this data type */
  107.                                        /*  in this handler. Can not be used       */
  108.                                        /*  with the SPCBBUF_INTERLEAVED or        */
  109.                                        /*  SPCBBUF_USERPROVIDED flags.            */
  110. #define  SPCBBUF_NONCONTIGUOUS 0x0004L /* Buffer do not need to be contiguous     */
  111.                                        /*  in physical memory.                    */
  112. #define  SPCBBUF_INTERLEAVED   0x0008L /* Stream buffers can be interleaved.      */
  113.                                        /*  Can not be use with the                */
  114.                                        /*  SPCBBUF_USERPROVIDED flag.             */
  115.                                        /*  (Source Handler only)                  */
  116. #define  SPCBBUF_MAXSIZE       0x0010L /* ulBufSize is the maximum size that      */
  117.                                        /*  can be used by this stream handler     */
  118. #define  SPCBBUF_16MEG         0x0020L /* The Stream buffers may be allocated     */
  119.                                        /*  above the 16 Meg line. This is used    */
  120.                                        /*  by stream handlers that can support    */
  121.                                        /*  greater than 16 Megabyte addresses.    */
  122.  
  123. /*******************
  124.  * SPCB_ulHandFlags:
  125.  *******************/
  126. /* XLATOFF */
  127. #define  VALIDHANDFLAGS        ( SPCBHAND_GENSYNC |           \
  128.                                  SPCBHAND_RCVSYNC |           \
  129.                                  SPCBHAND_TIMER |             \
  130.                                  SPCBHAND_NONSTREAM |         \
  131.                                  SPCBHAND_GENTIME |           \
  132.                                  SPCBHAND_NOPREROLL |         \
  133.                                  SPCBHAND_NOSYNC |            \
  134.                                  SPCBHAND_PHYS_SEEK )
  135. /* XLATON */
  136. #define  SPCBHAND_GENSYNC      0x0001L /* (INPUT FROM HANDLER ONLY)               */
  137.                                        /* This handler can generate sync pulses   */
  138.                                        /* if it is the master.                    */
  139. #define  SPCBHAND_RCVSYNC      0x0002L /* (INPUT FROM HANDLER ONLY)               */
  140.                                        /* This handler can receive sync pulses    */
  141.                                        /* if it is a slave                        */
  142. #define  SPCBHAND_TIMER        0x0004L /* Use Stream Manager Timer for Sync       */
  143. #define  SPCBHAND_NONSTREAM    0x0008L /* Stream Handler is non-streaming         */
  144. #define  SPCBHAND_GENTIME      0x0010L /* This handler contains real              */
  145.                                        /* stream time. The handler that           */
  146.                                        /* supports the SpiGetTime, data/time      */
  147.                                        /* cue point calls for this stream.        */
  148. #define  SPCBHAND_NOPREROLL    0x0020L /* This stream can not be prerolled.       */
  149.                                        /* (i.e. recording streams)                */
  150. #define  SPCBHAND_NOSYNC       0x0040L /* This stream can be group into a         */
  151.                                        /* sync group, but does not send or        */
  152.                                        /* receive sync pulses.                    */
  153. #define  SPCBHAND_PHYS_SEEK    0x0080L /* This handler does a seek to a physical  */
  154.                                        /* device or memory not just a time adjustment.*/
  155.                                        /* (ssm will always call this handler first on */
  156.                                        /*  an SpiSeekStream call).                    */
  157.  
  158. /* XLATOFF */
  159. #pragma pack()
  160. /* XLATON */
  161.