1 |
/* |
/* -*- c-basic-offset: 8 -*- |
2 |
rdesktop: A Remote Desktop Protocol client. |
rdesktop: A Remote Desktop Protocol client. |
3 |
Sound Channel Process Functions |
Sound Channel Process Functions |
4 |
Copyright (C) Matthew Chapman 2003 |
Copyright (C) Matthew Chapman 2003 |
26 |
#define RDPSND_SET_VOLUME 3 |
#define RDPSND_SET_VOLUME 3 |
27 |
#define RDPSND_UNKNOWN4 4 |
#define RDPSND_UNKNOWN4 4 |
28 |
#define RDPSND_COMPLETION 5 |
#define RDPSND_COMPLETION 5 |
29 |
#define RDPSND_UNKNOWN6 6 |
#define RDPSND_SERVERTICK 6 |
30 |
#define RDPSND_NEGOTIATE 7 |
#define RDPSND_NEGOTIATE 7 |
31 |
|
|
32 |
#define MAX_FORMATS 10 |
#define MAX_FORMATS 10 |
38 |
static unsigned int format_count; |
static unsigned int format_count; |
39 |
static unsigned int current_format; |
static unsigned int current_format; |
40 |
|
|
41 |
STREAM |
static STREAM |
42 |
rdpsnd_init_packet(uint16 type, uint16 size) |
rdpsnd_init_packet(uint16 type, uint16 size) |
43 |
{ |
{ |
44 |
STREAM s; |
STREAM s; |
49 |
return s; |
return s; |
50 |
} |
} |
51 |
|
|
52 |
void |
static void |
53 |
rdpsnd_send(STREAM s) |
rdpsnd_send(STREAM s) |
54 |
{ |
{ |
55 |
#ifdef RDPSND_DEBUG |
#ifdef RDPSND_DEBUG |
73 |
rdpsnd_send(s); |
rdpsnd_send(s); |
74 |
} |
} |
75 |
|
|
76 |
void |
static void |
77 |
rdpsnd_process_negotiate(STREAM in) |
rdpsnd_process_negotiate(STREAM in) |
78 |
{ |
{ |
79 |
unsigned int in_format_count, i; |
unsigned int in_format_count, i; |
156 |
rdpsnd_send(out); |
rdpsnd_send(out); |
157 |
} |
} |
158 |
|
|
159 |
void |
static void |
160 |
rdpsnd_process_unknown6(STREAM in) |
rdpsnd_process_servertick(STREAM in) |
161 |
{ |
{ |
162 |
uint16 unknown1, unknown2; |
uint16 tick1, tick2; |
163 |
STREAM out; |
STREAM out; |
164 |
|
|
165 |
/* in_uint8s(in, 4); unknown */ |
/* in_uint8s(in, 4); unknown */ |
166 |
in_uint16_le(in, unknown1); |
in_uint16_le(in, tick1); |
167 |
in_uint16_le(in, unknown2); |
in_uint16_le(in, tick2); |
168 |
|
|
169 |
out = rdpsnd_init_packet(RDPSND_UNKNOWN6 | 0x2300, 4); |
out = rdpsnd_init_packet(RDPSND_SERVERTICK | 0x2300, 4); |
170 |
out_uint16_le(out, unknown1); |
out_uint16_le(out, tick1); |
171 |
out_uint16_le(out, unknown2); |
out_uint16_le(out, tick2); |
172 |
s_mark_end(out); |
s_mark_end(out); |
173 |
rdpsnd_send(out); |
rdpsnd_send(out); |
174 |
} |
} |
175 |
|
|
176 |
void |
static void |
177 |
rdpsnd_process(STREAM s) |
rdpsnd_process(STREAM s) |
178 |
{ |
{ |
179 |
uint8 type; |
uint8 type; |
238 |
case RDPSND_NEGOTIATE: |
case RDPSND_NEGOTIATE: |
239 |
rdpsnd_process_negotiate(s); |
rdpsnd_process_negotiate(s); |
240 |
break; |
break; |
241 |
case RDPSND_UNKNOWN6: |
case RDPSND_SERVERTICK: |
242 |
rdpsnd_process_unknown6(s); |
rdpsnd_process_servertick(s); |
243 |
break; |
break; |
244 |
case RDPSND_SET_VOLUME: |
case RDPSND_SET_VOLUME: |
245 |
in_uint32(s, volume); |
in_uint32(s, volume); |