summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--instfiles/pam.d/xrdp-sesman.other4
-rw-r--r--neutrinordp/xrdp-neutrinordp.c51
-rw-r--r--sesman/chansrv/pulse/Makefile3
-rw-r--r--sesman/chansrv/pulse/module-xrdp-sink.c45
-rw-r--r--sesman/chansrv/sound.c273
-rw-r--r--sesman/chansrv/sound.h12
-rw-r--r--sesman/chansrv/wave-format-server.txt466
-rwxr-xr-xsesman/startwm.sh1
-rw-r--r--xorg/X11R7.6/rdp/rdpCopyArea.c80
-rw-r--r--xorg/X11R7.6/rdp/rdpdraw.c3
10 files changed, 766 insertions, 172 deletions
diff --git a/instfiles/pam.d/xrdp-sesman.other b/instfiles/pam.d/xrdp-sesman.other
new file mode 100644
index 00000000..56c8d56a
--- /dev/null
+++ b/instfiles/pam.d/xrdp-sesman.other
@@ -0,0 +1,4 @@
+#%PAM-1.0
+auth required pam_unix.so shadow nullok
+auth required pam_env.so readenv=1
+account required pam_unix.so
diff --git a/neutrinordp/xrdp-neutrinordp.c b/neutrinordp/xrdp-neutrinordp.c
index 3c24d8be..ef0e4d4c 100644
--- a/neutrinordp/xrdp-neutrinordp.c
+++ b/neutrinordp/xrdp-neutrinordp.c
@@ -181,6 +181,8 @@ lxrdp_event(struct mod *mod, int msg, long param1, long param2,
{
int x;
int y;
+ int cx;
+ int cy;
int flags;
int size;
int total_size;
@@ -262,49 +264,12 @@ lxrdp_event(struct mod *mod, int msg, long param1, long param2,
case 110:
break;
case 200:
- LLOGLN(12, ("Invalidate request sent from client"));
- RECTANGLE_16 *rectangle = (RECTANGLE_16 *) g_malloc(sizeof(RECTANGLE_16), 0);
- /* The parameters are coded as follows param1 = MAKELONG(y, x), param2 =MAKELONG(h, w)
- * #define MAKELONG(lo, hi) ((((hi) & 0xffff) << 16) | ((lo) & 0xffff))
- */
- rectangle->left = (param1 >> 16) & 0xffff;
- rectangle->top = param1 & 0xffff;
- rectangle->right = (((param2 >> 16) & 0xffff) + rectangle->left) - 1;
- rectangle->bottom = ((param2 & 0xffff) + rectangle->top) - 1;
-
- if (mod->inst->settings->refresh_rect)
- {
- if (mod->inst->update != NULL)
- {
- if (mod->inst->update->RefreshRect != NULL)
- {
- if (mod->inst->context != NULL)
- {
- LLOGLN(0, ("update rectangle left: %d top: %d bottom: %d right: %d",
- rectangle->left, rectangle->top, rectangle->bottom, rectangle->right));
- mod->inst->update->RefreshRect(mod->inst->context, 1, rectangle);
- }
- else
- {
- LLOGLN(0, ("Invalidate request -The context is null"));
- }
- }
- else
- {
- LLOGLN(0, ("Invalidate request - RefreshRect is Null"));
- }
- }
- else
- {
- LLOGLN(0, ("Invalidate request -the update pointer is null"));
- }
- }
- else
- {
- LLOGLN(0, ("Invalidate request - warning - update rectangle is disabled"));
- }
-
- g_free(rectangle);
+ LLOGLN(10, ("Invalidate request sent from client"));
+ x = (param1 >> 16) & 0xffff;
+ y = (param1 >> 0) & 0xffff;
+ cx = (param2 >> 16) & 0xffff;
+ cy = (param2 >> 0) & 0xffff;
+ mod->inst->SendInvalidate(mod->inst, -1, x, y, cx, cy);
break;
case 0x5555:
chanid = LOWORD(param1);
diff --git a/sesman/chansrv/pulse/Makefile b/sesman/chansrv/pulse/Makefile
index 7c3ee7b9..6efbfc16 100644
--- a/sesman/chansrv/pulse/Makefile
+++ b/sesman/chansrv/pulse/Makefile
@@ -1,8 +1,9 @@
-PULSE_DIR=/home/jay/temp/pulseaudio-0.9.21
+#PULSE_DIR=/home/jay/temp/pulseaudio-0.9.21
#PULSE_DIR=/home/jay/pulseaudio-0.9.22
#PULSE_DIR=/home/jay/pulseaudio-0.9.21
+PULSE_DIR=/home/jay/pulseaudio-2.0
OBJS = module-xrdp-sink.o
diff --git a/sesman/chansrv/pulse/module-xrdp-sink.c b/sesman/chansrv/pulse/module-xrdp-sink.c
index bcab8f1b..f6650635 100644
--- a/sesman/chansrv/pulse/module-xrdp-sink.c
+++ b/sesman/chansrv/pulse/module-xrdp-sink.c
@@ -47,7 +47,7 @@
#include <pulse/rtclock.h>
#include <pulse/timeval.h>
#include <pulse/xmalloc.h>
-#include <pulse/i18n.h>
+//#include <pulse/i18n.h>
#include <pulsecore/core-error.h>
#include <pulsecore/sink.h>
@@ -74,7 +74,8 @@ PA_MODULE_USAGE(
"channel_map=<channel map>");
#define DEFAULT_SINK_NAME "xrdp"
-#define BLOCK_USEC (PA_USEC_PER_SEC * 2)
+#define BLOCK_USEC 30000
+//#define BLOCK_USEC (PA_USEC_PER_SEC * 2)
#define CHANSRV_PORT_STR "/tmp/.xrdp/xrdp_chansrv_audio_socket_%d"
struct userdata {
@@ -117,7 +118,7 @@ static int sink_process_msg(pa_msgobject *o, int code, void *data,
pa_usec_t now;
long lat;
- //pa_log("sink_process_msg: code %d", code);
+ pa_log_debug("sink_process_msg: code %d", code);
switch (code) {
@@ -130,7 +131,7 @@ static int sink_process_msg(pa_msgobject *o, int code, void *data,
case PA_SINK_MESSAGE_GET_LATENCY: /* 7 */
now = pa_rtclock_now();
lat = u->timestamp > now ? u->timestamp - now : 0ULL;
- //pa_log("sink_process_msg: lat %ld", lat);
+ pa_log_debug("sink_process_msg: lat %ld", lat);
*((pa_usec_t*) data) = lat;
return 0;
@@ -140,6 +141,7 @@ static int sink_process_msg(pa_msgobject *o, int code, void *data,
case PA_SINK_MESSAGE_SET_STATE: /* 9 */
if (PA_PTR_TO_UINT(data) == PA_SINK_RUNNING) /* 0 */ {
pa_log("sink_process_msg: running");
+
u->timestamp = pa_rtclock_now();
} else {
pa_log("sink_process_msg: not running");
@@ -159,11 +161,14 @@ static void sink_update_requested_latency_cb(pa_sink *s) {
pa_sink_assert_ref(s);
pa_assert_se(u = s->userdata);
- u->block_usec = pa_sink_get_requested_latency_within_thread(s);
+ u->block_usec = BLOCK_USEC;
+ //u->block_usec = pa_sink_get_requested_latency_within_thread(s);
+ pa_log("1 block_usec %d", u->block_usec);
u->got_max_latency = 0;
if (u->block_usec == (pa_usec_t) -1) {
u->block_usec = s->thread_info.max_latency;
+ pa_log("2 block_usec %d", u->block_usec);
u->got_max_latency = 1;
}
@@ -226,6 +231,9 @@ static int get_display_num_from_display(char *display_text) {
char disp[256];
char scre[256];
+ if (display_text == NULL) {
+ return 0;
+ }
memset(host, 0, 256);
memset(disp, 0, 256);
memset(scre, 0, 256);
@@ -280,11 +288,11 @@ static int data_send(struct userdata *u, pa_memchunk *chunk) {
s.sun_family = AF_UNIX;
bytes = sizeof(s.sun_path) - 1;
snprintf(s.sun_path, bytes, CHANSRV_PORT_STR, u->display_num);
- pa_log("trying to conenct to %s", s.sun_path);
+ pa_log_debug("trying to conenct to %s", s.sun_path);
if (connect(fd, (struct sockaddr *)&s,
sizeof(struct sockaddr_un)) != 0) {
u->failed_connect_time = pa_rtclock_now();
- pa_log("Connected failed");
+ pa_log_debug("Connected failed");
close(fd);
return 0;
}
@@ -294,7 +302,7 @@ static int data_send(struct userdata *u, pa_memchunk *chunk) {
}
bytes = chunk->length;
- //pa_log("bytes %d", bytes);
+ pa_log_debug("bytes %d", bytes);
/* from rewind */
if (u->skip_bytes > 0) {
@@ -315,7 +323,7 @@ static int data_send(struct userdata *u, pa_memchunk *chunk) {
u->fd = 0;
return 0;
} else {
- //pa_log("data_send: sent header ok bytes %d", bytes);
+ pa_log_debug("data_send: sent header ok bytes %d", bytes);
}
data = (char*)pa_memblock_acquire(chunk->memblock);
@@ -340,7 +348,6 @@ static int close_send(struct userdata *u) {
if (u->fd == 0) {
return 0;
}
-
h.code = 1;
h.bytes = 8;
if (send(u->fd, &h, 8, 0) != 8) {
@@ -349,36 +356,24 @@ static int close_send(struct userdata *u) {
u->fd = 0;
return 0;
} else {
- //pa_log("close_send: sent header ok");
+ pa_log_debug("close_send: sent header ok");
}
-
return 8;
}
static void process_render(struct userdata *u, pa_usec_t now) {
pa_memchunk chunk;
int request_bytes;
- //int index;
pa_assert(u);
-
if (u->got_max_latency) {
return;
}
-
- //index = 0;
+ pa_log_debug("process_render: u->block_usec %d", u->block_usec);
while (u->timestamp < now + u->block_usec) {
- //index++;
- //if (index > 3) {
- /* used when u->block_usec and
- u->sink->thread_info.max_request get big
- using got_max_latency now */
- // return;
- //}
request_bytes = u->sink->thread_info.max_request;
request_bytes = MIN(request_bytes, 16 * 1024);
pa_sink_render(u->sink, request_bytes, &chunk);
- //pa_log("bytes %d index %d", chunk.length, index);
data_send(u, &chunk);
pa_memblock_unref(chunk.memblock);
u->timestamp += pa_bytes_to_usec(chunk.length, &u->sink->sample_spec);
@@ -414,6 +409,7 @@ static void thread_func(void *userdata) {
}
if (u->timestamp <= now) {
+ pa_log_debug("thread_func: calling process_render");
process_render(u, now);
}
@@ -507,6 +503,7 @@ int pa__init(pa_module*m) {
pa_sink_set_rtpoll(u->sink, u->rtpoll);
u->block_usec = BLOCK_USEC;
+ pa_log("3 block_usec %d", u->block_usec);
nbytes = pa_usec_to_bytes(u->block_usec, &u->sink->sample_spec);
pa_sink_set_max_rewind(u->sink, nbytes);
pa_sink_set_max_request(u->sink, nbytes);
diff --git a/sesman/chansrv/sound.c b/sesman/chansrv/sound.c
index 5119aac4..55f6f88d 100644
--- a/sesman/chansrv/sound.c
+++ b/sesman/chansrv/sound.c
@@ -18,43 +18,100 @@
#include "sound.h"
#include "thread_calls.h"
+#include "defines.h"
extern int g_rdpsnd_chan_id; /* in chansrv.c */
extern int g_display_num; /* in chansrv.c */
-static struct trans *g_audio_l_trans = 0; // listener
-static struct trans *g_audio_c_trans = 0; // connection
+static struct trans *g_audio_l_trans = 0; /* listener */
+static struct trans *g_audio_c_trans = 0; /* connection */
static int g_training_sent_time = 0;
static int g_cBlockNo = 0;
+#define BBUF_SIZE (1024 * 8)
+char g_buffer[BBUF_SIZE];
+int g_buf_index = 0;
+int g_sent_time[256];
+
#if defined(XRDP_SIMPLESOUND)
static void *DEFAULT_CC
read_raw_audio_data(void *arg);
#endif
+#define CHANSRV_PORT_STR "/tmp/.xrdp/xrdp_chansrv_audio_socket_%d"
+
+struct xr_wave_format_ex
+{
+ int wFormatTag;
+ int nChannels;
+ int nSamplesPerSec;
+ int nAvgBytesPerSec;
+ int nBlockAlign;
+ int wBitsPerSample;
+ int cbSize;
+ char *data;
+};
+
+static char g_pmc_22050_data[] = { 0 };
+static struct xr_wave_format_ex g_pmc_22050 =
+{
+ 1, /* wFormatTag - WAVE_FORMAT_PCM */
+ 2, /* num of channels */
+ 22050, /* samples per sec */
+ 88200, /* avg bytes per sec */
+ 4, /* block align */
+ 16, /* bits per sample */
+ 0, /* data size */
+ g_pmc_22050_data /* data */
+};
+
+static char g_pmc_44100_data[] = { 0 };
+static struct xr_wave_format_ex g_pmc_44100 =
+{
+ 1, /* wFormatTag - WAVE_FORMAT_PCM */
+ 2, /* num of channels */
+ 44100, /* samples per sec */
+ 176400, /* avg bytes per sec */
+ 4, /* block align */
+ 16, /* bits per sample */
+ 0, /* data size */
+ g_pmc_44100_data /* data */
+};
+
+#define NUM_BUILT_IN 2
+static struct xr_wave_format_ex *g_wave_formats[NUM_BUILT_IN] =
+{
+ &g_pmc_44100,
+ &g_pmc_22050
+};
+
+/* index into list from client */
+static int g_current_client_format_index = 0;
+/* index into list from server */
+static int g_current_server_format_index = 0;
+
/*****************************************************************************/
static int APP_CC
sound_send_server_formats(void)
{
struct stream *s;
int bytes;
+ int index;
char *size_ptr;
- print_got_here();
-
make_stream(s);
init_stream(s, 8182);
out_uint16_le(s, SNDC_FORMATS);
size_ptr = s->p;
- out_uint16_le(s, 0); /* size, set later */
- out_uint32_le(s, 0); /* dwFlags */
- out_uint32_le(s, 0); /* dwVolume */
- out_uint32_le(s, 0); /* dwPitch */
- out_uint16_le(s, 0); /* wDGramPort */
- out_uint16_le(s, 1); /* wNumberOfFormats */
- out_uint8(s, g_cBlockNo); /* cLastBlockConfirmed */
- out_uint16_le(s, 2); /* wVersion */
- out_uint8(s, 0); /* bPad */
+ out_uint16_le(s, 0); /* size, set later */
+ out_uint32_le(s, 0); /* dwFlags */
+ out_uint32_le(s, 0); /* dwVolume */
+ out_uint32_le(s, 0); /* dwPitch */
+ out_uint16_le(s, 0); /* wDGramPort */
+ out_uint16_le(s, NUM_BUILT_IN); /* wNumberOfFormats */
+ out_uint8(s, g_cBlockNo); /* cLastBlockConfirmed */
+ out_uint16_le(s, 2); /* wVersion */
+ out_uint8(s, 0); /* bPad */
/* sndFormats */
/*
@@ -75,13 +132,21 @@ sound_send_server_formats(void)
00 00
*/
- out_uint16_le(s, 1); // wFormatTag - WAVE_FORMAT_PCM
- out_uint16_le(s, 2); // num of channels
- out_uint32_le(s, 44100); // samples per sec
- out_uint32_le(s, 176400); // avg bytes per sec
- out_uint16_le(s, 4); // block align
- out_uint16_le(s, 16); // bits per sample
- out_uint16_le(s, 0); // size
+ for (index = 0; index < NUM_BUILT_IN; index++)
+ {
+ out_uint16_le(s, g_wave_formats[index]->wFormatTag);
+ out_uint16_le(s, g_wave_formats[index]->nChannels);
+ out_uint32_le(s, g_wave_formats[index]->nSamplesPerSec);
+ out_uint32_le(s, g_wave_formats[index]->nAvgBytesPerSec);
+ out_uint16_le(s, g_wave_formats[index]->nBlockAlign);
+ out_uint16_le(s, g_wave_formats[index]->wBitsPerSample);
+ bytes = g_wave_formats[index]->cbSize;
+ out_uint16_le(s, bytes);
+ if (bytes > 0)
+ {
+ out_uint8p(s, g_wave_formats[index]->data, bytes);
+ }
+ }
s_mark_end(s);
bytes = (int)((s->end - s->data) - 4);
@@ -102,8 +167,6 @@ sound_send_training(void)
int time;
char *size_ptr;
- print_got_here();
-
make_stream(s);
init_stream(s, 8182);
out_uint16_le(s, SNDC_TRAINING);
@@ -125,6 +188,52 @@ sound_send_training(void)
}
/*****************************************************************************/
+static int APP_CC
+sound_process_format(int aindex, int wFormatTag, int nChannels,
+ int nSamplesPerSec, int nAvgBytesPerSec,
+ int nBlockAlign, int wBitsPerSample,
+ int cbSize, char *data)
+{
+ int lindex;
+
+ LOG(0, ("sound_process_format:"));
+ LOG(0, (" wFormatTag %d", wFormatTag));
+ LOG(0, (" nChannels %d", nChannels));
+ LOG(0, (" nSamplesPerSec %d", nSamplesPerSec));
+ LOG(0, (" nAvgBytesPerSec %d", nAvgBytesPerSec));
+ LOG(0, (" nBlockAlign %d", nBlockAlign));
+ LOG(0, (" wBitsPerSample %d", wBitsPerSample));
+ LOG(0, (" cbSize %d", cbSize));
+ g_hexdump(data, cbSize);
+ if (wFormatTag == g_pmc_44100.wFormatTag &&
+ nChannels == g_pmc_44100.nChannels &&
+ nSamplesPerSec == g_pmc_44100.nSamplesPerSec &&
+ nAvgBytesPerSec == g_pmc_44100.nAvgBytesPerSec &&
+ nBlockAlign == g_pmc_44100.nBlockAlign &&
+ wBitsPerSample == g_pmc_44100.wBitsPerSample)
+ {
+ g_current_client_format_index = aindex;
+ g_current_server_format_index = 0;
+ }
+#if 0
+ for (lindex = 0; lindex < NUM_BUILT_IN; lindex++)
+ {
+ if (wFormatTag == g_wave_formats[lindex]->wFormatTag &&
+ nChannels == g_wave_formats[lindex]->nChannels &&
+ nSamplesPerSec == g_wave_formats[lindex]->nSamplesPerSec &&
+ nAvgBytesPerSec == g_wave_formats[lindex]->nAvgBytesPerSec &&
+ nBlockAlign == g_wave_formats[lindex]->nBlockAlign &&
+ wBitsPerSample == g_wave_formats[lindex]->wBitsPerSample)
+ {
+ g_current_client_format_index = aindex;
+ g_current_server_format_index = lindex;
+ }
+ }
+#endif
+ return 0;
+}
+
+/*****************************************************************************/
/*
0000 07 02 26 00 03 00 80 00 ff ff ff ff 00 00 00 00 ..&.............
0010 00 00 01 00 00 02 00 00 01 00 02 00 44 ac 00 00 ............D...
@@ -135,8 +244,15 @@ static int APP_CC
sound_process_formats(struct stream *s, int size)
{
int num_formats;
-
- print_got_here();
+ int index;
+ int wFormatTag;
+ int nChannels;
+ int nSamplesPerSec;
+ int nAvgBytesPerSec;
+ int nBlockAlign;
+ int wBitsPerSample;
+ int cbSize;
+ char *data;
LOG(0, ("sound_process_formats:"));
@@ -147,9 +263,24 @@ sound_process_formats(struct stream *s, int size)
in_uint8s(s, 14);
in_uint16_le(s, num_formats);
+ in_uint8s(s, 4);
if (num_formats > 0)
{
+ for (index = 0; index < num_formats; index++)
+ {
+ in_uint16_le(s, wFormatTag);
+ in_uint16_le(s, nChannels);
+ in_uint32_le(s, nSamplesPerSec);
+ in_uint32_le(s, nAvgBytesPerSec);
+ in_uint16_le(s, nBlockAlign);
+ in_uint16_le(s, wBitsPerSample);
+ in_uint16_le(s, cbSize);
+ in_uint8p(s, data, cbSize);
+ sound_process_format(index, wFormatTag, nChannels, nSamplesPerSec,
+ nAvgBytesPerSec, nBlockAlign, wBitsPerSample,
+ cbSize, data);
+ }
sound_send_training();
}
@@ -157,37 +288,39 @@ sound_process_formats(struct stream *s, int size)
}
/*****************************************************************************/
+/* send wave message to client */
static int
-sound_send_wave_data(char *data, int data_bytes)
+sound_send_wave_data_chunk(char *data, int data_bytes)
{
struct stream *s;
int bytes;
int time;
char *size_ptr;
- print_got_here();
+ LOG(10, ("sound_send_wave_data_chunk: data_bytes %d", data_bytes));
if ((data_bytes < 4) || (data_bytes > 128 * 1024))
{
- LOG(0, ("sound_send_wave_data: bad data_bytes %d", data_bytes));
+ LOG(0, ("sound_send_wave_data_chunk: bad data_bytes %d", data_bytes));
}
/* part one of 2 PDU wave info */
- LOG(10, ("sound_send_wave_data: sending %d bytes", data_bytes));
+ LOG(10, ("sound_send_wave_data_chunk: sending %d bytes", data_bytes));
make_stream(s);
- init_stream(s, data_bytes);
+ init_stream(s, 16 + data_bytes); /* some extra space */
out_uint16_le(s, SNDC_WAVE);
size_ptr = s->p;
out_uint16_le(s, 0); /* size, set later */
time = g_time2();
out_uint16_le(s, time);
- out_uint16_le(s, 0); /* wFormatNo */
+ out_uint16_le(s, g_current_client_format_index); /* wFormatNo */
g_cBlockNo++;
out_uint8(s, g_cBlockNo);
+ g_sent_time[g_cBlockNo & 0xff] = time;
- LOG(10, ("sound_send_wave_data: sending time %d, g_cBlockNo %d",
+ LOG(10, ("sound_send_wave_data_chunk: sending time %d, g_cBlockNo %d",
time & 0xffff, g_cBlockNo & 0xff));
out_uint8s(s, 3);
@@ -201,18 +334,54 @@ sound_send_wave_data(char *data, int data_bytes)
bytes = (int)(s->end - s->data);
send_channel_data(g_rdpsnd_chan_id, s->data, bytes);
- /* part two of 2 PDU wave info */
+ /* part two of 2 PDU wave info
+ even is zero, we have to send this */
init_stream(s, data_bytes);
out_uint32_le(s, 0);
out_uint8a(s, data + 4, data_bytes - 4);
s_mark_end(s);
bytes = (int)(s->end - s->data);
send_channel_data(g_rdpsnd_chan_id, s->data, bytes);
+
free_stream(s);
return 0;
}
/*****************************************************************************/
+/* send wave message to client, buffer first */
+static int
+sound_send_wave_data(char *data, int data_bytes)
+{
+ int space_left;
+ int chunk_bytes;
+ int data_index;
+
+ LOG(10, ("sound_send_wave_data: sending %d bytes", data_bytes));
+ data_index = 0;
+ while (data_bytes > 0)
+ {
+ space_left = BBUF_SIZE - g_buf_index;
+ chunk_bytes = MIN(space_left, data_bytes);
+ if (chunk_bytes < 1)
+ {
+ LOG(10, ("sound_send_wave_data: error"));
+ break;
+ }
+ g_memcpy(g_buffer + g_buf_index, data + data_index, chunk_bytes);
+ g_buf_index += chunk_bytes;
+ if (g_buf_index >= BBUF_SIZE)
+ {
+ sound_send_wave_data_chunk(g_buffer, BBUF_SIZE);
+ g_buf_index = 0;
+ }
+ data_bytes -= chunk_bytes;
+ data_index += chunk_bytes;
+ }
+ return 0;
+}
+
+/*****************************************************************************/
+/* send close message to client */
static int
sound_send_close(void)
{
@@ -220,7 +389,11 @@ sound_send_close(void)
int bytes;
char *size_ptr;
- print_got_here();
+ LOG(10, ("sound_send_close:"));
+
+ /* send any left over data */
+ sound_send_wave_data_chunk(g_buffer, g_buf_index);
+ g_buf_index = 0;
make_stream(s);
init_stream(s, 8182);
@@ -238,42 +411,45 @@ sound_send_close(void)
}
/*****************************************************************************/
+/* from client */
static int APP_CC
sound_process_training(struct stream *s, int size)
{
int time_diff;
- print_got_here();
-
time_diff = g_time2() - g_training_sent_time;
LOG(0, ("sound_process_training: round trip time %u", time_diff));
return 0;
}
/*****************************************************************************/
+/* from client */
static int APP_CC
sound_process_wave_confirm(struct stream *s, int size)
{
int wTimeStamp;
int cConfirmedBlockNo;
+ int time;
+ int time_diff;
- print_got_here();
-
+ time = g_time2();
in_uint16_le(s, wTimeStamp);
in_uint8(s, cConfirmedBlockNo);
+ time_diff = time - g_sent_time[cConfirmedBlockNo];
- LOG(10, ("sound_process_wave_confirm: wTimeStamp %d, cConfirmedBlockNo %d",
- wTimeStamp, cConfirmedBlockNo));
+ LOG(10, ("sound_process_wave_confirm: wTimeStamp %d, "
+ "cConfirmedBlockNo %d time diff %d",
+ wTimeStamp, cConfirmedBlockNo, time_diff));
return 0;
}
/*****************************************************************************/
+/* process message in from the audio source, eg pulse, alsa
+ on it's way to the client */
static int APP_CC
process_pcm_message(int id, int size, struct stream *s)
{
- print_got_here();
-
switch (id)
{
case 0:
@@ -290,7 +466,7 @@ process_pcm_message(int id, int size, struct stream *s)
}
/*****************************************************************************/
-/* data coming in from audio source, eg pulse, alsa */
+/* data in from audio source, eg pulse, alsa */
static int DEFAULT_CC
sound_trans_audio_data_in(struct trans *trans)
{
@@ -332,11 +508,11 @@ sound_trans_audio_data_in(struct trans *trans)
}
/*****************************************************************************/
+/* this is a connection in on the unix domain socket */
static int DEFAULT_CC
sound_trans_audio_conn_in(struct trans *trans, struct trans *new_trans)
{
LOG(0, ("sound_trans_audio_conn_in:"));
- print_got_here();
if (trans == 0)
{
@@ -366,8 +542,6 @@ sound_trans_audio_conn_in(struct trans *trans, struct trans *new_trans)
return 0;
}
-#define CHANSRV_PORT_STR "/tmp/.xrdp/xrdp_chansrv_audio_socket_%d"
-
/*****************************************************************************/
int APP_CC
sound_init(void)
@@ -375,7 +549,6 @@ sound_init(void)
char port[256];
int error;
- print_got_here();
LOG(0, ("sound_init:"));
sound_send_server_formats();
@@ -403,8 +576,6 @@ sound_init(void)
int APP_CC
sound_deinit(void)
{
- print_got_here();
-
if (g_audio_l_trans != 0)
{
trans_delete(g_audio_l_trans);
@@ -421,7 +592,7 @@ sound_deinit(void)
}
/*****************************************************************************/
-/* data in from client ( clinet -> xrdp -> chansrv ) */
+/* data in from client ( client -> xrdp -> chansrv ) */
int APP_CC
sound_data_in(struct stream *s, int chan_id, int chan_flags, int length,
int total_length)
@@ -429,8 +600,6 @@ sound_data_in(struct stream *s, int chan_id, int chan_flags, int length,
int code;
int size;
- print_got_here();
-
in_uint8(s, code);
in_uint8s(s, 1);
in_uint16_le(s, size);
@@ -500,6 +669,8 @@ sound_check_wait_objs(void)
#if defined(XRDP_SIMPLESOUND)
+#define AUDIO_BUF_SIZE 2048
+
static int DEFAULT_CC
sttrans_data_in(struct trans *self)
{
diff --git a/sesman/chansrv/sound.h b/sesman/chansrv/sound.h
index f74476c4..0666ea00 100644
--- a/sesman/chansrv/sound.h
+++ b/sesman/chansrv/sound.h
@@ -30,18 +30,6 @@
#include "chansrv.h"
#include "trans.h"
-#define _DEBUG_RDPSND
-
-#ifdef DEBUG_RDPSND
-#include <stdio.h>
-#define print_got_here() printf("****** got here: %s : %s : %d\n", \
- __FILE__, __func__, __LINE__);
-#else
-#define print_got_here()
-#endif
-
-#define AUDIO_BUF_SIZE 2048
-
#define SNDC_CLOSE 0x01
#define SNDC_WAVE 0x02
#define SNDC_SETVOLUME 0x03
diff --git a/sesman/chansrv/wave-format-server.txt b/sesman/chansrv/wave-format-server.txt
new file mode 100644
index 00000000..1d0bb91e
--- /dev/null
+++ b/sesman/chansrv/wave-format-server.txt
@@ -0,0 +1,466 @@
+
+
+Example wave formats from some servers
+
+see MMREG.H for defines
+
+Windows 7 SP1
+
+example wave data sizes coming from server 8820
+
+wFormatTag=1 nChannels=2 nSamplesPerSec=44100 nAvgBytesPerSec=176400 nBlockAlign=4 wBitsPerSample=16 cbSize=0
+
+#define WAVE_FORMAT_ALAW 0x0006 /* Microsoft Corporation */
+wFormatTag=6 nChannels=2 nSamplesPerSec=44100 nAvgBytesPerSec=88200 nBlockAlign=2 wBitsPerSample=8 cbSize=0
+
+#define WAVE_FORMAT_MULAW 0x0007 /* Microsoft Corporation */
+wFormatTag=7 nChannels=2 nSamplesPerSec=44100 nAvgBytesPerSec=88200 nBlockAlign=2 wBitsPerSample=8 cbSize=0
+
+#define WAVE_FORMAT_ADPCM 0x0002 /* Microsoft Corporation */
+wFormatTag=2 nChannels=2 nSamplesPerSec=44100 nAvgBytesPerSec=44359 nBlockAlign=2048 wBitsPerSample=4 cbSize=32
+ 0000 f4 07 07 00 00 01 00 00 00 02 00 ff 00 00 00 00 ................
+ 0010 c0 00 40 00 f0 00 00 00 cc 01 30 ff 88 01 18 ff ..@.......0.....
+
+#define WAVE_FORMAT_DVI_ADPCM 0x0011 /* Intel Corporation */
+wFormatTag=17 nChannels=2 nSamplesPerSec=44100 nAvgBytesPerSec=44251 nBlockAlign=2048 wBitsPerSample=4 cbSize=2
+ 0000 f9 07 ..
+
+#define WAVE_FORMAT_ALAW 0x0006 /* Microsoft Corporation */
+wFormatTag=6 nChannels=2 nSamplesPerSec=22050 nAvgBytesPerSec=44100 nBlockAlign=2 wBitsPerSample=8 cbSize=0
+
+#define WAVE_FORMAT_ALAW 0x0006 /* Microsoft Corporation */
+wFormatTag=6 nChannels=1 nSamplesPerSec=44100 nAvgBytesPerSec=44100 nBlockAlign=1 wBitsPerSample=8 cbSize=0
+
+#define WAVE_FORMAT_MULAW 0x0007 /* Microsoft Corporation */
+wFormatTag=7 nChannels=2 nSamplesPerSec=22050 nAvgBytesPerSec=44100 nBlockAlign=2 wBitsPerSample=8 cbSize=0
+
+#define WAVE_FORMAT_MULAW 0x0007 /* Microsoft Corporation */
+wFormatTag=7 nChannels=1 nSamplesPerSec=44100 nAvgBytesPerSec=44100 nBlockAlign=1 wBitsPerSample=8 cbSize=0
+
+#define WAVE_FORMAT_ADPCM 0x0002 /* Microsoft Corporation */
+wFormatTag=2 nChannels=2 nSamplesPerSec=22050 nAvgBytesPerSec=22311 nBlockAlign=1024 wBitsPerSample=4 cbSize=32
+ 0000 f4 03 07 00 00 01 00 00 00 02 00 ff 00 00 00 00 ................
+ 0010 c0 00 40 00 f0 00 00 00 cc 01 30 ff 88 01 18 ff ..@.......0.....
+
+#define WAVE_FORMAT_DVI_ADPCM 0x0011 /* Intel Corporation */
+wFormatTag=17 nChannels=2 nSamplesPerSec=22050 nAvgBytesPerSec=22201 nBlockAlign=1024 wBitsPerSample=4 cbSize=2
+ 0000 f9 03 ..
+
+#define WAVE_FORMAT_ADPCM 0x0002 /* Microsoft Corporation */
+wFormatTag=2 nChannels=1 nSamplesPerSec=44100 nAvgBytesPerSec=22179 nBlockAlign=1024 wBitsPerSample=4 cbSize=32
+ 0000 f4 07 07 00 00 01 00 00 00 02 00 ff 00 00 00 00 ................
+ 0010 c0 00 40 00 f0 00 00 00 cc 01 30 ff 88 01 18 ff ..@.......0.....
+
+#define WAVE_FORMAT_DVI_ADPCM 0x0011 /* Intel Corporation */
+wFormatTag=17 nChannels=1 nSamplesPerSec=44100 nAvgBytesPerSec=22125 nBlockAlign=1024 wBitsPerSample=4 cbSize=2
+ 0000 f9 07 ..
+
+#define WAVE_FORMAT_ALAW 0x0006 /* Microsoft Corporation */
+wFormatTag=6 nChannels=2 nSamplesPerSec=11025 nAvgBytesPerSec=22050 nBlockAlign=2 wBitsPerSample=8 cbSize=0
+
+#define WAVE_FORMAT_ALAW 0x0006 /* Microsoft Corporation */
+wFormatTag=6 nChannels=1 nSamplesPerSec=22050 nAvgBytesPerSec=22050 nBlockAlign=1 wBitsPerSample=8 cbSize=0
+
+#define WAVE_FORMAT_MULAW 0x0007 /* Microsoft Corporation */
+wFormatTag=7 nChannels=2 nSamplesPerSec=11025 nAvgBytesPerSec=22050 nBlockAlign=2 wBitsPerSample=8 cbSize=0
+
+#define WAVE_FORMAT_MULAW 0x0007 /* Microsoft Corporation */
+wFormatTag=7 nChannels=1 nSamplesPerSec=22050 nAvgBytesPerSec=22050 nBlockAlign=1 wBitsPerSample=8 cbSize=0
+
+#define WAVE_FORMAT_ALAW 0x0006 /* Microsoft Corporation */
+wFormatTag=6 nChannels=2 nSamplesPerSec=8000 nAvgBytesPerSec=16000 nBlockAlign=2 wBitsPerSample=8 cbSize=0
+
+#define WAVE_FORMAT_MULAW 0x0007 /* Microsoft Corporation */
+wFormatTag=7 nChannels=2 nSamplesPerSec=8000 nAvgBytesPerSec=16000 nBlockAlign=2 wBitsPerSample=8 cbSize=0
+
+#define WAVE_FORMAT_ADPCM 0x0002 /* Microsoft Corporation */
+wFormatTag=2 nChannels=2 nSamplesPerSec=11025 nAvgBytesPerSec=11289 nBlockAlign=512 wBitsPerSample=4 cbSize=32
+ 0000 f4 01 07 00 00 01 00 00 00 02 00 ff 00 00 00 00 ................
+ 0010 c0 00 40 00 f0 00 00 00 cc 01 30 ff 88 01 18 ff ..@.......0.....
+
+#define WAVE_FORMAT_DVI_ADPCM 0x0011 /* Intel Corporation */
+wFormatTag=17 nChannels=2 nSamplesPerSec=11025 nAvgBytesPerSec=11177 nBlockAlign=512 wBitsPerSample=4 cbSize=2
+ 0000 f9 01 ..
+
+#define WAVE_FORMAT_ADPCM 0x0002 /* Microsoft Corporation */
+wFormatTag=2 nChannels=1 nSamplesPerSec=22050 nAvgBytesPerSec=11155 nBlockAlign=512 wBitsPerSample=4 cbSize=32
+ 0000 f4 03 07 00 00 01 00 00 00 02 00 ff 00 00 00 00 ................
+ 0010 c0 00 40 00 f0 00 00 00 cc 01 30 ff 88 01 18 ff ..@.......0.....
+
+#define WAVE_FORMAT_DVI_ADPCM 0x0011 /* Intel Corporation */
+wFormatTag=17 nChannels=1 nSamplesPerSec=22050 nAvgBytesPerSec=11100 nBlockAlign=512 wBitsPerSample=4 cbSize=2
+ 0000 f9 03 ..
+
+#define WAVE_FORMAT_ALAW 0x0006 /* Microsoft Corporation */
+wFormatTag=6 nChannels=1 nSamplesPerSec=11025 nAvgBytesPerSec=11025 nBlockAlign=1 wBitsPerSample=8 cbSize=0
+
+#define WAVE_FORMAT_MULAW 0x0007 /* Microsoft Corporation */
+wFormatTag=7 nChannels=1 nSamplesPerSec=11025 nAvgBytesPerSec=11025 nBlockAlign=1 wBitsPerSample=8 cbSize=0
+
+wFormatTag=49 nChannels=1 nSamplesPerSec=44100 nAvgBytesPerSec=8957 nBlockAlign=65 wBitsPerSample=0 cbSize=2
+ 0000 40 01 @.
+
+#define WAVE_FORMAT_ADPCM 0x0002 /* Microsoft Corporation */
+wFormatTag=2 nChannels=2 nSamplesPerSec=8000 nAvgBytesPerSec=8192 nBlockAlign=512 wBitsPerSample=4 cbSize=32
+ 0000 f4 01 07 00 00 01 00 00 00 02 00 ff 00 00 00 00 ................
+ 0010 c0 00 40 00 f0 00 00 00 cc 01 30 ff 88 01 18 ff ..@.......0.....
+
+#define WAVE_FORMAT_DVI_ADPCM 0x0011 /* Intel Corporation */
+wFormatTag=17 nChannels=2 nSamplesPerSec=8000 nAvgBytesPerSec=8110 nBlockAlign=512 wBitsPerSample=4 cbSize=2
+ 0000 f9 01 ..
+
+#define WAVE_FORMAT_ALAW 0x0006 /* Microsoft Corporation */
+wFormatTag=6 nChannels=1 nSamplesPerSec=8000 nAvgBytesPerSec=8000 nBlockAlign=1 wBitsPerSample=8 cbSize=0
+
+#define WAVE_FORMAT_MULAW 0x0007 /* Microsoft Corporation */
+wFormatTag=7 nChannels=1 nSamplesPerSec=8000 nAvgBytesPerSec=8000 nBlockAlign=1 wBitsPerSample=8 cbSize=0
+
+wFormatTag=2 nChannels=1 nSamplesPerSec=11025 nAvgBytesPerSec=5644 nBlockAlign=256 wBitsPerSample=4 cbSize=32
+ 0000 f4 01 07 00 00 01 00 00 00 02 00 ff 00 00 00 00 ................
+ 0010 c0 00 40 00 f0 00 00 00 cc 01 30 ff 88 01 18 ff ..@.......0.....
+
+wFormatTag=17 nChannels=1 nSamplesPerSec=11025 nAvgBytesPerSec=5588 nBlockAlign=256 wBitsPerSample=4 cbSize=2
+ 0000 f9 01 ..
+
+#define WAVE_FORMAT_GSM610 0x0031 /* Microsoft Corporation */
+wFormatTag=49 nChannels=1 nSamplesPerSec=22050 nAvgBytesPerSec=4478 nBlockAlign=65 wBitsPerSample=0 cbSize=2
+ 0000 40 01 @.
+
+#define WAVE_FORMAT_ADPCM 0x0002 /* Microsoft Corporation */
+wFormatTag=2 nChannels=1 nSamplesPerSec=8000 nAvgBytesPerSec=4096 nBlockAlign=256 wBitsPerSample=4 cbSize=32
+ 0000 f4 01 07 00 00 01 00 00 00 02 00 ff 00 00 00 00 ................
+ 0010 c0 00 40 00 f0 00 00 00 cc 01 30 ff 88 01 18 ff ..@.......0.....
+
+#define WAVE_FORMAT_DVI_ADPCM 0x0011 /* Intel Corporation */
+wFormatTag=17 nChannels=1 nSamplesPerSec=8000 nAvgBytesPerSec=4055 nBlockAlign=256 wBitsPerSample=4 cbSize=2
+ 0000 f9 01 ..
+
+#define WAVE_FORMAT_GSM610 0x0031 /* Microsoft Corporation */
+wFormatTag=49 nChannels=1 nSamplesPerSec=11025 nAvgBytesPerSec=2239 nBlockAlign=65 wBitsPerSample=0 cbSize=2
+ 0000 40 01 @.
+
+#define WAVE_FORMAT_GSM610 0x0031 /* Microsoft Corporation */
+wFormatTag=49 nChannels=1 nSamplesPerSec=8000 nAvgBytesPerSec=1625 nBlockAlign=65 wBitsPerSample=0 cbSize=2
+ 0000 40 01 @.
+
+
+
+
+Windows XP SP3
+
+example wave data sizes coming from server 32512, 16256
+
+wFormatTag=1 nChannels=2 nSamplesPerSec=22050 nAvgBytesPerSec=88200 nBlockAlign=4 wBitsPerSample=16 cbSize=0
+
+#define WAVE_FORMAT_ALAW 0x0006 /* Microsoft Corporation */
+wFormatTag=6 nChannels=2 nSamplesPerSec=22050 nAvgBytesPerSec=44100 nBlockAlign=2 wBitsPerSample=8 cbSize=0
+
+#define WAVE_FORMAT_MULAW 0x0007 /* Microsoft Corporation */
+wFormatTag=7 nChannels=2 nSamplesPerSec=22050 nAvgBytesPerSec=44100 nBlockAlign=2 wBitsPerSample=8 cbSize=0
+
+#define WAVE_FORMAT_ADPCM 0x0002 /* Microsoft Corporation */
+wFormatTag=2 nChannels=2 nSamplesPerSec=22050 nAvgBytesPerSec=22311 nBlockAlign=1024 wBitsPerSample=4 cbSize=32
+0000 f4 03 07 00 00 01 00 00 00 02 00 ff 00 00 00 00 ................
+0010 c0 00 40 00 f0 00 00 00 cc 01 30 ff 88 01 18 ff ..@.......0.....
+
+#define WAVE_FORMAT_DVI_ADPCM 0x0011 /* Intel Corporation */
+wFormatTag=17 nChannels=2 nSamplesPerSec=22050 nAvgBytesPerSec=22201 nBlockAlign=1024 wBitsPerSample=4 cbSize=2
+0000 f9 03 ..
+
+#define WAVE_FORMAT_ALAW 0x0006 /* Microsoft Corporation */
+wFormatTag=6 nChannels=2 nSamplesPerSec=11025 nAvgBytesPerSec=22050 nBlockAlign=2 wBitsPerSample=8 cbSize=0
+
+#define WAVE_FORMAT_ALAW 0x0006 /* Microsoft Corporation */
+wFormatTag=6 nChannels=1 nSamplesPerSec=22050 nAvgBytesPerSec=22050 nBlockAlign=1 wBitsPerSample=8 cbSize=0
+
+#define WAVE_FORMAT_MULAW 0x0007 /* Microsoft Corporation */
+wFormatTag=7 nChannels=2 nSamplesPerSec=11025 nAvgBytesPerSec=22050 nBlockAlign=2 wBitsPerSample=8 cbSize=0
+
+#define WAVE_FORMAT_MULAW 0x0007 /* Microsoft Corporation */
+wFormatTag=7 nChannels=1 nSamplesPerSec=22050 nAvgBytesPerSec=22050 nBlockAlign=1 wBitsPerSample=8 cbSize=0
+
+#define WAVE_FORMAT_ALAW 0x0006 /* Microsoft Corporation */
+wFormatTag=6 nChannels=2 nSamplesPerSec=8000 nAvgBytesPerSec=16000 nBlockAlign=2 wBitsPerSample=8 cbSize=0
+
+#define WAVE_FORMAT_MULAW 0x0007 /* Microsoft Corporation */
+wFormatTag=7 nChannels=2 nSamplesPerSec=8000 nAvgBytesPerSec=16000 nBlockAlign=2 wBitsPerSample=8 cbSize=0
+
+#define WAVE_FORMAT_ADPCM 0x0002 /* Microsoft Corporation */
+wFormatTag=2 nChannels=2 nSamplesPerSec=11025 nAvgBytesPerSec=11289 nBlockAlign=512 wBitsPerSample=4 cbSize=32
+0000 f4 01 07 00 00 01 00 00 00 02 00 ff 00 00 00 00 ................
+0010 c0 00 40 00 f0 00 00 00 cc 01 30 ff 88 01 18 ff ..@.......0.....
+
+#define WAVE_FORMAT_DVI_ADPCM 0x0011 /* Intel Corporation */
+wFormatTag=17 nChannels=2 nSamplesPerSec=11025 nAvgBytesPerSec=11177 nBlockAlign=512 wBitsPerSample=4 cbSize=2
+0000 f9 01 ..
+
+#define WAVE_FORMAT_ADPCM 0x0002 /* Microsoft Corporation */
+wFormatTag=2 nChannels=1 nSamplesPerSec=22050 nAvgBytesPerSec=11155 nBlockAlign=512 wBitsPerSample=4 cbSize=32
+0000 f4 03 07 00 00 01 00 00 00 02 00 ff 00 00 00 00 ................
+0010 c0 00 40 00 f0 00 00 00 cc 01 30 ff 88 01 18 ff ..@.......0.....
+
+#define WAVE_FORMAT_DVI_ADPCM 0x0011 /* Intel Corporation */
+wFormatTag=17 nChannels=1 nSamplesPerSec=22050 nAvgBytesPerSec=11100 nBlockAlign=512 wBitsPerSample=4 cbSize=2
+0000 f9 03 ..
+
+#define WAVE_FORMAT_ALAW 0x0006 /* Microsoft Corporation */
+wFormatTag=6 nChannels=1 nSamplesPerSec=11025 nAvgBytesPerSec=11025 nBlockAlign=1 wBitsPerSample=8 cbSize=0
+
+#define WAVE_FORMAT_MULAW 0x0007 /* Microsoft Corporation */
+wFormatTag=7 nChannels=1 nSamplesPerSec=11025 nAvgBytesPerSec=11025 nBlockAlign=1 wBitsPerSample=8 cbSize=0
+
+#define WAVE_FORMAT_ADPCM 0x0002 /* Microsoft Corporation */
+wFormatTag=2 nChannels=2 nSamplesPerSec=8000 nAvgBytesPerSec=8192 nBlockAlign=512 wBitsPerSample=4 cbSize=32
+0000 f4 01 07 00 00 01 00 00 00 02 00 ff 00 00 00 00 ................
+0010 c0 00 40 00 f0 00 00 00 cc 01 30 ff 88 01 18 ff ..@.......0.....
+
+#define WAVE_FORMAT_DVI_ADPCM 0x0011 /* Intel Corporation */
+wFormatTag=17 nChannels=2 nSamplesPerSec=8000 nAvgBytesPerSec=8110 nBlockAlign=512 wBitsPerSample=4 cbSize=2
+0000 f9 01 ..
+
+#define WAVE_FORMAT_ALAW 0x0006 /* Microsoft Corporation */
+wFormatTag=6 nChannels=1 nSamplesPerSec=8000 nAvgBytesPerSec=8000 nBlockAlign=1 wBitsPerSample=8 cbSize=0
+
+#define WAVE_FORMAT_MULAW 0x0007 /* Microsoft Corporation */
+wFormatTag=7 nChannels=1 nSamplesPerSec=8000 nAvgBytesPerSec=8000 nBlockAlign=1 wBitsPerSample=8 cbSize=0
+
+#define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */
+wFormatTag=85 nChannels=2 nSamplesPerSec=22050 nAvgBytesPerSec=7000 nBlockAlign=1 wBitsPerSample=0 cbSize=12
+0000 01 00 02 00 00 00 b6 00 01 00 71 05 ..........q.
+
+#define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */
+wFormatTag=85 nChannels=2 nSamplesPerSec=16000 nAvgBytesPerSec=7000 nBlockAlign=1 wBitsPerSample=0 cbSize=12
+0000 01 00 02 00 00 00 fc 00 01 00 71 05 ..........q.
+
+#define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */
+wFormatTag=85 nChannels=2 nSamplesPerSec=22050 nAvgBytesPerSec=6000 nBlockAlign=1 wBitsPerSample=0 cbSize=12
+0000 01 00 02 00 00 00 9c 00 01 00 71 05 ..........q.
+
+#define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */
+wFormatTag=85 nChannels=2 nSamplesPerSec=16000 nAvgBytesPerSec=6000 nBlockAlign=1 wBitsPerSample=0 cbSize=12
+0000 01 00 02 00 00 00 d8 00 01 00 71 05 ..........q.
+
+#define WAVE_FORMAT_ADPCM 0x0002 /* Microsoft Corporation */
+wFormatTag=2 nChannels=1 nSamplesPerSec=11025 nAvgBytesPerSec=5644 nBlockAlign=256 wBitsPerSample=4 cbSize=32
+0000 f4 01 07 00 00 01 00 00 00 02 00 ff 00 00 00 00 ................
+0010 c0 00 40 00 f0 00 00 00 cc 01 30 ff 88 01 18 ff ..@.......0.....
+
+#define WAVE_FORMAT_DVI_ADPCM 0x0011 /* Intel Corporation */
+wFormatTag=17 nChannels=1 nSamplesPerSec=11025 nAvgBytesPerSec=5588 nBlockAlign=256 wBitsPerSample=4 cbSize=2
+0000 f9 01 ..
+
+#define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */
+wFormatTag=85 nChannels=2 nSamplesPerSec=22050 nAvgBytesPerSec=5000 nBlockAlign=1 wBitsPerSample=0 cbSize=12
+0000 01 00 02 00 00 00 82 00 01 00 71 05 ..........q.
+
+#define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */
+wFormatTag=85 nChannels=2 nSamplesPerSec=16000 nAvgBytesPerSec=5000 nBlockAlign=1 wBitsPerSample=0 cbSize=12
+0000 01 00 02 00 00 00 b4 00 01 00 71 05 ..........q.
+
+#define WAVE_FORMAT_GSM610 0x0031 /* Microsoft Corporation */
+wFormatTag=49 nChannels=1 nSamplesPerSec=22050 nAvgBytesPerSec=4478 nBlockAlign=65 wBitsPerSample=0 cbSize=2
+0000 40 01 @.
+
+#define WAVE_FORMAT_ADPCM 0x0002 /* Microsoft Corporation */
+wFormatTag=2 nChannels=1 nSamplesPerSec=8000 nAvgBytesPerSec=4096 nBlockAlign=256 wBitsPerSample=4 cbSize=32
+0000 f4 01 07 00 00 01 00 00 00 02 00 ff 00 00 00 00 ................
+0010 c0 00 40 00 f0 00 00 00 cc 01 30 ff 88 01 18 ff ..@.......0.....
+
+#define WAVE_FORMAT_DVI_ADPCM 0x0011 /* Intel Corporation */
+wFormatTag=17 nChannels=1 nSamplesPerSec=8000 nAvgBytesPerSec=4055 nBlockAlign=256 wBitsPerSample=4 cbSize=2
+0000 f9 01 ..
+
+?
+wFormatTag=353 nChannels=2 nSamplesPerSec=22050 nAvgBytesPerSec=4005 nBlockAlign=186 wBitsPerSample=16 cbSize=47
+0000 00 04 00 00 01 00 ba 00 00 00 46 36 44 43 39 38 ..........F6DC98
+0010 33 30 2d 42 43 37 39 2d 31 31 64 32 2d 41 39 44 30-BC79-11d2-A9D
+0020 30 2d 30 30 36 30 39 37 39 32 36 30 33 36 00 0-006097926036.
+
+#define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */
+wFormatTag=85 nChannels=2 nSamplesPerSec=16000 nAvgBytesPerSec=4000 nBlockAlign=1 wBitsPerSample=0 cbSize=12
+0000 01 00 02 00 00 00 90 00 01 00 71 05 ..........q.
+
+#define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */
+wFormatTag=85 nChannels=2 nSamplesPerSec=12000 nAvgBytesPerSec=4000 nBlockAlign=1 wBitsPerSample=0 cbSize=12
+0000 01 00 02 00 00 00 c0 00 01 00 71 05 ..........q.
+
+#define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */
+wFormatTag=85 nChannels=2 nSamplesPerSec=11025 nAvgBytesPerSec=4000 nBlockAlign=1 wBitsPerSample=0 cbSize=12
+0000 01 00 02 00 00 00 d0 00 01 00 71 05 ..........q.
+
+#define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */
+wFormatTag=85 nChannels=2 nSamplesPerSec=8000 nAvgBytesPerSec=4000 nBlockAlign=1 wBitsPerSample=0 cbSize=12
+0000 01 00 02 00 00 00 20 01 01 00 71 05 ...... ...q.
+
+#define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */
+wFormatTag=85 nChannels=1 nSamplesPerSec=22050 nAvgBytesPerSec=4000 nBlockAlign=1 wBitsPerSample=0 cbSize=12
+0000 01 00 02 00 00 00 68 00 01 00 71 05 ......h...q.
+
+#define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */
+wFormatTag=85 nChannels=1 nSamplesPerSec=16000 nAvgBytesPerSec=4000 nBlockAlign=1 wBitsPerSample=0 cbSize=12
+0000 01 00 02 00 00 00 90 00 01 00 71 05 ..........q.
+
+#define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */
+wFormatTag=85 nChannels=2 nSamplesPerSec=12000 nAvgBytesPerSec=3000 nBlockAlign=1 wBitsPerSample=0 cbSize=12
+0000 01 00 02 00 00 00 90 00 01 00 71 05 ..........q.
+
+#define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */
+wFormatTag=85 nChannels=2 nSamplesPerSec=11025 nAvgBytesPerSec=3000 nBlockAlign=1 wBitsPerSample=0 cbSize=12
+0000 01 00 02 00 00 00 9c 00 01 00 71 05 ..........q.
+
+#define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */
+wFormatTag=85 nChannels=2 nSamplesPerSec=8000 nAvgBytesPerSec=3000 nBlockAlign=1 wBitsPerSample=0 cbSize=12
+0000 01 00 02 00 00 00 d8 00 01 00 71 05 ..........q.
+
+#define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */
+wFormatTag=85 nChannels=1 nSamplesPerSec=22050 nAvgBytesPerSec=3000 nBlockAlign=1 wBitsPerSample=0 cbSize=12
+0000 01 00 02 00 00 00 4e 00 01 00 71 05 ......N...q.
+
+#define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */
+wFormatTag=85 nChannels=1 nSamplesPerSec=16000 nAvgBytesPerSec=3000 nBlockAlign=1 wBitsPerSample=0 cbSize=12
+0000 01 00 02 00 00 00 6c 00 01 00 71 05 ......l...q.
+
+?
+wFormatTag=353 nChannels=1 nSamplesPerSec=22050 nAvgBytesPerSec=2519 nBlockAlign=117 wBitsPerSample=16 cbSize=47
+0000 00 04 00 00 00 00 75 00 00 00 46 36 44 43 39 38 ......u...F6DC98
+0010 33 30 2d 42 43 37 39 2d 31 31 64 32 2d 41 39 44 30-BC79-11d2-A9D
+0020 30 2d 30 30 36 30 39 37 39 32 36 30 33 36 00 0-006097926036.
+
+?
+wFormatTag=353 nChannels=2 nSamplesPerSec=22050 nAvgBytesPerSec=2519 nBlockAlign=117 wBitsPerSample=16 cbSize=47
+0000 00 04 00 00 00 00 75 00 00 00 46 36 44 43 39 38 ......u...F6DC98
+0010 33 30 2d 42 43 37 39 2d 31 31 64 32 2d 41 39 44 30-BC79-11d2-A9D
+0020 30 2d 30 30 36 30 39 37 39 32 36 30 33 36 00 0-006097926036.
+
+#define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */
+wFormatTag=85 nChannels=2 nSamplesPerSec=12000 nAvgBytesPerSec=2500 nBlockAlign=1 wBitsPerSample=0 cbSize=12
+0000 01 00 02 00 00 00 f0 00 02 00 71 05 ..........q.
+
+#define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */
+wFormatTag=85 nChannels=2 nSamplesPerSec=11025 nAvgBytesPerSec=2500 nBlockAlign=1 wBitsPerSample=0 cbSize=12
+0000 01 00 02 00 00 00 04 01 02 00 71 05 ..........q.
+
+#define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */
+wFormatTag=85 nChannels=2 nSamplesPerSec=8000 nAvgBytesPerSec=2500 nBlockAlign=1 wBitsPerSample=0 cbSize=12
+0000 01 00 02 00 00 00 68 01 02 00 71 05 ......h...q.
+
+#define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */
+wFormatTag=85 nChannels=1 nSamplesPerSec=16000 nAvgBytesPerSec=2500 nBlockAlign=1 wBitsPerSample=0 cbSize=12
+0000 01 00 02 00 00 00 b4 00 02 00 71 05 ..........q.
+
+#define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */
+wFormatTag=85 nChannels=1 nSamplesPerSec=12000 nAvgBytesPerSec=2500 nBlockAlign=1 wBitsPerSample=0 cbSize=12
+0000 01 00 02 00 00 00 f0 00 02 00 71 05 ..........q.
+
+#define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */
+wFormatTag=85 nChannels=1 nSamplesPerSec=11025 nAvgBytesPerSec=2500 nBlockAlign=1 wBitsPerSample=0 cbSize=12
+0000 01 00 02 00 00 00 04 01 02 00 71 05 ..........q.
+
+#define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */
+wFormatTag=85 nChannels=2 nSamplesPerSec=12000 nAvgBytesPerSec=2250 nBlockAlign=1 wBitsPerSample=0 cbSize=12
+0000 01 00 02 00 00 00 b0 01 04 00 71 05 ..........q.
+
+#define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */
+wFormatTag=85 nChannels=2 nSamplesPerSec=11025 nAvgBytesPerSec=2250 nBlockAlign=1 wBitsPerSample=0 cbSize=12
+0000 01 00 02 00 00 00 d4 01 04 00 71 05 ..........q.
+
+#define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */
+wFormatTag=85 nChannels=2 nSamplesPerSec=8000 nAvgBytesPerSec=2250 nBlockAlign=1 wBitsPerSample=0 cbSize=12
+0000 01 00 02 00 00 00 88 02 04 00 71 05 ..........q.
+
+#define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */
+wFormatTag=85 nChannels=1 nSamplesPerSec=16000 nAvgBytesPerSec=2250 nBlockAlign=1 wBitsPerSample=0 cbSize=12
+0000 01 00 02 00 00 00 44 01 04 00 71 05 ......D...q.
+
+#define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */
+wFormatTag=85 nChannels=1 nSamplesPerSec=12000 nAvgBytesPerSec=2250 nBlockAlign=1 wBitsPerSample=0 cbSize=12
+0000 01 00 02 00 00 00 b0 01 04 00 71 05 ..........q.
+
+#define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */
+wFormatTag=85 nChannels=1 nSamplesPerSec=11025 nAvgBytesPerSec=2250 nBlockAlign=1 wBitsPerSample=0 cbSize=12
+0000 01 00 02 00 00 00 d4 01 04 00 71 05 ..........q.
+
+#define WAVE_FORMAT_GSM610 0x0031 /* Microsoft Corporation */
+wFormatTag=49 nChannels=1 nSamplesPerSec=11025 nAvgBytesPerSec=2239 nBlockAlign=65 wBitsPerSample=0 cbSize=2
+0000 40 01 @.
+
+?
+wFormatTag=353 nChannels=1 nSamplesPerSec=16000 nAvgBytesPerSec=2000 nBlockAlign=64 wBitsPerSample=16 cbSize=47
+0000 00 02 00 00 00 00 40 00 00 00 46 36 44 43 39 38 ......@...F6DC98
+0010 33 30 2d 42 43 37 39 2d 31 31 64 32 2d 41 39 44 30-BC79-11d2-A9D
+0020 30 2d 30 30 36 30 39 37 39 32 36 30 33 36 00 0-006097926036.
+
+#define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */
+wFormatTag=85 nChannels=1 nSamplesPerSec=16000 nAvgBytesPerSec=2000 nBlockAlign=1 wBitsPerSample=0 cbSize=12
+0000 01 00 02 00 00 00 48 00 01 00 71 05 ......H...q.
+
+#define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */
+wFormatTag=85 nChannels=1 nSamplesPerSec=12000 nAvgBytesPerSec=2000 nBlockAlign=1 wBitsPerSample=0 cbSize=12
+0000 01 00 02 00 00 00 60 00 01 00 71 05 ......`...q.
+
+#define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */
+wFormatTag=85 nChannels=1 nSamplesPerSec=11025 nAvgBytesPerSec=2000 nBlockAlign=1 wBitsPerSample=0 cbSize=12
+0000 01 00 02 00 00 00 68 00 01 00 71 05 ......h...q.
+
+#define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */
+wFormatTag=85 nChannels=1 nSamplesPerSec=8000 nAvgBytesPerSec=2000 nBlockAlign=1 wBitsPerSample=0 cbSize=12
+0000 01 00 02 00 00 00 90 00 01 00 71 05 ..........q.
+
+#define WAVE_FORMAT_GSM610 0x0031 /* Microsoft Corporation */
+wFormatTag=49 nChannels=1 nSamplesPerSec=8000 nAvgBytesPerSec=1625 nBlockAlign=65 wBitsPerSample=0 cbSize=2
+0000 40 01 @.
+
+?
+wFormatTag=353 nChannels=2 nSamplesPerSec=8000 nAvgBytesPerSec=1500 nBlockAlign=96 wBitsPerSample=16 cbSize=47
+0000 00 02 00 00 00 00 60 00 00 00 46 36 44 43 39 38 ......`...F6DC98
+0010 33 30 2d 42 43 37 39 2d 31 31 64 32 2d 41 39 44 30-BC79-11d2-A9D
+0020 30 2d 30 30 36 30 39 37 39 32 36 30 33 36 00 0-006097926036.
+
+?
+wFormatTag=353 nChannels=1 nSamplesPerSec=11025 nAvgBytesPerSec=1249 nBlockAlign=58 wBitsPerSample=16 cbSize=47
+0000 00 02 00 00 00 00 3a 00 00 00 46 36 44 43 39 38 ......:...F6DC98
+0010 33 30 2d 42 43 37 39 2d 31 31 64 32 2d 41 39 44 30-BC79-11d2-A9D
+0020 30 2d 30 30 36 30 39 37 39 32 36 30 33 36 00 0-006097926036.
+
+#define WAVE_FORMAT_DSPGROUP_TRUESPEECH 0x0022 /* DSP Group, Inc */
+wFormatTag=34 nChannels=1 nSamplesPerSec=8000 nAvgBytesPerSec=1067 nBlockAlign=32 wBitsPerSample=1 cbSize=32
+0000 01 00 f0 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+0010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+
+?
+wFormatTag=353 nChannels=1 nSamplesPerSec=11025 nAvgBytesPerSec=1012 nBlockAlign=47 wBitsPerSample=16 cbSize=47
+0000 00 02 00 00 00 00 2f 00 00 00 46 36 44 43 39 38 ....../...F6DC98
+0010 33 30 2d 42 43 37 39 2d 31 31 64 32 2d 41 39 44 30-BC79-11d2-A9D
+0020 30 2d 30 30 36 30 39 37 39 32 36 30 33 36 00 0-006097926036.
+
+?
+wFormatTag=353 nChannels=1 nSamplesPerSec=8000 nAvgBytesPerSec=1000 nBlockAlign=64 wBitsPerSample=16 cbSize=47
+0000 00 02 00 00 00 00 40 00 00 00 46 36 44 43 39 38 ......@...F6DC98
+0010 33 30 2d 42 43 37 39 2d 31 31 64 32 2d 41 39 44 30-BC79-11d2-A9D
+0020 30 2d 30 30 36 30 39 37 39 32 36 30 33 36 00 0-006097926036.
+
+#define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */
+wFormatTag=85 nChannels=1 nSamplesPerSec=12000 nAvgBytesPerSec=1000 nBlockAlign=1 wBitsPerSample=0 cbSize=12
+0000 01 00 02 00 00 00 30 00 01 00 71 05 ......0...q.
+
+#define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */
+wFormatTag=85 nChannels=1 nSamplesPerSec=11025 nAvgBytesPerSec=1000 nBlockAlign=1 wBitsPerSample=0 cbSize=12
+0000 01 00 02 00 00 00 34 00 01 00 71 05 ......4...q.
+
+#define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */
+wFormatTag=85 nChannels=1 nSamplesPerSec=8000 nAvgBytesPerSec=1000 nBlockAlign=1 wBitsPerSample=0 cbSize=12
+0000 01 00 02 00 00 00 48 00 01 00 71 05 ......H...q.
+
+?
+wFormatTag=66 nChannels=1 nSamplesPerSec=8000 nAvgBytesPerSec=800 nBlockAlign=24 wBitsPerSample=0 cbSize=10
+0000 02 00 ce 9a 32 f7 a2 ae de ac ....2.....
+
+?
+wFormatTag=353 nChannels=1 nSamplesPerSec=8000 nAvgBytesPerSec=750 nBlockAlign=48 wBitsPerSample=16 cbSize=47
+0000 00 02 00 00 00 00 30 00 00 00 46 36 44 43 39 38 ......0...F6DC98
+0010 33 30 2d 42 43 37 39 2d 31 31 64 32 2d 41 39 44 30-BC79-11d2-A9D
+0020 30 2d 30 30 36 30 39 37 39 32 36 30 33 36 00 0-006097926036.
+
+?
+wFormatTag=66 nChannels=1 nSamplesPerSec=8000 nAvgBytesPerSec=666 nBlockAlign=20 wBitsPerSample=0 cbSize=10
+0000 03 00 ce 9a 32 f7 a2 ae de ac ....2.....
diff --git a/sesman/startwm.sh b/sesman/startwm.sh
index 0724bb76..457ca1a5 100755
--- a/sesman/startwm.sh
+++ b/sesman/startwm.sh
@@ -3,7 +3,6 @@ if [ -r /etc/default/locale ]; then
. /etc/default/locale
export LANG LANGUAGE
fi
-. /etc/X11/Xsession
# debian
if [ -r /etc/X11/Xsession ]; then
diff --git a/xorg/X11R7.6/rdp/rdpCopyArea.c b/xorg/X11R7.6/rdp/rdpCopyArea.c
index 0a5e5206..300f857d 100644
--- a/xorg/X11R7.6/rdp/rdpCopyArea.c
+++ b/xorg/X11R7.6/rdp/rdpCopyArea.c
@@ -81,9 +81,6 @@ rdpCopyAreaWndToWnd(WindowPtr pSrcWnd, WindowPtr pDstWnd, GCPtr pGC,
RegionRec clip_reg;
LLOGLN(10, ("rdpCopyAreaWndToWnd:"));
-
- rv = rdpCopyAreaOrg(&(pSrcWnd->drawable), &(pDstWnd->drawable),
- pGC, srcx, srcy, w, h, dstx, dsty);
RegionInit(&clip_reg, NullBox, 0);
cd = rdp_get_clip(&clip_reg, &(pDstWnd->drawable), pGC);
lsrcx = pSrcWnd->drawable.x + srcx;
@@ -104,14 +101,16 @@ rdpCopyAreaWndToWnd(WindowPtr pSrcWnd, WindowPtr pDstWnd, GCPtr pGC,
if (num_clips > 0)
{
rdpup_begin_update();
- dx = dstx - srcx;
- dy = dsty - srcy;
+ dx = ldstx - lsrcx;
+ dy = ldsty - lsrcy;
if ((dy < 0) || ((dy == 0) && (dx < 0)))
{
for (j = 0; j < num_clips; j++)
{
box = REGION_RECTS(&clip_reg)[j];
+ LLOGLN(10, (" index %d x1 %d y1 %d x2 %d y2 %d", j,
+ box.x1, box.y1, box.x2, box.y2));
rdpup_set_clip(box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
rdpup_screen_blt(ldstx, ldsty, w, h, lsrcx, lsrcy);
}
@@ -121,6 +120,8 @@ rdpCopyAreaWndToWnd(WindowPtr pSrcWnd, WindowPtr pDstWnd, GCPtr pGC,
for (j = num_clips - 1; j >= 0; j--)
{
box = REGION_RECTS(&clip_reg)[j];
+ LLOGLN(10, (" index %d x1 %d y1 %d x2 %d y2 %d", j,
+ box.x1, box.y1, box.x2, box.y2));
rdpup_set_clip(box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
rdpup_screen_blt(ldstx, ldsty, w, h, lsrcx, lsrcy);
}
@@ -132,6 +133,8 @@ rdpCopyAreaWndToWnd(WindowPtr pSrcWnd, WindowPtr pDstWnd, GCPtr pGC,
}
RegionUninit(&clip_reg);
+ rv = rdpCopyAreaOrg(&(pSrcWnd->drawable), &(pDstWnd->drawable),
+ pGC, srcx, srcy, w, h, dstx, dsty);
return rv;
}
@@ -148,17 +151,12 @@ rdpCopyAreaWndToPixmap(WindowPtr pSrcWnd,
int ldstx;
int ldsty;
int num_clips;
- int dx;
- int dy;
int j;
BoxRec box;
RegionPtr rv;
RegionRec clip_reg;
LLOGLN(10, ("rdpCopyAreaWndToPixmap:"));
-
- rv = rdpCopyAreaOrg(&(pSrcWnd->drawable), &(pDstPixmap->drawable),
- pGC, srcx, srcy, w, h, dstx, dsty);
RegionInit(&clip_reg, NullBox, 0);
cd = rdp_get_clip(&clip_reg, &(pDstPixmap->drawable), pGC);
lsrcx = pSrcWnd->drawable.x + srcx;
@@ -182,26 +180,12 @@ rdpCopyAreaWndToPixmap(WindowPtr pSrcWnd,
{
rdpup_switch_os_surface(pDstPriv->rdpindex);
rdpup_begin_update();
- dx = dstx - srcx;
- dy = dsty - srcy;
- if ((dy < 0) || ((dy == 0) && (dx < 0)))
- {
- for (j = 0; j < num_clips; j++)
- {
- box = REGION_RECTS(&clip_reg)[j];
- rdpup_set_clip(box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
- rdpup_screen_blt(ldstx, ldsty, w, h, lsrcx, lsrcy);
- }
- }
- else
+ for (j = 0; j < num_clips; j++)
{
- for (j = num_clips - 1; j >= 0; j--)
- {
- box = REGION_RECTS(&clip_reg)[j];
- rdpup_set_clip(box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
- rdpup_screen_blt(ldstx, ldsty, w, h, lsrcx, lsrcy);
- }
+ box = REGION_RECTS(&clip_reg)[j];
+ rdpup_set_clip(box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
+ rdpup_screen_blt(ldstx, ldsty, w, h, lsrcx, lsrcy);
}
rdpup_reset_clip();
@@ -211,6 +195,8 @@ rdpCopyAreaWndToPixmap(WindowPtr pSrcWnd,
}
RegionUninit(&clip_reg);
+ rv = rdpCopyAreaOrg(&(pSrcWnd->drawable), &(pDstPixmap->drawable),
+ pGC, srcx, srcy, w, h, dstx, dsty);
return rv;
}
@@ -234,9 +220,6 @@ rdpCopyAreaPixmapToWnd(PixmapPtr pSrcPixmap, rdpPixmapRec *pSrcPriv,
BoxRec box;
LLOGLN(10, ("rdpCopyAreaPixmapToWnd:"));
-
- rv = rdpCopyAreaOrg(&(pSrcPixmap->drawable), &(pDstWnd->drawable),
- pGC, srcx, srcy, w, h, dstx, dsty);
RegionInit(&clip_reg, NullBox, 0);
cd = rdp_get_clip(&clip_reg, &(pDstWnd->drawable), pGC);
ldstx = pDstWnd->drawable.x + dstx;
@@ -274,6 +257,8 @@ rdpCopyAreaPixmapToWnd(PixmapPtr pSrcPixmap, rdpPixmapRec *pSrcPriv,
}
RegionUninit(&clip_reg);
+ rv = rdpCopyAreaOrg(&(pSrcPixmap->drawable), &(pDstWnd->drawable),
+ pGC, srcx, srcy, w, h, dstx, dsty);
return rv;
}
@@ -292,14 +277,13 @@ rdpCopyAreaPixmapToPixmap(PixmapPtr pSrcPixmap, rdpPixmapRec *pSrcPriv,
int cd;
int j;
int num_clips;
+ int dx;
+ int dy;
RegionPtr rv;
RegionRec clip_reg;
BoxRec box;
LLOGLN(10, ("rdpCopyAreaPixmapToPixmap:"));
-
- rv = rdpCopyAreaOrg(&(pSrcPixmap->drawable), &(pDstPixmap->drawable),
- pGC, srcx, srcy, w, h, dstx, dsty);
RegionInit(&clip_reg, NullBox, 0);
cd = rdp_get_clip(&clip_reg, &(pDstPixmap->drawable), pGC);
LLOGLN(10, ("rdpCopyAreaPixmapToPixmap: cd %d", cd));
@@ -325,14 +309,30 @@ rdpCopyAreaPixmapToPixmap(PixmapPtr pSrcPixmap, rdpPixmapRec *pSrcPriv,
{
rdpup_switch_os_surface(pDstPriv->rdpindex);
rdpup_begin_update();
+ dx = ldstx - lsrcx;
+ dy = ldsty - lsrcy;
+
LLOGLN(10, ("rdpCopyAreaPixmapToPixmap: num_clips %d", num_clips));
- for (j = 0; j < num_clips; j++)
+ if ((dy < 0) || ((dy == 0) && (dx < 0)))
{
- box = REGION_RECTS(&clip_reg)[j];
- rdpup_set_clip(box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
- rdpup_paint_rect_os(ldstx, ldsty, w, h, pSrcPriv->rdpindex, lsrcx, lsrcy);
- LLOGLN(10, ("%d %d %d %d %d %d", ldstx, ldsty, w, h, lsrcx, lsrcy));
+ for (j = 0; j < num_clips; j++)
+ {
+ box = REGION_RECTS(&clip_reg)[j];
+ rdpup_set_clip(box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
+ rdpup_paint_rect_os(ldstx, ldsty, w, h, pSrcPriv->rdpindex, lsrcx, lsrcy);
+ LLOGLN(10, ("%d %d %d %d %d %d", ldstx, ldsty, w, h, lsrcx, lsrcy));
+ }
+ }
+ else
+ {
+ for (j = num_clips - 1; j >= 0; j--)
+ {
+ box = REGION_RECTS(&clip_reg)[j];
+ rdpup_set_clip(box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
+ rdpup_paint_rect_os(ldstx, ldsty, w, h, pSrcPriv->rdpindex, lsrcx, lsrcy);
+ LLOGLN(10, ("%d %d %d %d %d %d", ldstx, ldsty, w, h, lsrcx, lsrcy));
+ }
}
rdpup_reset_clip();
@@ -342,6 +342,8 @@ rdpCopyAreaPixmapToPixmap(PixmapPtr pSrcPixmap, rdpPixmapRec *pSrcPriv,
}
RegionUninit(&clip_reg);
+ rv = rdpCopyAreaOrg(&(pSrcPixmap->drawable), &(pDstPixmap->drawable),
+ pGC, srcx, srcy, w, h, dstx, dsty);
return rv;
}
diff --git a/xorg/X11R7.6/rdp/rdpdraw.c b/xorg/X11R7.6/rdp/rdpdraw.c
index 35b501c4..068f8267 100644
--- a/xorg/X11R7.6/rdp/rdpdraw.c
+++ b/xorg/X11R7.6/rdp/rdpdraw.c
@@ -524,7 +524,7 @@ draw_item_pack(PixmapPtr pix, rdpPixmapRec *priv)
}
#endif
-#if 1
+#if 0
/* subtract regions */
if (priv->draw_item_tail != 0)
@@ -559,6 +559,7 @@ draw_item_pack(PixmapPtr pix, rdpPixmapRec *priv)
#endif
#if 1
+
/* remove draw items with empty regions */
di = priv->draw_item_head;
di_prev = 0;