| 1 |
greg |
1.1 |
/* variables and declarations for client RPC library for software frame
|
| 2 |
|
|
buffer approach */
|
| 3 |
|
|
|
| 4 |
|
|
#include <netdb.h>
|
| 5 |
|
|
#include <rpc/rpc.h>
|
| 6 |
|
|
#include <sys/socket.h>
|
| 7 |
|
|
#include <sys/time.h>
|
| 8 |
|
|
|
| 9 |
|
|
/* if Limpel-Zev is used, a directive to define WIDEAREA is included
|
| 10 |
|
|
on the compile line */
|
| 11 |
|
|
|
| 12 |
|
|
|
| 13 |
|
|
#define SUNFRONT /* Sun is client */
|
| 14 |
|
|
|
| 15 |
|
|
#define PCPORT 2000 /* hard-wired PC port */
|
| 16 |
|
|
|
| 17 |
|
|
#define PROGNUM 1000 /* program number */
|
| 18 |
|
|
#define TESTVERS 1 /* version */
|
| 19 |
|
|
|
| 20 |
|
|
/* remote procedure numbers */
|
| 21 |
|
|
|
| 22 |
|
|
/* used in both metafile and software frame buffer approaches */
|
| 23 |
|
|
|
| 24 |
|
|
#define AUTHPROC 1 /* authorization procedure */
|
| 25 |
|
|
#define INITPROC 2 /* initialize VTR or videodisk */
|
| 26 |
|
|
#define RECORDPROC 4 /* record frame */
|
| 27 |
|
|
#define CLOSEPROC 5 /* relinquish control */
|
| 28 |
|
|
|
| 29 |
|
|
/* used only in software frame buffer approach */
|
| 30 |
|
|
|
| 31 |
|
|
#define NOCOMPRESS 6 /* no compression */
|
| 32 |
|
|
#define DISPLAY 7 /* display using TARGA graphics calls */
|
| 33 |
|
|
#define SENDUDP 13 /* send scan lines using UDP preliminary to
|
| 34 |
|
|
display */
|
| 35 |
|
|
#define MAPPROC 8 /* receive color map */
|
| 36 |
|
|
|
| 37 |
|
|
/* test RPC for rough timing estimates */
|
| 38 |
|
|
|
| 39 |
|
|
#define TESTRPC 14
|
| 40 |
|
|
|
| 41 |
|
|
/* definitions and variables common to both metafile and frame
|
| 42 |
|
|
buffer approaches */
|
| 43 |
|
|
|
| 44 |
|
|
/* give up after certain amount of time */
|
| 45 |
|
|
extern struct timeval total_timeout ;
|
| 46 |
|
|
/* client handle */
|
| 47 |
|
|
extern CLIENT *client ;
|
| 48 |
|
|
|
| 49 |
|
|
#define UDP 0 /* UDP protocol */
|
| 50 |
|
|
#define TCP 1 /* TCP protocol */
|
| 51 |
|
|
|
| 52 |
|
|
extern short protocol ; /* which protocol */
|
| 53 |
|
|
|
| 54 |
|
|
#define PREVIEW 0 /* preview mode */
|
| 55 |
|
|
|
| 56 |
|
|
extern FILE *vcr_rec ; /* records starting and ending frame numbers */
|
| 57 |
|
|
extern int curr_frame ; /* current frame number */
|
| 58 |
|
|
extern int copy_num ; /* number of frames to record image on */
|
| 59 |
|
|
extern int record ; /* preview or record */
|
| 60 |
|
|
extern bool_t optflag ; /* video workstation has optical disk */
|
| 61 |
|
|
|
| 62 |
|
|
struct netuser /* user description structure */
|
| 63 |
|
|
{
|
| 64 |
|
|
int nu_uid ; /* effective user id */
|
| 65 |
|
|
unsigned int nu_glen ; /* number of groups user in */
|
| 66 |
|
|
int *nu_gids ; /* groups user is in */
|
| 67 |
|
|
} ;
|
| 68 |
|
|
|
| 69 |
|
|
struct record
|
| 70 |
|
|
{
|
| 71 |
|
|
int in_at ; /* start recording image at */
|
| 72 |
|
|
int out_at ; /* finish recording image at */
|
| 73 |
|
|
} ;
|
| 74 |
|
|
|
| 75 |
|
|
/* used only in software frame buffer approach */
|
| 76 |
|
|
|
| 77 |
|
|
#define NONE 0 /* no compression */
|
| 78 |
|
|
#define BTC 1 /* BTC compression */
|
| 79 |
|
|
#define COLORMAP 2 /* BTC and color map compression */
|
| 80 |
|
|
/* hereafter referred to as color map */
|
| 81 |
|
|
|
| 82 |
|
|
extern short compression ; /* type of compression */
|
| 83 |
|
|
|
| 84 |
|
|
struct mapstore
|
| 85 |
|
|
{
|
| 86 |
|
|
short mapnum ; /* number of entries in color map */
|
| 87 |
|
|
unsigned short map[256] ; /* entries in color map */
|
| 88 |
|
|
} ;
|
| 89 |
|
|
|
| 90 |
|
|
|
| 91 |
|
|
struct scan_packet
|
| 92 |
|
|
{
|
| 93 |
|
|
bool_t first ; /* first frame - no frame-frame differencing */
|
| 94 |
|
|
int record ; /* preview or record */
|
| 95 |
|
|
short compression ; /* type of compression */
|
| 96 |
|
|
short linenum ; /* scan line number (0 to 399) */
|
| 97 |
|
|
int index ; /* used by server as index into piece of
|
| 98 |
|
|
incoming buffer */
|
| 99 |
|
|
int total1, total2 ; /* server uses in building up compressed
|
| 100 |
|
|
frame buffer from incoming pieces */
|
| 101 |
|
|
#ifdef WIDEAREA
|
| 102 |
|
|
/* number of bytes in compressed frame (Limpel_Zev only) */
|
| 103 |
|
|
int total_lz ;
|
| 104 |
|
|
#endif
|
| 105 |
|
|
int in_at, out_at ; /* starting, ending numbers to
|
| 106 |
|
|
record image on */
|
| 107 |
|
|
short mapnum ; /* number of entries in color map */
|
| 108 |
|
|
unsigned short map[256] ; /* color map */
|
| 109 |
|
|
short num_bytes[100] ; /* number of bytes in each group of
|
| 110 |
|
|
4 compressed scan lines */
|
| 111 |
|
|
unsigned char pack[76800] ; /* compressed frame buffer or piece thereof */
|
| 112 |
|
|
/* 2 scan lines stored here when compression
|
| 113 |
|
|
not used */
|
| 114 |
|
|
} ;
|