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