lbxopts.h
上传用户:lctgjx
上传日期:2022-06-04
资源大小:8887k
文件大小:4k
源码类别:

流媒体/Mpeg4/MP4

开发平台:

Visual C++

  1. /* $Xorg: lbxopts.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ */
  2. /*
  3.  * Copyright 1994 Network Computing Devices, Inc.
  4.  *
  5.  * Permission to use, copy, modify, distribute, and sell this software and
  6.  * its documentation for any purpose is hereby granted without fee, provided
  7.  * that the above copyright notice appear in all copies and that both that
  8.  * copyright notice and this permission notice appear in supporting
  9.  * documentation, and that the name Network Computing Devices, Inc. not be
  10.  * used in advertising or publicity pertaining to distribution of this
  11.  * software without specific, written prior permission.
  12.  *
  13.  * THIS SOFTWARE IS PROVIDED `AS-IS'.  NETWORK COMPUTING DEVICES, INC.,
  14.  * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT
  15.  * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
  16.  * PARTICULAR PURPOSE, OR NONINFRINGEMENT.  IN NO EVENT SHALL NETWORK
  17.  * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING
  18.  * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA,
  19.  * OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS OF
  20.  * WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT OF OR IN
  21.  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  22.  *
  23.  */
  24. /* $XFree86: xc/include/extensions/lbxopts.h,v 1.5 2001/01/17 17:53:21 dawes Exp $ */
  25. #ifndef _LBX_OPTS_H_
  26. #define _LBX_OPTS_H_
  27. /*
  28.  * Negotiable configuration options
  29.  */
  30. #define LBX_OPT_DELTA_PROXY 0
  31. #define LBX_OPT_DELTA_SERVER 1
  32. #define LBX_OPT_STREAM_COMP 2
  33. #define LBX_OPT_BITMAP_COMP 3
  34. #define LBX_OPT_PIXMAP_COMP 4
  35. #define LBX_OPT_MSG_COMP 5 /* aka "squishing" */
  36. #define LBX_OPT_USE_TAGS 6
  37. #define LBX_OPT_CMAP_ALL 7
  38. #define LBX_OPT_EXTENSION 255
  39. /*
  40.  * Length fields are encoded in 1 or 3 bytes
  41.  */
  42. #define LBX_OPT_SMALLLEN_SIZE 1
  43. #define LBX_OPT_BIGLEN_SIZE 3
  44. #define LBX_OPT_BIGLEN_MIN 256
  45. #define LBX_OPT_DECODE_LEN(p, len, size) 
  46.     if ((p)[0]) { 
  47. (len) = (p)[0]; 
  48. (size) = LBX_OPT_SMALLLEN_SIZE; 
  49.     } 
  50.     else { 
  51. (len) = ((LBX_OPT_BIGLEN_MIN + (p)[1]) << 8) | (p)[2]; 
  52. (size) = LBX_OPT_BIGLEN_SIZE; 
  53.     }
  54. /*
  55.  * Option header lengths
  56.  */
  57. #define LBX_OPT_SMALLHDR_LEN (1 + LBX_OPT_SMALLLEN_SIZE)
  58. #define LBX_OPT_BIGHDR_LEN (1 + LBX_OPT_BIGLEN_SIZE)
  59. /*
  60.  * Delta compression parameters
  61.  */
  62. #define LBX_OPT_DELTA_REQLEN 6
  63. #define LBX_OPT_DELTA_REPLYLEN 2
  64. #define LBX_OPT_DELTA_NCACHE_DFLT 16
  65. #define LBX_OPT_DELTA_MSGLEN_MIN 32
  66. #define LBX_OPT_DELTA_MSGLEN_DFLT 64
  67. /*
  68.  * Stream compression opts
  69.  */
  70. #include <sys/types.h>
  71. #if defined(WIN32) || (defined(USG) && !defined(CRAY) && !defined(umips) && !defined(MOTOROLA) && !defined(uniosu) && !defined(__sxg__))
  72. struct iovec {
  73.     caddr_t iov_base;
  74.     int iov_len;
  75. };
  76. #else
  77. #ifndef Lynx
  78. #include <sys/uio.h>
  79. #else
  80. #include <uio.h>
  81. #endif
  82. #endif
  83. typedef void *LbxStreamCompHandle;
  84. typedef struct _LbxStreamOpts {
  85.     LbxStreamCompHandle (*streamCompInit)(int fd, pointer arg);
  86.     pointer streamCompArg;
  87.     int (*streamCompStuffInput)(
  88.     int fd,
  89.     unsigned char *buf,
  90.     int buflen
  91. );
  92.     int (*streamCompInputAvail)(
  93.     int fd
  94. );
  95.     int (*streamCompFlush)(
  96.     int fd
  97. );
  98.     int (*streamCompRead)(
  99.     int fd,
  100.     unsigned char *buf,
  101.     int buflen
  102. );
  103.     int          (*streamCompWriteV)(
  104.     int fd,
  105.     struct iovec *iov,
  106.     int iovcnt
  107. );
  108.     void (*streamCompOn)(
  109.     int fd
  110. );
  111.     void (*streamCompOff)(
  112.     int fd
  113. );
  114.     void (*streamCompFreeHandle)(
  115.     LbxStreamCompHandle handle
  116. );
  117. } LbxStreamOpts;
  118. #endif /* _LBX_OPTS_H_ */